-
Notifications
You must be signed in to change notification settings - Fork 205
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
P521 FieldElement
conversions can panic
#965
Comments
Hmm, where did you get that key from? The panic is certainly bad, yes, but it seems like the given coordinate is invalid? It's:
...which exceeds the field modulus size:
...in fact, it's p + 1 |
Aha, I see the problem: https://github.com/RustCrypto/elliptic-curves/blob/f19ccf0/p521/src/arithmetic/field.rs#L84-L87 That function checks that the input As currently written, the @MasterAwesome I guess we should just remove the Edit: went ahead and did that in #967 |
Some `debug_assert!`s were getting triggered on inputs that need to be handled without panicking. Fixes #965
Apologies for the lack of context here! Thank you for the quick fix! |
Some `debug_assert!`s were getting triggered on inputs that need to be handled without panicking. Fixes #965
Minimal test case:
... instead of returning an error it panics with:
I believe this can be boiled down to:
... where
FieldElement
is inp521::arithmetic::field::FieldElement
, but is actually not public.The text was updated successfully, but these errors were encountered: