circuit.rs: Use BaseFitsInScalarInstructions for variable-base mul.

This commit is contained in:
therealyingtong 2022-04-19 12:58:48 +02:00 committed by Jack Grigg
parent 4e6200796e
commit 2f2bab5627
1 changed files with 4 additions and 2 deletions

View File

@ -45,7 +45,7 @@ use crate::{
use halo2_gadgets::{ use halo2_gadgets::{
ecc::{ ecc::{
chip::{EccChip, EccConfig}, chip::{EccChip, EccConfig},
FixedPoint, NonIdentityPoint, Point, FixedPoint, NonIdentityPoint, Point, ScalarVar,
}, },
poseidon::{Pow5Chip as PoseidonChip, Pow5Config as PoseidonConfig}, poseidon::{Pow5Chip as PoseidonChip, Pow5Config as PoseidonConfig},
primitives::poseidon, primitives::poseidon,
@ -504,11 +504,13 @@ impl plonk::Circuit<pallas::Base> for Circuit {
rivk, rivk,
)? )?
}; };
let ivk =
ScalarVar::from_base(ecc_chip.clone(), layouter.namespace(|| "ivk"), ivk.inner())?;
// [ivk] g_d_old // [ivk] g_d_old
// The scalar value is passed through and discarded. // The scalar value is passed through and discarded.
let (derived_pk_d_old, _ivk) = 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 // Constrain derived pk_d_old to equal witnessed pk_d_old
// //