feat(wnaf): add scalar_repr_to_le_bytes()#10
Closed
tob-scott-a wants to merge 1 commit intoRustCrypto:mainfrom
Closed
feat(wnaf): add scalar_repr_to_le_bytes()#10tob-scott-a wants to merge 1 commit intoRustCrypto:mainfrom
tob-scott-a wants to merge 1 commit intoRustCrypto:mainfrom
Conversation
5568ca4 to
3eef6c5
Compare
Member
|
Hmm, I do think a fix to Per @str4d it sounds like the wNAF implementation in |
tarcieri
added a commit
to RustCrypto/ff
that referenced
this pull request
Mar 31, 2026
The current `group::Wnaf` implementation assumes `PrimeField::to_repr` returns a little endian encoding, so it doesn't work with our implementations of the NIST P-curves, which return a big endian SEC1 encoding. Following the general idea from RustCrypto/group#10, this adds an API which is guaranteed to return a little endian encoding which will always work with the current implementation of `group::Wnaf`. This is largely a stopgap solution which allows us to begin using `group::Wnaf` at all, though ideally we can find a more elegant upstream solution.
tarcieri
added a commit
to RustCrypto/ff
that referenced
this pull request
Mar 31, 2026
The current `group::Wnaf` implementation assumes `PrimeField::to_repr` returns a little endian encoding, so it doesn't work with our implementations of the NIST P-curves, which return a big endian SEC1 encoding. Following the general idea from RustCrypto/group#10, this adds an API which is guaranteed to return a little endian encoding which will always work with the current implementation of `group::Wnaf`. This is largely a stopgap solution which allows us to begin using `group::Wnaf` at all, though ideally we can find a more elegant upstream solution.
Member
|
FYI, I took a slightly different approach here, adding a method to That's probably not the ideal solution, but it should be enough to at least get things working initially. |
Member
|
Closing in favor of #12, but thanks for finding the issue! |
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.
Needed for a clean fix to elliptic-curve.