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 (#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 committed Oct 4, 2021
1 parent 5cbd473 commit c7abb6f
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 @@ -219,7 +219,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 c7abb6f

Please sign in to comment.