Skip to content

Commit

Permalink
feat(avm): add to avm_proving_test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasRidhuan committed Jun 14, 2024
1 parent 9ce0dce commit 0c94556
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ fn handle_black_box_function(avm_instrs: &mut Vec<AvmInstruction>, operation: &B
let num_points = points.size.0;
let scalars_offset = scalars.pointer.0;
// Output array is fixed to 3
assert!(outputs.size == &3u32, "Output array size must be equal to 3");
assert_eq!(outputs.size, 3, "Output array size must be equal to 3");
let outputs_offset = outputs.pointer.0;
avm_instrs.push(AvmInstruction {
opcode: AvmOpcode::MSM,
Expand Down
18 changes: 18 additions & 0 deletions yarn-project/bb-prover/src/avm_proving.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ describe('AVM WitGen, proof generation and verification', () => {
TIMEOUT,
);

/************************************************************************
* Avm Embedded Curve functions
************************************************************************/
describe('AVM Embedded Curve functions', () => {
// The functions have no inputs for now, but we might change that in the future for more flexible testing.
const avmEmbeddedCurveFunctions: [string, Fr[]][] = [
['elliptic_curve_add_and_double', []],
['variable_base_msm', []],
];
it.each(avmEmbeddedCurveFunctions)(
'Should prove %s',
async (name, _) => {
await proveAndVerifyAvmTestContract(name);
},
TIMEOUT,
);
});

/************************************************************************
* AvmContext functions
************************************************************************/
Expand Down

0 comments on commit 0c94556

Please sign in to comment.