From 5d9a9542359287b5b1aa589991f03c48b7d68dcf Mon Sep 17 00:00:00 2001 From: parazyd Date: Sat, 8 Jul 2023 11:12:57 +0200 Subject: [PATCH] tests: Extend zkvm tests for zero_cond opcode. --- proof/opcodes.zk | 4 ++++ tests/halo2_vk_ser.rs | 1 + tests/zkvm_opcodes.rs | 1 + 3 files changed, 6 insertions(+) diff --git a/proof/opcodes.zk b/proof/opcodes.zk index f43026661..cddb124d7 100644 --- a/proof/opcodes.zk +++ b/proof/opcodes.zk @@ -38,6 +38,7 @@ circuit "Opcodes" { value_commit2 = ec_add(vcv2, vcr2); constrain_equal_point(value_commit, value_commit2); + zero = witness_base(0); one = witness_base(1); two = witness_base(2); c = poseidon_hash(one, two, blind); @@ -69,4 +70,7 @@ circuit "Opcodes" { out = cond_select(cond, a, b); constrain_instance(out); + + zz = zero_cond(zero, c); + constrain_instance(zz); } diff --git a/tests/halo2_vk_ser.rs b/tests/halo2_vk_ser.rs index e7824f3cd..07998ac75 100644 --- a/tests/halo2_vk_ser.rs +++ b/tests/halo2_vk_ser.rs @@ -147,6 +147,7 @@ fn halo2_vk_ser() -> Result<()> { ephem_x, ephem_y, a, + pallas::Base::ZERO, ]; println!("Creating proof"); diff --git a/tests/zkvm_opcodes.rs b/tests/zkvm_opcodes.rs index e7d28180a..3b2645f67 100644 --- a/tests/zkvm_opcodes.rs +++ b/tests/zkvm_opcodes.rs @@ -114,6 +114,7 @@ fn zkvm_opcodes() -> Result<()> { ephem_x, ephem_y, a, + pallas::Base::ZERO, ]; let circuit = ZkCircuit::new(prover_witnesses, zkbin.clone());