Add simplified elliptic curve code generator.#1756
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1756 +/- ##
==========================================
+ Coverage 95.90% 96.01% +0.11%
==========================================
Files 132 138 +6
Lines 15102 20788 +5686
Branches 169 226 +57
==========================================
+ Hits 14483 19959 +5476
- Misses 598 792 +194
- Partials 21 37 +16
... and 28 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
05b3b13 to
54d659e
Compare
|
Yes, I generated the params with python as well, they are the same, not sure why my code doesn't pass the 32bit tests, since code is reused from p384. I was unable to get a 32bit dev enviroment unfortunately. |
mk/generate_curves.py
Outdated
| }; | ||
|
|
||
| pub static COMMON_OPS: CommonOps = CommonOps { | ||
| num_limbs: (%(bits)s + 7) / LIMB_BITS, |
There was a problem hiding this comment.
- 7 should be (LIMB_BITS - 1), or 31
Add a tool to generate and/or verify NIST curve boilerplate. Sync the existing P-256 and P-384 code with the generator.
Add preliminary support for P-521 but don't sync the existing (semi-)generated code with it.
54d659e to
3094b9d
Compare
|
I updated this PR substantially so that it can generate everything in in p384.rs except the addition chains. I also extended the P-521 support so that it does the right thing for the 32-bit vs. 64-bit Montgomery stuff; it does the
I didn't extend the code generator to generate gfp_p{384,521}.c. If you have Python code that can generate the constants in the C code, then could you please submit it as a change to this Python script? |
Add a tool to generate and/or verify NIST curve boilerplate.
Manually sync the formatting of the existing code with the generator.