diff --git a/Cargo.toml b/Cargo.toml index a836993b..ea6e842d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ plotters = { version = "0.3.0", optional = true } [dev-dependencies] criterion = "0.3" halo2_gadgets = { version = "=0.1.0-beta.3", features = ["test-dependencies"] } +hex = "0.4" proptest = "1.0.0" zcash_note_encryption = { version = "0.1", features = ["pre-zip-212"] } @@ -82,7 +83,7 @@ debug = true debug = true [patch.crates-io] -halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "72ff677776504c288f4927a6ce8d3c273ebd588d" } -halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "72ff677776504c288f4927a6ce8d3c273ebd588d" } +halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "30f92f3f4b785ea2a32392bf65c1b08f0411567c" } +halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "30f92f3f4b785ea2a32392bf65c1b08f0411567c" } incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "f23e3d89507849a24543121839eea6f40b141aff" } reddsa = { git = "https://github.com/ZcashFoundation/reddsa.git", rev = "0e912de3000fe165daf58ad98d1a22f1a66e7f18" } diff --git a/src/circuit.rs b/src/circuit.rs index 7accc42d..4bc1bc21 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -45,7 +45,7 @@ use crate::{ use halo2_gadgets::{ ecc::{ chip::{EccChip, EccConfig}, - FixedPoint, NonIdentityPoint, Point, + FixedPoint, NonIdentityPoint, Point, ScalarVar, }, poseidon::{Pow5Chip as PoseidonChip, Pow5Config as PoseidonConfig}, primitives::poseidon, @@ -504,11 +504,13 @@ impl plonk::Circuit for Circuit { rivk, )? }; + let ivk = + ScalarVar::from_base(ecc_chip.clone(), layouter.namespace(|| "ivk"), ivk.inner())?; // [ivk] g_d_old // The scalar value is passed through and discarded. let (derived_pk_d_old, _ivk) = - g_d_old.mul(layouter.namespace(|| "[ivk] g_d_old"), ivk.inner())?; + g_d_old.mul(layouter.namespace(|| "[ivk] g_d_old"), ivk)?; // Constrain derived pk_d_old to equal witnessed pk_d_old // diff --git a/src/constants/fixed_bases.rs b/src/constants/fixed_bases.rs index d6c7c770..af11e335 100644 --- a/src/constants/fixed_bases.rs +++ b/src/constants/fixed_bases.rs @@ -98,7 +98,7 @@ impl FixedPoints for OrchardFixedBases { } impl FixedPoint for OrchardFixedBasesFull { - type ScalarKind = FullScalar; + type FixedScalarKind = FullScalar; fn generator(&self) -> pallas::Affine { match self { @@ -129,7 +129,7 @@ impl FixedPoint for OrchardFixedBasesFull { } impl FixedPoint for NullifierK { - type ScalarKind = BaseFieldElem; + type FixedScalarKind = BaseFieldElem; fn generator(&self) -> pallas::Affine { nullifier_k::generator() @@ -145,7 +145,7 @@ impl FixedPoint for NullifierK { } impl FixedPoint for ValueCommitV { - type ScalarKind = ShortScalar; + type FixedScalarKind = ShortScalar; fn generator(&self) -> pallas::Affine { value_commit_v::generator()