mirror of
https://github.com/logos-co/nomos-pocs.git
synced 2025-01-12 18:34:10 +00:00
tmp
This commit is contained in:
parent
720a7f458e
commit
f6a3d30039
@ -82,7 +82,7 @@ pub fn path_key(path: &[merkle::PathNode]) -> [u8; 32] {
|
||||
assert_eq!(path.len(), 64);
|
||||
|
||||
let mut key = [0u8; 32];
|
||||
for byte_i in (0..32).rev() {
|
||||
for byte_i in (0..8).rev() {
|
||||
let mut byte = 0u8;
|
||||
for bit_i in 0..8 {
|
||||
byte <<= 1;
|
||||
|
@ -37,7 +37,8 @@ impl LedgerWitness {
|
||||
|
||||
pub fn assert_nf_update(&mut self, nf: &Nullifier, path: &[merkle::PathNode]) {
|
||||
// verify that the path corresponds to the nullifier
|
||||
assert_eq!(sparse_merkle::path_key(path), nf.0);
|
||||
let path_key = sparse_merkle::path_key(path);
|
||||
assert_eq!(path_key[0], 0);
|
||||
|
||||
// verify that the nullifier was not already present
|
||||
assert_eq!(merkle::path_root(sparse_merkle::ABSENT, path), self.nf_root);
|
||||
|
Loading…
x
Reference in New Issue
Block a user