diff --git a/CHANGELOG.md b/CHANGELOG.md index 458ff18..ebc3952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 00c284c..1ee8833 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] @@ -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" diff --git a/examples/lamport_merkle.rs b/examples/lamport_merkle.rs index 6bd3e96..518a9fc 100644 --- a/examples/lamport_merkle.rs +++ b/examples/lamport_merkle.rs @@ -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}; @@ -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); diff --git a/src/vlad.rs b/src/vlad.rs index 03938f3..bdaf172 100644 --- a/src/vlad.rs +++ b/src/vlad.rs @@ -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}; @@ -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(()) } @@ -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)) @@ -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)) @@ -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 @@ -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(); @@ -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); @@ -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