-
Notifications
You must be signed in to change notification settings - Fork 200
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
p384: scalar multiplication test vectors #570
Conversation
It looks like the With that fixed it gets farther but still fails on one of the vectors. |
Sidebar: it looks like Confirmed this: /// Preconditions:
/// 0 ≤ bytes_eval arg1 < m
...so the input scalar needs to be checked to ensure it doesn't overflow the order |
Why do we need The semantics of |
This is done in
|
At least in this particular case, it's being exercised by the test suite which is checking the equivalence of repeated doublings of the generator and scalar multiplication by the generator. I'm not aware of external-facing applications offhand, but regardless, it was easy to fix.
There is some ongoing discussion about this from users of
This doesn't really uphold the contract of the function, which returns a It's addressed easily enough using e.g. |
Here's my proposed fix, which makes This allows |
Tests scalar multiplication using vectors from: http://point-at-infinity.org/ecc/nisttv
6c2b5e9
to
22ef9b4
Compare
@jedisct1 the https://docs.rs/ff/0.12.0/ff/trait.PrimeField.html pub trait PrimeField: Field + From<u64> { ... } |
Tests scalar multiplication using vectors from:
http://point-at-infinity.org/ecc/nisttv