Просмотр исходного кода

Use patched halo2_gadgets project-wide.

parazyd 3 лет назад
Родитель
Сommit
411d25aa85
5 измененных файлов с 7 добавлено и 5 удалено
  1. 1 2
      Cargo.lock
  2. 1 0
      Cargo.toml
  3. 2 1
      proof/opcodes.zk
  4. 1 0
      src/sdk/Cargo.toml
  5. 2 2
      tests/zkvm_opcodes.rs

+ 1 - 2
Cargo.lock

@@ -2363,8 +2363,7 @@ dependencies = [
 [[package]]
 [[package]]
 name = "halo2_gadgets"
 name = "halo2_gadgets"
 version = "0.3.0"
 version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126a150072b0c38c7b573fe3eaf0af944a7fed09e154071bf2436d3f016f7230"
+source = "git+https://github.com/parazyd/halo2?branch=v3#481f00066dbfa5199195062b7d1f497db0281c16"
 dependencies = [
 dependencies = [
  "arrayvec",
  "arrayvec",
  "bitvec",
  "bitvec",

+ 1 - 0
Cargo.toml

@@ -327,3 +327,4 @@ required-features = ["zk"]
 
 
 [patch.crates-io]
 [patch.crates-io]
 halo2_proofs = {git="https://github.com/parazyd/halo2", branch="v3"}
 halo2_proofs = {git="https://github.com/parazyd/halo2", branch="v3"}
+halo2_gadgets = {git="https://github.com/parazyd/halo2", branch="v3"}

+ 2 - 1
proof/opcodes.zk

@@ -37,7 +37,8 @@ circuit "Opcodes" {
 	constrain_equal_point(value_commit, value_commit2);
 	constrain_equal_point(value_commit, value_commit2);
 
 
 	one = witness_base(1);
 	one = witness_base(1);
-	c = poseidon_hash(one, blind);
+	two = witness_base(2);
+	c = poseidon_hash(one, two, blind);
 	constrain_instance(c);
 	constrain_instance(c);
 
 
 	d = poseidon_hash(one, blind, ec_get_x(value_commit), ec_get_y(value_commit));
 	d = poseidon_hash(one, blind, ec_get_x(value_commit), ec_get_y(value_commit));

+ 1 - 0
src/sdk/Cargo.toml

@@ -44,3 +44,4 @@ rand = "0.8.5"
 
 
 [patch.crates-io]
 [patch.crates-io]
 halo2_proofs = {git="https://github.com/parazyd/halo2", branch="v3"}
 halo2_proofs = {git="https://github.com/parazyd/halo2", branch="v3"}
+halo2_gadgets = {git="https://github.com/parazyd/halo2", branch="v3"}

+ 2 - 2
tests/zkvm_opcodes.rs

@@ -61,8 +61,8 @@ fn zkvm_opcodes() -> Result<()> {
     let c1 = pallas::Base::random(&mut OsRng);
     let c1 = pallas::Base::random(&mut OsRng);
     let c3 = pallas::Base::random(&mut OsRng);
     let c3 = pallas::Base::random(&mut OsRng);
     let c2 = {
     let c2 = {
-        let messages = [pallas::Base::one(), blind];
-        poseidon::Hash::<_, P128Pow5T3, ConstantLength<2>, 3, 2>::init().hash(messages)
+        let messages = [pallas::Base::one(), pallas::Base::from(2), blind];
+        poseidon::Hash::<_, P128Pow5T3, ConstantLength<3>, 3, 2>::init().hash(messages)
     };
     };
 
 
     tree.append(&MerkleNode::from(c0));
     tree.append(&MerkleNode::from(c0));