Skip to content

Upgrade sha2, sha3, blake2, hmac and pbkdf2 to the digest 0.11 stack #167

Done

Description

@WingZer0o

Summary

cas-lib currently runs two RustCrypto generations side by side: digest 0.10 (sha2 0.10, sha3 0.10, blake2 0.10, hmac 0.12, pbkdf2 0.12) and digest 0.11 (pulled in by hkdf 0.13, rsa 0.10, hpke 0.15, x25519-dalek 3). That's why Cargo.toml has the sha2-hkdf = { package = "sha2", version = "0.11" } alias. This issue moves the hash, HMAC and PBKDF2 crates to digest 0.11.

Crate Current Target
sha2 0.10.9 (+ 0.11.1 via sha2-hkdf alias) 0.11.2
sha3 0.10.8 0.12.0
blake2 0.10.6 0.11.0
hmac 0.12.1 (0.13.0 already in the tree via hkdf) 0.13.0
pbkdf2 0.12.2 0.13.0

pbkdf2 has to move with sha3, because password_hashers/pbkdf2.rs calls pbkdf2_hmac_array::<Sha3_256, _>, and pbkdf2 0.12 only accepts digest 0.10 hashes.

Work

  • Bump the five crates in Cargo.toml, remove the sha2-hkdf alias and its comment, and switch sha2_hkdf:: imports back to sha2::.
  • Files: src/hashers/sha2.rs, src/hashers/sha.rs, src/hashers/blake2.rs, src/message/hmac.rs, src/kdf/hkdf.rs, src/key_exchange/x25519.rs, src/pqc/ml_kem.rs, src/password_hashers/pbkdf2.rs.
  • Hash, HMAC, HKDF and PBKDF2 outputs must be byte-identical before and after. The existing KATs cover this, and they must not be edited to make them pass.
  • While here, refresh the semver-compatible lockfile entries (cargo update -p hpke -p uuid -p zeroize -p sha2@0.11.1 …): hpke 0.15.1→0.15.2, uuid 1.21→1.29.3, zeroize 1.8.2→1.9.2. Dependabot may already cover these.

Notes

  • cargo audit --deny unsound --deny yanked is clean today, so this is maintenance, not a security fix.
  • digest 0.10 won't leave the tree completely until slh-dsa moves to 0.2 (tracked separately), and scrypt 0.11 / ed25519-dalek 2 still pull in sha2 0.10.
  • Pinned toolchain 1.100.0 meets every target crate's MSRV (highest: sha2 0.11.2 at 1.88).

Acceptance criteria

  • cargo build --release --locked and cargo test --release --locked pass on Linux, Windows and macOS.
  • NIST/FIPS KATs in tests/data/ and the Wycheproof tests still pass.
  • docs/EXAMPLES.md updated if any public signature changes.
  • PR title follows Conventional Commits (chore(deps): …, or feat!: / fix!: if the public API breaks). Don't bump the crate version or edit CHANGELOG.md by hand.

Activity

  1. added
    dependencies
    rust
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesrust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions