diff --git a/Cargo.lock b/Cargo.lock index 2fd3d493454..8684f825e88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3127,7 +3127,7 @@ dependencies = [ "quickcheck-ext", "rand 0.10.2", "serde", - "sha2 0.10.9", + "sha2 0.11.0", "smallvec", "thiserror 2.0.19", "tokio", @@ -3640,7 +3640,7 @@ dependencies = [ "prost-codec", "rand 0.10.2", "serde", - "sha2 0.10.9", + "sha2 0.11.0", "tinytemplate", "tracing", ] diff --git a/Cargo.toml b/Cargo.toml index 5c3aa832855..092e759eed0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -144,6 +144,7 @@ quickcheck = { package = "quickcheck-ext", path = "misc/quickcheck-ext" } rand = "0.10" rcgen = "0.13" ring = "0.17" +sha2 = "0.11" rw-stream-sink = { version = "0.5.0", path = "misc/rw-stream-sink" } thiserror = "2" tokio = { version = "1.53", default-features = false } diff --git a/misc/webrtc-utils/Cargo.toml b/misc/webrtc-utils/Cargo.toml index a2b83a6aeb1..e3f408f6127 100644 --- a/misc/webrtc-utils/Cargo.toml +++ b/misc/webrtc-utils/Cargo.toml @@ -22,7 +22,7 @@ prost = { workspace = true } prost-codec = { workspace = true } rand = { workspace = true } serde = { version = "1.0", features = ["derive"] } -sha2 = "0.10" +sha2 = { workspace = true } tinytemplate = "1.2" tracing = { workspace = true } diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index bdd6d183065..aa7bb6c452e 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -35,7 +35,7 @@ prost-codec = { workspace = true } rand = { workspace = true } regex = "1.13" serde = { version = "1", optional = true, features = ["derive"] } -sha2 = "0.11" +sha2 = { workspace = true } tracing = { workspace = true } # Metrics dependencies diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index cf1fb589a94..0fe9b15b74d 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -23,7 +23,7 @@ prost = { workspace = true } prost-codec = { workspace = true } libp2p-identity = { workspace = true, features = ["rand"] } rand = { workspace = true } -sha2 = "0.10" +sha2 = { workspace = true } smallvec = "1.15" uint = "0.10" futures-timer = { workspace = true } diff --git a/protocols/kad/src/kbucket/key.rs b/protocols/kad/src/kbucket/key.rs index e5db79b89ea..c3dcfc5527f 100644 --- a/protocols/kad/src/kbucket/key.rs +++ b/protocols/kad/src/kbucket/key.rs @@ -28,7 +28,7 @@ use libp2p_core::multihash::Multihash; use libp2p_identity::PeerId; use sha2::{ Digest, Sha256, - digest::generic_array::{GenericArray, typenum::U32}, + digest::common::array::{Array, typenum::U32}, }; use uint::*; @@ -153,7 +153,7 @@ impl Hash for Key { /// The raw bytes of a key in the DHT keyspace. #[derive(PartialEq, Eq, Clone, Copy, Debug)] -pub struct KeyBytes(GenericArray); +pub struct KeyBytes(Array); impl KeyBytes { /// Creates a new key in the DHT keyspace by running the given @@ -182,7 +182,7 @@ impl KeyBytes { /// `self xor other = distance <==> other = self xor distance` pub fn for_distance(&self, d: Distance) -> KeyBytes { let key_int = U256::from_big_endian(self.0.as_slice()) ^ d.0; - KeyBytes(GenericArray::from(key_int.to_big_endian())) + KeyBytes(Array::from(key_int.to_big_endian())) } }