@@ -64,7 +64,7 @@ use crate::operation::{MPTPath, SingleOp};
64
64
use halo2_proofs:: {
65
65
arithmetic:: Field ,
66
66
circuit:: { Chip , Layouter , Region , Value } ,
67
- ff:: { FromUniformBytes , PrimeField } ,
67
+ ff:: FromUniformBytes ,
68
68
plonk:: {
69
69
Advice , Column , ConstraintSystem , Error , Expression , Selector , TableColumn , VirtualCells ,
70
70
} ,
@@ -123,7 +123,7 @@ impl MPTOpTables {
123
123
)
124
124
}
125
125
126
- pub fn build_lookup_any < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
126
+ pub fn build_lookup_any < Fp : FromUniformBytes < 64 > + Ord > (
127
127
& self ,
128
128
enable : Expression < Fp > ,
129
129
rules : impl IntoIterator < Item = Expression < Fp > > ,
@@ -138,7 +138,7 @@ impl MPTOpTables {
138
138
ret
139
139
}
140
140
141
- pub fn build_lookup < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
141
+ pub fn build_lookup < Fp : FromUniformBytes < 64 > + Ord > (
142
142
& self ,
143
143
enable : Expression < Fp > ,
144
144
old : Expression < Fp > ,
@@ -148,7 +148,7 @@ impl MPTOpTables {
148
148
self . build_lookup_any ( enable, [ old, new] , mark)
149
149
}
150
150
151
- pub fn fill_constant < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
151
+ pub fn fill_constant < Fp : FromUniformBytes < 64 > + Ord > (
152
152
& self ,
153
153
layouter : & mut impl Layouter < Fp > ,
154
154
rules : impl Iterator < Item = ( [ u32 ; 3 ] , u32 ) > + Clone ,
@@ -207,7 +207,7 @@ impl HashTable {
207
207
self . 0 . map ( |col| col. index ( ) )
208
208
}
209
209
210
- pub fn build_lookup < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
210
+ pub fn build_lookup < Fp : FromUniformBytes < 64 > + Ord > (
211
211
& self ,
212
212
meta : & mut VirtualCells < ' _ , Fp > ,
213
213
enable : Expression < Fp > ,
@@ -239,7 +239,7 @@ impl HashTable {
239
239
240
240
/// a helper entry to fill hash table with specified rows, use padding record
241
241
/// when hashing_records is not enough
242
- pub fn dev_fill_with_paddings < ' d , Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
242
+ pub fn dev_fill_with_paddings < ' d , Fp : FromUniformBytes < 64 > + Ord > (
243
243
& self ,
244
244
layouter : & mut impl Layouter < Fp > ,
245
245
hashing_records : impl Iterator < Item = & ' d ( Fp , Fp , Fp ) > + Clone ,
@@ -256,7 +256,7 @@ impl HashTable {
256
256
}
257
257
258
258
/// a helper entry to fill hash table, only for dev (in using cases)
259
- pub fn dev_fill < ' d , Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
259
+ pub fn dev_fill < ' d , Fp : FromUniformBytes < 64 > + Ord > (
260
260
& self ,
261
261
layouter : & mut impl Layouter < Fp > ,
262
262
hashing_records : impl Iterator < Item = & ' d ( Fp , Fp , Fp ) > + Clone ,
@@ -349,7 +349,7 @@ impl MPTOpGadget {
349
349
}
350
350
351
351
/// if the gadget would be used only once, this entry is more easy
352
- pub fn configure_simple < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
352
+ pub fn configure_simple < Fp : FromUniformBytes < 64 > + Ord > (
353
353
meta : & mut ConstraintSystem < Fp > ,
354
354
sel : Selector ,
355
355
exported : & [ Column < Advice > ] ,
@@ -378,7 +378,7 @@ impl MPTOpGadget {
378
378
/// + s_op_flags * 6 (corresponding 6 ctrl_types)
379
379
/// + free col * 8
380
380
/// notice the gadget has bi-direction exporting (on top it exporting mpt root and bottom exporting leaf)
381
- pub fn configure < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
381
+ pub fn configure < Fp : FromUniformBytes < 64 > + Ord > (
382
382
meta : & mut ConstraintSystem < Fp > ,
383
383
sel : Selector ,
384
384
exported : & [ Column < Advice > ] ,
@@ -469,13 +469,13 @@ impl MPTOpGadget {
469
469
i1. chain ( i2)
470
470
}
471
471
472
- /* pub fn init<Fp: PrimeField + FromUniformBytes<64> + Ord>(&self, layouter: &mut impl Layouter<Fp>) -> Result<(), Error> {
472
+ /* pub fn init<Fp: FromUniformBytes<64> + Ord>(&self, layouter: &mut impl Layouter<Fp>) -> Result<(), Error> {
473
473
self.tables
474
474
.fill_constant(layouter, Self::transition_rules())
475
475
}*/
476
476
477
477
/// assign data and enable flag for MPT circuit
478
- pub fn assign < Fp : PrimeField + FromUniformBytes < 64 > + Ord > (
478
+ pub fn assign < Fp : FromUniformBytes < 64 > + Ord > (
479
479
& self ,
480
480
region : & mut Region < ' _ , Fp > ,
481
481
offset : usize ,
@@ -510,7 +510,7 @@ impl MPTOpGadget {
510
510
}
511
511
512
512
/*
513
- fn lagrange_polynomial_for_hashtype<Fp: PrimeField + FromUniformBytes<64> + Ord, const T: usize>(
513
+ fn lagrange_polynomial_for_hashtype<Fp: FromUniformBytes<64> + Ord, const T: usize>(
514
514
ref_n: Expression<Fp>,
515
515
) -> Expression<Fp> {
516
516
super::lagrange_polynomial::<Fp, T, 5 /* last Type: Leaf */>(ref_n)
@@ -531,14 +531,14 @@ struct PathChipConfig {
531
531
532
532
/// chip for verify mutiple merkle path in MPT
533
533
/// it do not need any auxiliary cols
534
- struct PathChip < ' d , F : PrimeField + FromUniformBytes < 64 > + Ord > {
534
+ struct PathChip < ' d , F : FromUniformBytes < 64 > + Ord > {
535
535
offset : usize ,
536
536
config : PathChipConfig ,
537
537
data : & ' d MPTPath < F > ,
538
538
ref_ctrl_type : Option < & ' d [ HashType ] > ,
539
539
}
540
540
541
- impl < Fp : PrimeField + FromUniformBytes < 64 > + Ord > Chip < Fp > for PathChip < ' _ , Fp > {
541
+ impl < Fp : FromUniformBytes < 64 > + Ord > Chip < Fp > for PathChip < ' _ , Fp > {
542
542
type Config = PathChipConfig ;
543
543
type Loaded = MPTPath < Fp > ;
544
544
@@ -551,7 +551,7 @@ impl<Fp: PrimeField + FromUniformBytes<64> + Ord> Chip<Fp> for PathChip<'_, Fp>
551
551
}
552
552
}
553
553
554
- impl < ' d , Fp : PrimeField + FromUniformBytes < 64 > + Ord > PathChip < ' d , Fp > {
554
+ impl < ' d , Fp : FromUniformBytes < 64 > + Ord > PathChip < ' d , Fp > {
555
555
fn configure (
556
556
meta : & mut ConstraintSystem < Fp > ,
557
557
g_config : & MPTOpConfig ,
@@ -854,13 +854,13 @@ struct OpChipConfig {
854
854
855
855
/// chip for verify mutiple merkle path in MPT
856
856
/// it do not need any auxiliary cols
857
- struct OpChip < ' d , F : PrimeField + FromUniformBytes < 64 > + Ord > {
857
+ struct OpChip < ' d , F : FromUniformBytes < 64 > + Ord > {
858
858
offset : usize ,
859
859
config : OpChipConfig ,
860
860
data : & ' d SingleOp < F > ,
861
861
}
862
862
863
- impl < Fp : PrimeField + FromUniformBytes < 64 > + Ord > Chip < Fp > for OpChip < ' _ , Fp > {
863
+ impl < Fp : FromUniformBytes < 64 > + Ord > Chip < Fp > for OpChip < ' _ , Fp > {
864
864
type Config = OpChipConfig ;
865
865
type Loaded = SingleOp < Fp > ;
866
866
@@ -873,7 +873,7 @@ impl<Fp: PrimeField + FromUniformBytes<64> + Ord> Chip<Fp> for OpChip<'_, Fp> {
873
873
}
874
874
}
875
875
876
- impl < ' d , Fp : PrimeField + FromUniformBytes < 64 > + Ord > OpChip < ' d , Fp > {
876
+ impl < ' d , Fp : FromUniformBytes < 64 > + Ord > OpChip < ' d , Fp > {
877
877
fn configure (
878
878
meta : & mut ConstraintSystem < Fp > ,
879
879
g_config : & MPTOpConfig ,
0 commit comments