Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Jan 12, 2022

This is a stepping stone towards solving #508 for p256.

Replaces the implementation of AffinePoint::generator with one that uses Rust literal syntax to construct the field elements which represent the base point's affine coordinates.

Coordinates are specified in canonical form for easy auditability, then converted to Montgomery form. With const fn, this conversion could happen completely at compile time.

This can't yet be made fully const though, as there isn't a const fn constructor for subtle::Choice, which is used to represent the point at infinity.

This is a stepping stone towards solving #508.

Replaces the implementation of `AffinePoint::generator` with one that
uses Rust literal syntax to construct the field elements which represent
the base point's affine coordinates.

Coordinates are specified in canonical form for easy auditability, then
converted to Montgomery form. With `const fn`, this conversion could
happen completely at compile time.

This can't yet be made fully `const` though, as there isn't a `const fn`
constructor for `subtle::Choice`, which is used to represent the point
at infinity.
@tarcieri tarcieri force-pushed the p256/more-const-friendly-generator-impl branch from 6ae32b9 to 9b7ff79 Compare January 12, 2022 18:31
@tarcieri tarcieri merged commit 3683c7e into master Jan 12, 2022
@tarcieri tarcieri deleted the p256/more-const-friendly-generator-impl branch January 12, 2022 18:35
@tarcieri tarcieri mentioned this pull request Jan 17, 2022
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