Skip to content

fix: assert signature is normalized instead of reducing it#14

Open
TomAFrench wants to merge 3 commits intomasterfrom
tf/assert-normalized-signature
Open

fix: assert signature is normalized instead of reducing it#14
TomAFrench wants to merge 3 commits intomasterfrom
tf/assert-normalized-signature

Conversation

@TomAFrench
Copy link
Member

@TomAFrench TomAFrench commented Feb 3, 2026

Description

Problem*

Resolves

Summary*

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Change normalize_signature to assert_normalized_signature which now
asserts the input is already in range [0, BN254_Fq_MODULUS) rather than
reducing it. This removes the need for the quotient computation and
simplifies the modulus constant to a single tuple.
Previously only sig_e was validated to be in range [0, BN254_Fq_MODULUS).
A malicious signature could use sig_s values >= modulus that would be
reduced internally, allowing multiple valid signatures for the same
message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant