From c7abb6f70c97cdc75aed021870f5902ec2cb268e Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Mon, 4 Oct 2021 20:14:50 +0200 Subject: [PATCH] transports/noise: Fix compilation with additional generic-array features (#2264) For crate that depends on `generic-array = { version = "0.14.3", features = ["serde", "more_lengths"] }` It's seems that `as_ref()` is ambiguous. --- transports/noise/src/protocol/x25519.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transports/noise/src/protocol/x25519.rs b/transports/noise/src/protocol/x25519.rs index fb216909806..14ca8c60689 100644 --- a/transports/noise/src/protocol/x25519.rs +++ b/transports/noise/src/protocol/x25519.rs @@ -219,7 +219,7 @@ impl SecretKey { // let ed25519_sk = ed25519::SecretKey::from(ed); let mut curve25519_sk: [u8; 32] = [0; 32]; let hash = Sha512::digest(ed25519_sk.as_ref()); - curve25519_sk.copy_from_slice(&hash.as_ref()[..32]); + curve25519_sk.copy_from_slice(&hash[..32]); let sk = SecretKey(X25519(curve25519_sk)); // Copy curve25519_sk.zeroize(); sk