X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fpeer_channel_encryptor.rs;h=da6dc67aba5c4f52ec9e9dcd819aebf131d33084;hb=c581bab8bea05899fec923f1ce6fcdbb2a9e3d97;hp=fbd32526ea658470f810c487bcb88da608904e8b;hpb=8e7f241149b286b5bd467642fef06ad9daeb5c77;p=rust-lightning diff --git a/lightning/src/ln/peer_channel_encryptor.rs b/lightning/src/ln/peer_channel_encryptor.rs index fbd32526..da6dc67a 100644 --- a/lightning/src/ln/peer_channel_encryptor.rs +++ b/lightning/src/ln/peer_channel_encryptor.rs @@ -16,7 +16,7 @@ use bitcoin::hashes::{Hash, HashEngine}; use bitcoin::hashes::sha256::Hash as Sha256; use bitcoin::secp256k1::Secp256k1; -use bitcoin::secp256k1::key::{PublicKey,SecretKey}; +use bitcoin::secp256k1::{PublicKey,SecretKey}; use bitcoin::secp256k1::ecdh::SharedSecret; use bitcoin::secp256k1; @@ -163,7 +163,7 @@ impl PeerChannelEncryptor { #[inline] fn hkdf(state: &mut BidirectionalNoiseState, ss: SharedSecret) -> [u8; 32] { - let (t1, t2) = hkdf_extract_expand_twice(&state.ck, &ss[..]); + let (t1, t2) = hkdf_extract_expand_twice(&state.ck, ss.as_ref()); state.ck = t1; t2 } @@ -473,7 +473,7 @@ impl PeerChannelEncryptor { mod tests { use super::LN_MAX_MSG_LEN; - use bitcoin::secp256k1::key::{PublicKey,SecretKey}; + use bitcoin::secp256k1::{PublicKey,SecretKey}; use hex;