diff --git a/Cargo.lock b/Cargo.lock index b1d8ca8b5ec2..a028d5520df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4374,16 +4374,15 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version 0.4.0", "subtle 2.6.1", "zeroize", @@ -4810,7 +4809,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519", "rand_core 0.6.4", "serde", @@ -4819,27 +4818,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ed25519-zebra" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", - "zeroize", -] - [[package]] name = "ed25519-zebra" version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519", "hashbrown 0.14.3", "hex", @@ -8146,7 +8131,7 @@ dependencies = [ "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "either", "hashlink", "lioness", @@ -16914,7 +16899,7 @@ dependencies = [ "aead 0.5.2", "arrayref", "arrayvec 0.7.4", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin 3.0.0", "rand_core 0.6.4", @@ -17514,7 +17499,7 @@ dependencies = [ "chacha20 0.9.1", "crossbeam-queue", "derive_more", - "ed25519-zebra 4.0.3", + "ed25519-zebra", "either", "event-listener", "fnv", @@ -17603,7 +17588,7 @@ dependencies = [ "aes-gcm 0.9.2", "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "ring 0.16.20", "rustc_version 0.4.0", @@ -18350,7 +18335,7 @@ dependencies = [ "bs58 0.5.0", "criterion 0.4.0", "dyn-clonable", - "ed25519-zebra 3.1.0", + "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", @@ -18881,7 +18866,7 @@ name = "sp-statement-store" version = "10.0.0" dependencies = [ "aes-gcm 0.10.3", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519-dalek", "hkdf", "parity-scale-codec", @@ -22111,7 +22096,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "serde", "zeroize", diff --git a/substrate/primitives/core/Cargo.toml b/substrate/primitives/core/Cargo.toml index f5914049f41a..4c6488d15fdf 100644 --- a/substrate/primitives/core/Cargo.toml +++ b/substrate/primitives/core/Cargo.toml @@ -47,7 +47,7 @@ itertools = { version = "0.10.3", optional = true } # full crypto array-bytes = { version = "6.1", optional = true } -ed25519-zebra = { version = "3.1.0", default-features = false, optional = true } +ed25519-zebra = { version = "4.0.3", default-features = false, optional = true } blake2 = { version = "0.10.4", default-features = false, optional = true } libsecp256k1 = { version = "0.7", default-features = false, features = ["static-context"], optional = true } schnorrkel = { version = "0.11.4", features = ["preaudit_deprecated"], default-features = false } diff --git a/substrate/primitives/core/src/ed25519.rs b/substrate/primitives/core/src/ed25519.rs index aa0d77510bd8..09e3bf7ef94a 100644 --- a/substrate/primitives/core/src/ed25519.rs +++ b/substrate/primitives/core/src/ed25519.rs @@ -120,7 +120,7 @@ impl TryFrom<&[u8]> for Public { fn try_from(data: &[u8]) -> Result { if data.len() != Self::LEN { - return Err(()) + return Err(()); } let mut r = [0u8; Self::LEN]; r.copy_from_slice(data); @@ -322,7 +322,7 @@ impl Signature { /// you are certain that the array actually is a signature. GIGO! pub fn from_slice(data: &[u8]) -> Option { if data.len() != 64 { - return None + return None; } let mut r = [0u8; 64]; r.copy_from_slice(data); @@ -423,7 +423,9 @@ impl TraitPair for Pair { /// Returns true if the signature is good. fn verify>(sig: &Signature, message: M, public: &Public) -> bool { let Ok(public) = VerificationKey::try_from(public.as_slice()) else { return false }; - let Ok(signature) = ed25519_zebra::Signature::try_from(sig.as_ref()) else { return false }; + let Ok(signature) = ed25519_zebra::Signature::try_from(sig.0.as_slice()) else { + return false; + }; public.verify(&signature, message.as_ref()).is_ok() } diff --git a/substrate/primitives/statement-store/Cargo.toml b/substrate/primitives/statement-store/Cargo.toml index 14af57a7b419..caaad8d0102b 100644 --- a/substrate/primitives/statement-store/Cargo.toml +++ b/substrate/primitives/statement-store/Cargo.toml @@ -31,7 +31,7 @@ thiserror = { version = "1.0", optional = true } # ECIES dependencies ed25519-dalek = { version = "2.1", optional = true } x25519-dalek = { version = "2.0", optional = true, features = ["static_secrets"] } -curve25519-dalek = { version = "4.1.1", optional = true } +curve25519-dalek = { version = "4.1.3", optional = true } aes-gcm = { version = "0.10", optional = true } hkdf = { version = "0.12.0", optional = true } sha2 = { version = "0.10.7", optional = true }