Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
run: cargo test --verbose --all-features

msrv:
name: Verify MSRV (1.85)
name: Verify MSRV (1.99)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust Toolchain (1.85)
uses: dtolnay/rust-toolchain@1.85.0
- name: Install Rust Toolchain (1.99)
uses: dtolnay/rust-toolchain@1.99.0

- name: Check
run: cargo check --all-features
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Cargo.lock
# Added by cargo

/target

plan.md
session.json
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2026-10-07

### Added

- SHAKE128 and SHAKE256 extendable-output function (XOF) support. `Codec::Shake128` and `Codec::Shake256` now end the `HASH_CODECS` list.
- Streaming `Builder` support. `Builder::update` feeds data in chunks, and `Builder::output_len` sets the XOF output length in bytes.
- The `MAX_HASH_LENGTH` constant. The builder rejects XOF output lengths above this 16 MiB value before any allocation or squeeze.
- The `fips` feature. It exports the `FIPS_CODECS` and `SAFE_FIPS_CODECS` constants, which list the NIST FIPS approved hash algorithms.
- New error variants `Error::OutputLenRequired { codec }` and `Error::OutputLenInvalid { codec, output_len, max }`. They report a missing or out-of-range XOF output length.

### Changed

- `Builder::new(codec)` now returns a `Result`. It returns `Error::UnsupportedHash` for a codec outside `HASH_CODECS`.
- Removed `Builder::new_from_bytes`. Use `Builder::new` and `Builder::update` instead.
- `Builder::try_build()` and `Builder::try_build_encoded()` now consume the builder. Clone the builder when you need a second build.
- `Builder::try_build()` now checks the digest length against the codec's output policy. Fixed-output codecs accept only their exact policy length, and the XOF codecs accept 1 to `MAX_HASH_LENGTH` bytes.
- Removed the derived `Default` implementation for `Builder`. Create a builder with `Builder::new(codec)`.
- Fixed-output codecs ignore a `Builder::output_len` setting. They always produce their exact policy digest length.
- `HASH_CODECS` grew to 25 entries, and `SAFE_HASH_CODECS` grew to 10 entries.
- Streamed `Blake3` builds now require an `output_len` setting. A `Blake3` digest set with `with_hash` accepts 1 to `MAX_HASH_LENGTH` bytes.
- Raised the MSRV from 1.85 to 1.99. The CI MSRV job now checks 1.99.0.
- Made the `HashDigest::len` and `HashDigest::is_empty` methods `const`.

### Dependencies

- Added the `shake = "0.1"` dependency. It provides the SHAKE128 and SHAKE256 extendable-output functions.

## [1.1.2] - 2026-08-17

### Fixed
Expand Down Expand Up @@ -138,6 +165,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added a test suite for edge cases, integration, proptests, and security.
- Initial published release on crates.io as `multi-hash`.

[2.0.0]: https://github.com/cryptidtech/multi-hash/compare/v1.1.2...v2.0.0
[1.1.2]: https://github.com/cryptidtech/multi-hash/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/cryptidtech/multi-hash/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/cryptidtech/multi-hash/compare/v1.0.7...v1.1.0
Expand Down
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "multi-hash"
version = "1.1.2"
version = "2.0.0"
edition = "2024"
rust-version = "1.85"
rust-version = "1.99"
authors = ["Dave Grantham <dwg@linuxprogrammer.org>"]
description = "Multihash self-describing cryptographic hash data"
repository = "https://github.com/cryptidtech/multi-hash.git"
Expand All @@ -14,21 +14,25 @@ categories = ["cryptography", "encoding"]
[features]
default = ["serde"]

# expose the FIPS approved codec constants, FIPS_CODECS and SAFE_FIPS_CODECS
fips = []

[dependencies]
blake2 = "0.11.0-rc.6"
blake3 = { version = "1.8", features = ["traits-preview", "zeroize"] }
multi-base = "1.0"
multi-codec = "1.2"
multi-trait = "1.0"
multi-util = "1.1"
digest = "0.11"
digest = { version = "0.11", features = ["alloc"] }
hex = "0.4"
md-5 = "0.11"
ripemd = "0.2"
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"], optional = true }
sha1 = "0.11"
sha2 = "0.11"
sha3 = "0.12"
shake = "0.1"
subtle = "2"
thiserror = { version = "2.0" }
typenum = "1.20"
Expand Down
Loading
Loading