-
Notifications
You must be signed in to change notification settings - Fork 122
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
[EC] Use s2n-bignum's modular inversion for P-256/384/521 #2057
Conversation
This reverts commit 86bee87.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2057 +/- ##
==========================================
- Coverage 78.76% 78.74% -0.02%
==========================================
Files 598 598
Lines 103688 103655 -33
Branches 14742 14733 -9
==========================================
- Hits 81666 81627 -39
- Misses 21369 21374 +5
- Partials 653 654 +1 ☔ View full report in Codecov by Sentry. |
@@ -63,6 +63,8 @@ static inline void p256_montjscalarmul_selector(uint64_t res[S2N_BIGNUM_STATIC 1 | |||
else { p256_montjscalarmul(res, scalar, point); } | |||
} | |||
|
|||
extern void bignum_montinv_p256(uint64_t z[S2N_BIGNUM_STATIC 4], const uint64_t x[S2N_BIGNUM_STATIC 4]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document what the function does and that it's constant-time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Issues:
N/A
Description of changes:
Use s2n-bignum's inversion modulo the field characteristic
for curves P-256/384/521. This gives us the following
performance improvements:
Call-outs:
Point out areas that need special attention or support during the review process. Discuss architecture or design changes.
Testing:
How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.