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
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,55 @@ 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-14

### Added

- The `bls12-381` feature. It gates the `views::bls12381` module, the BLS12-381 view dispatch, the BLS ssh signature conversions in `Builder::new_from_ssh_signature`, and the `Builder::new_from_bls_*` constructors, and it pulls in `blsful`.
- The `chacha20` feature. It gates `encrypt_threshold_meta`, `decrypt_threshold_meta`, and `generate_meta_key`, and pulls in `chacha20poly1305`, `getrandom`, and `zeroize`.
- With `default-features = false` the crate depends on no signature or AEAD crate. It provides the `Multisig` type, its attributes, the view traits, `ViewBuilder`, the threshold metadata types, and the data-only views (Ed25519, secp256k1, NIST P, RSA, SLH-DSA, ML-DSA, FN-DSA, MAYO, and the hybrids).
- Tests for the partial-disclosure round trip and for the disclosure modes without `chacha20`.
- `FromStr` for `AttrId` and `SchemeTypeId`. The existing `TryFrom<&str>` impls now delegate to it, so `"sig-data".parse::<AttrId>()` works and the old calls are unchanged. This clears the `clippy::try_from_instead_of_from_str` errors that failed `cargo clippy -- -D warnings`.
- `impl From<&Multisig> for Vec<u8>` encodes without cloning. The owned `From<Multisig>` delegates to it, and binary serde serialization uses it instead of cloning the multisig.

### Changed

- **Breaking:** the default feature set is now `bls12-381`, `chacha20`, `lamport`, `serde`, and `xmss`. A build with `default-features = false` loses the BLS constructors, BLS views, and the threshold metadata encryption functions; add the features you use.
- **Breaking:** without `bls12-381`, the BLS12-381 combined and share codecs leave `SIG_CODECS` and `SIG_SHARE_CODECS`, so the arrays shrink by two entries each. This matches how the `lamport` and `xmss` codecs already behave.
- Without `chacha20`, `stamp_disclosure_attrs` and `read_threshold_params` return `SharesError::MetaEncryption` for the partial and fully confidential disclosure modes. The confidential threshold is never written in plaintext.
- The `xmss` feature no longer pulls in a crate. The XMSS views carry signature bytes only.
- Removed redundant copies on the encode and decode paths: message and attribute bytes are written straight into the output instead of being cloned into a `Varbytes` first, decoded attributes are moved instead of cloned, the `Builder` setters no longer copy each attribute twice, and binary serde deserialization decodes from the input bytes directly. In paired benchmarks against 1.6.0 on an idle machine, `multisig_to_bytes` is about 26% faster, `Builder` construction about 20% faster, and a full roundtrip 29–38% faster; decoding is unchanged within noise.
- Re-enabled `clippy::redundant_clone`.
- Fixed four redundant intra-doc link targets so `cargo doc` builds with `RUSTDOCFLAGS="-D warnings"`.
- Moved the crate-level lint settings from `lib.rs` into the `[lints]` table in `Cargo.toml`, so they now apply to tests and benches as well as the library. Fixed the one trivial cast in `tests/security_tests.rs` that this exposed.
- **Breaking:** renamed `ThresholdDisclosure::FullConfidentialial` to `ThresholdDisclosure::FullConfidential`, fixing the typo. The encoded value (2) is unchanged, so existing shares decode as before; `as_str()` and `Display` now return `full-confidential`.
- `ThresholdMetadata` and `ThresholdMetaCipher` CBOR encoding uses `serde_cbor_2` instead of `ciborium`. The bytes are identical: blobs written by 1.6.0 decode unchanged, and 1.6.0 decodes blobs written by 2.0.0.

### Removed

- **Breaking:** `Builder::new_from_bls_signature` and `Builder::new_from_bls_signature_share`, deprecated since 1.0.7. They inferred G1 or G2 from the byte length. Use `new_from_bls_signature_with_codec` and `new_from_bls_signature_share_with_codec`, which take the codec as their first argument.
- **Breaking:** the `Views` trait and `impl Views for Multisig`, deprecated since 1.5.0. Use `ViewBuilder` instead: `ms.attr_view()` becomes `ViewBuilder::new(&ms).attr().build()`, and likewise for `data`, `conv`, `threshold_attr`, `threshold`, and `disclosure`.

### Fixed

- Enabling `lamport` without `xmss` failed to compile, because `SIG_CODECS` had a fixed length of 60 while three entries were gated on `xmss`. The array lengths are now derived from the enabled features.

### Dependencies

- `blsful`, `chacha20poly1305`, `getrandom`, and `zeroize` are now optional.
- Removed the unused `elliptic-curve` and `xmss` dependencies.
- `ssh-key` now enables only `alloc`. The `ecdsa` and `ed25519` features were never used by this crate.
- Replaced `ciborium` with `serde_cbor_2`.
- Sorted the keys in every `Cargo.toml` section and dropped a stale comment about a local `multi-codec` build.

### Documentation

- README codec tables now use the real `Codec` variant names (`MlDsa65Msig`, `SlhDsaSha2128FMsig`, …) and multicodec names (`ml-dsa-65-msig`, `slh-dsa-sha2-128f-msig`, …). The old tables had both wrong.
- README now covers the 25 Lamport, Merkle-Lamport, and XMSS codecs, the 11 Merkle-Lamport share codecs, the `sig-index` and `depth` attributes, and Lamport and Merkle-Lamport threshold support. It previously described threshold signatures as BLS-only and counted 35 codecs; the default build has 60 signature and 13 share codecs.
- README lists the `_with_codec` BLS constructors, adds an "Upgrading from 1.x" section, and fixes the CI badge and multi-key links.
- The crate-level docs list every supported signature family instead of only Ed25519, secp256k1, and BLS12-381, and the examples build with `Codec::EddsaMsig` instead of the key codec `Codec::Ed25519Pub`.
- SECURITY.md reflects `blsful` 4.1.0 and the `[lints.rust]` `unsafe_code = "deny"` setting.

## [1.6.0] - 2026-10-08

### Changed
Expand Down
126 changes: 92 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
[package]
name = "multi-sig"
version = "1.6.0"
edition = "2024"
rust-version = "1.99"
authors = ["Dave Grantham <dwg@linuxprogrammer.org>"]
categories = ["cryptography", "encoding"]
description = "Multisig self-describing multicodec implementation for digital signatures"
repository = "https://github.com/cryptidtech/multi-sig.git"
readme = "README.md"
license = "Apache-2.0"
edition = "2024"
keywords = ["multiformats", "multisig", "signatures", "crypto"]
categories = ["cryptography", "encoding"]
license = "Apache-2.0"
name = "multi-sig"
readme = "README.md"
repository = "https://github.com/cryptidtech/multi-sig.git"
rust-version = "1.99"
version = "2.0.0"

[features]
default = ["serde", "lamport", "xmss"]
# BLS12-381 signatures, signature shares, and share combining
bls12-381 = ["dep:blsful"]
# ChaCha20-Poly1305 encryption of threshold metadata (partial and fully
# confidential disclosure modes)
chacha20 = ["dep:chacha20poly1305", "dep:getrandom", "dep:zeroize"]
default = ["bls12-381", "chacha20", "lamport", "serde", "xmss"]
# Lamport and Merkle-Lamport signature views
lamport = ["dep:blake2", "dep:blake3", "dep:lamport_signature_plus", "dep:sha2", "dep:sha3", "dep:shake"]
# `serde` is now a required dependency because the core `threshold_meta`
# module (always compiled) derives `Serialize`/`Deserialize` for its CBOR
# blob types. The feature flag is retained for backward compatibility and
# controls only the public `serde` impl module.
serde = []
lamport = ["dep:lamport_signature_plus", "dep:sha3", "dep:sha2", "dep:blake2", "dep:shake", "dep:blake3"]
xmss = ["dep:xmss"]
# XMSS signature views; they carry signature bytes only, so no XMSS crate is needed
xmss = []

# Local multi-codec 1.4.0 until it is published (remove at release).
[dependencies]
ciborium = "0.2"
chacha20poly1305 = "0.11"
elliptic-curve = "0.14"
getrandom = { version = "0.4" }
# blsful configured per-target below (blst for native, rust for wasm)
blake2 = { version = "0.11.0", optional = true }
blake3 = { version = "1.8", optional = true }
chacha20poly1305 = { version = "0.11", optional = true }
getrandom = { version = "0.4", optional = true }
lamport_signature_plus = { version = "0.5.0", optional = true }
multi-base = { version = "1.1", default-features = false }
multi-codec = "1.6"
multi-trait = { version = "1.1", default-features = false }
multi-util = "1.2"
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
serde_cbor_2 = "0.13.0"
sha2 = { version = "0.11", optional = true }
sha3 = { version = "0.12", optional = true }
shake = { version = "0.1", optional = true }
ssh-encoding = "0.3"
ssh-key = { version = "0.7.0-rc.11", default-features = false, features = ["alloc"] }
thiserror = { version = "2.0" }
unsigned-varint = { version = "0.8", features = ["std"] }
zeroize = "1"
# Lamport support (feature-gated, default-enabled)
lamport_signature_plus = { version = "0.5.0", optional = true }
sha3 = { version = "0.12", optional = true }
sha2 = { version = "0.11", optional = true }
blake2 = { version = "0.11.0", optional = true }
shake = { version = "0.1", optional = true }
blake3 = { version = "1.8", optional = true }
# XMSS support (feature-gated, default-enabled)
xmss = { version = "0.1.0-pre.0", optional = true }
zeroize = { version = "1", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
blsful = { version = "4.1.0", default-features = false, features = ["rust"] }
getrandom = { version = "0.4", features = ["wasm_js"] }
ssh-key = { version = "0.7.0-rc.11", default-features = false, features = ["alloc", "ecdsa", "ed25519"] }
blsful = { version = "4.1.0", default-features = false, features = ["rust"], optional = true }
getrandom = { version = "0.4", features = ["wasm_js"], optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
blsful = { version = "4.1.0", default-features = false, features = ["blst"] }
ssh-key = { version = "0.7.0-rc.11", default-features = false, features = ["alloc", "ecdsa", "ed25519"] }
blsful = { version = "4.1.0", default-features = false, features = ["blst"], optional = true }

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
Expand All @@ -65,15 +66,72 @@ serde_json = "1.0"
serde_test = "1.0"

[[bench]]
name = "multisig_bench"
harness = false
name = "multisig_bench"
path = "benches/multisig_bench.rs"

# Pedantic, nursery, and cargo lints are on. The allows suppress stylistic
# lints that would require large-scale churn for minimal security benefit.
# Each is reviewed individually.
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
# false positives in complex match arms
branches_sharing_code = "allow"
cargo = { level = "warn", priority = -1 }
# intentional in codec conversions
cast_possible_truncation = "allow"
# wrapping common terms in backticks is stylistic
doc_markdown = "allow"
# explicit lifetimes aid readability
elidable_lifetime_names = "allow"
# glob imports of enums are used judiciously
enum_glob_use = "allow"
# into_iter() is idiomatic
explicit_iter_loop = "allow"
# stylistic
if_not_else = "allow"
# module-level items are ordered logically
items_after_statements = "allow"
# many functions can't be const due to trait bounds
missing_const_for_fn = "allow"
# public APIs are documented; this is noisy on impl blocks and trait impls
missing_errors_doc = "allow"
# we avoid panics; where they exist they are documented
missing_panics_doc = "allow"
# blsful pulls in duplicate versions (tracked)
multiple_crate_versions = { level = "allow", priority = 1 }
# too noisy on every function returning Result
must_use_candidate = "allow"
# false positives in test code
needless_for_each = "allow"
nursery = { level = "warn", priority = -1 }
# sometimes less readable than if-let
option_if_let_else = "allow"
# false positives for cheap constructors like BTreeMap::new
or_fun_call = "allow"
pedantic = { level = "warn", priority = -1 }
# needed for crate-internal module visibility
redundant_pub_crate = "allow"
# builder pattern returns self by design
return_self_not_must_use = "allow"
# stylistic preference
semicolon_if_nothing_returned = "allow"
# single-arm match with else is clearer in context
single_match_else = "allow"
# crate-level doc paragraph length
too_long_first_doc_paragraph = "allow"
# large match arms are inherent to this crate
too_many_lines = "allow"
# stylistic; format strings are clear as-is
uninlined_format_args = "allow"
# false positive
unnecessary_semicolon = "allow"
# causes churn in match arms on large enums
use_self = "allow"

[lints.rust]
missing_docs = "warn"
trivial_casts = "deny"
trivial_numeric_casts = "deny"
unsafe_code = "deny"
unused_import_braces = "deny"
unused_qualifications = "deny"
Loading
Loading