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

## [0.2.3] - 2026-10-07

### Changed

- Migrated view construction in `Vlad::verify`, `Builder::try_build`, `Builder::try_build_advance`, the unit tests, and the merkle example from `multi_key::Views` to `multi_key::ViewBuilder`. Requirements `multi-key` 2.0 → 2.1 and `multi-sig` 1.4 → 1.5. No public API changes.

## [0.2.2] - 2026-10-06

### Changed
Expand Down Expand Up @@ -90,6 +96,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- The `multi-base`, `multi-codec`, `multi-key`, `multi-sig`, `multi-trait`, and `multi-util` dependencies use the published crates.io versions. `multi-vlad` does not declare `multi-hash` as a dependency; it appears transitively via `multi-key`.

[0.2.3]: https://github.com/cryptidtech/multi-vlad/compare/v0.2.2...v0.2.3
[0.2.2]: https://github.com/cryptidtech/multi-vlad/compare/v0.2.0...v0.2.2
[0.2.0]: https://github.com/cryptidtech/multi-vlad/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/cryptidtech/multi-vlad/releases/tag/v0.1.2
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "multi-vlad"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
rust-version = "1.96"
authors = ["Dave Grantham <dwg@linuxprogrammer.org>"]
Expand All @@ -20,8 +20,8 @@ xmss = ["multi-key/xmss"]
multi-base = { version = "1.0", default-features = false }
multi-cbor = { version = "0.1", optional = true }
multi-codec = "1.5"
multi-key = "2.0"
multi-sig = "1.4"
multi-key = "2.1"
multi-sig = "1.5"
multi-trait = { version = "1.0", default-features = false }
multi-util = "1.1"
thiserror = "2.0"
Expand Down
7 changes: 5 additions & 2 deletions examples/lamport_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! `ed25519` example for an equivalent with Ed25519.

use multi_codec::Codec;
use multi_key::{Builder as MkBuilder, Multikey, Views as _};
use multi_key::{Builder as MkBuilder, Multikey};
use multi_util::CodecInfo as _;
use multi_vlad::{Builder, Vlad};

Expand Down Expand Up @@ -63,7 +63,10 @@ fn main() {

// 8. In a real deployment the `advanced` key MUST be persisted now: leaf 0
// is consumed and the next signature (the first plog entry) uses leaf 1.
let mv = advanced.merkle_state_view().unwrap();
let mv = multi_key::ViewBuilder::new(&advanced)
.merkle_state()
.build()
.unwrap();
assert_eq!(mv.next_index().unwrap(), 1);
assert_eq!(mv.remaining_signatures().unwrap(), 1);

Expand Down
18 changes: 9 additions & 9 deletions src/vlad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{error::VladError, Error};
use core::fmt;
use multi_base::Base;
use multi_codec::Codec;
use multi_key::{Multikey, Views};
use multi_key::{Multikey, ViewBuilder};
use multi_sig::Multisig;
use multi_trait::{EncodeInto, EncodeIntoBuffer, Null, TryDecodeFrom};
use multi_util::{BaseEncoded, CodecInfo, DetectedEncoder, EncodingInfo};
Expand Down Expand Up @@ -89,7 +89,7 @@ impl Vlad {
/// Returns an error if the key does not match the signature, or if the
/// underlying `multi-key`/`multi-sig` verification fails.
pub fn verify(&self, mk: &Multikey) -> Result<(), Error> {
let vv = mk.verify_view()?;
let vv = ViewBuilder::new(mk).verify().build()?;
vv.verify(&self.0, Some(&self.0.message))?;
Ok(())
}
Expand Down Expand Up @@ -266,7 +266,7 @@ impl Builder {
if msg.len() < 4 || msg[..4] != WASM_MAGIC {
return Err(VladError::InvalidWasm.into());
}
let sv = mk.sign_view()?;
let sv = ViewBuilder::new(mk).sign().build()?;
// combined=true: message is stored inside the Multisig
let ms = sv.sign(msg, true, None)?;
Ok(Vlad(ms))
Expand All @@ -289,7 +289,7 @@ impl Builder {
if msg.len() < 4 || msg[..4] != WASM_MAGIC {
return Err(VladError::InvalidWasm.into());
}
let sv = mk.sign_view()?;
let sv = ViewBuilder::new(mk).sign().build()?;
// combined=true: message is stored inside the Multisig
let (ms, advanced) = sv.sign_advance(msg, true, None)?;
Ok((Vlad(ms), advanced))
Expand Down Expand Up @@ -536,7 +536,7 @@ mod tests {
fn test_decode_rejects_detached_multisig() {
let mk = test_signing_key();
let msg = test_wasm_message();
let sv = mk.sign_view().unwrap();
let sv = ViewBuilder::new(&mk).sign().build().unwrap();
// sign with combined=false to create a detached signature
let ms = sv.sign(&msg, false, None).unwrap();
// manually construct a Vlad with a detached Multisig and try to serialize/decode
Expand All @@ -553,7 +553,7 @@ mod tests {
fn test_decode_rejects_non_wasm_message() {
let mk = test_signing_key();
let bad_msg = b"not a wasm module at all!";
let sv = mk.sign_view().unwrap();
let sv = ViewBuilder::new(&mk).sign().build().unwrap();
// sign with combined=true but non-WASM message
let ms = sv.sign(bad_msg.as_slice(), true, None).unwrap();
let mut v = Vec::default();
Expand Down Expand Up @@ -643,7 +643,7 @@ mod tests {
decoded.verify(&advanced).unwrap();

// the advanced key consumed leaf 0 of the 2-leaf tree
let mv = advanced.merkle_state_view().unwrap();
let mv = ViewBuilder::new(&advanced).merkle_state().build().unwrap();
assert_eq!(mv.depth().unwrap(), 1);
assert_eq!(mv.capacity().unwrap(), 2);
assert_eq!(mv.next_index().unwrap(), 1);
Expand Down Expand Up @@ -671,11 +671,11 @@ mod tests {
.unwrap();

// leaf 1 signs a second message via sign_advance on the advanced key
let sv = advanced.sign_view().unwrap();
let sv = ViewBuilder::new(&advanced).sign().build().unwrap();
let (_ms2, exhausted) = sv.sign_advance(b"second message", false, None).unwrap();

// the tree is empty; a third signature fails
let sv3 = exhausted.sign_view().unwrap();
let sv3 = ViewBuilder::new(&exhausted).sign().build().unwrap();
assert!(sv3.sign_advance(b"third message", false, None).is_err());

// the stateless sign path never worked for merkle keys
Expand Down
Loading