Skip to content

Commit

Permalink
pbkdf2 v0.12.2 (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored Jul 8, 2023
1 parent cb56812 commit 165f4a8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 6 additions & 0 deletions pbkdf2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.12.2 (2023-07-08)
### Fixed
- Use `RECOMMENDED_ROUNDS` in `Default` impl for `Params` ([#442])

[#442]: https://github.com/RustCrypto/password-hashes/pull/442

## 0.12.1 (2023-03-04)
### Changed
- Re-export `hmac` ([#397])
Expand Down
2 changes: 1 addition & 1 deletion pbkdf2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pbkdf2"
version = "0.12.1"
version = "0.12.2"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
description = "Generic implementation of PBKDF2"
Expand Down
16 changes: 8 additions & 8 deletions pbkdf2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
//! let password = b"password";
//! let salt = b"salt";
//! // number of iterations
//! let n = 4096;
//! let n = 600_000;
//! // Expected value of generated key
//! let expected = hex!("c5e478d59288c841aa530db6845c4c8d962893a0");
//! let expected = hex!("669cfe52482116fda1aa2cbe409b2f56c8e45637");
//!
//! let mut key1 = [0u8; 20];
//! pbkdf2_hmac::<Sha256>(password, salt, n, &mut key1);
Expand Down Expand Up @@ -200,9 +200,9 @@ where
/// use hmac::Hmac;
/// use sha2::Sha256;
///
/// let res = pbkdf2_array::<Hmac<Sha256>, 20>(b"password", b"salt", 4096)
/// let res = pbkdf2_array::<Hmac<Sha256>, 20>(b"password", b"salt", 600_000)
/// .expect("HMAC can be initialized with any key length");
/// assert_eq!(res, hex!("c5e478d59288c841aa530db6845c4c8d962893a0"));
/// assert_eq!(res, hex!("669cfe52482116fda1aa2cbe409b2f56c8e45637"));
/// ```
#[inline]
pub fn pbkdf2_array<PRF, const N: usize>(
Expand All @@ -226,8 +226,8 @@ where
/// use sha2::Sha256;
///
/// let mut buf = [0u8; 20];
/// pbkdf2_hmac::<Sha256>(b"password", b"salt", 4096, &mut buf);
/// assert_eq!(buf, hex!("c5e478d59288c841aa530db6845c4c8d962893a0"));
/// pbkdf2_hmac::<Sha256>(b"password", b"salt", 600_000, &mut buf);
/// assert_eq!(buf, hex!("669cfe52482116fda1aa2cbe409b2f56c8e45637"));
/// ```
#[cfg(feature = "hmac")]
#[cfg_attr(docsrs, doc(cfg(feature = "hmac")))]
Expand Down Expand Up @@ -257,8 +257,8 @@ where
/// use sha2::Sha256;
///
/// assert_eq!(
/// pbkdf2_hmac_array::<Sha256, 20>(b"password", b"salt", 4096),
/// hex!("c5e478d59288c841aa530db6845c4c8d962893a0"),
/// pbkdf2_hmac_array::<Sha256, 20>(b"password", b"salt", 600_000),
/// hex!("669cfe52482116fda1aa2cbe409b2f56c8e45637"),
/// );
/// ```
#[cfg(feature = "hmac")]
Expand Down

0 comments on commit 165f4a8

Please sign in to comment.