Replace limbs initializer with const from_hex#1702
Merged
briansmith merged 1 commit intobriansmith:mainfrom Oct 17, 2023
Merged
Replace limbs initializer with const from_hex#1702briansmith merged 1 commit intobriansmith:mainfrom
briansmith merged 1 commit intobriansmith:mainfrom
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
briansmith
approved these changes
Oct 17, 2023
| n: Elem::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"), | ||
| a: Elem::from_hex("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffc0000000000000003fffffffc"), | ||
| b: Elem::from_hex("cd08114b604fbff9b62b21f41f022094e3374bee94938ae277f2209b1920022ef729add87a4c32ec081188719d412dcc") | ||
| , |
Owner
There was a problem hiding this comment.
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"; |
Owner
There was a problem hiding this comment.
This doesn't need to have the leading zero, right? I will fix this after I merge it.
13 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.