Skip to content

Commit

Permalink
32 bits shift instead of 8
Browse files Browse the repository at this point in the history
  • Loading branch information
TAdev0 committed Aug 10, 2024
1 parent b85a7c5 commit 3739367
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/merkle_tree.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn merkle_root(ref txids: Array<Array<u32>>) -> u256 {
let mut i: u32 = 0;
while i != 8 {
let element: u256 = (*txid[i]).into();
root += shl(element, (8 * i));
root += shl(element, (32 * i));

i += 1;
};
Expand Down
1 change: 0 additions & 1 deletion src/utils.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ const TWO_POW_96: u128 = 0x1000000000000000000000000;

pub fn double_sha256(a: @Array<u32>, b: @Array<u32>) -> Array<u32> {
let mut input1: Array<u32> = array![];

input1.append_span(a.span());
input1.append_span(b.span());

Expand Down

0 comments on commit 3739367

Please sign in to comment.