Skip to content

perf: Migrate to new crypto libraries using dalek's math#402

Merged
HealthyBuilder merged 3 commits into
solana-foundation:mainfrom
sparx7783:ed25519-+-curve25519
Apr 26, 2026
Merged

perf: Migrate to new crypto libraries using dalek's math#402
HealthyBuilder merged 3 commits into
solana-foundation:mainfrom
sparx7783:ed25519-+-curve25519

Conversation

@sparx7783
Copy link
Copy Markdown
Contributor

Problem

Go's std lib crypto/ed25519 is not using the optimized ed25519 math used in Dalek's rust lib, which offers significant performance improvements, we can switch to github.com/oasisprotocol/curve25519-voi to get these improvements.

Summary of Changes

Migrate from crypto/ed25519 and filippo.io/edwards25519 to new oasisprotocol/curve25519-voi, with slightly rewriting the isOnCurve verification function for slight api differences. Uses VerifyWithOptions(..., verifyOptionsStdLib) to keep verification 1:1 with the previous stdlib implementation.

Benchmarks

Operation main (stdlib + filippo) voi Speedup
Sign 19,650 ns, 1 alloc 11,420 ns, 1 alloc 1.72×
Verify 37,548 ns, 0 allocs 23,491 ns, 0 allocs 1.60×
IsOnCurve 2,786 ns, 0 allocs 2,519 ns, 0 allocs 1.11×
FindAssociatedTokenAddress (wSOL) 25,157 ns, 58 allocs 23,086 ns, 58 allocs 1.09×

Copy link
Copy Markdown
Contributor

@sonicfromnewyoke sonicfromnewyoke left a comment

Choose a reason for hiding this comment

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

awesome MR, thanks 🙏

Comment thread keys.go Outdated
@HealthyBuilder
Copy link
Copy Markdown
Collaborator

Thanks for the great work! This conflicts with #399 (which just landed) on keys.go. Could you rebase on latest main to resolve? @sparx7783

Thank you!

@sparx7783
Copy link
Copy Markdown
Contributor Author

Should be good to go now.

@sparx7783 sparx7783 force-pushed the ed25519-+-curve25519 branch from 20c4511 to ac95117 Compare April 23, 2026 20:27
@HealthyBuilder HealthyBuilder merged commit 20713fb into solana-foundation:main Apr 26, 2026
11 of 12 checks passed
@HealthyBuilder
Copy link
Copy Markdown
Collaborator

Merged, thankyou!

@sparx7783 sparx7783 deleted the ed25519-+-curve25519 branch April 28, 2026 20:53
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.

3 participants