Skip to content

elliptic-curve: import arithmetic helper functions#281

Merged
tarcieri merged 1 commit into
masterfrom
import-arithmetic-util-functions
Sep 2, 2020
Merged

elliptic-curve: import arithmetic helper functions#281
tarcieri merged 1 commit into
masterfrom
import-arithmetic-util-functions

Conversation

@tarcieri

@tarcieri tarcieri commented Sep 2, 2020

Copy link
Copy Markdown
Member

These are helper functions for performing arithmetic on field element "limbs", e.g. implementing carry chains.

The particular versions in this file come from the k256, which started as a fork of the p256 crate, and notably provide 32-bit and 64-bit versions of the same functions.

These are potentially helpful to have in the elliptic-curve crate for several reasons, most notably for testing things which are generic across elliptic curves without having to provide a full curve arithmetic implementation.

Also having things in one place is nice, and potentially we can use these to provide a generic baseline implementation of certain types of curve arithmetic for curves that don't provide their own arithmetic.

cc @str4d who I had talked to about this at one point.

These are helper functions for performing arithmetic on field element
"limbs", e.g. implementing carry chains.

The particular versions in this file come from the `k256`, which started
as a fork of the `p256` crate, and notably provide 32-bit and 64-bit
versions of the same functions.

These are potentially helpful to have in the `elliptic-curve` crate for
several reasons, most notably for testing things which are generic
across elliptic curves without having to provide a full curve arithmetic
implementation.

Also having things in one place is nice, and potentially we can use
these to provide a generic baseline implementation of certain types of
curve arithmetic for curves that don't provide their own arithmetic.
@tarcieri

tarcieri commented Sep 2, 2020

Copy link
Copy Markdown
Member Author

most notably for testing things which are generic across elliptic curves

Note: I specifically intend to use these to test the generic RFC6979 implementation. The spec mandates that all scalars are reduced and additionally performs rejection sampling on HMAC_DRBG outputs, so testing it requires the ability to ensure that a particular output doesn't overflow the curve's order (or if it does, it requires reading subsequent outputs until one does not overflow).

@tarcieri tarcieri merged commit abff234 into master Sep 2, 2020
@tarcieri tarcieri deleted the import-arithmetic-util-functions branch September 2, 2020 00:51
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Sep 2, 2020
Migrated to the `elliptic-curve` crate in RustCrypto/traits#281
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Sep 2, 2020
Migrated to the `elliptic-curve` crate in RustCrypto/traits#281
@tarcieri tarcieri mentioned this pull request Sep 11, 2020
dns2utf8 pushed a commit to dns2utf8/traits that referenced this pull request Jan 24, 2023
Bumps [zeroize](https://github.com/RustCrypto/utils) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/RustCrypto/utils/releases)
- [Commits](RustCrypto/utils@zeroize-v1.5.2...zeroize-v1.5.3)

---
updated-dependencies:
- dependency-name: zeroize
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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