Skip to content

Commit e34a6ae

Browse files
authored
Rename simple features to password-hash (#776)
To reflect the feature activates the integration with the `password-hash`, this renames the various `simple` features of the crates in this repo to `password-hash` instead. It also takes care of wiring up `rand_core` better. The respective `simple` modules have either been named to `mcf` or `phc` depending on which format is implemented. This will make it possible to add another module to crates that support both, e.g. `pbkdf2` and `scrypt` could both have a `mcf` module. Closes #764
1 parent 4d8d764 commit e34a6ae

File tree

33 files changed

+113
-103
lines changed

33 files changed

+113
-103
lines changed

.github/workflows/argon2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
targets: ${{ matrix.target }}
3838
- run: cargo build --target ${{ matrix.target }} --no-default-features
3939
- run: cargo build --target ${{ matrix.target }} --no-default-features --features password-hash
40-
- run: cargo build --target ${{ matrix.target }} --no-default-features --features simple
40+
- run: cargo build --target ${{ matrix.target }} --no-default-features --features password-hash
4141
- run: cargo build --target ${{ matrix.target }} --no-default-features --features zeroize
4242

4343
minimal-versions:

.github/workflows/scrypt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
toolchain: ${{ matrix.rust }}
3636
targets: ${{ matrix.target }}
3737
- run: cargo build --target ${{ matrix.target }} --no-default-features
38-
- run: cargo build --target ${{ matrix.target }} --no-default-features --features simple
38+
- run: cargo build --target ${{ matrix.target }} --no-default-features --features password-hash
3939

4040
minimal-versions:
4141
# disabled until belt-block gets published

.github/workflows/sha-crypt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
toolchain: ${{ matrix.rust }}
3636
targets: ${{ matrix.target }}
3737
- run: cargo build --target ${{ matrix.target }} --no-default-features
38-
- run: cargo build --target ${{ matrix.target }} --no-default-features --features simple
38+
- run: cargo build --target ${{ matrix.target }} --no-default-features --features password-hash
3939

4040
minimal-versions:
4141
if: false # disabled while using pre-releases

.readme/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ publish = false
88
[dependencies]
99
password-hash = "0.6.0-rc.3"
1010
argon2 = { path = "../argon2" }
11-
pbkdf2 = { path = "../pbkdf2", features = ["simple"] }
11+
pbkdf2 = { path = "../pbkdf2", features = ["password-hash"] }
1212
scrypt = { path = "../scrypt" }

Cargo.lock

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ opt-level = 2
2020
argon2 = { path = "./argon2" }
2121
pbkdf2 = { path = "./pbkdf2" }
2222
scrypt = { path = "./scrypt" }
23+
24+
password-hash = { git = "https://github.com/RustCrypto/traits" }

argon2/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ blake2 = { version = "0.11.0-rc.3", default-features = false }
2323
# optional dependencies
2424
rayon = { version = "1.7", optional = true }
2525
password-hash = { version = "0.6.0-rc.5", optional = true, features = ["phc"] }
26-
phc = { version = "0.6.0-rc.0", optional = true, features = ["rand_core"] }
2726
zeroize = { version = "1", default-features = false, optional = true }
2827

2928
[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
@@ -33,12 +32,13 @@ cpufeatures = "0.2.17"
3332
hex-literal = "1"
3433

3534
[features]
36-
default = ["alloc", "getrandom", "simple"]
35+
default = ["alloc", "getrandom", "password-hash"]
3736
alloc = ["password-hash?/alloc"]
3837

39-
getrandom = ["simple", "password-hash/getrandom"]
38+
getrandom = ["password-hash/getrandom"]
4039
parallel = ["dep:rayon"]
41-
simple = ["password-hash", "phc"]
40+
password-hash = ["dep:password-hash"]
41+
rand_core = ["password-hash/rand_core"]
4242
zeroize = ["dep:zeroize"]
4343

4444
[lints.rust.unexpected_cfgs]

argon2/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ mod tests {
711711
}
712712

713713
#[test]
714-
fn hash_simple_retains_configured_params() {
714+
fn password_hash_retains_configured_params() {
715715
// Non-default but valid parameters
716716
let t_cost = 4;
717717
let m_cost = 2048;

balloon-hash/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ crypto-bigint = { version = "0.7.0-rc.9", default-features = false, features = [
1919

2020
# optional dependencies
2121
password-hash = { version = "0.6.0-rc.5", optional = true, default-features = false, features = ["phc"] }
22-
phc = { version = "0.6.0-rc.0", optional = true, features = ["rand_core"] }
2322
rayon = { version = "1.7", optional = true }
2423
zeroize = { version = "1", default-features = false, optional = true }
2524

@@ -33,7 +32,8 @@ alloc = ["password-hash/alloc"]
3332

3433
getrandom = ["password-hash/getrandom"]
3534
parallel = ["dep:rayon"]
36-
password-hash = ["dep:password-hash", "dep:phc"]
35+
password-hash = ["dep:password-hash"]
36+
rand_core = ["password-hash/rand_core"]
3737
zeroize = ["dep:zeroize"]
3838

3939
[package.metadata.docs.rs]

balloon-hash/src/params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use {
99
fmt::{self, Display},
1010
str::FromStr,
1111
},
12-
phc::{ParamsString, PasswordHash},
12+
password_hash::phc::{ParamsString, PasswordHash},
1313
};
1414

1515
/// Balloon password hash parameters.

0 commit comments

Comments
 (0)