mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 09:01:29 +01:00
refactor: flattened repo structure
This commit is contained in:
29
src/merkle/mod.rs
Normal file
29
src/merkle/mod.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use crate::Word;
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::{Felt, ZERO};
|
||||
|
||||
pub mod merkle_path_set;
|
||||
pub mod merkle_tree;
|
||||
|
||||
// ERRORS
|
||||
// ================================================================================================
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum MerkleError {
|
||||
DepthTooSmall,
|
||||
DepthTooBig(u32),
|
||||
NumLeavesNotPowerOfTwo(usize),
|
||||
InvalidIndex(u32, u64),
|
||||
InvalidDepth(u32, u32),
|
||||
InvalidPath(Vec<Word>),
|
||||
NodeNotInSet(u64),
|
||||
}
|
||||
|
||||
// HELPER FUNCTIONS
|
||||
// ================================================================================================
|
||||
|
||||
#[cfg(test)]
|
||||
const fn int_to_node(value: u64) -> Word {
|
||||
[Felt::new(value), ZERO, ZERO, ZERO]
|
||||
}
|
||||
Reference in New Issue
Block a user