Przeglądaj źródła

tests: Extend zkvm tests for zero_cond opcode.

parazyd 3 lat temu
rodzic
commit
5d9a954235
3 zmienionych plików z 6 dodań i 0 usunięć
  1. 4 0
      proof/opcodes.zk
  2. 1 0
      tests/halo2_vk_ser.rs
  3. 1 0
      tests/zkvm_opcodes.rs

+ 4 - 0
proof/opcodes.zk

@@ -38,6 +38,7 @@ circuit "Opcodes" {
 	value_commit2 = ec_add(vcv2, vcr2);
 	value_commit2 = ec_add(vcv2, vcr2);
 	constrain_equal_point(value_commit, value_commit2);
 	constrain_equal_point(value_commit, value_commit2);
 
 
+	zero = witness_base(0);
 	one = witness_base(1);
 	one = witness_base(1);
 	two = witness_base(2);
 	two = witness_base(2);
 	c = poseidon_hash(one, two, blind);
 	c = poseidon_hash(one, two, blind);
@@ -69,4 +70,7 @@ circuit "Opcodes" {
 
 
 	out = cond_select(cond, a, b);
 	out = cond_select(cond, a, b);
 	constrain_instance(out);
 	constrain_instance(out);
+
+	zz = zero_cond(zero, c);
+	constrain_instance(zz);
 }
 }

+ 1 - 0
tests/halo2_vk_ser.rs

@@ -147,6 +147,7 @@ fn halo2_vk_ser() -> Result<()> {
         ephem_x,
         ephem_x,
         ephem_y,
         ephem_y,
         a,
         a,
+        pallas::Base::ZERO,
     ];
     ];
 
 
     println!("Creating proof");
     println!("Creating proof");

+ 1 - 0
tests/zkvm_opcodes.rs

@@ -114,6 +114,7 @@ fn zkvm_opcodes() -> Result<()> {
         ephem_x,
         ephem_x,
         ephem_y,
         ephem_y,
         a,
         a,
+        pallas::Base::ZERO,
     ];
     ];
 
 
     let circuit = ZkCircuit::new(prover_witnesses, zkbin.clone());
     let circuit = ZkCircuit::new(prover_witnesses, zkbin.clone());