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

Support fast field inversion for P-256, P-384, and P-521 #4209

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

randombit
Copy link
Owner

@randombit randombit commented Jul 13, 2024

For P-256 this speeds up projective->affine conversion by about 5%, saving ~2K cycles.

For P-384 it speeds up conversion by 25%, saving 8K cycles.

For P-521 it speeds up conversion by 20%, saving 33K cycles.

The savings are most pronounced with ECDSA signing (since it is the fastest operation), improving by 2%, 4%, and 2% resp.

GH #4027 #1479

@randombit
Copy link
Owner Author

The bad news is the savings are pretty weak overall. The good news is that suggests that a 5 bit fixed window is nearly as good as using the best known addition chain, so there isn't much need to do this for the other curves.

@randombit randombit force-pushed the jack/faster-pcurves-inversion branch from 8a0f4ec to 0ab6d94 Compare July 13, 2024 23:08
@coveralls
Copy link

coveralls commented Jul 13, 2024

Coverage Status

coverage: 91.698% (+0.009%) from 91.689%
when pulling 71afb7b on jack/faster-pcurves-inversion
into 85491b3 on master.

@randombit randombit added this to the Botan 3.6.0 milestone Jul 14, 2024
@randombit randombit requested a review from reneme July 14, 2024 12:40
@randombit randombit force-pushed the jack/faster-pcurves-inversion branch from 0ab6d94 to 368d574 Compare July 15, 2024 07:03
src/lib/math/pcurves/pcurves_impl/pcurves_wrap.h Outdated Show resolved Hide resolved
@randombit randombit force-pushed the jack/faster-pcurves-inversion branch from 368d574 to 71afb7b Compare July 15, 2024 11:40
For P-256 this speeds up projective->affine conversion by about 5%,
saving ~2K cycles.

For P-384 it speeds up conversion by 25%, saving 8K cycles.

For P-521 it speeds up conversion by 20%, saving 33K cycles.

The savings are most pronounced with ECDSA signing (since it is the
fastest operation), improving by 2%, 4%, and 2% resp.

GH #4027
@randombit randombit merged commit 25356e1 into master Jul 15, 2024
39 checks passed
@randombit randombit deleted the jack/faster-pcurves-inversion branch July 15, 2024 12:42
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.

3 participants