Skip to content

Commit

Permalink
modify solidity verifier to use ProofData and not slice proof
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Oct 5, 2023
1 parent f6860ec commit fe32f77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import toml from 'toml';
import { compile, init_log_level as compilerLogLevel } from '@noir-lang/noir_wasm';
import { Noir } from '@noir-lang/noir_js';
import { BarretenbergBackend } from '@noir-lang/backend_barretenberg';
import { separatePublicInputsFromProof } from '../shared/proof';

compilerLogLevel('INFO');

Expand Down Expand Up @@ -44,19 +43,18 @@ test_cases.forEach((testInfo) => {
const prover_toml = readFileSync(resolve(`${base_relative_path}/${test_case}/Prover.toml`)).toString();
const inputs = toml.parse(prover_toml);

const proofWithPublicInputs = await program.generateFinalProof(inputs);
const proofData = await program.generateFinalProof(inputs);

// JS verification

const verified = await program.verifyFinalProof(proofWithPublicInputs);
const verified = await program.verifyFinalProof(proofData);
expect(verified, 'Proof fails verification in JS').to.be.true;

// Smart contract verification

const contract = await ethers.deployContract(testInfo.compiled, [], {});

const { proof, publicInputs } = separatePublicInputsFromProof(proofWithPublicInputs, testInfo.numPublicInputs);
const result = await contract.verify(proof, publicInputs);
const result = await contract.verify(proofData.proof, proofData.publicInputs);

expect(result).to.be.true;
});
Expand Down
17 changes: 0 additions & 17 deletions compiler/integration-tests/test/shared/proof.ts

This file was deleted.

0 comments on commit fe32f77

Please sign in to comment.