Minor fixes

This commit is contained in:
wborgeaud 2021-04-29 08:18:31 +02:00
parent 8590407764
commit fd3e8bcd4c
2 changed files with 6 additions and 1 deletions

View File

@ -246,7 +246,7 @@ fn compute_evaluation<F: Field>(
// The answer is gotten by interpolating {(x*g^i, P(x*g^i))} and evaluating at beta.
let points = g
.powers()
.zip(evals.into_iter())
.zip(evals)
.map(|(y, e)| (x * y, e))
.collect::<Vec<_>>();
let barycentric_weights = barycentric_weights(&points);

View File

@ -29,6 +29,11 @@ pub(crate) fn verify_merkle_proof<F: Field>(
proof: &MerkleProof<F>,
reverse_bits: bool,
) -> Result<()> {
ensure!(
leaf_index >> proof.siblings.len() == 0,
"Merkle leaf index is too large."
);
let index = if reverse_bits {
crate::util::reverse_bits(leaf_index, proof.siblings.len())
} else {