Skip to content

Conversation

@tarcieri
Copy link
Member

Because NonZeroScalar means we'll never divide by 0, it's possible to make the implementation infallible.

To accomplish this, CtOption is removed from the Invert trait's signature, and used as the result type for scalars that are potentially zero as part of the blanket impl of Invert.

Fixes RustCrypto/elliptic-curves#499

Because `NonZeroScalar` means we'll never divide by 0, it's possible to
make the implementation infallible.

To accomplish this, `CtOption` is removed from the `Invert` trait's
signature, and used as the result type for scalars that are potentially
zero as part of the blanket impl of `Invert`.

Fixes RustCrypto/elliptic-curves#499
@tarcieri tarcieri force-pushed the elliptic-curve/infallible-nonzero-scalar-inversions branch from 44c72a1 to 712434d Compare January 17, 2022 21:45
@tarcieri tarcieri merged commit bb3d0de into master Jan 17, 2022
@tarcieri tarcieri deleted the elliptic-curve/infallible-nonzero-scalar-inversions branch January 17, 2022 21:48
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.

Why is NonZeroScalar::invert() fallible?

2 participants