Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k256+primeorder: add BatchInvert and BatchNormalize impls #971

Merged
merged 21 commits into from
Nov 14, 2023

Conversation

ycscaly
Copy link
Contributor

@ycscaly ycscaly commented Nov 12, 2023

Addresses #943

k256/src/arithmetic.rs Outdated Show resolved Hide resolved
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 12, 2023

@tarcieri there are the tests for inversion, and also implemented the projective to affine batch conversion.
However, this is only for k256 for now. I can do it for other crates, but its a bit of repetitive work - perhaps we leave it so that if any community request for it comes up, they can copy my logic?

@tarcieri
Copy link
Member

However, this is only for k256 for now. I can do it for other crates, but its a bit of repetitive work

Once you have k256 nailed down, the only other thing that needs it is primeorder, then all of the other crates will benefit.

ycscaly and others added 2 commits November 14, 2023 00:28
Co-authored-by: Tony Arcieri <bascule@gmail.com>
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 13, 2023

However, this is only for k256 for now. I can do it for other crates, but its a bit of repetitive work

Once you have k256 nailed down, the only other thing that needs it is primeorder, then all of the other crates will benefit.

Ok ok, I did it

@ycscaly ycscaly requested a review from tarcieri November 13, 2023 22:57
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 14, 2023

@tarcieri should be good now

@tarcieri
Copy link
Member

Why did you remove all of the Invert impls on scalars?

@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 14, 2023

Why did you remove all of the Invert impls on scalars?

Because I added a macro that implements it, so they were double implementations

primeorder/src/field.rs Outdated Show resolved Hide resolved
@tarcieri
Copy link
Member

In places where you reference alloc::vec::Vec, particularly the projective.rs files, I think the code would be a bit less noisy with a conditional import:

#[cfg(feature = "alloc")]
use alloc::vec::Vec;

@ycscaly ycscaly requested a review from tarcieri November 14, 2023 22:33
Cargo.toml Outdated Show resolved Hide resolved
@tarcieri tarcieri changed the title k256: Batch Conversion ToAffineBatch k256: add BatchInvert and BatchNormalize impls Nov 14, 2023
@tarcieri tarcieri changed the title k256: add BatchInvert and BatchNormalize impls k256+primeorder: add BatchInvert and BatchNormalize impls Nov 14, 2023
Co-authored-by: Tony Arcieri <bascule@gmail.com>
@tarcieri tarcieri merged commit 8e1fff4 into RustCrypto:master Nov 14, 2023
122 checks passed
@ycscaly
Copy link
Contributor Author

ycscaly commented Nov 15, 2023

Thanks!

This was referenced Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants