697 Commits

Author SHA1 Message Date
Tony Arcieri
375e3bc159 Revert "pbkdf2: have minimal-versions run cargo check" (#831)
This reverts commit cb4867eaa3  (#830).

This is now the upstream default: RustCrypto/actions#56
2026-01-24 10:55:43 -07:00
Tony Arcieri
9eca9870fd CI: run workflows when .yml config files change (#832)
A few of the workflows were missing this
2026-01-24 10:55:31 -07:00
Tony Arcieri
cb4867eaa3 pbkdf2: have minimal-versions run cargo check (#830)
The `pbkdf2` crate has a lot of features which leads to a combinatorial
explosion in `cargo hack` with `--feature-powerset`.

On the last CI run, `minimal-versions` took 20 minutes:

https://github.com/RustCrypto/password-hashes/actions/runs/21318294427/job/61364340801?pr=829

This switches the `stable-cmd` from using `cargo hack test` to `cargo
hack check`, which should still check all feature combinations build in
a minimal versions scenario but be significantly faster than trying to
test every possible feature combination.

This is the recommended way to use `cargo hack` according to its
developers:

https://github.com/taiki-e/cargo-hack?tab=readme-ov-file#usage
2026-01-24 10:37:48 -07:00
Tony Arcieri
7f42ad4750 Bump password-hash to v0.6.0-rc.11 (#829) 2026-01-24 10:12:24 -07:00
Artyom Pavlov
20a9730449 ci: update Clippy to 1.92 (#827)
Also change Clippy flags to `--workspace --all-features --lib --bins
--tests` for better coverage.
2026-01-21 21:11:05 +03:00
Artyom Pavlov
53cd99e770 scrypt: fix doctest gating (#828) 2026-01-21 20:57:43 +03:00
Artyom Pavlov
edfd311b47 ci: re-enable minimal-versions jobs (#826) 2026-01-21 20:27:47 +03:00
Tony Arcieri
747932ff07 Cut new prereleases (#825)
Releases the following:
- `argon2` v0.6.0-rc.6
- `balloon-hash` v0.5.0-rc.4
- `bcrypt-pbkdf` v0.11.0-rc.3
- `pbkdf2` v0.13.0-rc.8
- `scrypt` v0.12.0-rc.9
- `sha-crypt` v0.6.0-rc.3
- `yescrypt` v0.1.0-rc.4
sha-crypt-v0.6.0-rc.3 pbkdf2-v0.13.0-rc.8 scrypt-v0.12.0-rc.9 argon2-v0.6.0-rc.6 balloon-hash-v0.5.0-rc.4 bcrypt-pbkdf-v0.11.0-rc.3 yescrypt-v0.1.0-rc.4
2026-01-21 09:25:16 -07:00
Tony Arcieri
a3407a8523 bcrypt-pbkdf: improve README.md 2026-01-21 08:23:20 -07:00
Tony Arcieri
9b9a7ba5fe README.md: add yescrypt 2026-01-21 07:49:21 -07:00
Tony Arcieri
449bd9e753 scrypt: remove Display/FromStr impls from Params (#824)
Also bumps `password-hash` to v0.6.0-rc.10, which permits these bounds.

They were previously impl'd using the PHC params syntax, but now that
we've added MCF support (#806) there isn't one-true-serialization that
actually makes sense to use.

In such a case, I think it's best not to impl `Display`/`FromStr` but
instead use format-specific inherent methods and impls for
format-specific types (like `phc::ParamsString`).
2026-01-20 17:16:43 -07:00
Tony Arcieri
2cfdb6f494 Add impls for kdf::{Kdf, Pbkdf} (#823)
For the password hash algorithms that already have a `struct` where we
can impl traits (i.e. any with a `password-hash`/`phc`/`mcf` feature)
adds feature-gated impls of the traits from the new `kdf` crate.

The `Kdf` trait provides a generic API, and `Pbkdf` is a marker trait
for password-based KDFs where a password can be used as a secret input.
2026-01-20 16:12:13 -07:00
Tony Arcieri
cd61372f99 bcrypt-pbkdf + password-auth: remove/disable std features (#822)
These features are literally doing nothing other than linking `std`.
They seem to be vestiges of `std::error::Error`.

- Removes the feature from `bcrypt-pbkdf` completely
- Makes it a no-op in `password-auth`, but doesn't remove it because it
would be a breaking change and it's a post-1.0 crate
2026-01-20 11:59:48 -07:00
Tony Arcieri
be593db727 Bump password-hash to v0.6.0-rc.9 (#821) 2026-01-20 11:33:58 -07:00
Tony Arcieri
a6bc5d42ac bcrypt-pbkdf: move pub fns to top of file (#820)
Puts the public API at the forefront, rather than the implementation
details
2026-01-20 11:18:34 -07:00
dependabot[bot]
b55851ec01 Update Cargo.lock (#819) 2026-01-19 13:20:11 +03:00
Tony Arcieri
07dd94075c Bump pbkdf2 to v0.13.0-rc.7 2026-01-12 07:29:29 -07:00
Tony Arcieri
85b5c61d79 pbkdf2 v0.13.0-rc.7 (#818) pbkdf2/v0.13.0-rc.7 2026-01-12 07:13:45 -07:00
dependabot[bot]
e5e148c268 build(deps): bump the all-deps group with 5 updates (#817) 2026-01-12 06:57:20 -07:00
Tony Arcieri
7a930f8d62 pbkdf2: heapless MCF hash verification support (#816)
Adds an `alloc` feature which is needed to enable MCF hashing
functionality.

The `PasswordVerifier<mcf::PasswordHashRef>` impl now works without any
dependency on liballoc.
2026-01-11 22:34:08 -07:00
Tony Arcieri
bf6c9560d0 pbkdf2: use Base64::Pbkdf2 (#815)
Use support for PBKDF2's special Base64 alphabet now natively
implemented in the `base64ct` and `mcf` crates in
RustCrypto/formats#2168.
2026-01-11 21:56:17 -07:00
Tony Arcieri
1ff0a06a2f README.md(s): fix build badges (#814) 2026-01-11 20:04:44 -07:00
Tony Arcieri
1b669a0615 sha-crypt: add ShaCrypt::SHA256 and ShaCrypt::SHA512 (#813)
Associated constants which are each configured using the default
recommended `Parameters` but the respective SHA-family algorithm
2026-01-11 18:02:13 -07:00
Tony Arcieri
2ac5d0d4e1 password-auth v1.1.0-rc.1 (#812) password-auth-v1.1.0-rc.1 2026-01-11 17:52:58 -07:00
Tony Arcieri
bbbd84040e pbkdf2 v0.13.0-rc.6 (#811) pbkdf2-v0.13.0-rc.6 2026-01-11 17:45:31 -07:00
Tony Arcieri
2d1dbd20c5 pbkdf2: fallible Params constructors (#810)
Ensures the rounds are set to an acceptable minimum and that the output
length falls within the range `10..=64` bytes.
2026-01-11 17:38:51 -07:00
Tony Arcieri
a5b3e25d49 pbkdf2: impl PasswordVerifier<mcf::PasswordHash> (#809)
Adds support for verifying password hashes in MCF format.
2026-01-11 17:23:49 -07:00
Tony Arcieri
7c232a7bd8 pbkdf2: fix MCF Base64; add SHA-512 MCF support (#808)
I discovered these test vectors from a Go port of Passlib:

https://github.com/hlandau/passlib/blob/8f820e0/hash/pbkdf2/pbkdf2_test.go

...and also checked against the Python implementation of Passlib itself,
and discovered PBKDF2 seems to use its own variant of Base64 which is
distinct from the ones used by bcrypt/crypt, namely it's a variant of
unpadded Base64 which swaps `+` for `.`

This implements this Base64 variant, and also adds a test vector from
the Go implementation of Passlib for PBKDF2-SHA-512.
2026-01-11 16:59:36 -07:00
Tony Arcieri
53498b3138 Bump password-hash dependency to v0.6.0-rc.8 (#807) 2026-01-11 16:22:58 -07:00
Tony Arcieri
74c160d5b5 pbkdf2: initial MCF (Customized)PasswordHasher support (#806)
Initial support for computing password hash strings in Modular Crypt
Format (MCF) instead of the PHC string format.

Tested against a vector from passlib:

https://passlib.readthedocs.io/en/stable/lib/passlib.hash.pbkdf2_digest.html

TODO: `PasswordVerifier` support
2026-01-11 16:04:45 -07:00
Tony Arcieri
62dd4ad654 pbkdf2: have Pbkdf2::new take algorithm/params args (#805)
Changes this constructor to allow it to customize both the algorithm and
params, leaving `From` impls for `Algorithm` and `Params` as the way to
customize one or the other while using defaults for the one not
explicitly specified.
2026-01-11 12:43:37 -07:00
Tony Arcieri
b0de9cbab0 yescrypt v0.1.0-rc.3 (#804) yescrypt-v0.1.0-rc.3 2026-01-11 12:25:55 -07:00
Tony Arcieri
2fc7af5ab9 pbkdf2: factor Algorithm and Params into modules (#803)
Moves these types out of the `phc` module, which should make it easier
to add MCF support (#747)
sha-crypt-v0.6.0-rc.2
2026-01-11 12:21:09 -07:00
Tony Arcieri
90adb30886 yescrypt: configurable Params for Yescrypt hasher (#802)
Support for configuring the default `Params` to use when computing new
Modular Crypt Format (MCF) hashes from a given password and salt
2026-01-11 12:07:48 -07:00
Tony Arcieri
271e78071b sha-crypt: customized Params for ShaCrypt (#801)
Adds the ability to customize the default params used by `ShaCrypt`, the
Modular Crypt Format password hasher.
2026-01-11 11:51:26 -07:00
Tony Arcieri
e99a3410af sha-crypt: dynamic Algorithm support (#800)
Removes the `D` generic parameter on `ShaCrypt` and replaces it
internally with a new `Algorithm` enum, similar to other crates like
`argon2` and `pbkdf2`, where `ShaCrypt` can now store a default
algorithm.

The verifier impl now dynamically dispatches on the MCF algorithm ID,
and can verify both SHA-256-crypt and SHA-512-crypt hashes.
2026-01-11 11:43:53 -07:00
dependabot[bot]
90ece8a6ef build(deps): bump the all-deps group with 2 updates (#799) 2026-01-04 22:10:18 -07:00
Tony Arcieri
e27ee7476f pbkdf2: customizable Params for Pbkdf2 type (#798)
Following the general pattern of `Argon2` and `Scrypt`, allows the
`Params` used with the `Pbkdf2` type to be customized.

See also: #797
2026-01-04 11:14:28 -07:00
Tony Arcieri
e55e01cb91 scrypt: customizable Params for Scrypt type (#797)
Following the general pattern of `Argon2`, allows the `Params` used with
the `Scrypt` type to be customized
2026-01-04 11:03:10 -07:00
Tony Arcieri
bc20e5d45d Cut new prereleases of mcf-dependent crates (#796)
Releases the following:
- `scrypt` v0.12.0-rc.8
- `sha-crypt` v0.6.0-rc.1
- `yescrypt` v0.1.0-rc.2
scrypt-v0.12.0-rc.8 yescrypt-v0.1.0-rc.2 sha-crypt-v0.6.0-rc.1
2026-01-03 15:52:37 -07:00
Tony Arcieri
cc29c9322a Cargo.lock: bump dependencies (#795)
Updates the following dependencies:

    $ cargo update
    Updating crates.io index
     Locking 12 packages to latest compatible versions
    Updating base64ct v1.8.1 -> v1.8.2
    Updating bumpalo v3.19.0 -> v3.19.1
    Updating cipher v0.5.0-rc.2 -> v0.5.0-rc.3
      Adding cmov v0.4.3
    Updating crypto-bigint v0.7.0-rc.10 -> v0.7.0-rc.13
    Updating crypto-common v0.2.0-rc.5 -> v0.2.0-rc.8
      Adding ctutils v0.3.1
    Updating digest v0.11.0-rc.4 -> v0.11.0-rc.5
    Updating inout v0.2.1 -> v0.2.2
    Updating libc v0.2.177 -> v0.2.179
    Updating proc-macro2 v1.0.103 -> v1.0.104
    Updating syn v2.0.111 -> v2.0.113
2026-01-03 15:39:02 -07:00
Tony Arcieri
918ad45ff3 Bump mcf to v0.6.0-rc.2 (#794) 2026-01-03 15:34:36 -07:00
饺子w (Yumechi)
1c5b8f4aec scrypt: SSE2/simd128 RoMix data layout optimization (#622)
Prearranged data into 128bit lanes so we don't have to transpose back
and forth in the BlockMix Salsa20 kernel on SSE2.

The permute constants are the same as
https://github.com/RustCrypto/stream-ciphers/blob/07ee501/salsa20/src/backends/soft.rs#L54-L57
read column wise.

After:
> cargo bench 
test scrypt_15_8_1 ... bench: 180,070,625.10 ns/iter (+/- 4,549,929.06)
> RUSTFLAGS="-Ctarget-feature=+simd128" cargo bench --target wasm32-wasip1    
test scrypt_15_8_1 ... bench: 118,944,571.20 ns/iter (+/- 3,098,151.70)
> ssh cheap_vps cargo bench
test scrypt_15_8_1 ... bench: 304,886,161.00 ns/iter (+/- 6,625,867.19)

Before:
> cargo bench
test scrypt_15_8_1 ... bench: 230,760,302.00 ns/iter (+/- 8,838,571.54)
> RUSTFLAGS="-Ctarget-feature=+simd128" cargo bench --target wasm32-wasip1    
test scrypt_15_8_1 ... bench: 190,474,545.40 ns/iter (+/- 5,895,216.01)
> ssh cheap_vps cargo bench
test scrypt_15_8_1 ... bench: 409,880,353.40 ns/iter (+/- 17,629,444.54)

Picked from my own performance oriented implementation:
https://github.com/eternal-flame-AD/scrypt-opt
2025-12-29 08:45:57 -07:00
dependabot[bot]
c037939d0a build(deps): bump the all-deps group across 1 directory with 6 updates (#792) 2025-12-27 20:12:50 -07:00
Tony Arcieri
41b5f25466 Bump password-hash dependency to v0.6.0-rc.7 (#791)
Includes `getrandom` v0.4.0-rc.0 upgrade
2025-12-27 20:04:26 -07:00
Tony Arcieri
31bbe6e447 Bump mcf to v0.6.0-rc.1 (#789) 2025-12-27 09:42:57 -07:00
Tony Arcieri
45db826bf8 CI: fix security audit (#790) 2025-12-27 09:33:06 -07:00
Tony Arcieri
495f34086a scrypt: rename rayon feature to parallel (#785)
`rayon` is an implementation detail of parallel password hash
computation, not the actual feature.

`parallel` matches the existing `argon2` crate feature.
2025-12-18 17:29:47 -07:00
Tony Arcieri
a2755f8824 scrypt v0.12.0-rc.7 (#784) scrypt/v0.12.0-rc.7 2025-12-18 16:46:54 -07:00
Tony Arcieri
8674302026 pbkdf2+scrypt: include README.md in rustdoc (#783)
These are the only two crates in this repo which aren't doing this
2025-12-16 18:30:02 -07:00