From 4b0fbe85bdb79e24e30addc9df565150ce51e943 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Mon, 23 Mar 2026 23:42:34 +0100 Subject: [PATCH 01/26] wip --- MODIFS.md | 5 + src/array.rs | 2 +- src/signature/generalized_xmss.rs | 2 +- .../instantiations_aborting.rs | 17 ++-- src/symmetric/message_hash.rs | 2 + src/symmetric/message_hash/aborting.rs | 1 + src/symmetric/message_hash/poseidon.rs | 4 +- src/symmetric/tweak_hash/poseidon.rs | 97 +++++++++++-------- 8 files changed, 77 insertions(+), 53 deletions(-) create mode 100644 MODIFS.md diff --git a/MODIFS.md b/MODIFS.md new file mode 100644 index 0000000..2706001 --- /dev/null +++ b/MODIFS.md @@ -0,0 +1,5 @@ +# Modifs + +- replacement sponge +- t-sponge +- data ordering in chains \ No newline at end of file diff --git a/src/array.rs b/src/array.rs index cd0f898..0ef0b3a 100644 --- a/src/array.rs +++ b/src/array.rs @@ -8,7 +8,7 @@ use crate::serialization::Serializable; use p3_field::{PrimeCharacteristicRing, PrimeField32, RawDataSerializable}; /// A wrapper around an array of field elements that implements SSZ Encode/Decode. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] pub struct FieldArray(pub [F; N]); diff --git a/src/signature/generalized_xmss.rs b/src/signature/generalized_xmss.rs index 3d6c795..72ab34f 100644 --- a/src/signature/generalized_xmss.rs +++ b/src/signature/generalized_xmss.rs @@ -188,7 +188,7 @@ impl Decode for GeneralizedXMSSSign /// Public key for GeneralizedXMSSSignatureScheme /// It contains a Merkle root and a parameter for the tweakable hash -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)] pub struct GeneralizedXMSSPublicKey { root: TH::Domain, parameter: TH::Parameter, diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index ddd5942..9ac132a 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -4,7 +4,7 @@ pub mod lifetime_2_to_the_32 { use crate::{ inc_encoding::target_sum::TargetSumEncoding, signature::generalized_xmss::{ - GeneralizedXMSSPublicKey, GeneralizedXMSSSignature, GeneralizedXMSSSignatureScheme, + GeneralizedXMSSPublicKey, GeneralizedXMSSSecretKey, GeneralizedXMSSSignature, GeneralizedXMSSSignatureScheme }, symmetric::{ message_hash::aborting::AbortingHypercubeMessageHash, prf::shake_to_field::ShakePRFtoF, @@ -43,9 +43,10 @@ pub mod lifetime_2_to_the_32 { type PRF = ShakePRFtoF; type IE = TargetSumEncoding; - pub type SIGAbortingTargetSumLifetime32Dim64Base8 = + pub type SchemeAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSignatureScheme; pub type PubKeyAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSPublicKey; + pub type SecretKeyAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSecretKey; pub type SigAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSignature; #[cfg(test)] @@ -121,7 +122,7 @@ pub mod lifetime_2_to_the_6 { type PRF = ShakePRFtoF; type IE = TargetSumEncoding; - pub type SIGAbortingTargetSumLifetime6Dim46Base8 = + pub type SchemeAbortingTargetSumLifetime6Dim46Base8 = GeneralizedXMSSSignatureScheme; #[cfg(test)] @@ -130,19 +131,19 @@ pub mod lifetime_2_to_the_6 { SignatureScheme, test_templates::test_signature_scheme_correctness, }; - use super::SIGAbortingTargetSumLifetime6Dim46Base8; + use super::SchemeAbortingTargetSumLifetime6Dim46Base8; #[test] pub fn test_correctness() { - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 2, 0, - SIGAbortingTargetSumLifetime6Dim46Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime6Dim46Base8::LIFETIME as usize, ); - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 11, 0, - SIGAbortingTargetSumLifetime6Dim46Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime6Dim46Base8::LIFETIME as usize, ); } } diff --git a/src/symmetric/message_hash.rs b/src/symmetric/message_hash.rs index 95fc4e5..0ba2181 100644 --- a/src/symmetric/message_hash.rs +++ b/src/symmetric/message_hash.rs @@ -5,6 +5,8 @@ use rand::RngExt; use crate::MESSAGE_LENGTH; use crate::serialization::Serializable; +pub use poseidon::encode_message; + /// Trait to model a hash function used for message hashing. /// /// This is a variant of a tweakable hash function that we use for diff --git a/src/symmetric/message_hash/aborting.rs b/src/symmetric/message_hash/aborting.rs index 90818ff..7b8a971 100644 --- a/src/symmetric/message_hash/aborting.rs +++ b/src/symmetric/message_hash/aborting.rs @@ -14,6 +14,7 @@ use crate::array::FieldArray; /// Given p = Q * w^z + alpha, each Poseidon output field element A_i is: /// 1) checked to be less than Q * w^z, and if not the hash aborts /// 2) decomposed as d_i = floor(A_i / Q), then d_i is written in base w with z digits. +#[derive(Debug, Clone, Copy)] pub struct AbortingHypercubeMessageHash< const PARAMETER_LEN: usize, const RAND_LEN_FE: usize, diff --git a/src/symmetric/message_hash/poseidon.rs b/src/symmetric/message_hash/poseidon.rs index 5605cbf..f4fe81e 100644 --- a/src/symmetric/message_hash/poseidon.rs +++ b/src/symmetric/message_hash/poseidon.rs @@ -114,11 +114,11 @@ pub(crate) fn poseidon_message_hash_fe< let epoch_fe = encode_epoch::(epoch); // now, we hash randomness, parameters, epoch, message using PoseidonCompress - let combined_input_vec: Vec = randomness + let combined_input_vec: Vec = message_fe .iter() .chain(parameter.iter()) .chain(epoch_fe.iter()) - .chain(message_fe.iter()) + .chain(randomness.iter()) .copied() .collect(); diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 286d09e..9f8e087 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -161,7 +161,7 @@ fn poseidon_safe_domain_separator( poseidon_compress::(perm, &input) } -/// Poseidon Sponge Hash Function +/// Poseidon T-Sponge with "Replacement" Hash Function /// /// Absorbs an arbitrary-length input using the Poseidon sponge construction /// and outputs `OUT_LEN` field elements. Domain separation is achieved by @@ -179,13 +179,22 @@ fn poseidon_safe_domain_separator( /// - `input`: message to hash (any length). /// /// ### Sponge Construction -/// This follows the classic sponge structure: -/// - **Absorption**: inputs are added chunk-by-chunk into the first `rate` elements of the state. -/// - **Squeezing**: outputs are read from the first `rate` elements of the state, permuted as needed. +/// This follows the classic sponge structure with capacity-first layout: +/// - The state is `[capacity | rate]`, i.e., the first elements hold the capacity, +/// followed by the rate elements. +/// - **Absorption**: inputs are written into the rate part of the state (`state[cap_len..]`). +/// - **Squeezing**: outputs are read from the rate part of the state, permuted as needed. +/// +/// ### "T-Sponge" +/// This means we use Poseidon in compresson mode (not a permutation), at each step. +/// +/// ### "Replacement" +/// This means we "replace" the rate elements of the state with the input chunk, instead +/// of adding (in the sense of finite field addition). /// /// ### Panics /// - If `capacity_value.len() >= WIDTH` -fn poseidon_sponge( +fn poseidon_replacement_t_sponge( perm: &P, capacity_value: &[A], input: &[A], @@ -200,11 +209,12 @@ where capacity_value.len() < WIDTH, "Capacity length must be smaller than the state width." ); - let rate = WIDTH - capacity_value.len(); + let cap_len = capacity_value.len(); + let rate = WIDTH - cap_len; // initialize let mut state = [A::ZERO; WIDTH]; - state[rate..].copy_from_slice(capacity_value); + state[..cap_len].copy_from_slice(capacity_value); // Instead of converting the input to a vector, resizing and feeding the data into the // sponge, we instead fill in the vector from all chunks until we are left with a non @@ -213,21 +223,23 @@ where // 1. fill in all full chunks and permute let mut it = input.chunks_exact(rate); for chunk in &mut it { - // add chunk elements into the first `rate` many elements of the `state` - for (s, &x) in state.iter_mut().take(rate).zip(chunk) { - *s += x; + // write chunk elements into the `rate` part of the state + for (s, &x) in state[cap_len..].iter_mut().zip(chunk) { + *s = x; // 'replacement' sponge } - perm.permute_mut(&mut state); + state = poseidon_compress::(perm, &state); // T-sponge } // 2. Fill the remainder and pad with zeros. // NOTE: This zero-padding is secure for constant-size inputs but may be insecure elsewhere. if !it.remainder().is_empty() { + let num_remainder = it.remainder().len(); for (i, x) in it.remainder().iter().enumerate() { - state[i] += *x; + state[cap_len + i] = *x; } - // Since we only *add* to the state, positions beyond the remainder remain zero - // (their initial value), so no explicit zero-padding is needed. - perm.permute_mut(&mut state); + for s in &mut state[cap_len + num_remainder..] { + *s = A::ZERO; + } + state = poseidon_compress::(perm, &state); // T-sponge } // 3. squeeze @@ -235,11 +247,11 @@ where let mut out_index = 0; while out_index < OUT_LEN { let chunk_size = (OUT_LEN - out_index).min(rate); - out[out_index..out_index + chunk_size].copy_from_slice(&state[..chunk_size]); + out[out_index..out_index + chunk_size].copy_from_slice(&state[cap_len..][..chunk_size]); out_index += chunk_size; if out_index < OUT_LEN { // no need to permute in last iteration, `state` is local variable - perm.permute_mut(&mut state); + state = poseidon_compress::(perm, &state); // T-sponge } } out @@ -249,7 +261,7 @@ where /// /// Note: HASH_LEN, TWEAK_LEN, CAPACITY, and PARAMETER_LEN must /// be given in the unit "number of field elements". -#[derive(Clone)] +#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)] pub struct PoseidonTweakHash< const PARAMETER_LEN: usize, const HASH_LEN: usize, @@ -343,18 +355,17 @@ impl< match message { [single] => { - // we compress parameter, tweak, message + // we compress message, parameter, tweak let perm = poseidon1_16(); - // Build input on stack: [parameter | tweak | message] + // Build input on stack: [message | parameter | tweak] let mut combined_input = [F::ZERO; CHAIN_COMPRESSION_WIDTH]; - combined_input[..PARAMETER_LEN].copy_from_slice(¶meter.0); - combined_input[PARAMETER_LEN..PARAMETER_LEN + TWEAK_LEN].copy_from_slice(&tweak_fe); - combined_input[PARAMETER_LEN + TWEAK_LEN..PARAMETER_LEN + TWEAK_LEN + HASH_LEN] - .copy_from_slice(&single.0); + combined_input[..HASH_LEN].copy_from_slice(&single.0); + combined_input[HASH_LEN..][..PARAMETER_LEN].copy_from_slice(¶meter.0); + combined_input[HASH_LEN + PARAMETER_LEN..][..TWEAK_LEN].copy_from_slice(&tweak_fe); FieldArray( - poseidon_compress::( + poseidon_compress::<_, _, CHAIN_COMPRESSION_WIDTH, HASH_LEN>( &perm, &combined_input, ), @@ -376,7 +387,7 @@ impl< .copy_from_slice(&right.0); FieldArray( - poseidon_compress::( + poseidon_compress::<_, _, MERGE_COMPRESSION_WIDTH, HASH_LEN>( &perm, &combined_input, ), @@ -400,11 +411,12 @@ impl< HASH_LEN as u32, ]; let capacity_value = poseidon_safe_domain_separator::(&perm, &lengths); - FieldArray(poseidon_sponge::( - &perm, - &capacity_value, - &combined_input, - )) + FieldArray(poseidon_replacement_t_sponge::< + _, + _, + MERGE_COMPRESSION_WIDTH, + HASH_LEN, + >(&perm, &capacity_value, &combined_input)) } _ => FieldArray([F::ONE; HASH_LEN]), // Unreachable case, added for safety } @@ -593,9 +605,10 @@ impl< // Cache strategy: process one chain at a time to maximize locality. // All epochs for that chain stay in registers across iterations. - // Offsets for chain compression: [parameter | tweak | current_value] - let chain_tweak_offset = PARAMETER_LEN; - let chain_value_offset = PARAMETER_LEN + TWEAK_LEN; + // Offsets for chain compression: [current_value | parameter | tweak] + let chain_value_offset = 0; + let chain_parameter_offset = HASH_LEN; + let chain_tweak_offset = HASH_LEN + PARAMETER_LEN; for (chain_index, packed_chain) in packed_chains.iter_mut().enumerate().take(num_chains) @@ -607,11 +620,17 @@ impl< let pos = (step + 1) as u8; // Assemble the packed input for the hash function. - // Layout: [parameter | tweak | current_value] + // Layout: [current_value | parameter | tweak] let mut packed_input = [PackedF::ZERO; CHAIN_COMPRESSION_WIDTH]; + // Copy current chain value (already packed) + packed_input[chain_value_offset..chain_value_offset + HASH_LEN] + .copy_from_slice(packed_chain); + // Copy pre-packed parameter - packed_input[..PARAMETER_LEN].copy_from_slice(&packed_parameter); + packed_input + [chain_parameter_offset..chain_parameter_offset + PARAMETER_LEN] + .copy_from_slice(&packed_parameter); // Pack tweaks directly into destination pack_fn_into::( @@ -623,10 +642,6 @@ impl< }, ); - // Copy current chain value (already packed) - packed_input[chain_value_offset..chain_value_offset + HASH_LEN] - .copy_from_slice(packed_chain); - // Apply the hash function to advance the chain. // This single call processes all epochs in parallel. *packed_chain = @@ -678,7 +693,7 @@ impl< // Apply the sponge hash to produce the leaf. // This absorbs all chain ends and squeezes out the final hash. - poseidon_sponge::( + poseidon_replacement_t_sponge::( &sponge_perm, &capacity_val, packed_leaf_input, From 489b425a60c34cfe851dafa935ebd7f023bced54 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 10:12:32 +0100 Subject: [PATCH 02/26] no T-sponge for now --- src/symmetric/tweak_hash/poseidon.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 9f8e087..e70049f 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -161,7 +161,7 @@ fn poseidon_safe_domain_separator( poseidon_compress::(perm, &input) } -/// Poseidon T-Sponge with "Replacement" Hash Function +/// Poseidon Sponge with "Replacement" Hash Function /// /// Absorbs an arbitrary-length input using the Poseidon sponge construction /// and outputs `OUT_LEN` field elements. Domain separation is achieved by @@ -185,9 +185,6 @@ fn poseidon_safe_domain_separator( /// - **Absorption**: inputs are written into the rate part of the state (`state[cap_len..]`). /// - **Squeezing**: outputs are read from the rate part of the state, permuted as needed. /// -/// ### "T-Sponge" -/// This means we use Poseidon in compresson mode (not a permutation), at each step. -/// /// ### "Replacement" /// This means we "replace" the rate elements of the state with the input chunk, instead /// of adding (in the sense of finite field addition). @@ -227,7 +224,7 @@ where for (s, &x) in state[cap_len..].iter_mut().zip(chunk) { *s = x; // 'replacement' sponge } - state = poseidon_compress::(perm, &state); // T-sponge + perm.permute_mut(&mut state); } // 2. Fill the remainder and pad with zeros. // NOTE: This zero-padding is secure for constant-size inputs but may be insecure elsewhere. @@ -239,7 +236,7 @@ where for s in &mut state[cap_len + num_remainder..] { *s = A::ZERO; } - state = poseidon_compress::(perm, &state); // T-sponge + perm.permute_mut(&mut state); } // 3. squeeze @@ -251,7 +248,7 @@ where out_index += chunk_size; if out_index < OUT_LEN { // no need to permute in last iteration, `state` is local variable - state = poseidon_compress::(perm, &state); // T-sponge + perm.permute_mut(&mut state); } } out From 678c7543aa42cbefc2a3e9befe928403772d07d8 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 16:49:08 +0100 Subject: [PATCH 03/26] naming --- src/symmetric/tweak_hash/poseidon.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index e70049f..9b8ebc1 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -191,7 +191,7 @@ fn poseidon_safe_domain_separator( /// /// ### Panics /// - If `capacity_value.len() >= WIDTH` -fn poseidon_replacement_t_sponge( +fn poseidon_replacement_sponge( perm: &P, capacity_value: &[A], input: &[A], @@ -408,7 +408,7 @@ impl< HASH_LEN as u32, ]; let capacity_value = poseidon_safe_domain_separator::(&perm, &lengths); - FieldArray(poseidon_replacement_t_sponge::< + FieldArray(poseidon_replacement_sponge::< _, _, MERGE_COMPRESSION_WIDTH, @@ -690,7 +690,7 @@ impl< // Apply the sponge hash to produce the leaf. // This absorbs all chain ends and squeezes out the final hash. - poseidon_replacement_t_sponge::( + poseidon_replacement_sponge::( &sponge_perm, &capacity_val, packed_leaf_input, From cdd95241f5be2018548facb8f9e94b813c6f212d Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 16:51:25 +0100 Subject: [PATCH 04/26] rm modifs --- MODIFS.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 MODIFS.md diff --git a/MODIFS.md b/MODIFS.md deleted file mode 100644 index 2706001..0000000 --- a/MODIFS.md +++ /dev/null @@ -1,5 +0,0 @@ -# Modifs - -- replacement sponge -- t-sponge -- data ordering in chains \ No newline at end of file From 6b03aaa6e17317428e6c2d5ad0f425c3290a785a Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 18:08:48 +0100 Subject: [PATCH 05/26] clippy --- .../generalized_xmss/instantiations_aborting.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index 9ac132a..e386055 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -4,7 +4,8 @@ pub mod lifetime_2_to_the_32 { use crate::{ inc_encoding::target_sum::TargetSumEncoding, signature::generalized_xmss::{ - GeneralizedXMSSPublicKey, GeneralizedXMSSSecretKey, GeneralizedXMSSSignature, GeneralizedXMSSSignatureScheme + GeneralizedXMSSPublicKey, GeneralizedXMSSSecretKey, GeneralizedXMSSSignature, + GeneralizedXMSSSignatureScheme, }, symmetric::{ message_hash::aborting::AbortingHypercubeMessageHash, prf::shake_to_field::ShakePRFtoF, @@ -46,14 +47,15 @@ pub mod lifetime_2_to_the_32 { pub type SchemeAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSignatureScheme; pub type PubKeyAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSPublicKey; - pub type SecretKeyAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSecretKey; + pub type SecretKeyAbortingTargetSumLifetime32Dim64Base8 = + GeneralizedXMSSSecretKey; pub type SigAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSignature; #[cfg(test)] mod test { #[cfg(feature = "slow-tests")] - use super::*; + use super::SchemeAbortingTargetSumLifetime32Dim64Base8; #[cfg(feature = "slow-tests")] use crate::signature::SignatureScheme; @@ -63,15 +65,15 @@ pub mod lifetime_2_to_the_32 { #[test] #[cfg(feature = "slow-tests")] pub fn test_correctness() { - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 213, 0, - SIGAbortingTargetSumLifetime32Dim64Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime32Dim64Base8::LIFETIME as usize, ); - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 4, 0, - SIGAbortingTargetSumLifetime32Dim64Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime32Dim64Base8::LIFETIME as usize, ); } } From 7bb4d6374100a8bff418c1f52f28a69e00cd69c5 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 22:51:00 +0100 Subject: [PATCH 06/26] typo --- .../instantiations_aborting.rs | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index e386055..e2fc8e5 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -44,18 +44,18 @@ pub mod lifetime_2_to_the_32 { type PRF = ShakePRFtoF; type IE = TargetSumEncoding; - pub type SchemeAbortingTargetSumLifetime32Dim64Base8 = + pub type SchemeAbortingTargetSumLifetime32Dim46Base8 = GeneralizedXMSSSignatureScheme; - pub type PubKeyAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSPublicKey; - pub type SecretKeyAbortingTargetSumLifetime32Dim64Base8 = + pub type PubKeyAbortingTargetSumLifetime32Dim46Base8 = GeneralizedXMSSPublicKey; + pub type SecretKeyAbortingTargetSumLifetime32Dim46Base8 = GeneralizedXMSSSecretKey; - pub type SigAbortingTargetSumLifetime32Dim64Base8 = GeneralizedXMSSSignature; + pub type SigAbortingTargetSumLifetime32Dim46Base8 = GeneralizedXMSSSignature; #[cfg(test)] mod test { #[cfg(feature = "slow-tests")] - use super::SchemeAbortingTargetSumLifetime32Dim64Base8; + use super::SchemeAbortingTargetSumLifetime32Dim46Base8; #[cfg(feature = "slow-tests")] use crate::signature::SignatureScheme; @@ -65,15 +65,15 @@ pub mod lifetime_2_to_the_32 { #[test] #[cfg(feature = "slow-tests")] pub fn test_correctness() { - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 213, 0, - SchemeAbortingTargetSumLifetime32Dim64Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime32Dim46Base8::LIFETIME as usize, ); - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 4, 0, - SchemeAbortingTargetSumLifetime32Dim64Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime32Dim46Base8::LIFETIME as usize, ); } } @@ -85,7 +85,10 @@ pub mod lifetime_2_to_the_32 { pub mod lifetime_2_to_the_6 { use crate::{ inc_encoding::target_sum::TargetSumEncoding, - signature::generalized_xmss::GeneralizedXMSSSignatureScheme, + signature::generalized_xmss::{ + GeneralizedXMSSPublicKey, GeneralizedXMSSSecretKey, GeneralizedXMSSSignature, + GeneralizedXMSSSignatureScheme, + }, symmetric::{ message_hash::aborting::AbortingHypercubeMessageHash, prf::shake_to_field::ShakePRFtoF, tweak_hash::poseidon::PoseidonTweakHash, @@ -126,15 +129,19 @@ pub mod lifetime_2_to_the_6 { pub type SchemeAbortingTargetSumLifetime6Dim46Base8 = GeneralizedXMSSSignatureScheme; + pub type PubKeyAbortingTargetSumLifetime6Dim46Base8 = GeneralizedXMSSPublicKey; + pub type SecretKeyAbortingTargetSumLifetime6Dim46Base8 = + GeneralizedXMSSSecretKey; + pub type SigAbortingTargetSumLifetime6Dim46Base8 = GeneralizedXMSSSignature; #[cfg(test)] mod test { use crate::signature::{ - SignatureScheme, test_templates::test_signature_scheme_correctness, + SignatureScheme, + generalized_xmss::instantiations_aborting::lifetime_2_to_the_6::SchemeAbortingTargetSumLifetime6Dim46Base8, + test_templates::test_signature_scheme_correctness, }; - use super::SchemeAbortingTargetSumLifetime6Dim46Base8; - #[test] pub fn test_correctness() { test_signature_scheme_correctness::( From 93a82207fe02b2e26fcba37b330c4b929f142a73 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 22:58:55 +0100 Subject: [PATCH 07/26] test coonfig with lifetime 8 --- .../instantiations_aborting.rs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index e2fc8e5..ad254ff 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -82,7 +82,7 @@ pub mod lifetime_2_to_the_32 { /// Instantiations with Lifetime 2^6. This is for testing purposes only. /// /// Warning: Should not be used in production environments. -pub mod lifetime_2_to_the_6 { +pub mod lifetime_2_to_the_8 { use crate::{ inc_encoding::target_sum::TargetSumEncoding, signature::generalized_xmss::{ @@ -95,7 +95,7 @@ pub mod lifetime_2_to_the_6 { }, }; - const LOG_LIFETIME: usize = 6; + const LOG_LIFETIME: usize = 8; const DIMENSION: usize = 46; const BASE: usize = 8; @@ -127,32 +127,32 @@ pub mod lifetime_2_to_the_6 { type PRF = ShakePRFtoF; type IE = TargetSumEncoding; - pub type SchemeAbortingTargetSumLifetime6Dim46Base8 = + pub type SchemeAbortingTargetSumLifetime8Dim46Base8 = GeneralizedXMSSSignatureScheme; - pub type PubKeyAbortingTargetSumLifetime6Dim46Base8 = GeneralizedXMSSPublicKey; - pub type SecretKeyAbortingTargetSumLifetime6Dim46Base8 = + pub type PubKeyAbortingTargetSumLifetime8Dim46Base8 = GeneralizedXMSSPublicKey; + pub type SecretKeyAbortingTargetSumLifetime8Dim46Base8 = GeneralizedXMSSSecretKey; - pub type SigAbortingTargetSumLifetime6Dim46Base8 = GeneralizedXMSSSignature; + pub type SigAbortingTargetSumLifetime8Dim46Base8 = GeneralizedXMSSSignature; #[cfg(test)] mod test { use crate::signature::{ SignatureScheme, - generalized_xmss::instantiations_aborting::lifetime_2_to_the_6::SchemeAbortingTargetSumLifetime6Dim46Base8, + generalized_xmss::instantiations_aborting::lifetime_2_to_the_8::SchemeAbortingTargetSumLifetime8Dim46Base8, test_templates::test_signature_scheme_correctness, }; #[test] pub fn test_correctness() { - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 2, 0, - SchemeAbortingTargetSumLifetime6Dim46Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime8Dim46Base8::LIFETIME as usize, ); - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 11, 0, - SchemeAbortingTargetSumLifetime6Dim46Base8::LIFETIME as usize, + SchemeAbortingTargetSumLifetime8Dim46Base8::LIFETIME as usize, ); } } From 76e38811e2e8665bb1a7b7e8858e78ed22c5d5e8 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 24 Mar 2026 23:10:37 +0100 Subject: [PATCH 08/26] typo --- src/signature/generalized_xmss/instantiations_aborting.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index ad254ff..6cf581b 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -79,7 +79,7 @@ pub mod lifetime_2_to_the_32 { } } -/// Instantiations with Lifetime 2^6. This is for testing purposes only. +/// Instantiations with Lifetime 2^8. This is for testing purposes only. /// /// Warning: Should not be used in production environments. pub mod lifetime_2_to_the_8 { From a3ed05f0d6b9be61338cda967074f73c29ed168d Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Thu, 26 Mar 2026 00:12:02 +0100 Subject: [PATCH 09/26] update test config --- src/signature/generalized_xmss/instantiations_aborting.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index 6cf581b..09348bb 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -97,9 +97,9 @@ pub mod lifetime_2_to_the_8 { const LOG_LIFETIME: usize = 8; - const DIMENSION: usize = 46; + const DIMENSION: usize = 4; const BASE: usize = 8; - const TARGET_SUM: usize = 200; + const TARGET_SUM: usize = 6; const Z: usize = 8; const Q: usize = 127; From f7d834fcd2673aa31e5d3c314edf97c7c70ba1fd Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Thu, 26 Mar 2026 11:18:31 +0100 Subject: [PATCH 10/26] add "Deviations from the original paper" in readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 309cc13..a2047f6 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,10 @@ Confidence intervals can also be shown via python3 benchmark-mean.py target --intervals ``` +## Deviations from the [original paper](https://eprint.iacr.org/2025/055.pdf) + +- use of 'overwrite' sponge, instead of 'addition' / 'xor' sponge. + ## License Apache Version 2.0. From 5cc7e37480362f94e86695428a9ceb9a96b66b97 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Wed, 1 Apr 2026 15:17:12 +0200 Subject: [PATCH 11/26] update deps --- .gitignore | 1 - Cargo.lock | 2571 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 8 +- 3 files changed, 2575 insertions(+), 5 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index d8ff55f..135d529 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /target -Cargo.lock /.debug # Proptest data diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..1c24ed4 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2571 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloy-primitives" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3b431b4e72cd8bd0ec7a50b4be18e73dab74de0dba180eef171055e5d5926e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash 0.2.0", + "hashbrown 0.16.1", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.2", + "rapidhash", + "ruint", + "rustc-hash", + "serde", + "sha3", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93e50f64a77ad9c5470bf2ad0ca02f228da70c792a8f06634801e202579f35e" +dependencies = [ + "arrayvec", + "bytes", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bincode" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +dependencies = [ + "bincode_derive", + "serde", + "unty", +] + +[[package]] +name = "bincode_derive" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" +dependencies = [ + "virtue", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chacha20" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.0", +] + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "const-hex" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "proptest", + "serde_core", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "criterion" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1c047a62b0cc3e145fa84415a3191f628e980b194c2755aa12300a4e6cbd928" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "itertools 0.13.0", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1bcc0dc7dfae599d84ad0b1a55f80cde8af3725da8313b528da95ef783e338" +dependencies = [ + "cast", + "itertools 0.13.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.117", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "ethereum_serde_utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dc1355dbb41fbbd34ec28d4fb2a57d9a70c67ac3c19f6a5ca4d4a176b9e997a" +dependencies = [ + "alloy-primitives", + "hex", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "ethereum_ssz" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2128a84f7a3850d54ee343334e3392cca61f9f6aa9441eec481b9394b43c238b" +dependencies = [ + "alloy-primitives", + "ethereum_serde_utils", + "itertools 0.14.0", + "serde", + "serde_derive", + "smallvec", + "typenum", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", + "serde", + "serde_core", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" +dependencies = [ + "cpufeatures 0.2.17", +] + +[[package]] +name = "keccak-asm" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa468878266ad91431012b3e5ef1bf9b170eab22883503a318d46857afa4579a" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "leansig" +version = "0.1.0" +dependencies = [ + "bincode", + "criterion", + "dashmap", + "ethereum_ssz", + "num-bigint", + "num-traits", + "p3-baby-bear", + "p3-field", + "p3-koala-bear", + "p3-symmetric", + "proptest", + "rand 0.10.0", + "rayon", + "serde", + "sha3", + "thiserror", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.184" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "p3-baby-bear" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "p3-challenger", + "p3-field", + "p3-mds", + "p3-monty-31", + "p3-poseidon1", + "p3-poseidon2", + "p3-symmetric", + "rand 0.10.0", +] + +[[package]] +name = "p3-challenger" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "p3-field", + "p3-maybe-rayon", + "p3-monty-31", + "p3-symmetric", + "p3-util", + "tracing", +] + +[[package]] +name = "p3-dft" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "spin", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "itertools 0.14.0", + "num-bigint", + "p3-maybe-rayon", + "p3-util", + "paste", + "rand 0.10.0", + "serde", + "tracing", +] + +[[package]] +name = "p3-koala-bear" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "p3-challenger", + "p3-field", + "p3-mds", + "p3-monty-31", + "p3-poseidon1", + "p3-poseidon2", + "p3-symmetric", + "rand 0.10.0", +] + +[[package]] +name = "p3-matrix" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand 0.10.0", + "serde", + "tracing", +] + +[[package]] +name = "p3-maybe-rayon" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" + +[[package]] +name = "p3-mds" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "p3-dft", + "p3-field", + "p3-symmetric", + "p3-util", + "rand 0.10.0", +] + +[[package]] +name = "p3-monty-31" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "itertools 0.14.0", + "num-bigint", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-mds", + "p3-poseidon1", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "paste", + "rand 0.10.0", + "serde", + "spin", + "tracing", +] + +[[package]] +name = "p3-poseidon1" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "p3-field", + "p3-symmetric", + "rand 0.10.0", +] + +[[package]] +name = "p3-poseidon2" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "p3-field", + "p3-mds", + "p3-symmetric", + "p3-util", + "rand 0.10.0", +] + +[[package]] +name = "p3-symmetric" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "p3-util", + "serde", +] + +[[package]] +name = "p3-util" +version = "0.5.1" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +dependencies = [ + "serde", + "transpose", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "plotters" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" + +[[package]] +name = "plotters-svg" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "num-traits", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", + "serde", +] + +[[package]] +name = "rand" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand_core 0.10.0", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", + "serde", +] + +[[package]] +name = "rand_core" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.5", +] + +[[package]] +name = "rapidhash" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59" +dependencies = [ + "rustversion", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "ark-ff 0.5.0", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.5", + "rand 0.9.2", + "rlp", + "ruint-macro", + "serde_core", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.27", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cbb88c189d6352cc8ae96a39d19c7ecad8f7330b29461187f2587fdc2988d5" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.9+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da053d28fe57e2c9d21b48261e14e7b4c8b670b54d2c684847b91feaf4c7dac5" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ca317ebc49f06bd748bfba29533eac9485569dc9bf80b849024b025e814fb9" +dependencies = [ + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" + +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver 1.0.27", +] + +[[package]] +name = "web-sys" +version = "0.3.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver 1.0.27", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 7e55c68..18618be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,10 +41,10 @@ thiserror = "2.0" ssz = { package = "ethereum_ssz", version = "0.10.0" } -p3-field = { git = "https://github.com/Plonky3/Plonky3.git", rev = "b4dcde46" } -p3-baby-bear = { git = "https://github.com/Plonky3/Plonky3.git", rev = "b4dcde46" } -p3-koala-bear = { git = "https://github.com/Plonky3/Plonky3.git", rev = "b4dcde46" } -p3-symmetric = { git = "https://github.com/Plonky3/Plonky3.git", rev = "b4dcde46" } +p3-field = { git = "https://github.com/Plonky3/Plonky3.git" } +p3-baby-bear = { git = "https://github.com/Plonky3/Plonky3.git" } +p3-koala-bear = { git = "https://github.com/Plonky3/Plonky3.git" } +p3-symmetric = { git = "https://github.com/Plonky3/Plonky3.git" } [dev-dependencies] criterion = "0.7" From 01213a78c09d15b8ab28598463267cfceca382c4 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 09:50:24 +0200 Subject: [PATCH 12/26] restore naming `SIG...` instead of 'Scheme...' --- src/signature/generalized_xmss/instantiations_aborting.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index 09348bb..98e2ada 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -44,7 +44,7 @@ pub mod lifetime_2_to_the_32 { type PRF = ShakePRFtoF; type IE = TargetSumEncoding; - pub type SchemeAbortingTargetSumLifetime32Dim46Base8 = + pub type SIGAbortingTargetSumLifetime32Dim46Base8 = GeneralizedXMSSSignatureScheme; pub type PubKeyAbortingTargetSumLifetime32Dim46Base8 = GeneralizedXMSSPublicKey; pub type SecretKeyAbortingTargetSumLifetime32Dim46Base8 = @@ -55,7 +55,7 @@ pub mod lifetime_2_to_the_32 { mod test { #[cfg(feature = "slow-tests")] - use super::SchemeAbortingTargetSumLifetime32Dim46Base8; + use super::SIGAbortingTargetSumLifetime32Dim46Base8; #[cfg(feature = "slow-tests")] use crate::signature::SignatureScheme; From 6af1304932cf7639e3672bf2bbe664d5ca4bd4be Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 09:50:59 +0200 Subject: [PATCH 13/26] doc: "Warning: Must not" --- src/signature/generalized_xmss/instantiations_aborting.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index 98e2ada..4761ea6 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -81,7 +81,7 @@ pub mod lifetime_2_to_the_32 { /// Instantiations with Lifetime 2^8. This is for testing purposes only. /// -/// Warning: Should not be used in production environments. +/// Warning: Must not be used in production environments. pub mod lifetime_2_to_the_8 { use crate::{ inc_encoding::target_sum::TargetSumEncoding, From 3588fe1c72f526ec0a9b1bd966fe82026164df78 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 10:01:59 +0200 Subject: [PATCH 14/26] better doc comment for Replacement sponge --- src/symmetric/tweak_hash/poseidon.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 9b8ebc1..ab6931c 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -188,6 +188,9 @@ fn poseidon_safe_domain_separator( /// ### "Replacement" /// This means we "replace" the rate elements of the state with the input chunk, instead /// of adding (in the sense of finite field addition). +/// Using a replacement-sponge is not consistent with [eprint 055](https://eprint.iacr.org/2025/055.pdf), +/// but keep the same security level. Motivations of this change: zkVM friendliness (saving +/// roughly 1 cycle per element that we `replace` instead of `adding` it). /// /// ### Panics /// - If `capacity_value.len() >= WIDTH` From 02c67599acc3652b06417e3b87e7b98d1f521aca Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 10:05:14 +0200 Subject: [PATCH 15/26] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2047f6..d6bdbcc 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ python3 benchmark-mean.py target --intervals ## Deviations from the [original paper](https://eprint.iacr.org/2025/055.pdf) -- use of 'overwrite' sponge, instead of 'addition' / 'xor' sponge. +- use of 'overwrite' sponge, instead of 'addition' / 'xor' sponge, when hashing the WOTS pubkey. Motivation: zkVM friendliness (saving some cycles). Same security level. ## License From 24ec8f7d1f31fbb610990c86c5b42325458b498a Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 10:28:26 +0200 Subject: [PATCH 16/26] remove "pub use poseidon::encode_message;" --- src/symmetric/message_hash.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/symmetric/message_hash.rs b/src/symmetric/message_hash.rs index 0ba2181..95fc4e5 100644 --- a/src/symmetric/message_hash.rs +++ b/src/symmetric/message_hash.rs @@ -5,8 +5,6 @@ use rand::RngExt; use crate::MESSAGE_LENGTH; use crate::serialization::Serializable; -pub use poseidon::encode_message; - /// Trait to model a hash function used for message hashing. /// /// This is a variant of a tweakable hash function that we use for From 8fd4a87a8d6cc8183522f223cbd9d1ededfdd897 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 10:28:41 +0200 Subject: [PATCH 17/26] fmt --- src/symmetric/tweak_hash/poseidon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index ab6931c..17457e8 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -188,7 +188,7 @@ fn poseidon_safe_domain_separator( /// ### "Replacement" /// This means we "replace" the rate elements of the state with the input chunk, instead /// of adding (in the sense of finite field addition). -/// Using a replacement-sponge is not consistent with [eprint 055](https://eprint.iacr.org/2025/055.pdf), +/// Using a replacement-sponge is not consistent with [eprint 055](https://eprint.iacr.org/2025/055.pdf), /// but keep the same security level. Motivations of this change: zkVM friendliness (saving /// roughly 1 cycle per element that we `replace` instead of `adding` it). /// From 70d9489e59d96f3ba28777715259c788c410cc08 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 10:42:08 +0200 Subject: [PATCH 18/26] restore ordering at encoding --- src/symmetric/message_hash/poseidon.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/symmetric/message_hash/poseidon.rs b/src/symmetric/message_hash/poseidon.rs index f4fe81e..5605cbf 100644 --- a/src/symmetric/message_hash/poseidon.rs +++ b/src/symmetric/message_hash/poseidon.rs @@ -114,11 +114,11 @@ pub(crate) fn poseidon_message_hash_fe< let epoch_fe = encode_epoch::(epoch); // now, we hash randomness, parameters, epoch, message using PoseidonCompress - let combined_input_vec: Vec = message_fe + let combined_input_vec: Vec = randomness .iter() .chain(parameter.iter()) .chain(epoch_fe.iter()) - .chain(randomness.iter()) + .chain(message_fe.iter()) .copied() .collect(); From 2fa94432c1d0d1a97f49ee036b58db0f0a8034aa Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 10:44:05 +0200 Subject: [PATCH 19/26] fix --- src/signature/generalized_xmss/instantiations_aborting.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/signature/generalized_xmss/instantiations_aborting.rs b/src/signature/generalized_xmss/instantiations_aborting.rs index 4761ea6..55e5182 100644 --- a/src/signature/generalized_xmss/instantiations_aborting.rs +++ b/src/signature/generalized_xmss/instantiations_aborting.rs @@ -65,15 +65,15 @@ pub mod lifetime_2_to_the_32 { #[test] #[cfg(feature = "slow-tests")] pub fn test_correctness() { - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 213, 0, - SchemeAbortingTargetSumLifetime32Dim46Base8::LIFETIME as usize, + SIGAbortingTargetSumLifetime32Dim46Base8::LIFETIME as usize, ); - test_signature_scheme_correctness::( + test_signature_scheme_correctness::( 4, 0, - SchemeAbortingTargetSumLifetime32Dim46Base8::LIFETIME as usize, + SIGAbortingTargetSumLifetime32Dim46Base8::LIFETIME as usize, ); } } From 730dd4bb40c1636bbd213698c93a0e4bb6e10dad Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 11:06:00 +0200 Subject: [PATCH 20/26] add comment --- src/symmetric/tweak_hash/poseidon.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 17457e8..5b0a3a6 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -356,6 +356,8 @@ impl< match message { [single] => { // we compress message, parameter, tweak + // This does not respect the convention from [eprint 055](https://eprint.iacr.org/2025/055.pdf), + // but keeps the same security level. let perm = poseidon1_16(); // Build input on stack: [message | parameter | tweak] From 9f558c1b7ee326936d26fba87b89d90f08d3c43b Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 11:17:51 +0200 Subject: [PATCH 21/26] wip --- Cargo.lock | 210 +++++++++++++++------------ src/symmetric/tweak_hash/poseidon.rs | 38 +++-- 2 files changed, 136 insertions(+), 112 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c24ed4..e916e39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ "keccak-asm", "paste", "proptest", - "rand 0.9.2", + "rand 0.9.4", "rapidhash", "ruint", "rustc-hash", @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e93e50f64a77ad9c5470bf2ad0ca02f228da70c792a8f06634801e202579f35e" +checksum = "dc90b1e703d3c03f4ff7f48e82dd0bc1c8211ab7d079cd836a06fcfeb06651cb" dependencies = [ "arrayvec", "bytes", @@ -232,7 +232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.8.6", ] [[package]] @@ -242,7 +242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.8.6", ] [[package]] @@ -252,7 +252,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", - "rand 0.8.5", + "rand 0.8.6", ] [[package]] @@ -327,9 +327,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "bitvec" @@ -387,9 +387,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.58" +version = "1.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" +checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" dependencies = [ "find-msvc-tools", "shlex", @@ -409,7 +409,7 @@ checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" dependencies = [ "cfg-if", "cpufeatures 0.3.0", - "rand_core 0.10.0", + "rand_core 0.10.1", ] [[package]] @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.0" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", ] @@ -484,11 +484,12 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.35" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" dependencies = [ "const_format_proc_macros", + "konst", ] [[package]] @@ -796,9 +797,9 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2128a84f7a3850d54ee343334e3392cca61f9f6aa9441eec481b9394b43c238b" +checksum = "368a4a4e4273b0135111fe9464e35465067766a8f664615b5a86338b73864407" dependencies = [ "alloy-primitives", "ethereum_serde_utils", @@ -811,9 +812,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "fastrlp" @@ -860,7 +861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand 0.8.6", "rustc-hex", "static_assertions", ] @@ -932,7 +933,7 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "rand_core 0.10.0", + "rand_core 0.10.1", "wasip2", "wasip3", ] @@ -985,6 +986,12 @@ dependencies = [ "serde_core", ] +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + [[package]] name = "heck" version = "0.5.0" @@ -1034,12 +1041,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown 0.17.0", "serde", "serde_core", ] @@ -1079,9 +1086,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "js-sys" -version = "0.3.94" +version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" dependencies = [ "once_cell", "wasm-bindgen", @@ -1119,6 +1126,21 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "leansig" version = "0.1.0" @@ -1134,7 +1156,7 @@ dependencies = [ "p3-koala-bear", "p3-symmetric", "proptest", - "rand 0.10.0", + "rand 0.10.1", "rayon", "serde", "sha3", @@ -1149,9 +1171,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.184" +version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" +checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "libm" @@ -1230,7 +1252,7 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "p3-baby-bear" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "p3-challenger", "p3-field", @@ -1239,13 +1261,13 @@ dependencies = [ "p3-poseidon1", "p3-poseidon2", "p3-symmetric", - "rand 0.10.0", + "rand 0.10.1", ] [[package]] name = "p3-challenger" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -1258,7 +1280,7 @@ dependencies = [ [[package]] name = "p3-dft" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "itertools 0.14.0", "p3-field", @@ -1272,14 +1294,14 @@ dependencies = [ [[package]] name = "p3-field" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "itertools 0.14.0", "num-bigint", "p3-maybe-rayon", "p3-util", "paste", - "rand 0.10.0", + "rand 0.10.1", "serde", "tracing", ] @@ -1287,7 +1309,7 @@ dependencies = [ [[package]] name = "p3-koala-bear" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "p3-challenger", "p3-field", @@ -1296,19 +1318,19 @@ dependencies = [ "p3-poseidon1", "p3-poseidon2", "p3-symmetric", - "rand 0.10.0", + "rand 0.10.1", ] [[package]] name = "p3-matrix" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "itertools 0.14.0", "p3-field", "p3-maybe-rayon", "p3-util", - "rand 0.10.0", + "rand 0.10.1", "serde", "tracing", ] @@ -1316,24 +1338,24 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" [[package]] name = "p3-mds" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "p3-dft", "p3-field", "p3-symmetric", "p3-util", - "rand 0.10.0", + "rand 0.10.1", ] [[package]] name = "p3-monty-31" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "itertools 0.14.0", "num-bigint", @@ -1347,7 +1369,7 @@ dependencies = [ "p3-symmetric", "p3-util", "paste", - "rand 0.10.0", + "rand 0.10.1", "serde", "spin", "tracing", @@ -1356,29 +1378,29 @@ dependencies = [ [[package]] name = "p3-poseidon1" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "p3-field", "p3-symmetric", - "rand 0.10.0", + "rand 0.10.1", ] [[package]] name = "p3-poseidon2" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "p3-field", "p3-mds", "p3-symmetric", "p3-util", - "rand 0.10.0", + "rand 0.10.1", ] [[package]] name = "p3-symmetric" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "itertools 0.14.0", "p3-field", @@ -1389,7 +1411,7 @@ dependencies = [ [[package]] name = "p3-util" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" +source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" dependencies = [ "serde", "transpose", @@ -1554,7 +1576,7 @@ dependencies = [ "bit-vec", "bitflags", "num-traits", - "rand 0.9.2", + "rand 0.9.4", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", @@ -1598,9 +1620,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -1609,9 +1631,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -1620,13 +1642,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" dependencies = [ "chacha20", "getrandom 0.4.2", - "rand_core 0.10.0", + "rand_core 0.10.1", ] [[package]] @@ -1670,9 +1692,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rand_xorshift" @@ -1694,9 +1716,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -1789,8 +1811,8 @@ dependencies = [ "parity-scale-codec", "primitive-types", "proptest", - "rand 0.8.5", - "rand 0.9.2", + "rand 0.8.6", + "rand 0.9.4", "rlp", "ruint-macro", "serde_core", @@ -1831,7 +1853,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.27", + "semver 1.0.28", ] [[package]] @@ -1905,9 +1927,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "semver-parser" @@ -1974,9 +1996,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "77fd7028345d415a4034cf8777cd4f8ab1851274233b45f84e3d955502d93874" dependencies = [ "digest 0.10.7", "keccak", @@ -2133,9 +2155,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.9+spec-1.1.0" +version = "0.25.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da053d28fe57e2c9d21b48261e14e7b4c8b670b54d2c684847b91feaf4c7dac5" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" dependencies = [ "indexmap", "toml_datetime", @@ -2145,9 +2167,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.1+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ca317ebc49f06bd748bfba29533eac9485569dc9bf80b849024b025e814fb9" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ "winnow", ] @@ -2192,9 +2214,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" [[package]] name = "ucd-trie" @@ -2289,11 +2311,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.3+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.57.1", ] [[package]] @@ -2302,14 +2324,14 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.51.0", ] [[package]] name = "wasm-bindgen" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" dependencies = [ "cfg-if", "once_cell", @@ -2320,9 +2342,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2330,9 +2352,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" dependencies = [ "bumpalo", "proc-macro2", @@ -2343,9 +2365,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" dependencies = [ "unicode-ident", ] @@ -2381,14 +2403,14 @@ dependencies = [ "bitflags", "hashbrown 0.15.5", "indexmap", - "semver 1.0.27", + "semver 1.0.28", ] [[package]] name = "web-sys" -version = "0.3.94" +version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" +checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" dependencies = [ "js-sys", "wasm-bindgen", @@ -2436,6 +2458,12 @@ dependencies = [ "wit-bindgen-rust-macro", ] +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + [[package]] name = "wit-bindgen-core" version = "0.51.0" @@ -2507,7 +2535,7 @@ dependencies = [ "id-arena", "indexmap", "log", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_derive", "serde_json", diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 5b0a3a6..3bd0cbc 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -315,7 +315,7 @@ impl< const { assert!( CAPACITY < 24, - "Poseidon Tweak Chain Hash: Capacity must be less than 24" + "Poseidon Tweak Hash: Capacity must be less than 24" ); assert!( PARAMETER_LEN + TWEAK_LEN + HASH_LEN <= 16, @@ -355,19 +355,18 @@ impl< match message { [single] => { - // we compress message, parameter, tweak - // This does not respect the convention from [eprint 055](https://eprint.iacr.org/2025/055.pdf), - // but keeps the same security level. + // we compress parameter, tweak, message let perm = poseidon1_16(); - // Build input on stack: [message | parameter | tweak] + // Build input on stack: [parameter | tweak | message] let mut combined_input = [F::ZERO; CHAIN_COMPRESSION_WIDTH]; - combined_input[..HASH_LEN].copy_from_slice(&single.0); - combined_input[HASH_LEN..][..PARAMETER_LEN].copy_from_slice(¶meter.0); - combined_input[HASH_LEN + PARAMETER_LEN..][..TWEAK_LEN].copy_from_slice(&tweak_fe); + combined_input[..PARAMETER_LEN].copy_from_slice(¶meter.0); + combined_input[PARAMETER_LEN..PARAMETER_LEN + TWEAK_LEN].copy_from_slice(&tweak_fe); + combined_input[PARAMETER_LEN + TWEAK_LEN..PARAMETER_LEN + TWEAK_LEN + HASH_LEN] + .copy_from_slice(&single.0); FieldArray( - poseidon_compress::<_, _, CHAIN_COMPRESSION_WIDTH, HASH_LEN>( + poseidon_compress::( &perm, &combined_input, ), @@ -607,10 +606,9 @@ impl< // Cache strategy: process one chain at a time to maximize locality. // All epochs for that chain stay in registers across iterations. - // Offsets for chain compression: [current_value | parameter | tweak] - let chain_value_offset = 0; - let chain_parameter_offset = HASH_LEN; - let chain_tweak_offset = HASH_LEN + PARAMETER_LEN; + // Offsets for chain compression: [parameter | tweak | current_value] + let chain_tweak_offset = PARAMETER_LEN; + let chain_value_offset = PARAMETER_LEN + TWEAK_LEN; for (chain_index, packed_chain) in packed_chains.iter_mut().enumerate().take(num_chains) @@ -622,17 +620,11 @@ impl< let pos = (step + 1) as u8; // Assemble the packed input for the hash function. - // Layout: [current_value | parameter | tweak] + // Layout: [parameter | tweak | current_value] let mut packed_input = [PackedF::ZERO; CHAIN_COMPRESSION_WIDTH]; - // Copy current chain value (already packed) - packed_input[chain_value_offset..chain_value_offset + HASH_LEN] - .copy_from_slice(packed_chain); - // Copy pre-packed parameter - packed_input - [chain_parameter_offset..chain_parameter_offset + PARAMETER_LEN] - .copy_from_slice(&packed_parameter); + packed_input[..PARAMETER_LEN].copy_from_slice(&packed_parameter); // Pack tweaks directly into destination pack_fn_into::( @@ -644,6 +636,10 @@ impl< }, ); + // Copy current chain value (already packed) + packed_input[chain_value_offset..chain_value_offset + HASH_LEN] + .copy_from_slice(packed_chain); + // Apply the hash function to advance the chain. // This single call processes all epochs in parallel. *packed_chain = From 35fa892430dfb43e69e7bf264437a46c3696732d Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 12:10:59 +0200 Subject: [PATCH 22/26] Revert "wip" This reverts commit 9f558c1b7ee326936d26fba87b89d90f08d3c43b. --- Cargo.lock | 210 ++++++++++++--------------- src/symmetric/tweak_hash/poseidon.rs | 38 ++--- 2 files changed, 112 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e916e39..1c24ed4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ "keccak-asm", "paste", "proptest", - "rand 0.9.4", + "rand 0.9.2", "rapidhash", "ruint", "rustc-hash", @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.15" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc90b1e703d3c03f4ff7f48e82dd0bc1c8211ab7d079cd836a06fcfeb06651cb" +checksum = "e93e50f64a77ad9c5470bf2ad0ca02f228da70c792a8f06634801e202579f35e" dependencies = [ "arrayvec", "bytes", @@ -232,7 +232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand 0.8.6", + "rand 0.8.5", ] [[package]] @@ -242,7 +242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.6", + "rand 0.8.5", ] [[package]] @@ -252,7 +252,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", - "rand 0.8.6", + "rand 0.8.5", ] [[package]] @@ -327,9 +327,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "bitvec" @@ -387,9 +387,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.60" +version = "1.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" dependencies = [ "find-msvc-tools", "shlex", @@ -409,7 +409,7 @@ checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" dependencies = [ "cfg-if", "cpufeatures 0.3.0", - "rand_core 0.10.1", + "rand_core 0.10.0", ] [[package]] @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.1" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" dependencies = [ "clap_builder", ] @@ -484,12 +484,11 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.36" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" dependencies = [ "const_format_proc_macros", - "konst", ] [[package]] @@ -797,9 +796,9 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.10.3" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368a4a4e4273b0135111fe9464e35465067766a8f664615b5a86338b73864407" +checksum = "2128a84f7a3850d54ee343334e3392cca61f9f6aa9441eec481b9394b43c238b" dependencies = [ "alloy-primitives", "ethereum_serde_utils", @@ -812,9 +811,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.4.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fastrlp" @@ -861,7 +860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.6", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -933,7 +932,7 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "rand_core 0.10.1", + "rand_core 0.10.0", "wasip2", "wasip3", ] @@ -986,12 +985,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "hashbrown" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - [[package]] name = "heck" version = "0.5.0" @@ -1041,12 +1034,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.14.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown 0.17.0", + "hashbrown 0.16.1", "serde", "serde_core", ] @@ -1086,9 +1079,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" dependencies = [ "once_cell", "wasm-bindgen", @@ -1126,21 +1119,6 @@ dependencies = [ "sha3-asm", ] -[[package]] -name = "konst" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" -dependencies = [ - "konst_macro_rules", -] - -[[package]] -name = "konst_macro_rules" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" - [[package]] name = "leansig" version = "0.1.0" @@ -1156,7 +1134,7 @@ dependencies = [ "p3-koala-bear", "p3-symmetric", "proptest", - "rand 0.10.1", + "rand 0.10.0", "rayon", "serde", "sha3", @@ -1171,9 +1149,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.185" +version = "0.2.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" [[package]] name = "libm" @@ -1252,7 +1230,7 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "p3-baby-bear" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "p3-challenger", "p3-field", @@ -1261,13 +1239,13 @@ dependencies = [ "p3-poseidon1", "p3-poseidon2", "p3-symmetric", - "rand 0.10.1", + "rand 0.10.0", ] [[package]] name = "p3-challenger" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -1280,7 +1258,7 @@ dependencies = [ [[package]] name = "p3-dft" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "itertools 0.14.0", "p3-field", @@ -1294,14 +1272,14 @@ dependencies = [ [[package]] name = "p3-field" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "itertools 0.14.0", "num-bigint", "p3-maybe-rayon", "p3-util", "paste", - "rand 0.10.1", + "rand 0.10.0", "serde", "tracing", ] @@ -1309,7 +1287,7 @@ dependencies = [ [[package]] name = "p3-koala-bear" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "p3-challenger", "p3-field", @@ -1318,19 +1296,19 @@ dependencies = [ "p3-poseidon1", "p3-poseidon2", "p3-symmetric", - "rand 0.10.1", + "rand 0.10.0", ] [[package]] name = "p3-matrix" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "itertools 0.14.0", "p3-field", "p3-maybe-rayon", "p3-util", - "rand 0.10.1", + "rand 0.10.0", "serde", "tracing", ] @@ -1338,24 +1316,24 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" [[package]] name = "p3-mds" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "p3-dft", "p3-field", "p3-symmetric", "p3-util", - "rand 0.10.1", + "rand 0.10.0", ] [[package]] name = "p3-monty-31" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "itertools 0.14.0", "num-bigint", @@ -1369,7 +1347,7 @@ dependencies = [ "p3-symmetric", "p3-util", "paste", - "rand 0.10.1", + "rand 0.10.0", "serde", "spin", "tracing", @@ -1378,29 +1356,29 @@ dependencies = [ [[package]] name = "p3-poseidon1" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "p3-field", "p3-symmetric", - "rand 0.10.1", + "rand 0.10.0", ] [[package]] name = "p3-poseidon2" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "p3-field", "p3-mds", "p3-symmetric", "p3-util", - "rand 0.10.1", + "rand 0.10.0", ] [[package]] name = "p3-symmetric" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "itertools 0.14.0", "p3-field", @@ -1411,7 +1389,7 @@ dependencies = [ [[package]] name = "p3-util" version = "0.5.1" -source = "git+https://github.com/Plonky3/Plonky3.git#e920945c405761688024dfe18abb39238225af5a" +source = "git+https://github.com/Plonky3/Plonky3.git#369449ef12ffd68d780cb7539a24d5ba8f657aa9" dependencies = [ "serde", "transpose", @@ -1576,7 +1554,7 @@ dependencies = [ "bit-vec", "bitflags", "num-traits", - "rand 0.9.4", + "rand 0.9.2", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", @@ -1620,9 +1598,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -1631,9 +1609,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -1642,13 +1620,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" +checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" dependencies = [ "chacha20", "getrandom 0.4.2", - "rand_core 0.10.1", + "rand_core 0.10.0", ] [[package]] @@ -1692,9 +1670,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" +checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" [[package]] name = "rand_xorshift" @@ -1716,9 +1694,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.12.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -1811,8 +1789,8 @@ dependencies = [ "parity-scale-codec", "primitive-types", "proptest", - "rand 0.8.6", - "rand 0.9.4", + "rand 0.8.5", + "rand 0.9.2", "rlp", "ruint-macro", "serde_core", @@ -1853,7 +1831,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.28", + "semver 1.0.27", ] [[package]] @@ -1927,9 +1905,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.28" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "semver-parser" @@ -1996,9 +1974,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.9" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77fd7028345d415a4034cf8777cd4f8ab1851274233b45f84e3d955502d93874" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ "digest 0.10.7", "keccak", @@ -2155,9 +2133,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.11+spec-1.1.0" +version = "0.25.9+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +checksum = "da053d28fe57e2c9d21b48261e14e7b4c8b670b54d2c684847b91feaf4c7dac5" dependencies = [ "indexmap", "toml_datetime", @@ -2167,9 +2145,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "39ca317ebc49f06bd748bfba29533eac9485569dc9bf80b849024b025e814fb9" dependencies = [ "winnow", ] @@ -2214,9 +2192,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.20.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "ucd-trie" @@ -2311,11 +2289,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.3+wasi-0.2.9" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "wit-bindgen 0.57.1", + "wit-bindgen", ] [[package]] @@ -2324,14 +2302,14 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "wit-bindgen 0.51.0", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" dependencies = [ "cfg-if", "once_cell", @@ -2342,9 +2320,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2352,9 +2330,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" dependencies = [ "bumpalo", "proc-macro2", @@ -2365,9 +2343,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" dependencies = [ "unicode-ident", ] @@ -2403,14 +2381,14 @@ dependencies = [ "bitflags", "hashbrown 0.15.5", "indexmap", - "semver 1.0.28", + "semver 1.0.27", ] [[package]] name = "web-sys" -version = "0.3.95" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" dependencies = [ "js-sys", "wasm-bindgen", @@ -2458,12 +2436,6 @@ dependencies = [ "wit-bindgen-rust-macro", ] -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - [[package]] name = "wit-bindgen-core" version = "0.51.0" @@ -2535,7 +2507,7 @@ dependencies = [ "id-arena", "indexmap", "log", - "semver 1.0.28", + "semver 1.0.27", "serde", "serde_derive", "serde_json", diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 3bd0cbc..5b0a3a6 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -315,7 +315,7 @@ impl< const { assert!( CAPACITY < 24, - "Poseidon Tweak Hash: Capacity must be less than 24" + "Poseidon Tweak Chain Hash: Capacity must be less than 24" ); assert!( PARAMETER_LEN + TWEAK_LEN + HASH_LEN <= 16, @@ -355,18 +355,19 @@ impl< match message { [single] => { - // we compress parameter, tweak, message + // we compress message, parameter, tweak + // This does not respect the convention from [eprint 055](https://eprint.iacr.org/2025/055.pdf), + // but keeps the same security level. let perm = poseidon1_16(); - // Build input on stack: [parameter | tweak | message] + // Build input on stack: [message | parameter | tweak] let mut combined_input = [F::ZERO; CHAIN_COMPRESSION_WIDTH]; - combined_input[..PARAMETER_LEN].copy_from_slice(¶meter.0); - combined_input[PARAMETER_LEN..PARAMETER_LEN + TWEAK_LEN].copy_from_slice(&tweak_fe); - combined_input[PARAMETER_LEN + TWEAK_LEN..PARAMETER_LEN + TWEAK_LEN + HASH_LEN] - .copy_from_slice(&single.0); + combined_input[..HASH_LEN].copy_from_slice(&single.0); + combined_input[HASH_LEN..][..PARAMETER_LEN].copy_from_slice(¶meter.0); + combined_input[HASH_LEN + PARAMETER_LEN..][..TWEAK_LEN].copy_from_slice(&tweak_fe); FieldArray( - poseidon_compress::( + poseidon_compress::<_, _, CHAIN_COMPRESSION_WIDTH, HASH_LEN>( &perm, &combined_input, ), @@ -606,9 +607,10 @@ impl< // Cache strategy: process one chain at a time to maximize locality. // All epochs for that chain stay in registers across iterations. - // Offsets for chain compression: [parameter | tweak | current_value] - let chain_tweak_offset = PARAMETER_LEN; - let chain_value_offset = PARAMETER_LEN + TWEAK_LEN; + // Offsets for chain compression: [current_value | parameter | tweak] + let chain_value_offset = 0; + let chain_parameter_offset = HASH_LEN; + let chain_tweak_offset = HASH_LEN + PARAMETER_LEN; for (chain_index, packed_chain) in packed_chains.iter_mut().enumerate().take(num_chains) @@ -620,11 +622,17 @@ impl< let pos = (step + 1) as u8; // Assemble the packed input for the hash function. - // Layout: [parameter | tweak | current_value] + // Layout: [current_value | parameter | tweak] let mut packed_input = [PackedF::ZERO; CHAIN_COMPRESSION_WIDTH]; + // Copy current chain value (already packed) + packed_input[chain_value_offset..chain_value_offset + HASH_LEN] + .copy_from_slice(packed_chain); + // Copy pre-packed parameter - packed_input[..PARAMETER_LEN].copy_from_slice(&packed_parameter); + packed_input + [chain_parameter_offset..chain_parameter_offset + PARAMETER_LEN] + .copy_from_slice(&packed_parameter); // Pack tweaks directly into destination pack_fn_into::( @@ -636,10 +644,6 @@ impl< }, ); - // Copy current chain value (already packed) - packed_input[chain_value_offset..chain_value_offset + HASH_LEN] - .copy_from_slice(packed_chain); - // Apply the hash function to advance the chain. // This single call processes all epochs in parallel. *packed_chain = From 9417675bb78774d54769c660bf37687853756647 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 12:11:05 +0200 Subject: [PATCH 23/26] Revert "restore ordering at encoding" This reverts commit 70d9489e59d96f3ba28777715259c788c410cc08. --- src/symmetric/message_hash/poseidon.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/symmetric/message_hash/poseidon.rs b/src/symmetric/message_hash/poseidon.rs index 5605cbf..f4fe81e 100644 --- a/src/symmetric/message_hash/poseidon.rs +++ b/src/symmetric/message_hash/poseidon.rs @@ -114,11 +114,11 @@ pub(crate) fn poseidon_message_hash_fe< let epoch_fe = encode_epoch::(epoch); // now, we hash randomness, parameters, epoch, message using PoseidonCompress - let combined_input_vec: Vec = randomness + let combined_input_vec: Vec = message_fe .iter() .chain(parameter.iter()) .chain(epoch_fe.iter()) - .chain(message_fe.iter()) + .chain(randomness.iter()) .copied() .collect(); From 0d833fd7c9c00c4a5e1219eeef90c876912b43e8 Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 12:18:21 +0200 Subject: [PATCH 24/26] update doc --- README.md | 6 +++++- src/symmetric/message_hash/poseidon.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6bdbcc..c06af42 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,11 @@ python3 benchmark-mean.py target --intervals ## Deviations from the [original paper](https://eprint.iacr.org/2025/055.pdf) -- use of 'overwrite' sponge, instead of 'addition' / 'xor' sponge, when hashing the WOTS pubkey. Motivation: zkVM friendliness (saving some cycles). Same security level. +- use of 'overwrite' sponge, instead of 'addition' / 'xor' sponge, when hashing the WOTS pubkey. +- WOTS encoding: use [message, parameters, epoch, randomness] instead of [randomness, parameters, epoch, message]. +- Hash chains: use [current_value | parameter | tweak] instead of [parameter | tweak | current_value]. + +Deviations are motivated by [leanVM](https://github.com/leanEthereum/leanMultisig) friendliness (XMSS aggregation requiring fewer cycles). They do not impact the security level. ## License diff --git a/src/symmetric/message_hash/poseidon.rs b/src/symmetric/message_hash/poseidon.rs index f4fe81e..fbdf3c9 100644 --- a/src/symmetric/message_hash/poseidon.rs +++ b/src/symmetric/message_hash/poseidon.rs @@ -113,7 +113,7 @@ pub(crate) fn poseidon_message_hash_fe< let message_fe = encode_message::(message); let epoch_fe = encode_epoch::(epoch); - // now, we hash randomness, parameters, epoch, message using PoseidonCompress + // now, we hash message, parameters, epoch, randomness using PoseidonCompress let combined_input_vec: Vec = message_fe .iter() .chain(parameter.iter()) From f825190b3592318e5fc61c3674e452b04d20137b Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 13:56:26 +0200 Subject: [PATCH 25/26] typo --- src/symmetric/tweak_hash/poseidon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/symmetric/tweak_hash/poseidon.rs b/src/symmetric/tweak_hash/poseidon.rs index 5b0a3a6..fe4f0b5 100644 --- a/src/symmetric/tweak_hash/poseidon.rs +++ b/src/symmetric/tweak_hash/poseidon.rs @@ -189,7 +189,7 @@ fn poseidon_safe_domain_separator( /// This means we "replace" the rate elements of the state with the input chunk, instead /// of adding (in the sense of finite field addition). /// Using a replacement-sponge is not consistent with [eprint 055](https://eprint.iacr.org/2025/055.pdf), -/// but keep the same security level. Motivations of this change: zkVM friendliness (saving +/// but keeps the same security level. Motivations of this change: zkVM friendliness (saving /// roughly 1 cycle per element that we `replace` instead of `adding` it). /// /// ### Panics From 15cbdd43ec8525aa43fea2f42cafc5ed366084ae Mon Sep 17 00:00:00 2001 From: Tom Wambsgans Date: Tue, 21 Apr 2026 14:33:18 +0200 Subject: [PATCH 26/26] fix readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c06af42..bcae136 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ python3 benchmark-mean.py target --intervals ## Deviations from the [original paper](https://eprint.iacr.org/2025/055.pdf) - use of 'overwrite' sponge, instead of 'addition' / 'xor' sponge, when hashing the WOTS pubkey. +- sponge data layout: [capacity | rate] instead of [rate | capacity]. - WOTS encoding: use [message, parameters, epoch, randomness] instead of [randomness, parameters, epoch, message]. - Hash chains: use [current_value | parameter | tweak] instead of [parameter | tweak | current_value].