Bound input length in split_to_two_frs#966
Closed
jonas-lj wants to merge 1 commit into
Closed
Conversation
Reject inputs outside [33, 47] bytes. Previously a `len() - 16` could underflow on too-short input, and inputs ≥ 48 bytes could trigger silent modular reduction in the first half (enabling collisions). Also add a note in get_nonce about a related latent underflow that is unreachable in practice.
Contributor
Author
|
Covered in #939. Closing |
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.
Reject inputs outside
[33, 47]bytes insplit_to_two_frs: shorter inputs would underflowlen() - 16, and≥ 48byte inputs let the first half exceed the BN254 modulus and silently reduce (enabling collisions).Also adds a note in
get_nonceabout a related latent underflow that is unreachable in practice.This has no impact on Sui which always builds
extended_pk_bytes = flag (1 byte) || public_key_bytes, producing 33 bytes for ed25519 and 34 bytes for compressed secp256k1 / secp256r1 both of which are inside the new bounds. Theverify_zk_loginpath insui-types::zk_login_authenticatorand the CLIkeytoolnonce-generation path are both unaffected.