Skip to content

Commit

Permalink
refactor(): Miscellaneous improvements from the Veridise audit
Browse files Browse the repository at this point in the history
  • Loading branch information
Xearty authored and Dimo99 committed Aug 30, 2024
1 parent 97e191b commit 9722257
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use plonky2::{
use plonky2_crypto::biguint::CircuitBuilderBiguint;

use super::first_level::{
DivaAccumulatedDataTarget, DepositAccumulatorBalanceAggregatorDivaFirstLevel,
DepositAccumulatorBalanceAggregatorDivaFirstLevel, DivaAccumulatedDataTarget,
};

pub struct DepositAccumulatorBalanceAggregatorDivaInnerLevel;
Expand All @@ -38,7 +38,7 @@ impl Circuit for DepositAccumulatorBalanceAggregatorDivaInnerLevel {
fn define(
builder: &mut CircuitBuilder<Self::F, D>,
circuit_data: &Self::Params,
) -> Self::Target where {
) -> Self::Target {
let proof1 = verify_proof(builder, &circuit_data);
let proof2 = verify_proof(builder, &circuit_data);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ mod test {
pw.set_proof_with_pis_target(&targets.bls_verification_proof, &bls_proof);

let s = Instant::now();
let proof = circuit.prove(pw).unwrap();
let _proof = circuit.prove(pw).unwrap();
println!("Proof generated in {:?}", s.elapsed());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ pub fn assert_merkle_proof_is_valid_const_sha256<
gindex: u64,
) {
let is_valid = validate_merkle_proof_const_sha256(builder, leaf, root, branch, gindex);
let _true = builder._true();
builder.connect(is_valid.target, _true.target);
builder.assert_true(is_valid);
}

pub fn hash_tree_root_sha256<F: RichField + Extendable<D>, const D: usize>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ abstract contract BalanceVerifier is Ownable, IBalanceVerifier {
bytes calldata proof,
uint256[] memory publicInputs
) internal {
// Make the call using `address(this).call`
(bool success, bytes memory returnData) = verifier.call(
// Encode the call to the `verify` function with the public inputs
abi.encodeWithSelector(PlonkVerifier.Verify.selector, proof, publicInputs)
Expand Down

0 comments on commit 9722257

Please sign in to comment.