change SharedSecret::derive_key method to use a reference
This commit is contained in:
parent
df5be01dfe
commit
190c56eeff
1 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ impl EncryptedStream {
|
||||||
let shared_secret = secret.diffie_hellman(&their_public);
|
let shared_secret = secret.diffie_hellman(&their_public);
|
||||||
|
|
||||||
let key =
|
let key =
|
||||||
shared_secret.derive_key(|bytes| blake3::derive_key(KEY_DERIVATION_CONTEXT, &bytes));
|
shared_secret.derive_key(|bytes| blake3::derive_key(KEY_DERIVATION_CONTEXT, bytes));
|
||||||
|
|
||||||
Ok(EncryptedStream::wrap(socket, key))
|
Ok(EncryptedStream::wrap(socket, key))
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ impl TryFrom<TcpStream> for EncryptedStream {
|
||||||
let shared_secret = secret.diffie_hellman(&their_public);
|
let shared_secret = secret.diffie_hellman(&their_public);
|
||||||
|
|
||||||
let key =
|
let key =
|
||||||
shared_secret.derive_key(|bytes| blake3::derive_key(KEY_DERIVATION_CONTEXT, &bytes));
|
shared_secret.derive_key(|bytes| blake3::derive_key(KEY_DERIVATION_CONTEXT, bytes));
|
||||||
|
|
||||||
Ok(EncryptedStream::wrap(socket, key))
|
Ok(EncryptedStream::wrap(socket, key))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue