Skip to content

Commit

Permalink
chore(deps): Bump curve25519-dalek to 4.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d committed Dec 5, 2024
1 parent d8b48c7 commit e96d83a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 39 deletions.
47 changes: 41 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 11 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ byteorder = { version = "1.5.0", default-features = false }
chrono = { version = "0.4.38", default-features = false }
console_error_panic_hook = "0.1.7"
console_log = "0.2.2"
curve25519-dalek = "3.2.1"
curve25519-dalek = { version = "4.1.3", features = ["digest", "rand_core"] }
derivation-path = { version = "0.2.0", default-features = false }
digest = { version = "0.10.7", default-features = false }
ed25519-dalek = { version = "=1.0.1", default-features = false }
Expand Down Expand Up @@ -92,35 +92,13 @@ hashbrown = "0.15"
nostd = { version = "0.1", features = ["hashbrown", "io"] }
thiserror = { version = "2.0", default-features = false }

# Our dependency tree has `curve25519-dalek` v3.2.1. They have removed the
# constraint in the next major release. The commit that removes the `zeroize`
# constraint was added to multiple release branches, but not to the 3.2 branch.
#
# `curve25519-dalek` maintainers are saying they do not want to invest any more
# time in the 3.2 release:
#
# https://github.com/dalek-cryptography/curve25519-dalek/issues/452#issuecomment-1749809428
#
# So we have to fork and create our own release, based on v3.2.1, with the
# commit that removed `zeroize` constraint on the `main` branch cherry-picked on
# top.
#
# `curve25519-dalek` v3.2.1 release:
#
# https://github.com/dalek-cryptography/curve25519-dalek/releases/tag/3.2.1
#
# Corresponds to commit
#
# https://github.com/dalek-cryptography/curve25519-dalek/commit/29e5c29b0e5c6821e4586af58b0d0891dd2ec639
#
# Comparison with `b500cdc2a920cd5bff9e2dd974d7b97349d61464`:
#
# https://github.com/dalek-cryptography/curve25519-dalek/compare/3.2.1...solana-labs:curve25519-dalek:b500cdc2a920cd5bff9e2dd974d7b97349d61464
#
# Or, using the branch name instead of the hash:
#
# https://github.com/dalek-cryptography/curve25519-dalek/compare/3.2.1...solana-labs:curve25519-dalek:3.2.1-unpin-zeroize
#
[patch.crates-io.curve25519-dalek]
git = "https://github.com/anza-xyz/curve25519-dalek.git"
rev = "b500cdc2a920cd5bff9e2dd974d7b97349d61464"
# curve25519-dalek uses the simd backend by default in v4 if possible,
# which has very slow performance on some platforms with opt-level 0,
# which is the default for dev and test builds.
# This slowdown causes certain interactions in the solana-test-validator,
# such as verifying ZK proofs in transactions, to take much more than 400ms,
# creating problems in the testing environment.
# To enable better performance in solana-test-validator during tests and dev builds,
# we override the opt-level to 3 for the crate.
[profile.dev.package.curve25519-dalek]
opt-level = 3
1 change: 1 addition & 0 deletions sdk/program/src/pubkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ pub fn bytes_are_curve_point<T: AsRef<[u8]>>(_bytes: T) -> bool {
#[cfg(not(target_os = "solana"))]
{
curve25519_dalek::edwards::CompressedEdwardsY::from_slice(_bytes.as_ref())
.unwrap()
.decompress()
.is_some()
}
Expand Down

0 comments on commit e96d83a

Please sign in to comment.