Skip to content

Commit

Permalink
hkdf: bump hmac crate dependency to v0.11 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored Apr 29, 2021
1 parent 65f5009 commit ec1591f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hkdf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "src/hkdf.rs"

[dependencies]
digest = "0.9"
hmac = "0.10"
hmac = "0.11"

[dev-dependencies]
blobby = "0.3"
Expand Down
7 changes: 2 additions & 5 deletions hkdf/src/hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
//! # Usage
//!
//! ```rust
//! # extern crate hex;
//! # extern crate hkdf;
//! # extern crate sha2;
//! # use sha2::Sha256;
//! # use hkdf::Hkdf;
//! let ikm = hex::decode("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b").unwrap();
Expand Down Expand Up @@ -71,7 +68,7 @@ where
pub fn new(salt: Option<&[u8]>) -> HkdfExtract<D> {
let default_salt = GenericArray::<u8, D::OutputSize>::default();
let salt = salt.unwrap_or(&default_salt);
let hmac = Hmac::<D>::new_varkey(salt).expect("HMAC can take a key of any size");
let hmac = Hmac::<D>::new_from_slice(salt).expect("HMAC can take a key of any size");
HkdfExtract { hmac }
}

Expand Down Expand Up @@ -125,7 +122,7 @@ where
}

Ok(Hkdf {
hmac: Hmac::new_varkey(prk).expect("HMAC can take a key of any size"),
hmac: Hmac::new_from_slice(prk).expect("HMAC can take a key of any size"),
})
}

Expand Down

0 comments on commit ec1591f

Please sign in to comment.