repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/math/samplerz.rs | miden-crypto/src/dsa/falcon512_rpo/math/samplerz.rs | use rand::Rng;
/// Samples an integer from {0, ..., 18} according to the distribution χ, which is close to
/// the half-Gaussian distribution on the natural numbers with mean 0 and standard deviation
/// equal to sigma_max.
fn base_sampler(bytes: [u8; 9]) -> i16 {
const RCDT: [u128; 18] = [
302468624112300... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/math/ffsampling.rs | miden-crypto/src/dsa/falcon512_rpo/math/ffsampling.rs | use alloc::boxed::Box;
use num::Zero;
use num_complex::{Complex, Complex64};
use rand::Rng;
use super::{fft::FastFft, polynomial::Polynomial, samplerz::sampler_z};
use crate::utils::zeroize::{Zeroize, ZeroizeOnDrop};
const SIGMIN: f64 = 1.2778336969128337;
/// Computes the Gram matrix. The argument must be a 2x2 ma... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/math/fft.rs | miden-crypto/src/dsa/falcon512_rpo/math/fft.rs | use alloc::vec::Vec;
use core::{
f64::consts::PI,
ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign},
};
use num::{One, Zero};
use num_complex::Complex64;
use super::{Inverse, field::FalconFelt, polynomial::Polynomial};
/// Implements Cyclotomic FFT without bitreversing the outputs, and using precomp... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/tests/prng.rs | miden-crypto/src/dsa/falcon512_rpo/tests/prng.rs | use alloc::vec::Vec;
use rand::{Rng, RngCore};
use rand_core::impls;
use sha3::{
Shake256, Shake256ReaderCore,
digest::{ExtendableOutput, Update, XofReader, core_api::XofReaderCoreWrapper},
};
use super::data::SYNC_DATA;
use crate::dsa::falcon512_rpo::SIG_NONCE_LEN;
/// Length of the seed for the ChaCha20-ba... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/tests/mod.rs | miden-crypto/src/dsa/falcon512_rpo/tests/mod.rs | use alloc::vec::Vec;
use data::{
EXPECTED_SIG, EXPECTED_SIG_POLYS, NUM_TEST_VECTORS, SK_POLYS, SYNC_DATA_FOR_TEST_VECTOR,
};
use prng::Shake256Testing;
use rand::{RngCore, SeedableRng};
use rand_chacha::ChaCha20Rng;
use super::{Serializable, math::Polynomial};
use crate::dsa::falcon512_rpo::{
PREVERSIONED_NON... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/tests/data.rs | miden-crypto/src/dsa/falcon512_rpo/tests/data.rs | use crate::dsa::falcon512_rpo::SIG_SERIALIZED_LEN;
pub(crate) const NUM_TEST_VECTORS: usize = 12;
/// Helper data to indicate the number of bytes the should be draw from the SHAKE256-based PRNG
/// in order to sync its state to the state of the PRNG in the reference implementation during
/// testing of the Falcon512 ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/keys/public_key.rs | miden-crypto/src/dsa/falcon512_rpo/keys/public_key.rs | //! Public key types for the RPO Falcon 512 digital signature scheme used in Miden VM.
use alloc::{string::ToString, vec::Vec};
use core::ops::Deref;
use num::Zero;
use super::{
super::{LOG_N, N, PK_LEN},
ByteReader, ByteWriter, Deserializable, DeserializationError, FalconFelt, Felt, Polynomial,
Serializ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/keys/secret_key.rs | miden-crypto/src/dsa/falcon512_rpo/keys/secret_key.rs | use alloc::{string::ToString, vec::Vec};
use miden_crypto_derive::{SilentDebug, SilentDisplay};
use num::Complex;
use num_complex::Complex64;
use rand::Rng;
use super::{
super::{
ByteReader, ByteWriter, Deserializable, DeserializationError, MODULUS, N, Nonce,
SIG_L2_BOUND, SIGMA, Serializable, Sho... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/keys/mod.rs | miden-crypto/src/dsa/falcon512_rpo/keys/mod.rs | use super::{
ByteReader, ByteWriter, Deserializable, DeserializationError, Felt, Serializable, Signature,
math::{FalconFelt, Polynomial},
};
mod public_key;
pub use public_key::PublicKey;
mod secret_key;
pub use secret_key::SecretKey;
pub(crate) use secret_key::{WIDTH_BIG_POLY_COEFFICIENT, WIDTH_SMALL_POLY_CO... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/ecdsa_k256_keccak/tests.rs | miden-crypto/src/dsa/ecdsa_k256_keccak/tests.rs | use rand::rng;
use super::*;
use crate::Felt;
#[test]
fn test_key_generation() {
let mut rng = rng();
let secret_key = SecretKey::with_rng(&mut rng);
let public_key = secret_key.public_key();
// Test that we can convert to/from bytes
let sk_bytes = secret_key.to_bytes();
let recovered_sk = S... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/ecdsa_k256_keccak/mod.rs | miden-crypto/src/dsa/ecdsa_k256_keccak/mod.rs | //! ECDSA (Elliptic Curve Digital Signature Algorithm) signature implementation over secp256k1
//! curve using Keccak to hash the messages when signing.
use alloc::{string::ToString, vec::Vec};
use k256::{
ecdh::diffie_hellman,
ecdsa::{RecoveryId, SigningKey, VerifyingKey, signature::hazmat::PrehashVerifier},... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/mod.rs | miden-crypto/src/hash/mod.rs | //! Cryptographic hash functions used by the Miden protocol.
use crate::{Felt, Word, ZERO};
/// Blake3 hash function.
pub mod blake;
/// Keccak hash function.
pub mod keccak;
/// SHA-2 hash functions (SHA-256 and SHA-512).
pub mod sha2;
/// Poseidon2 hash function.
pub mod poseidon2 {
pub use p3_miden_goldiloc... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/sha2/tests.rs | miden-crypto/src/hash/sha2/tests.rs | #![cfg(feature = "std")]
use alloc::vec::Vec;
use proptest::prelude::*;
use super::*;
use crate::rand::test_utils::rand_vector;
// SHA-256 TESTS
// ================================================================================================
#[test]
fn sha256_hash_elements() {
// test multiple of 8
let e... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/sha2/mod.rs | miden-crypto/src/hash/sha2/mod.rs | //! SHA2 hash function wrappers (SHA-256 and SHA-512).
//!
//! # Note on SHA-512 and the Digest trait
//!
//! `Sha512Digest` does not implement the `Digest` trait because Winterfell's `Digest` trait
//! requires a fixed 32-byte output via `as_bytes() -> [u8; 32]`, which is incompatible with
//! SHA-512's native 64-byte... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/blake/tests.rs | miden-crypto/src/hash/blake/tests.rs | #![cfg(feature = "std")]
use alloc::vec::Vec;
use p3_field::PrimeField64;
use p3_miden_goldilocks::Goldilocks as Felt;
use proptest::prelude::*;
use super::*;
use crate::rand::test_utils::rand_vector;
#[test]
fn blake3_hash_elements() {
// test multiple of 8
let elements = rand_vector::<Felt>(16);
let ex... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/blake/mod.rs | miden-crypto/src/hash/blake/mod.rs | use alloc::string::String;
use core::{
mem::size_of,
ops::Deref,
slice::{self, from_raw_parts},
};
use p3_field::{BasedVectorSpace, PrimeField64};
use p3_miden_goldilocks::Goldilocks as Felt;
use super::HasherExt;
use crate::utils::{
ByteReader, ByteWriter, Deserializable, DeserializationError, HexPar... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/mod.rs | miden-crypto/src/hash/algebraic_sponge/mod.rs | //! Algebraic sponge-based hash functions.
//!
//! These are hash functions based on the sponge construction, which itself is defined from
//! a cryptographic permutation function and a padding rule.
//!
//! Throughout the module, the padding rule used is the one in <https://eprint.iacr.org/2023/1045>.
//! The core of ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/tests.rs | miden-crypto/src/hash/algebraic_sponge/rescue/tests.rs | #![cfg(feature = "std")]
use p3_field::PrimeCharacteristicRing;
use super::{ALPHA, Felt, INV_ALPHA};
use crate::rand::test_utils::rand_value;
#[test]
fn test_alphas() {
let e: Felt = Felt::new(rand_value());
let e_exp = e.exp_u64(ALPHA);
assert_eq!(e, e_exp.exp_u64(INV_ALPHA));
}
| rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/mod.rs | miden-crypto/src/hash/algebraic_sponge/rescue/mod.rs | use p3_field::{Field, PrimeCharacteristicRing};
#[cfg(all(test, feature = "std"))]
pub(crate) use super::{ALPHA, INV_ALPHA};
use super::{
AlgebraicSponge, CAPACITY_RANGE, DIGEST_RANGE, Felt, RATE_RANGE, Range, STATE_WIDTH, Word, ZERO,
};
mod arch;
pub use arch::optimized::{
add_constants_and_apply_ext_round, ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/mds/freq.rs | miden-crypto/src/hash/algebraic_sponge/rescue/mds/freq.rs | // FFT-BASED MDS MULTIPLICATION HELPER FUNCTIONS
// ================================================================================================
//! This module contains helper functions as well as constants used to perform the vector-matrix
//! multiplication step of the Rescue prime permutation. The special form... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/mds/mod.rs | miden-crypto/src/hash/algebraic_sponge/rescue/mds/mod.rs | use p3_field::PrimeField64;
use super::{Felt, STATE_WIDTH, ZERO};
mod freq;
pub use freq::mds_multiply_freq;
// MDS MULTIPLICATION
// ================================================================================================
#[inline(always)]
pub fn apply_mds(state: &mut [Felt; STATE_WIDTH]) {
let mut resu... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/rpo/tests.rs | miden-crypto/src/hash/algebraic_sponge/rescue/rpo/tests.rs | #![cfg(feature = "std")]
use alloc::{collections::BTreeSet, vec::Vec};
use proptest::prelude::*;
use super::{
super::{ALPHA, INV_ALPHA, apply_inv_sbox, apply_sbox},
Felt, Rpo256, STATE_WIDTH,
};
use crate::{
ONE, Word, ZERO,
field::{PrimeCharacteristicRing, PrimeField64},
hash::algebraic_sponge::{... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/rpo/mod.rs | miden-crypto/src/hash/algebraic_sponge/rescue/rpo/mod.rs | use super::{
ARK1, ARK2, AlgebraicSponge, CAPACITY_RANGE, DIGEST_RANGE, Felt, NUM_ROUNDS, RATE_RANGE, Range,
STATE_WIDTH, Word, add_constants, add_constants_and_apply_inv_sbox,
add_constants_and_apply_sbox, apply_inv_sbox, apply_mds, apply_sbox,
};
use crate::hash::algebraic_sponge::rescue::mds::MDS;
#[cfg... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/arch/x86_64_avx512.rs | miden-crypto/src/hash/algebraic_sponge/rescue/arch/x86_64_avx512.rs | use core::arch::x86_64::*;
/// 12×u64 state split as:
/// - 8 lanes in AVX-512 register (__m512i) for vector operations
/// - 4 lanes as scalar u64 array
type State = (__m512i, [u64; 4]);
// CONSTANTS
// ================================================================================================
const EPS_U64: u... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/arch/mod.rs | miden-crypto/src/hash/algebraic_sponge/rescue/arch/mod.rs | // SVE OPTIMIZATIONS
// ================================================================================================
#[cfg(target_feature = "sve")]
pub mod optimized {
use crate::{Felt, hash::algebraic_sponge::rescue::STATE_WIDTH};
mod ffi {
#[link(name = "rpo_sve", kind = "static")]
unsaf... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/arch/x86_64_avx2.rs | miden-crypto/src/hash/algebraic_sponge/rescue/arch/x86_64_avx2.rs | use core::arch::x86_64::*;
// The following AVX2 implementation has been copied from plonky2:
// https://github.com/0xPolygonZero/plonky2/blob/main/plonky2/src/hash/arch/x86_64/poseidon_goldilocks_avx2_bmi2.rs
// Preliminary notes:
// 1. AVX does not support addition with carry but 128-bit (2-word) addition can be ea... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/rpx/tests.rs | miden-crypto/src/hash/algebraic_sponge/rescue/rpx/tests.rs | #![cfg(feature = "std")]
use alloc::{collections::BTreeSet, vec::Vec};
use p3_field::PrimeField64;
use proptest::prelude::*;
use super::{Felt, Rpx256};
use crate::{
ONE, Word, ZERO, hash::algebraic_sponge::AlgebraicSponge, rand::test_utils::rand_value,
};
// The number of iterations to run the `ext_round_matches... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/rescue/rpx/mod.rs | miden-crypto/src/hash/algebraic_sponge/rescue/rpx/mod.rs | use super::{
ARK1, ARK2, CAPACITY_RANGE, DIGEST_RANGE, Felt, MDS, NUM_ROUNDS, RATE_RANGE, Range,
STATE_WIDTH, Word, add_constants, add_constants_and_apply_ext_round,
add_constants_and_apply_inv_sbox, add_constants_and_apply_sbox, apply_inv_sbox, apply_mds,
apply_sbox,
};
use crate::hash::algebraic_spong... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/poseidon2/test.rs | miden-crypto/src/hash/algebraic_sponge/poseidon2/test.rs | use super::{Felt, ZERO};
use crate::hash::{algebraic_sponge::AlgebraicSponge, poseidon2::Poseidon2};
#[test]
fn permutation_test_vector() {
// tests that the current implementation is consistent with
// the reference [implementation](https://github.com/HorizenLabs/poseidon2) and uses
// the test vectors pr... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/poseidon2/mod.rs | miden-crypto/src/hash/algebraic_sponge/poseidon2/mod.rs | use super::{
AlgebraicSponge, CAPACITY_RANGE, DIGEST_RANGE, Felt, RATE_RANGE, Range, STATE_WIDTH, Word, ZERO,
};
use crate::field::PrimeCharacteristicRing;
mod constants;
use constants::{
ARK_EXT_INITIAL, ARK_EXT_TERMINAL, ARK_INT, MAT_DIAG, NUM_EXTERNAL_ROUNDS_HALF,
NUM_INTERNAL_ROUNDS,
};
#[cfg(test)]
m... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/algebraic_sponge/poseidon2/constants.rs | miden-crypto/src/hash/algebraic_sponge/poseidon2/constants.rs | use super::{Felt, STATE_WIDTH};
// HASH FUNCTION DEFINING CONSTANTS
// ================================================================================================
/// Number of external rounds.
pub(crate) const NUM_EXTERNAL_ROUNDS: usize = 8;
/// Number of either initial or terminal external rounds.
pub(crate) c... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/keccak/tests.rs | miden-crypto/src/hash/keccak/tests.rs | #![cfg(feature = "std")]
use alloc::vec::Vec;
use proptest::prelude::*;
use super::*;
use crate::rand::test_utils::rand_vector;
#[test]
fn keccak256_hash_elements() {
// test multiple of 8
let elements = rand_vector::<Felt>(16);
let expected = compute_expected_element_hash(&elements);
let actual: [u8... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/hash/keccak/mod.rs | miden-crypto/src/hash/keccak/mod.rs | use alloc::string::String;
use core::{
mem::size_of,
ops::Deref,
slice::{self, from_raw_parts},
};
use p3_field::BasedVectorSpace;
use sha3::Digest as Sha3Digest;
use super::{Felt, HasherExt};
use crate::{
field::PrimeField64,
utils::{
ByteReader, ByteWriter, Deserializable, Deserializatio... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/word/tests.rs | miden-crypto/src/word/tests.rs | #![cfg(feature = "std")]
use alloc::string::String;
use p3_field::PrimeCharacteristicRing;
use super::{Deserializable, Felt, Serializable, WORD_SIZE_BYTES, WORD_SIZE_FELT, Word};
use crate::{rand::test_utils::rand_value, utils::SliceReader, word};
// TESTS
// =========================================================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/word/lexicographic.rs | miden-crypto/src/word/lexicographic.rs | use core::cmp::Ordering;
use p3_field::PrimeField64;
use super::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable};
use crate::{Felt, WORD_SIZE, Word};
// LEXICOGRAPHIC WORD
// ================================================================================================
/// A [`Word`] w... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/word/mod.rs | miden-crypto/src/word/mod.rs | //! A [Word] type used in the Miden protocol and associated utilities.
use alloc::{string::String, vec::Vec};
use core::{
cmp::Ordering,
fmt::Display,
hash::{Hash, Hasher},
ops::{Deref, DerefMut, Index, IndexMut, Range},
slice,
};
use thiserror::Error;
const WORD_SIZE_FELT: usize = 4;
const WORD_... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/node.rs | miden-crypto/src/merkle/node.rs | use super::Word;
/// Representation of a node with two children used for iterating over containers.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(test, derive(PartialOrd, Ord))]
pub struct InnerNodeInfo {
pub value: Word,
pub left... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/path.rs | miden-crypto/src/merkle/path.rs | use alloc::vec::Vec;
use core::{
num::NonZero,
ops::{Deref, DerefMut},
};
use super::{InnerNodeInfo, MerkleError, NodeIndex, Rpo256, Word};
use crate::utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable};
// MERKLE PATH
// ========================================================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/index.rs | miden-crypto/src/merkle/index.rs | use core::fmt::Display;
use p3_field::PrimeField64;
use super::{Felt, MerkleError, Word};
use crate::utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable};
// NODE INDEX
// ================================================================================================
/// Address to a... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/empty_roots.rs | miden-crypto/src/merkle/empty_roots.rs | use core::slice;
use super::{EMPTY_WORD, Felt, Word, smt::InnerNode};
// EMPTY NODES SUBTREES
// ================================================================================================
/// Contains precomputed roots of empty subtrees in a Merkle tree.
pub struct EmptySubtreeRoots;
impl EmptySubtreeRoots {
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/sparse_path.rs | miden-crypto/src/merkle/sparse_path.rs | use alloc::{borrow::Cow, vec::Vec};
use core::{
iter::{self, FusedIterator},
num::NonZero,
};
use super::{
EmptySubtreeRoots, InnerNodeInfo, MerkleError, MerklePath, NodeIndex, Word, smt::SMT_MAX_DEPTH,
};
use crate::{
hash::rpo::Rpo256,
utils::{ByteReader, ByteWriter, Deserializable, Deserializati... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/error.rs | miden-crypto/src/merkle/error.rs | use alloc::string::String;
use thiserror::Error;
use super::{NodeIndex, Word, smt::MAX_LEAF_ENTRIES};
#[derive(Debug, Error)]
pub enum MerkleError {
#[error("expected merkle root {expected_root} found {actual_root}")]
ConflictingRoots { expected_root: Word, actual_root: Word },
#[error("provided merkle t... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mod.rs | miden-crypto/src/merkle/mod.rs | //! Data structures related to Merkle trees based on RPO256 hash function.
use super::{EMPTY_WORD, Felt, Word, hash::rpo::Rpo256};
// SUBMODULES
// ================================================================================================
mod empty_roots;
mod error;
mod index;
mod merkle_tree;
mod node;
mod pa... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/merkle_tree.rs | miden-crypto/src/merkle/merkle_tree.rs | use alloc::{string::String, vec::Vec};
use core::{fmt, slice};
use super::{InnerNodeInfo, MerkleError, MerklePath, NodeIndex, Rpo256, Word};
use crate::utils::{uninit_vector, word_to_hex};
// MERKLE TREE
// ================================================================================================
/// A fully-b... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/proof.rs | miden-crypto/src/merkle/mmr/proof.rs | /// The representation of a single Merkle path.
use super::super::MerklePath;
use super::forest::Forest;
use crate::Word;
// MMR PROOF
// ================================================================================================
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Dese... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/tests.rs | miden-crypto/src/merkle/mmr/tests.rs | use alloc::vec::Vec;
use assert_matches::assert_matches;
use super::{
super::{InnerNodeInfo, Rpo256, Word},
Mmr, MmrError, MmrPeaks, PartialMmr,
};
use crate::{
Felt,
merkle::{
MerklePath, MerkleTree, NodeIndex, int_to_node,
mmr::{
InOrderIndex, MmrPath, MmrProof,
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/delta.rs | miden-crypto/src/merkle/mmr/delta.rs | use alloc::vec::Vec;
use super::{super::Word, forest::Forest};
/// Container for the update data of a [super::PartialMmr]
#[derive(Debug)]
pub struct MmrDelta {
/// The new version of the [super::Mmr]
pub forest: Forest,
/// Update data.
///
/// The data is packed as follows:
/// 1. All the e... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/forest.rs | miden-crypto/src/merkle/mmr/forest.rs | use core::{
fmt::{Binary, Display},
ops::{BitAnd, BitOr, BitXor, BitXorAssign},
};
use super::InOrderIndex;
use crate::{
Felt,
field::PrimeField64,
utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable},
};
/// A compact representation of trees in a forest. Used in the... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/error.rs | miden-crypto/src/merkle/mmr/error.rs | use alloc::string::String;
use thiserror::Error;
use crate::merkle::MerkleError;
#[derive(Debug, Error)]
pub enum MmrError {
#[error("mmr does not contain position {0}")]
PositionNotFound(usize),
#[error("mmr peaks are invalid: {0}")]
InvalidPeaks(String),
#[error("mmr forest is out of bounds: re... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/mod.rs | miden-crypto/src/merkle/mmr/mod.rs | //! Merkle Mountain Range (MMR) data structures.
mod delta;
mod error;
mod forest;
mod full;
mod inorder;
mod partial;
mod peaks;
mod proof;
#[cfg(test)]
mod tests;
// REEXPORTS
// ================================================================================================
pub use delta::MmrDelta;
pub use error:... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/partial.rs | miden-crypto/src/merkle/mmr/partial.rs | use alloc::{
collections::{BTreeMap, BTreeSet},
vec::Vec,
};
use super::{MmrDelta, MmrPath};
use crate::{
Word,
merkle::{
InnerNodeInfo, MerklePath, Rpo256,
mmr::{InOrderIndex, MmrError, MmrPeaks, forest::Forest},
},
utils::{ByteReader, ByteWriter, Deserializable, Serializable},... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/peaks.rs | miden-crypto/src/merkle/mmr/peaks.rs | use alloc::vec::Vec;
use crate::{
Felt, Word, ZERO,
hash::rpo::Rpo256,
merkle::mmr::{Forest, MmrError, MmrProof},
};
// MMR PEAKS
// ================================================================================================
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/inorder.rs | miden-crypto/src/merkle/mmr/inorder.rs | //! Index for nodes of a binary tree based on an in-order tree walk.
//!
//! In-order walks have the parent node index split its left and right subtrees. All the left
//! children have indexes lower than the parent, meanwhile all the right subtree higher indexes.
//! This property makes it is easy to compute changes to... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/mmr/full.rs | miden-crypto/src/merkle/mmr/full.rs | //! A fully materialized Merkle mountain range (MMR).
//!
//! A MMR is a forest structure, i.e. it is an ordered set of disjoint rooted trees. The trees are
//! ordered by size, from the most to least number of leaves. Every tree is a perfect binary tree,
//! meaning a tree has all its leaves at the same depth, and eve... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/store/tests.rs | miden-crypto/src/merkle/store/tests.rs | #![cfg(feature = "std")]
use assert_matches::assert_matches;
use seq_macro::seq;
#[cfg(feature = "std")]
use {
super::{Deserializable, Serializable},
alloc::boxed::Box,
std::error::Error,
};
use super::{
EmptySubtreeRoots, MerkleError, MerklePath, MerkleStore, NodeIndex, PartialMerkleTree, Rpo256,
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/store/mod.rs | miden-crypto/src/merkle/store/mod.rs | //! Merkle store for efficiently storing multiple Merkle trees with common subtrees.
use alloc::vec::Vec;
use core::borrow::Borrow;
use super::{
EmptySubtreeRoots, InnerNodeInfo, MerkleError, MerklePath, MerkleProof, MerkleTree, NodeIndex,
PartialMerkleTree, RootPath, Rpo256, Word,
mmr::Mmr,
smt::{Sim... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/partial_mt/tests.rs | miden-crypto/src/merkle/partial_mt/tests.rs | use alloc::{collections::BTreeMap, vec::Vec};
use super::{
super::{
MerkleError, MerkleTree, NodeIndex, PartialMerkleTree, int_to_node, store::MerkleStore,
},
Deserializable, InnerNodeInfo, MerkleProof, Serializable, Word,
};
// TEST DATA
// ========================================================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/partial_mt/mod.rs | miden-crypto/src/merkle/partial_mt/mod.rs | use alloc::{
collections::{BTreeMap, BTreeSet},
string::String,
vec::Vec,
};
use core::fmt;
use super::{
EMPTY_WORD, InnerNodeInfo, MerkleError, MerklePath, MerkleProof, NodeIndex, Rpo256, Word,
};
use crate::utils::{
ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable, word_... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/mod.rs | miden-crypto/src/merkle/smt/mod.rs | //! Sparse Merkle Tree (SMT) data structures.
use alloc::vec::Vec;
use core::{
fmt::{self, Display},
hash::Hash,
};
use super::{EmptySubtreeRoots, InnerNodeInfo, MerkleError, NodeIndex, SparseMerklePath};
use crate::{
EMPTY_WORD, Map, Word,
hash::rpo::Rpo256,
utils::{ByteReader, ByteWriter, Deseri... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/partial/tests.rs | miden-crypto/src/merkle/smt/partial/tests.rs | use alloc::collections::{BTreeMap, BTreeSet};
use assert_matches::assert_matches;
use super::{PartialSmt, SMT_DEPTH};
#[cfg(any(test, feature = "std"))]
use crate::rand::test_utils::{rand_array, rand_value};
use crate::{
EMPTY_WORD, Felt, ONE, Word, ZERO,
merkle::{
EmptySubtreeRoots, MerkleError,
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/partial/mod.rs | miden-crypto/src/merkle/smt/partial/mod.rs | use super::{EmptySubtreeRoots, LeafIndex, SMT_DEPTH};
use crate::{
EMPTY_WORD, Word,
merkle::{
InnerNodeInfo, MerkleError, NodeIndex, SparseMerklePath,
smt::{InnerNode, InnerNodes, Leaves, SmtLeaf, SmtLeafError, SmtProof},
},
utils::{ByteReader, ByteWriter, Deserializable, Deserializatio... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/forest/store.rs | miden-crypto/src/merkle/smt/forest/store.rs | use alloc::vec::Vec;
use crate::{
Map, Word,
hash::rpo::Rpo256,
merkle::{EmptySubtreeRoots, MerkleError, MerklePath, MerkleProof, NodeIndex, smt::SMT_DEPTH},
};
// SMT FOREST STORE
// ================================================================================================
#[derive(Debug, Default,... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/forest/tests.rs | miden-crypto/src/merkle/smt/forest/tests.rs | use assert_matches::assert_matches;
use itertools::Itertools;
use super::{EmptySubtreeRoots, MerkleError, SmtForest, Word};
use crate::{
Felt, ONE, WORD_SIZE, ZERO,
merkle::{
int_to_node,
smt::{SMT_DEPTH, SmtProofError},
},
};
// TESTS
// ===================================================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/forest/mod.rs | miden-crypto/src/merkle/smt/forest/mod.rs | use alloc::{collections::BTreeSet, vec::Vec};
use super::{EmptySubtreeRoots, MerkleError, NodeIndex, SmtLeaf, SmtProof, Word};
use crate::{
Map,
merkle::smt::{LeafIndex, SMT_DEPTH, SmtLeafError, SmtProofError, forest::store::SmtStore},
};
mod store;
#[cfg(test)]
mod tests;
// SPARSE MERKLE TREE FOREST
// ==... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/leaf.rs | miden-crypto/src/merkle/smt/full/leaf.rs | use alloc::{string::ToString, vec::Vec};
use core::cmp::Ordering;
use super::EMPTY_WORD;
use crate::{
Felt, Word,
field::PrimeField64,
hash::rpo::Rpo256,
merkle::smt::{LeafIndex, MAX_LEAF_ENTRIES, SMT_DEPTH, SmtLeafError},
utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serial... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/proof.rs | miden-crypto/src/merkle/smt/full/proof.rs | use alloc::string::ToString;
use super::{SMT_DEPTH, SmtLeaf, SmtProofError, SparseMerklePath, Word};
use crate::{
merkle::InnerNodeInfo,
utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable},
};
/// A proof which can be used to assert presence (or absence) of key-value pairs
/// ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/tests.rs | miden-crypto/src/merkle/smt/full/tests.rs | use alloc::vec::Vec;
use assert_matches::assert_matches;
use p3_field::PrimeCharacteristicRing;
use super::{EMPTY_WORD, LeafIndex, NodeIndex, SMT_DEPTH, Smt, SmtLeaf};
use crate::{
Felt, ONE, WORD_SIZE, Word,
hash::rpo::Rpo256,
merkle::{
EmptySubtreeRoots,
smt::{
Map, MutationS... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/error.rs | miden-crypto/src/merkle/smt/full/error.rs | use thiserror::Error;
use crate::{
Word,
merkle::smt::{LeafIndex, MAX_LEAF_ENTRIES, SMT_DEPTH},
};
// SMT LEAF ERROR
// =================================================================================================
/// Errors that can occur when constructing or validating SMT leaves.
#[derive(Debug, Error... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/mod.rs | miden-crypto/src/merkle/smt/full/mod.rs | use alloc::{string::ToString, vec::Vec};
use super::{
EMPTY_WORD, EmptySubtreeRoots, InnerNode, InnerNodeInfo, InnerNodes, LeafIndex, MerkleError,
MutationSet, NodeIndex, SparseMerklePath, SparseMerkleTree, Word,
};
use crate::field::PrimeField64;
mod error;
pub use error::{SmtLeafError, SmtProofError};
mod ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/concurrent/tests.rs | miden-crypto/src/merkle/smt/full/concurrent/tests.rs | #![cfg(feature = "std")]
use alloc::{
collections::{BTreeMap, BTreeSet},
vec::Vec,
};
use assert_matches::assert_matches;
use proptest::prelude::*;
use rand::{Rng, prelude::IteratorRandom, rng};
use super::{
COLS_PER_SUBTREE, InnerNode, Map, NodeIndex, NodeMutations, PairComputations, SMT_DEPTH,
SUBT... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/full/concurrent/mod.rs | miden-crypto/src/merkle/smt/full/concurrent/mod.rs | use alloc::vec::Vec;
use core::mem;
use num::Integer;
use rayon::prelude::*;
use super::{
EmptySubtreeRoots, InnerNode, InnerNodes, Leaves, MerkleError, MutationSet, NodeIndex,
SMT_DEPTH, Smt, SmtLeaf, SparseMerkleTree, Word, leaf,
};
use crate::merkle::smt::{Map, NodeMutation, NodeMutations, SmtLeafError};
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large_forest/error.rs | miden-crypto/src/merkle/smt/large_forest/error.rs | //! This module contains the error types and helpers for working with errors from the large SMT
//! forest.
use thiserror::Error;
use crate::merkle::{MerkleError, smt::large_forest::history::error::HistoryError};
/// The errors returned by operations on the large SMT forest.
///
/// This type primarily serves to wra... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large_forest/mod.rs | miden-crypto/src/merkle/smt/large_forest/mod.rs | //! A high-performance sparse merkle tree forest backed by pluggable storage.
mod error;
mod history;
pub use error::LargeSmtForestError;
pub use history::{History, HistoryView, error::HistoryError};
| rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large_forest/history/tests.rs | miden-crypto/src/merkle/smt/large_forest/history/tests.rs | #![cfg(feature = "std")]
//! The functional tests for the history component.
use p3_field::PrimeCharacteristicRing;
use super::{CompactLeaf, History, LeafChanges, NodeChanges, error::Result};
use crate::{
Felt, Word,
merkle::{NodeIndex, smt::LeafIndex},
rand::test_utils::rand_value,
};
// TESTS
// ======... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large_forest/history/error.rs | miden-crypto/src/merkle/smt/large_forest/history/error.rs | //! The error type and utility types for working with errors from the SMT history construct.
use thiserror::Error;
use crate::merkle::smt::large_forest::history::VersionId;
/// The type of errors returned by the history container.
#[derive(Debug, Error, PartialEq)]
pub enum HistoryError {
/// Raised when a query ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large_forest/history/mod.rs | miden-crypto/src/merkle/smt/large_forest/history/mod.rs | //! This module contains the definition of [`History`], a simple container for some number of
//! historical versions of a given merkle tree.
//!
//! This history consists of a series of _deltas_ from the current state of the tree, moving
//! backward in history away from that current state. These deltas are then used ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/batch_ops.rs | miden-crypto/src/merkle/smt/large/batch_ops.rs | use alloc::vec::Vec;
use core::mem;
use num::Integer;
use rayon::prelude::*;
use super::{
IN_MEMORY_DEPTH, LargeSmt, LargeSmtError, LoadedLeaves, MutatedLeaves, ROOT_MEMORY_INDEX,
SMT_DEPTH, SmtStorage, StorageUpdates, Subtree, SubtreeUpdate,
};
use crate::{
Word,
merkle::smt::{
EmptySubtreeRo... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/tests.rs | miden-crypto/src/merkle/smt/large/tests.rs | use alloc::{collections::BTreeSet, vec::Vec};
use p3_field::PrimeCharacteristicRing;
use rand::{Rng, prelude::IteratorRandom, rng};
use super::MemoryStorage;
use crate::{
EMPTY_WORD, Felt, ONE, WORD_SIZE, Word,
field::PrimeField64,
merkle::{
InnerNodeInfo,
smt::{
LargeSmt, Leaf... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/error.rs | miden-crypto/src/merkle/smt/large/error.rs | use thiserror::Error;
use super::{MerkleError, StorageError};
use crate::Word;
// ERROR TYPES
// ================================================================================================
/// Errors that can occur during LargeSmt operations.
#[derive(Debug, Error)]
pub enum LargeSmtError {
/// A Merkle tre... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/mod.rs | miden-crypto/src/merkle/smt/large/mod.rs | //! Large-scale Sparse Merkle Tree backed by pluggable storage.
//!
//! `LargeSmt` stores the top of the tree (depths 0–23) in memory and persists the lower
//! depths (24–64) in storage as fixed-size subtrees. This hybrid layout scales beyond RAM
//! while keeping common operations fast. With the `rocksdb` feature ena... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/smt_trait.rs | miden-crypto/src/merkle/smt/large/smt_trait.rs | use alloc::vec::Vec;
use p3_field::PrimeField64;
use super::{
IN_MEMORY_DEPTH, LargeSmt, NUM_SUBTREE_LEVELS, ROOT_MEMORY_INDEX, SMT_DEPTH, SmtStorage,
StorageError, Subtree,
};
use crate::{
EMPTY_WORD, Word,
merkle::smt::{
EmptySubtreeRoots, InnerNode, LargeSmtError, LeafIndex, Map, MerkleErro... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/property_tests.rs | miden-crypto/src/merkle/smt/large/property_tests.rs | use alloc::{
collections::{BTreeMap, BTreeSet},
vec::Vec,
};
use proptest::prelude::*;
use super::MemoryStorage;
use crate::{
EMPTY_WORD, Felt, ONE, Word, ZERO,
merkle::smt::{LargeSmt, LeafIndex, SMT_DEPTH},
};
// GENERATORS
// =========================================================================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/iter.rs | miden-crypto/src/merkle/smt/large/iter.rs | use alloc::{boxed::Box, vec::Vec};
use super::{IN_MEMORY_DEPTH, LargeSmt, SmtStorage, is_empty_parent};
use crate::{
Word,
merkle::{InnerNodeInfo, Rpo256, smt::large::subtree::Subtree},
};
// ITERATORS
// ================================================================================================
enum In... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/construction.rs | miden-crypto/src/merkle/smt/large/construction.rs | use alloc::vec::Vec;
use core::mem;
use rayon::prelude::*;
use super::{
CONSTRUCTION_SUBTREE_BATCH_SIZE, IN_MEMORY_DEPTH, LargeSmt, LargeSmtError, NUM_IN_MEMORY_NODES,
ROOT_MEMORY_INDEX, SMT_DEPTH, SmtStorage, StorageError, Subtree,
};
use crate::{
EMPTY_WORD, Word,
merkle::smt::{
EmptySubtree... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/storage/memory.rs | miden-crypto/src/merkle/smt/large/storage/memory.rs | use alloc::{boxed::Box, vec::Vec};
use super::{SmtStorage, StorageError, StorageUpdateParts, StorageUpdates, SubtreeUpdate};
use crate::{
EMPTY_WORD, Map, MapEntry, Word,
merkle::{
NodeIndex,
smt::{
InnerNode, SmtLeaf,
large::{IN_MEMORY_DEPTH, subtree::Subtree},
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/storage/error.rs | miden-crypto/src/merkle/smt/large/storage/error.rs | use alloc::{boxed::Box, string::String};
/// Errors returned by any `SmtStorage` implementation.
///
/// Categories:
/// - Backend errors (DB/I/O)
/// - Decode/length mismatches with expected/actual parameters
/// - Unsupported operations
/// - Higher-level value and subtree decode failures
#[derive(Debug, thiserror::... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/storage/mod.rs | miden-crypto/src/merkle/smt/large/storage/mod.rs | use alloc::{boxed::Box, vec::Vec};
use core::{
fmt,
ops::{Deref, DerefMut},
};
use crate::{
Word,
merkle::{
NodeIndex,
smt::{InnerNode, Map, SmtLeaf, large::subtree::Subtree},
},
};
mod error;
pub use error::StorageError;
#[cfg(feature = "rocksdb")]
mod rocksdb;
#[cfg(feature = "r... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/storage/rocksdb.rs | miden-crypto/src/merkle/smt/large/storage/rocksdb.rs | use alloc::{boxed::Box, vec::Vec};
use std::{path::PathBuf, sync::Arc};
use rocksdb::{
BlockBasedOptions, Cache, ColumnFamilyDescriptor, DB, DBCompactionStyle, DBCompressionType,
DBIteratorWithThreadMode, FlushOptions, IteratorMode, Options, ReadOptions, WriteBatch,
WriteOptions,
};
use super::{SmtStorage... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | true |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/storage/updates.rs | miden-crypto/src/merkle/smt/large/storage/updates.rs | use alloc::vec::Vec;
use crate::merkle::{
NodeIndex,
smt::{Map, SmtLeaf, large::subtree::Subtree},
};
/// Represents a storage update operation for a subtree.
///
/// Each variant explicitly indicates whether to store or delete a subtree at a given index.
#[derive(Debug, Clone)]
pub enum SubtreeUpdate {
/... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/subtree/tests.rs | miden-crypto/src/merkle/smt/large/subtree/tests.rs | use super::{InnerNode, NodeIndex, SUBTREE_DEPTH, Subtree};
use crate::Word;
#[test]
fn test_initial_state() {
let root_index = NodeIndex::new(SUBTREE_DEPTH, 0).unwrap();
let subtree = Subtree::new(root_index);
assert_eq!(subtree.root_index(), root_index, "Root index should match the provided index");
... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/subtree/error.rs | miden-crypto/src/merkle/smt/large/subtree/error.rs | use thiserror::Error;
#[derive(Debug, Error)]
pub enum SubtreeError {
#[error("invalid hash data length: expected {expected} bytes, found {found} bytes")]
BadHashLen { expected: usize, found: usize },
#[error("invalid left hash format at local index {index}")]
BadLeft { index: u8 },
#[error("invali... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/large/subtree/mod.rs | miden-crypto/src/merkle/smt/large/subtree/mod.rs | use alloc::vec::Vec;
use super::{EmptySubtreeRoots, InnerNode, InnerNodeInfo, NodeIndex, SMT_DEPTH};
use crate::{
Word,
merkle::smt::{Map, full::concurrent::SUBTREE_DEPTH},
};
mod error;
pub use error::SubtreeError;
#[cfg(test)]
mod tests;
/// Represents a complete 8-depth subtree that is serialized into a ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/simple/proof.rs | miden-crypto/src/merkle/smt/simple/proof.rs | use crate::{
Word,
merkle::{MerkleError, MerkleProof, SparseMerklePath},
};
/// A container for a [crate::Word] value and its [SparseMerklePath] opening.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct SimpleSmtProof {
/// The node value opening for `path`.
pub value: Word,
/// The path ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/simple/tests.rs | miden-crypto/src/merkle/smt/simple/tests.rs | use alloc::vec::Vec;
use assert_matches::assert_matches;
use super::{
super::{MerkleError, SimpleSmt, Word},
NodeIndex,
};
use crate::{
EMPTY_WORD,
hash::rpo::Rpo256,
merkle::{
EmptySubtreeRoots, InnerNodeInfo, MerklePath, MerkleTree, int_to_leaf, int_to_node,
smt::{LeafIndex, Spar... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/merkle/smt/simple/mod.rs | miden-crypto/src/merkle/smt/simple/mod.rs | use alloc::collections::BTreeSet;
use super::{
EMPTY_WORD, EmptySubtreeRoots, InnerNode, InnerNodeInfo, InnerNodes, LeafIndex, MerkleError,
MutationSet, NodeIndex, SMT_MAX_DEPTH, SMT_MIN_DEPTH, SparseMerkleTree, Word,
};
use crate::merkle::{SparseMerklePath, smt::SmtLeafError};
mod proof;
pub use proof::Simpl... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/utils/iterators.rs | miden-crypto/src/utils/iterators.rs | // Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
//! Components needed for parallel iterators.
//!
//! When `concurrent` feature is enabled, this module re-exports `rayon::prelude`. Other... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/utils/mod.rs | miden-crypto/src/utils/mod.rs | //! Utilities used in this crate which can also be generally useful downstream.
use alloc::{string::String, vec::Vec};
use core::fmt::{self, Write};
// Re-export serialization traits from miden-serde-utils
#[cfg(feature = "std")]
pub use miden_serde_utils::ReadAdapter;
pub use miden_serde_utils::{
ByteReader, Byt... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ecdh/mod.rs | miden-crypto/src/ecdh/mod.rs | //! ECDH (Elliptic Curve Diffie-Hellman) key agreement implementations.
use alloc::vec::Vec;
use rand::{CryptoRng, RngCore};
use thiserror::Error;
use crate::utils::{
Deserializable, Serializable,
zeroize::{Zeroize, ZeroizeOnDrop},
};
pub mod k256;
pub mod x25519;
// KEY AGREEMENT TRAIT
// ================... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ecdh/k256.rs | miden-crypto/src/ecdh/k256.rs | //! ECDH (Elliptic Curve Diffie-Hellman) key agreement implementation over k256
//! i.e., secp256k1 curve.
//!
//! Note that the intended use is in the context of a one-way, sender initiated key agreement
//! scenario. Namely, when the sender knows the (static) public key of the receiver and it
//! uses that, together ... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
0xMiden/crypto | https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/ecdh/x25519.rs | miden-crypto/src/ecdh/x25519.rs | //! X25519 (Elliptic Curve Diffie-Hellman) key agreement implementation using
//! Curve25519.
//!
//! Note that the intended use is in the context of a one-way, sender initiated key agreement
//! scenario. Namely, when the sender knows the (static) public key of the receiver and it
//! uses that, together with an ephem... | rust | Apache-2.0 | b30552ecceb5f70565cc0267fca227f30c5af7ab | 2026-01-04T20:24:48.363198Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.