Skip to content

Commit

Permalink
Finish vector_commitment_decommit implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Jan 2, 2024
1 parent ace04a3 commit 5cdbdd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vector_commitment/vector_commitment.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ fn vector_commitment_decommit(
let shift = pow(2, commitment.config.height);
let shifted_queries = shift_queries(queries.span(), shift, commitment.config.height);

let root = compute_root_from_queries(shifted_queries, 0, commitment.config.n_verifier_friendly_commitment_layers, witness.authentications, 0);
root.print();
let expected_commitment = compute_root_from_queries(shifted_queries, 0, commitment.config.n_verifier_friendly_commitment_layers, witness.authentications, 0);

assert(expected_commitment == commitment.commitment_hash, 'decommitment failed');
}

// TODO: move to another file
Expand Down Expand Up @@ -90,6 +91,7 @@ fn compute_root_from_queries(
if current.index == 1 { // root
assert(current.depth == 0, 'root depth must be 0');
assert(start + 1 == queue.len(), 'root must be the last element');
assert(auth_start == authentications.len(), 'root must have no auth left');
return current.value;
}

Expand Down

0 comments on commit 5cdbdd3

Please sign in to comment.