-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unlike the existing system which instantiates everything at compile time based on the curve parameters, this allows choosing the parameters at runtime. This can be used for application specific curves, or when it is desirable to not use the dedicated modules for binary size reasons. Comparing the three approaches (pcurves, pcurves_generic, BigInt) for some common EC operations (keygen, ECDSA sign, ECDSA verify, ECDH agreement). All numbers are operations/second for the brainpool256r1 curve. | impl | keygen | sign | verify | agree | | -------- | -------- | -------- | -------- | -------- | | pcurves | 20770 | 16191 | 7410 | 5598 | | generic | 10208 | 8367 | 4013 | 3077 | | BigInt | 10405 | 7686 | 3707 | 2463 | The advantage of the fully compile-time implementation is clear (and could become even stronger if/when compilers improve their constexpr support), but this module has performance at least as good as the old BigInt-based EC and with a significantly improved situation regarding side channels. This implementation does not support curves which are cursed: * Curves with a order of different bitlength than the field * Curves with primes not congruent to 3 modulo 4 * Curves with a cofactor One notable cursed curve is P-224 (due to p == 1 mod 4), which is only supported if the dedicated pcurves_secp224r1 module is included.
- Loading branch information
Showing
9 changed files
with
2,204 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<defines> | ||
PCURVES_GENERIC -> 20250112 | ||
</defines> | ||
|
||
<module_info> | ||
name -> "PCurve generic" | ||
</module_info> | ||
|
||
<requires> | ||
bigint | ||
numbertheory | ||
mp | ||
</requires> |
Oops, something went wrong.