diff --git a/CHANGELOG.md b/CHANGELOG.md index e61bf5a..81feadd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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.2.1] - 2026-10-07 + +### Changed + +- Migrated the `check_signature`, `check_preimage_value`, and `enforce_stateful_key_rules` host functions and `MulticodecSignatureVerifier` from `multi_key::Views` and `multi_sig::Views` to `ViewBuilder`. No public API changes. +- Updated dependencies: `multi-codec` 1.3 → 1.5, `multi-key` 1.2 → 2.1, `multi-sig` 1.3 → 1.5, `wasmtime` 48.0 → 49.0, `wasmparser` 0.254 → 0.261, `blake3` 1.8.1 → 1.8. + ## [2.2.0] - 2026-10-06 ### Added @@ -96,6 +103,7 @@ different from 1.0.5. - Previous standalone release. Used `wasmtime 19.0`, `thiserror 1.0`, and FSL-1.1 license. Git deps for `multicid`, `multihash`, `multikey`, `multisig`, `multitrait`, `multiutil`. +[2.2.1]: https://github.com/cryptidtech/wacc/compare/v2.2.0...v2.2.1 [2.2.0]: https://github.com/cryptidtech/wacc/compare/v2.1.2...v2.2.0 [2.1.1]: https://github.com/cryptidtech/wacc/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/cryptidtech/wacc/compare/v2.0.0...v2.1.0 diff --git a/Cargo.toml b/Cargo.toml index b55c3c9..e1c79aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wacc" -version = "2.2.0" +version = "2.2.1" edition = "2021" rust-version = "1.96" authors = ["Dave Grantham "] @@ -17,8 +17,8 @@ log = "0.4" multi-cid = "0.2" multi-codec = "1.5" multi-hash = "1.1" -multi-key = "2.0" -multi-sig = "1.4" +multi-key = "2.1" +multi-sig = "1.5" multi-trait = "1.0" multi-util = "1.1" thiserror = "2.0" diff --git a/src/adapters/multicodec_crypto.rs b/src/adapters/multicodec_crypto.rs index 7ee59c2..0ee4cef 100644 --- a/src/adapters/multicodec_crypto.rs +++ b/src/adapters/multicodec_crypto.rs @@ -10,7 +10,7 @@ use crate::{ security::allowed_algorithms, }; use multi_hash::{mh, Multihash}; -use multi_key::{Multikey, Views}; +use multi_key::{Multikey, ViewBuilder}; use multi_sig::Multisig; use multi_util::CodecInfo; @@ -77,9 +77,12 @@ impl SignatureVerifier for MulticodecSignatureVerifier { })?; // Get verification view - let verify_view = public_key.verify_view().map_err(|e| { - CryptoError::InvalidPublicKey(format!("Failed to get verify view: {e}")) - })?; + let verify_view = ViewBuilder::new(&public_key) + .verify() + .build() + .map_err(|e| { + CryptoError::InvalidPublicKey(format!("Failed to get verify view: {e}")) + })?; // Verify signature verify_view diff --git a/src/vm/context.rs b/src/vm/context.rs index 3354c14..221c312 100644 --- a/src/vm/context.rs +++ b/src/vm/context.rs @@ -8,8 +8,8 @@ use crate::{ use log::info; use multi_codec::Codec; use multi_hash::{mh, Multihash}; -use multi_key::{Multikey, Views}; -use multi_sig::{Multisig, Views as _}; +use multi_key::{Multikey, ViewBuilder}; +use multi_sig::Multisig; use multi_util::CodecInfo; use std::{fmt, io::Write}; use wasmtime::{StoreLimits, Val}; @@ -333,8 +333,9 @@ impl Context { /// /// Takes hash bytes (from WASM memory) and a KVP path string. /// Decodes the hash bytes as a Multihash, validates the hash algorithm, - /// reads the Multikey from `current.get(key)`, uses its `fingerprint_view` - /// to compute the fingerprint with the same hash codec, and compares. + /// reads the Multikey from `current.get(key)`, builds its fingerprint view + /// through `ViewBuilder` to compute the fingerprint with the same hash + /// codec, and compares. /// No pstack interaction. pub fn check_preimage_value(&mut self, hash_bytes: &[u8], key: &str) -> Val { // Decode hash bytes as Multihash @@ -364,7 +365,7 @@ impl Context { }; // Compute fingerprint using Multikey's fingerprint view - let fp_view = match pubkey.fingerprint_view() { + let fp_view = match ViewBuilder::new(&pubkey).fingerprint().build() { Ok(v) => v, Err(e) => return self.check_fail(&e.to_string()), }; @@ -433,7 +434,7 @@ impl Context { } }; - let verify_view = match pubkey.verify_view() { + let verify_view = match ViewBuilder::new(&pubkey).verify().build() { Ok(v) => v, Err(e) => return self.check_fail(&e.to_string()), }; @@ -475,7 +476,11 @@ impl Context { Some(i) => i, None => return Err("XMSS multisig missing sig-index".into()), }; - let pubkey_bytes = match pubkey.data_view().and_then(|dv| dv.key_bytes()) { + let pubkey_bytes = match ViewBuilder::new(pubkey) + .data() + .build() + .and_then(|dv| dv.key_bytes()) + { Ok(b) => b, Err(e) => return Err(e.to_string()), }; @@ -484,7 +489,11 @@ impl Context { // Lamport keys are one-time: enforce that this public key has not // already signed an earlier entry in the log. if is_lamport_sig(codec) { - let pubkey_bytes = match pubkey.data_view().and_then(|dv| dv.key_bytes()) { + let pubkey_bytes = match ViewBuilder::new(pubkey) + .data() + .build() + .and_then(|dv| dv.key_bytes()) + { Ok(b) => b, Err(e) => return Err(e.to_string()), }; @@ -495,11 +504,19 @@ impl Context { // after the depth byte). Enforce monotonic consumption across // the log. if is_lamport_merkle_sig(codec) { - let pubkey_bytes = match pubkey.data_view().and_then(|dv| dv.key_bytes()) { + let pubkey_bytes = match ViewBuilder::new(pubkey) + .data() + .build() + .and_then(|dv| dv.key_bytes()) + { Ok(b) => b, Err(e) => return Err(e.to_string()), }; - let sig_bytes = match sig.data_view().and_then(|dv| dv.sig_bytes()) { + let sig_bytes = match multi_sig::ViewBuilder::new(sig) + .data() + .build() + .and_then(|dv| dv.sig_bytes()) + { Ok(b) => b, Err(e) => return Err(e.to_string()), };