hyperledger-labs / agora-glass_pumpkin

agora-glass_pumpkin
https://wiki.hyperledger.org/display/labs/Agora
Apache License 2.0
21 stars 11 forks source link

Faster safe prime generation #24

Closed andrewwhitehead closed 4 months ago

andrewwhitehead commented 4 months ago

This update aligns the safe prime generation more with the recommendations in https://eprint.iacr.org/2003/186, particularly in eliminating candidates for q that are congruent to (r-1)/2 for the small primes that are checked.

On my system the time to generate a 256-bit safe prime is reduced by 90-95% (to about 25ms on average) and seems competitive with OpenSSL. Unit tests in anoncreds-clsignatures can run in a few minutes.