Skip to content

elliptic-curve: have BatchInvert use ff::BatchInverter#2456

Merged
tarcieri merged 1 commit into
masterfrom
elliptic-curve/use-ff-batchinverter
Jun 21, 2026
Merged

elliptic-curve: have BatchInvert use ff::BatchInverter#2456
tarcieri merged 1 commit into
masterfrom
elliptic-curve/use-ff-batchinverter

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Instead of supplying our own generic implementation of Montgomery's trick, we can use the one in ff supplied by BatchInverter, which just so happens to have a signature that's very close to the one we switched to in #2455 (great minds think alike).

The main difference between that PR and what BatchInverter provides is instead of returning a Choice in the event of zero elements, it ignores them and returns the inverse of the product of all non-zero field elements.

Instead of supplying our own generic implementation of Montgomery's
trick, we can use the one in `ff` supplied by `BatchInverter`, which
just so happens to have a signature that's very close to the one we
switched to in #2455 (great minds think alike).

The main difference between that PR and what `BatchInverter` provides is
instead of returning a `Choice` in the event of zero elements, it
ignores them and returns the inverse of the product of all non-zero
field elements.
@tarcieri tarcieri merged commit 751f0c1 into master Jun 21, 2026
15 checks passed
@tarcieri tarcieri deleted the elliptic-curve/use-ff-batchinverter branch June 21, 2026 16:17
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jun 21, 2026
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