Skip to content

chore(deps): move to the digest 0.11 RustCrypto stack (hashes, argon2/scrypt, ed25519-dalek 3, zstd 0.14) - #177

Merged
WingZer0o merged 9 commits into
mainfrom
deps/rustcrypto-upgrades
Nov 27, 2026
Merged

WingZer0o merged 9 commits into
mainfrom
deps/rustcrypto-upgrades

Conversation

@WingZer0o

@WingZer0o WingZer0o commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves cas-lib off the old RustCrypto generation (digest 0.10 / rand_core 0.6) onto the current one (digest 0.11 / rand_core 0.10), via one child PR per issue, each reviewed, CI-tested on Linux/Windows/macOS and merged into this branch:

PR Issue Change
#173 #167 sha2 0.11, sha3 0.12, blake2 0.11, hmac 0.13, pbkdf2 0.13; drops the sha2-hkdf alias; lockfile refresh (hpke 0.15.2, uuid 1.29.3, zeroize 1.9.2)
#175 #169 ed25519-dalek 3.0, curve25519-dalek 5 (dev); curve25519-dalek 4 gone from the tree
#174 #170 zstd 0.14 (zstd-safe 8); decompression limits from #107 unchanged, floor still excludes the #108 advisories
#176 #168 argon2 0.6, scrypt 0.12 (password-hash 0.6)

Compatibility

  • No public API changes; docs/EXAMPLES.md untouched.
  • Hash, HMAC, HKDF, PBKDF2 outputs unchanged (KATs + Wycheproof pass unedited).
  • Ed25519 keys/signatures byte-identical (new RFC 8032 known-answer test, passed before and after).
  • Password hashes from 0.7.x still verify (new regression tests with stored argon2/scrypt PHC strings); default cost parameters pinned; PBKDF2 salt format unchanged.
  • zstd frames from 0.7.x still decompress (new fixture test). Note: compress output bytes differ for small inputs, since zstd 0.14 records the content size in the frame header; still standard frames.
  • Fewer panics at the FFI boundary: argon2/scrypt/PBKDF2 salt RNG failures now return PasswordHashingFailed; zstd allocation failures return errors. get_ed25519_key_pair() still panics if the OS RNG fails (unchanged behaviour, now documented).

Not in this PR

Testing

Final branch (6fa9f6a, all four child PRs merged) locally on Windows: cargo build --release --locked (no warnings), cargo test --release --locked 234 passed / 0 failed, cargo audit --deny unsound --deny yanked clean. Each child PR passed CI on Linux, Windows and macOS (one earlier Windows run of #176 failed on a curl crash while downloading Wycheproof vectors, unrelated to the change; the re-run passed).

Closes #167
Closes #168
Closes #169
Closes #170

🤖 Generated with Claude Code

WingZer0o and others added 9 commits November 27, 2026 10:55
Move the hash, HMAC and PBKDF2 crates onto the digest 0.11 stack:
sha2 0.10 -> 0.11.2, sha3 0.10 -> 0.12.0, blake2 0.10 -> 0.11.0,
hmac 0.12 -> 0.13.0, pbkdf2 0.12 -> 0.13.0.

- Drop the `sha2-hkdf` alias now that `sha2` itself is 0.11, and switch
  the `sha2_hkdf::` imports in src/kdf/hkdf.rs, src/key_exchange/x25519.rs
  and the key_exchange/symmetric tests back to `sha2::`.
- hmac 0.13 moved `new_from_slice` to the `KeyInit` trait; import it.
- sha3 0.12 no longer exposes a block-level core, so `Sha3_256` does not
  satisfy `EagerHash` and can't be used with `Hmac` / `pbkdf2_hmac_array`.
  PBKDF2-HMAC-SHA3-256 now uses `pbkdf2::<SimpleHmac<Sha3_256>>`, which
  computes the same HMAC and writes straight into the returned Vec. The
  PBKDF2 known-answer vectors pass unchanged.
- Targeted lockfile refreshes: hpke 0.15.2, uuid 1.29.3, zeroize 1.9.2
  (zeroize_derive 1.5.0).

No public API changes.

Part of #167

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move zstd 0.13.6 -> 0.14.5 (zstd-safe 7.4.2 -> 8.4.0; zstd-sys stays
2.2.0+zstd.1.6.0) with a targeted `cargo update -p zstd`.

- Keep `default-features = false`: 0.14 has the same default set
  (`legacy`, `arrays`, `zdict_builder`) and only adds opt-in features
  (`vendored`, `cmake`, `rust-backend`, `with-rust-allocator`), so the
  pre-v0.8 legacy decoders stay out (#107).
- Raise the floor to 0.14.5 and rewrite the Cargo.toml comment for it.
- The decompression path is unchanged: `read::Decoder::with_buffer`,
  `window_log_max` (still sets ZSTD_d_windowLogMax) and the `take(limit + 1)`
  output cap behave as before.
- Add a fixture frame compressed by cas-lib 0.7.1 (zstd 0.13.6) and check it
  still decompresses, and that the output limit still applies to it.

Part of #170.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ed25519-dalek 2.2 -> 3.0 (curve25519-dalek 5, sha2 0.11). Drop the
  `rand_core` feature: key generation now draws the 32-byte secret with
  getrandom::fill into a Zeroizing buffer and builds the key with
  SigningKey::from_bytes, which is what SigningKey::generate does.
- Both verify functions keep verify_strict (#118); its logic is unchanged
  between 2.2.0 and 3.0.0.
- Dev-dependency curve25519-dalek 4 -> 5; the tests need no API changes.
- Add RFC 8032 section 7.1 known-answer tests (TEST 1-3) that pin the
  secret-key, public-key and signature encodings. They pass on both
  ed25519-dalek 2.2.0 and 3.0.0.

curve25519-dalek 4.1.3 and fiat-crypto 0.2 leave the dependency tree.

Part of #169

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c and pbkdf2 to digest 0.11

chore(deps): upgrade sha2, sha3, blake2, hmac and pbkdf2 to digest 0.11
Both move to password-hash 0.6 (digest 0.11, rand_core 0.10 / getrandom 0.4).

- argon2/scrypt: salts are now drawn by the crates' `hash_password`
  (password-hash's `try_generate_salt`, getrandom), so an RNG failure maps
  to CasError::PasswordHashingFailed instead of panicking.
- scrypt 0.12 has no default features: enable `phc` and `getrandom`.
  Pin the default cost (ln=17, r=8, p=1) and the 32-byte output explicitly.
- argon2 defaults (Argon2id v19, m=19456, t=2, p=1, 32-byte output) are
  unchanged in 0.6.
- pbkdf2::derivation generates 16 bytes with getrandom and returns their
  22-character PHC "B64" salt string, the same shape as before.
- argon2 KDF salt generation stays on rand 0.8 (rand is #172).

Adds regression tests that verify argon2 and scrypt PHC strings made by
cas-lib 0.7.1 (argon2 0.5.3 / scrypt 0.11.0), and tests that pin the
default parameters and the pbkdf2 salt shape.

Part of #168

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d curve25519-dalek to 5

chore(deps): upgrade ed25519-dalek to 3.0 and curve25519-dalek to 5
Resolve the adjacent-line Cargo.toml conflict: keep #175's getrandom comment
(now also naming PBKDF2 salts) and this branch's scrypt 0.12 line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t to 0.12

chore(deps): upgrade argon2 to 0.6 and scrypt to 0.12
@WingZer0o
WingZer0o marked this pull request as ready for review November 27, 2026 16:14
@WingZer0o
WingZer0o merged commit ab7de69 into main Nov 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant