-
Notifications
You must be signed in to change notification settings - Fork 707
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
Replace limbs initializer with const from_hex #1702
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1702 +/- ##
==========================================
- Coverage 95.99% 95.85% -0.14%
==========================================
Files 134 135 +1
Lines 19980 19982 +2
Branches 199 199
==========================================
- Hits 19179 19154 -25
- Misses 765 791 +26
- Partials 36 37 +1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
The current macro initializer is not uniform across architectures, and doesn't work when the number of 64bit limbs is not exactly half that of 32bit limbs, (i.e. 521 bit). This change replaces all limbs! initializers with a new const function with hex string initializers, which is more portable and more ergonomic.
d682bf7
to
9072cb4
Compare
n: Elem::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"), | ||
a: Elem::from_hex("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffc0000000000000003fffffffc"), | ||
b: Elem::from_hex("cd08114b604fbff9b62b21f41f022094e3374bee94938ae277f2209b1920022ef729add87a4c32ec081188719d412dcc") | ||
, |
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.
This comma shouldn't be on its own line; it should be at the end of the line above. I will fix this after I merge this.
0x19b409a9, 0x2d319b24, 0xdf1aa419, 0xff3d81e5, 0xfcb82947, 0xbc3e483a, 0x4aab1cc5, 0xd40d4917, | ||
0x28266895, 0x3fb05b7a, 0x2b39bf21, 0x0c84ee01 | ||
]; | ||
const N_RR_HEX: &str = "0c84ee012b39bf213fb05b7a28266895d40d49174aab1cc5bc3e483afcb82947ff3d81e5df1aa4192d319b2419b409a9"; |
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.
This doesn't need to have the leading zero, right? I will fix this after I merge it.
The current macro initializer is not uniform across architectures, and doesn't work when the number of 64bit limbs is not exactly half that of 32bit limbs, (i.e. 521 bit).
This change replaces all limbs! initializers with a new const function with hex string initializers, which is more portable and more ergonomic.