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

elliptic-curve: use crypto-bigint to represent Curve::Order #645

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Jun 2, 2021

The crypto_bigint::UInt type has const-friendly initializers that can parse the curve order from e.g. hexadecimal.

This commit changes the Order to be represented as a UInt type. This also permits things like simplified (and constant time, if needed) comparisons to ensure a given value is in range.

Additionally, this commit reimplements the dev module's Scalar type for MockCurve to use a crypto_bigint::U256 internally.

@tarcieri tarcieri force-pushed the elliptic-curve/use-crypto-bigint-for-order branch from 86b591c to 7bf3d34 Compare June 2, 2021 19:17
The `crypto_bigint::UInt` type has const-friendly initializers that can
parse the curve order from e.g. hexadecimal.

This commit changes the `Order` to be represented as a `UInt` type.
This also permits things like simplified (and constant time, if needed)
comparisons to ensure a given value is in range.

Additionally, this commit reimplements the `dev` module's `Scalar` type
for `MockCurve` to use a `crypto_bigint::U256` internally.
@tarcieri tarcieri force-pushed the elliptic-curve/use-crypto-bigint-for-order branch from 7bf3d34 to 994b8ef Compare June 2, 2021 19:22
@tarcieri tarcieri merged commit a7bd3d2 into master Jun 2, 2021
@tarcieri tarcieri deleted the elliptic-curve/use-crypto-bigint-for-order branch June 2, 2021 19:28
@tarcieri tarcieri mentioned this pull request Jun 8, 2021
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.

1 participant