mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 00:51:29 +01:00
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user