Skip to content

fix: reject non-canonical Ed25519 point encodings - #132

Merged
hsiuhsiu merged 1 commit into
masterfrom
fix/ed25519-noncanonical-point-encoding
Aug 15, 2026
Merged

fix: reject non-canonical Ed25519 point encodings#132
hsiuhsiu merged 1 commit into
masterfrom
fix/ed25519-noncanonical-point-encoding

Conversation

@hsiuhsiu

Copy link
Copy Markdown
Contributor

Enforce the RFC 8032 5.1.3 canonical-encoding checks when decoding a point:

  • Reject y-coordinates that are not reduced mod p (the 19 values in [p, 2^255-1]), regardless of the encoded x sign bit.
  • Reject the "negative zero" encoding (x == 0 with the sign bit set).

Expand the malformed-encoding test to cover all 19 non-canonical y values with both sign bits, plus the negative-zero case.

Enforce the RFC 8032 5.1.3 canonical-encoding checks when decoding a
point:

- Reject y-coordinates that are not reduced mod p (the 19 values in
  [p, 2^255-1]), regardless of the encoded x sign bit.
- Reject the "negative zero" encoding (x == 0 with the sign bit set).

Expand the malformed-encoding test to cover all 19 non-canonical y
values with both sign bits, plus the negative-zero case.
@cb-heimdall

cb-heimdall commented Aug 14, 2026

Copy link
Copy Markdown

✅ Heimdall Review Status

Requirement Status More Info
Reviews 2/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 2
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 2
2
1 if commit is unverified 0
Sum 2
CODEOWNERS ✅ None for this change

@hsiuhsiu
hsiuhsiu marked this pull request as ready for review August 14, 2026 21:58

@valery-osheter-cb valery-osheter-cb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@hsiuhsiu
hsiuhsiu merged commit 41fee60 into master Aug 15, 2026
9 checks passed
@hsiuhsiu
hsiuhsiu deleted the fix/ed25519-noncanonical-point-encoding branch August 15, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants