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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
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 = "wacc"
version = "2.2.0"
version = "2.2.1"
edition = "2021"
rust-version = "1.96"
authors = ["Dave Grantham <dwg@linuxprogrammer.org>"]
Expand All @@ -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"
Expand Down
11 changes: 7 additions & 4 deletions src/adapters/multicodec_crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
37 changes: 27 additions & 10 deletions src/vm/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()),
};
Expand Down Expand Up @@ -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()),
};
Expand Down Expand Up @@ -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()),
};
Expand All @@ -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()),
};
Expand All @@ -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()),
};
Expand Down
Loading