mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 09:01:29 +01:00
@@ -57,7 +57,7 @@ impl MerklePathSet {
|
||||
let pos = 2u64.pow(self.total_depth) + index;
|
||||
|
||||
// Index of the leaf path in map. Paths of neighboring leaves are stored in one key-value pair
|
||||
let half_pos = (pos / 2) as u64;
|
||||
let half_pos = pos / 2;
|
||||
|
||||
let mut extended_path = path;
|
||||
if is_even(pos) {
|
||||
@@ -104,7 +104,7 @@ impl MerklePathSet {
|
||||
}
|
||||
|
||||
let pos = 2u64.pow(depth) + index;
|
||||
let index = (pos / 2) as u64;
|
||||
let index = pos / 2;
|
||||
|
||||
match self.paths.get(&index) {
|
||||
None => Err(MerkleError::NodeNotInSet(index)),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::MerkleError;
|
||||
use crate::{
|
||||
hash::{merge, Digest},
|
||||
log2, uninit_vector, Felt, FieldElement, Word,
|
||||
log2, uninit_vector, Felt, FieldElement, Vec, Word,
|
||||
};
|
||||
use core::slice;
|
||||
|
||||
@@ -80,7 +80,7 @@ impl MerkleTree {
|
||||
return Err(MerkleError::InvalidIndex(depth, index));
|
||||
}
|
||||
|
||||
let pos = 2usize.pow(depth as u32) + (index as usize);
|
||||
let pos = 2_usize.pow(depth) + (index as usize);
|
||||
Ok(self.nodes[pos])
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ impl MerkleTree {
|
||||
}
|
||||
|
||||
let mut path = Vec::with_capacity(depth as usize);
|
||||
let mut pos = 2usize.pow(depth as u32) + (index as usize);
|
||||
let mut pos = 2_usize.pow(depth) + (index as usize);
|
||||
|
||||
while pos > 1 {
|
||||
path.push(self.nodes[pos ^ 1]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::Word;
|
||||
use crate::{Vec, Word};
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::{Felt, ZERO};
|
||||
|
||||
Reference in New Issue
Block a user