Skip to content

Commit

Permalink
Fix Mpt Fuzz inputs processing
Browse files Browse the repository at this point in the history
  • Loading branch information
feltroidprime committed May 2, 2024
1 parent 0362001 commit 8368ecd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/fuzzing/mpt.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ func verify_n_mpt_proofs{
let (proof_bytes_len) = alloc();
local proof_len: felt;
local key: Uint256;
local key_leading_zeroes: felt;
local root: Uint256;

%{
from tools.py.utils import bytes_to_8_bytes_chunks_little, split_128, reverse_endian_256
from tools.py.utils import bytes_to_8_bytes_chunks_little, split_128, reverse_endian_256, count_leading_zero_nibbles_from_hex
def encode_proof(proof):
chunks = []
Expand Down Expand Up @@ -74,6 +75,7 @@ func verify_n_mpt_proofs{
ids.root.high = root_high
#handle key
ids.key_leading_zeroes = count_leading_zero_nibbles_from_hex(batch["key"])
(key_low, key_high) = split_128(int(batch["key"], 16))
ids.key.low = key_low
ids.key.high = key_high
Expand All @@ -83,10 +85,9 @@ func verify_n_mpt_proofs{
mpt_proof=proof,
mpt_proof_bytes_len=proof_bytes_len,
mpt_proof_len=proof_len,
key_little=key,
n_nibbles_already_checked=0,
node_index=0,
hash_to_assert=root,
key_be=key,
key_be_leading_zeroes_nibbles=key_leading_zeroes,
root=root,
pow2_array=pow2_array,
);

Expand Down

0 comments on commit 8368ecd

Please sign in to comment.