|
@@ -14,7 +14,7 @@ use halo2_gadgets::{
|
|
|
MerklePath,
|
|
MerklePath,
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- utilities::{lookup_range_check::LookupRangeCheckConfig, UtilitiesInstructions},
|
|
|
|
|
|
|
+ utilities::lookup_range_check::LookupRangeCheckConfig,
|
|
|
};
|
|
};
|
|
|
use halo2_proofs::{
|
|
use halo2_proofs::{
|
|
|
circuit::{AssignedCell, Layouter, SimpleFloorPlanner, Value},
|
|
circuit::{AssignedCell, Layouter, SimpleFloorPlanner, Value},
|
|
@@ -29,6 +29,7 @@ use super::gadget::{
|
|
|
even_bits::{EvenBitsChip, EvenBitsConfig, EvenBitsLookup},
|
|
even_bits::{EvenBitsChip, EvenBitsConfig, EvenBitsLookup},
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+use super::assign_free_advice;
|
|
|
pub use super::vm_stack::{StackVar, Witness};
|
|
pub use super::vm_stack::{StackVar, Witness};
|
|
|
use crate::{
|
|
use crate::{
|
|
|
crypto::constants::{
|
|
crypto::constants::{
|
|
@@ -116,10 +117,6 @@ impl ZkCircuit {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-impl UtilitiesInstructions<pallas::Base> for ZkCircuit {
|
|
|
|
|
- type Var = AssignedCell<Fp, Fp>;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
impl Circuit<pallas::Base> for ZkCircuit {
|
|
impl Circuit<pallas::Base> for ZkCircuit {
|
|
|
type Config = VmConfig;
|
|
type Config = VmConfig;
|
|
|
type FloorPlanner = SimpleFloorPlanner;
|
|
type FloorPlanner = SimpleFloorPlanner;
|
|
@@ -285,7 +282,7 @@ impl Circuit<pallas::Base> for ZkCircuit {
|
|
|
//let gt_chip = config.greaterthan_chip();
|
|
//let gt_chip = config.greaterthan_chip();
|
|
|
|
|
|
|
|
// This constant one is used for short multiplication
|
|
// This constant one is used for short multiplication
|
|
|
- let one = self.load_private(
|
|
|
|
|
|
|
+ let one = assign_free_advice(
|
|
|
layouter.namespace(|| "Load constant one"),
|
|
layouter.namespace(|| "Load constant one"),
|
|
|
config.advices[0],
|
|
config.advices[0],
|
|
|
Value::known(pallas::Base::one()),
|
|
Value::known(pallas::Base::one()),
|
|
@@ -337,7 +334,7 @@ impl Circuit<pallas::Base> for ZkCircuit {
|
|
|
|
|
|
|
|
Witness::Base(w) => {
|
|
Witness::Base(w) => {
|
|
|
debug!("Witnessing Base into circuit");
|
|
debug!("Witnessing Base into circuit");
|
|
|
- let base = self.load_private(
|
|
|
|
|
|
|
+ let base = assign_free_advice(
|
|
|
layouter.namespace(|| "Witness Base"),
|
|
layouter.namespace(|| "Witness Base"),
|
|
|
config.advices[0],
|
|
config.advices[0],
|
|
|
*w,
|
|
*w,
|