Skip to content

Commit

Permalink
transports/noise: Fix compilation with additional generic-array featu…
Browse files Browse the repository at this point in the history
…res (libp2p#2264)

For crate that depends on `generic-array = { version = "0.14.3", features =
["serde", "more_lengths"] }` It's seems that `as_ref()` is ambiguous.
  • Loading branch information
Milerius authored and nguquen committed Oct 28, 2021
1 parent b814231 commit 3b7a4fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transports/noise/src/protocol/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl SecretKey<X25519> {
// 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
Expand Down

0 comments on commit 3b7a4fe

Please sign in to comment.