Skip to content

elliptic-curve: add vartime BatchInvert/BatchNormalize methods#2468

Merged
tarcieri merged 1 commit into
masterfrom
elliptic-curve/batch-invert-normalize-vartime
Jun 25, 2026
Merged

elliptic-curve: add vartime BatchInvert/BatchNormalize methods#2468
tarcieri merged 1 commit into
masterfrom
elliptic-curve/batch-invert-normalize-vartime

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Adds the following:

  • BatchInvert::batch_invert_in_place_vartime
  • BatchNormalize::batch_normalize_vartime

Both are provided methods that currently call the constant-time path, but in the future we can potentially provide default implementations that are variable-time and optimized.

Since the new methods are provided, this isn't a breaking change.

Adds the following:
- `BatchInvert::batch_invert_in_place_vartime`
- `BatchNormalize::batch_normalize_vartime`

Both are provided methods that currently call the constant-time path,
but in the future we can potentially provide default implementations
that are variable-time and optimized.

Since the new methods are provided, this isn't a breaking change.
@tarcieri tarcieri merged commit 2586aef into master Jun 25, 2026
15 checks passed
@tarcieri tarcieri deleted the elliptic-curve/batch-invert-normalize-vartime branch June 25, 2026 00:57
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jun 25, 2026
Adds support for variable-time batch inversions, a method for which was
added in RustCrypto/traits#2468

Benchmarks showing it's ~20% faster than the constant-time version, and
ammortized ~2X faster than the single element inversion when inverting
two elements

    field element operations/invert
        time:   [2.5369 µs 2.5453 µs 2.5557 µs]
    field element operations/invert_vartime
        time:   [2.0041 µs 2.0076 µs 2.0111 µs]
    field element operations/batch_invert_in_place (2p)
        time:   [2.6878 µs 2.6929 µs 2.6980 µs]
    field element operations/batch_invert_in_place_vartime (2p)
        time:   [2.1331 µs 2.1379 µs 2.1426 µs]
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request Jun 25, 2026
Adds support for variable-time batch inversions, a method for which was
added in RustCrypto/traits#2468

Benchmarks showing it's ~20% faster than the constant-time version, and
ammortized ~2X faster than the single element inversion when inverting
two elements

    field element operations/invert
        time:   [2.5369 µs 2.5453 µs 2.5557 µs]
    field element operations/invert_vartime
        time:   [2.0041 µs 2.0076 µs 2.0111 µs]
    field element operations/batch_invert_in_place (2p)
        time:   [2.6878 µs 2.6929 µs 2.6980 µs]
    field element operations/batch_invert_in_place_vartime (2p)
        time:   [2.1331 µs 2.1379 µs 2.1426 µs]
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