Skip to content

Add curve448 (Goldilocks) curve support#61

Open
sridhar-panigrahi wants to merge 2 commits intoLFDT-Lockness:mfrom
sridhar-panigrahi:feat/add-curve448-support
Open

Add curve448 (Goldilocks) curve support#61
sridhar-panigrahi wants to merge 2 commits intoLFDT-Lockness:mfrom
sridhar-panigrahi:feat/add-curve448-support

Conversation

@sridhar-panigrahi
Copy link
Copy Markdown
Contributor

@sridhar-panigrahi sridhar-panigrahi commented Mar 23, 2026

Hey @survived! Following up on #58 — here's Curve448 support as discussed.

Closes #58 (partially — P-521 still remains)

Overview

This adds Curve448 (Goldilocks) using ed448-goldilocks-plus as the backend. I went with the same approach as Ed25519 (manual trait impls in its own module) since Curve448 uses Edwards encoding, not SEC1.

The implementation handles the quirk where ed448-goldilocks-plus uses 57-byte scalar representations internally (RFC 8032 convention) while the actual scalar fits in 56 bytes — so there's some padding logic for the conversions.

Changes

  • New generic-ec-curves/src/curve448.rs with all generic_ec_core trait impls
  • 57-byte compressed point encoding via CompressedEdwardsY
  • 56-byte scalar encoding with Reduce<56> and Reduce<112>
  • Cofactor-4 torsion checking through CofactorGroup
  • FromUniformBytes with 72-byte input per RFC 9380
  • All existing generic tests instantiated for the new curve
  • Benchmarks added
  • README + lib.rs docs updated

Testing

All 22 curve448-specific tests pass and the full workspace suite has zero regressions. Clippy is clean too.

Happy to tackle P-521 next if that's still useful!

  Adds Curve448 as a new curve backend using ed448-goldilocks-plus.
  Follows the same manual trait implementation approach as Ed25519
  since Curve448 uses Edwards encoding rather than SEC1.

  - 57-byte compressed point encoding (CompressedEdwardsY)
  - 56-byte scalar encoding with Reduce<56> and Reduce<112>
  - Cofactor-4 torsion checking via CofactorGroup
  - All existing tests instantiated for the new curve

  Signed-off-by: Shridhar Panigrahi <sridharpanigrahi2006@gmail.com>

Signed-off-by: Shridhar Panigrahi <sridharpanigrahi2006@gmail.com>
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 23, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addeded448-goldilocks-plus@​0.16.010010093100100

View full report

@sridhar-panigrahi
Copy link
Copy Markdown
Contributor Author

@survived , please let me know you thoughts on this !

  Signed-off-by: Shridhar Panigrahi <sridharpanigrahi2006@gmail.com>

Signed-off-by: Shridhar Panigrahi <sridharpanigrahi2006@gmail.com>
@sridhar-panigrahi sridhar-panigrahi force-pushed the feat/add-curve448-support branch from 96ef316 to e963cf0 Compare March 23, 2026 21:52
@survived
Copy link
Copy Markdown
Contributor

Hey @sridhar-panigrahi, sorry, it will take me some time to review the PR as I'm pressed by some other work. I should be able to get on this in a couple of weeks unless @maurges gets to it first!

@sridhar-panigrahi
Copy link
Copy Markdown
Contributor Author

it's ok @survived , I'll try to find and work on something even more valuable on this repo .

@sridhar-panigrahi
Copy link
Copy Markdown
Contributor Author

@maurges , please let me know your thoughts on this !

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.

Add support of curves with larger scalar sizes

2 participants