Repository navigation
chore(deps): upgrade zstd to 0.14 - #174
Merged
Merged
Conversation
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>
This was referenced Nov 27, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades
zstd0.13.6 → 0.14.5 (zstd-safe7.4.2 → 8.4.0;zstd-sysstays 2.2.0+zstd.1.6.0).Cargo.lockwas updated withcargo update -p zstdonly, so no other crate moved.Cargo.toml: floor raised to0.14.5. The comment now describes that floor: it requires zstd-safe 8.4.0 / zstd-sys 2.2.0, which are above the patched versions for RUSTSEC-2026-0391 (zstd >=0.14.3), 0398/0403 (zstd-safe >=8.2.0) and 0410 (zstd-sys >=2.1.2).default-features = falseis unchanged.src/compression/zstd.rsandsrc/error.rsare unchanged. No public API changes, sodocs/EXAMPLES.mdis unchanged too.decompress_with_limitstill rejects it with a limit one byte too small.What I checked in the zstd 0.14.5 / zstd-safe 8.4.0 source
The crates ship no changelog, so I diffed them against 0.13.6 / 7.4.2 in
~/.cargo/registry.legacy,arraysandzdict_builder, so none of them were renamed, moved, or newly turned on. The new features (vendored,cmake,rust-backend,with-rust-allocator) are all opt-in.cargo tree -e features -i zstd-sysshows onlystd, whichzstdalways enables onzstd-safe. Nolegacy.Decoder::with_buffernow goes through a newtry_with_buffer, but its behavior is the same.window_log_maxis still thedecoder_parameters!macro that setsDParameter::WindowLogMax, so the 2^27 cap is enforced as before. The test that a 2^28 window is rejected still passes.Decodernow overridesread_to_end, but our path callsTake::read_to_end, which reads throughTake::read. Thetake(max + 1)cap still bounds the output, and nothing reserves memory based on the size a frame claims. (Onlydecode_allreserves from the declared size, capped at 32 MiB, and we don't use it.)copy_encodenow reads up to 128 KiB first. When the whole input fits in that, it pledges the source size, so frames for small inputs record their decompressed size in the header. The compressed bytes for small inputs are therefore different from 0.13, but they are standard frames that every decoder accepts. The 128 KiB buffer is grown withtry_reserve_exact, so failing to get that memory is an error instead of an abort.CCtx::try_create/DCtx::try_create, so running out of memory returns anio::Errorinstead of panicking. zstd allocation errors are mapped toio::ErrorKind::OutOfMemory. We already turn everyio::ErrorintoCasError::CompressionFailed, so the FFI boundary is no more exposed than before.Test results
cargo build --release --locked: OKcargo test --release --locked(with network for Wycheproof): 229 passed, 0 failed. That includes 13 incompression.rs(the bomb, the exact 64 MiB boundary, one byte over, the window cap, concatenated frames, and the new 0.13 frame fixture) and the NIST KAT and Wycheproof suites.cargo audit --deny unsound --deny yanked: no vulnerabilities and no warnings (1571 advisories, 144 crates).Only tested locally on Windows. CI covers Linux and macOS.
Stacking
This is stacked on #173 (
deps/167-digest-0.11) and targetsdeps/rustcrypto-upgrades. Until #173 merges, the diff also shows #173's commit.Part of #170
🤖 Generated with Claude Code