Skip to content

Commit fc206fa

Browse files
Upgrade zebra dep (#18)
1 parent fdbd3a9 commit fc206fa

File tree

4 files changed

+18
-31
lines changed

4 files changed

+18
-31
lines changed

Cargo.lock

+11-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

substrate/primitives/core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ itertools = { version = "0.10.3", optional = true }
4747

4848
# full crypto
4949
array-bytes = { version = "6.1", optional = true }
50-
ed25519-zebra = { version = "3.1.0", default-features = false, optional = true }
50+
ed25519-zebra = { version = "4.0.3", default-features = false, optional = true }
5151
blake2 = { version = "0.10.4", default-features = false, optional = true }
5252
libsecp256k1 = { version = "0.7", default-features = false, features = ["static-context"], optional = true }
5353
schnorrkel = { version = "0.11.4", features = ["preaudit_deprecated"], default-features = false }

substrate/primitives/core/src/ed25519.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl TryFrom<&[u8]> for Public {
120120

121121
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
122122
if data.len() != Self::LEN {
123-
return Err(())
123+
return Err(());
124124
}
125125
let mut r = [0u8; Self::LEN];
126126
r.copy_from_slice(data);
@@ -322,7 +322,7 @@ impl Signature {
322322
/// you are certain that the array actually is a signature. GIGO!
323323
pub fn from_slice(data: &[u8]) -> Option<Self> {
324324
if data.len() != 64 {
325-
return None
325+
return None;
326326
}
327327
let mut r = [0u8; 64];
328328
r.copy_from_slice(data);
@@ -423,7 +423,9 @@ impl TraitPair for Pair {
423423
/// Returns true if the signature is good.
424424
fn verify<M: AsRef<[u8]>>(sig: &Signature, message: M, public: &Public) -> bool {
425425
let Ok(public) = VerificationKey::try_from(public.as_slice()) else { return false };
426-
let Ok(signature) = ed25519_zebra::Signature::try_from(sig.as_ref()) else { return false };
426+
let Ok(signature) = ed25519_zebra::Signature::try_from(sig.0.as_slice()) else {
427+
return false;
428+
};
427429
public.verify(&signature, message.as_ref()).is_ok()
428430
}
429431

substrate/primitives/statement-store/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ thiserror = { version = "1.0", optional = true }
3131
# ECIES dependencies
3232
ed25519-dalek = { version = "2.1", optional = true }
3333
x25519-dalek = { version = "2.0", optional = true, features = ["static_secrets"] }
34-
curve25519-dalek = { version = "4.1.1", optional = true }
34+
curve25519-dalek = { version = "4.1.3", optional = true }
3535
aes-gcm = { version = "0.10", optional = true }
3636
hkdf = { version = "0.12.0", optional = true }
3737
sha2 = { version = "0.10.7", optional = true }

0 commit comments

Comments
 (0)