Repository navigation
bignp256: reject secrets that aren't 32 bytes in hash_secret_to_curve - #1948
Open
FlashWayne wants to merge 1 commit into
Open
FlashWayne wants to merge 1 commit into
FlashWayne wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
bake-swu (STB 34.101.66-2014, 6.2.3) takes a secret of exactly
2l = 256bits, which belt-keywrap then wraps into 48 bytes.hash_secret_to_curveaccepted any length: the expander copies at most 32 bytes into a zeroed buffer, so longer secrets are silently truncated and shorter ones zero padded. As a result different secrets map to the same point (xandx || anything, or a 31 bytexandx || 00), and an empty secret is accepted too.It now returns an error unless the secret is 32 bytes. Doesn't touch the step 4 change in #1934.