Skip to content

Comments

Double-precision cubic towering + pairing#158

Merged
mratsim merged 6 commits intomasterfrom
cubic-2x
Feb 12, 2021
Merged

Double-precision cubic towering + pairing#158
mratsim merged 6 commits intomasterfrom
cubic-2x

Conversation

@mratsim
Copy link
Owner

@mratsim mratsim commented Feb 10, 2021

This PR continues the work of double precision towering

Hopefully we get so efficient that even BLS24 curves become interesting.

The first commit improves Fp12 multiplication by 5%, which tranlates to about 4% speedup on pairings.

Fp12 mul, before

image

Fp12 mul after

image

@mratsim
Copy link
Owner Author

mratsim commented Feb 12, 2021

PR is finished, we obtain a 3% boost in pairings overall.

  • The Miller Loop requires a specialized double-precision sparse codepath
  • The final exponentiation requires optimized Fp12.
  • Some lazy additions were not used but could improve perf (by hundreds of cycles on Fp12). They seem to work for BLS curves, but not for BN curves, is it because of the M-Twist/D-Twist or the fact that there is at least 3 spare bits and so we can store 3p on Fp or 6p on FpDbl, who knows.

Before

image

After

image

@mratsim mratsim merged commit e7296a7 into master Feb 12, 2021
@mratsim mratsim deleted the cubic-2x branch February 13, 2021 22:19
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