hashes: Derive Copy and Clone for Hkdf
Currently the `Hkdf` type does not derive any traits. We would like to derive the common set of traits but there are a bunch reasons we can't; - Don't want to leak secrets in `Debug`. - Don't want to enable timing attacks with Eq/Ord and friends. For now just derive `Copy` and `Clone`. We will then implement `Debug` manually.
This commit is contained in:
parent
20e970d7f6
commit
85652359e8
|
@ -32,6 +32,7 @@ impl fmt::Display for MaxLengthError {
|
||||||
impl std::error::Error for MaxLengthError {}
|
impl std::error::Error for MaxLengthError {}
|
||||||
|
|
||||||
/// HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
|
/// HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
|
||||||
|
#[derive(Copy, Clone)]
|
||||||
pub struct Hkdf<T: GeneralHash> {
|
pub struct Hkdf<T: GeneralHash> {
|
||||||
/// Pseudorandom key based on the extract step.
|
/// Pseudorandom key based on the extract step.
|
||||||
prk: Hmac<T>,
|
prk: Hmac<T>,
|
||||||
|
|
Loading…
Reference in New Issue