1
1
use crate :: {
2
- aggregation:: rlc :: POWS_OF_256 , aggregation :: util :: constrain_crt_equals_bytes ,
3
- blob_consistency :: BLOB_WIDTH , constants:: N_BYTES_U256 , BatchHash , ChunkInfo , RlcConfig ,
2
+ aggregation:: util :: constrain_crt_equals_bytes , blob_consistency :: BLOB_WIDTH ,
3
+ constants:: N_BYTES_U256 , BatchHash , ChunkInfo , RlcConfig ,
4
4
} ;
5
5
use eth_types:: { H256 , U256 } ;
6
6
use ethers_core:: utils:: keccak256;
@@ -579,6 +579,14 @@ impl<const N_SNARKS: usize> BatchDataConfig<N_SNARKS> {
579
579
region. constrain_equal ( four. cell ( ) , four_cell) ?;
580
580
four
581
581
} ;
582
+ let two_fifty_six = {
583
+ let two_fifty_six =
584
+ rlc_config. load_private ( region, & Fr :: from ( 256 ) , & mut rlc_config_offset) ?;
585
+ let two_fifty_six_cell = rlc_config. four_cell ( two_fifty_six. cell ( ) . region_index ) ;
586
+ region. constrain_equal ( two_fifty_six. cell ( ) , two_fifty_six_cell) ?;
587
+ two_fifty_six
588
+ } ;
589
+
582
590
let fixed_chunk_indices = {
583
591
let mut fixed_chunk_indices = vec ! [ one. clone( ) ] ;
584
592
for i in 2 ..=N_SNARKS {
@@ -594,22 +602,6 @@ impl<const N_SNARKS: usize> BatchDataConfig<N_SNARKS> {
594
602
} ;
595
603
let two = fixed_chunk_indices. get ( 1 ) . expect ( "N_SNARKS >= 2" ) ;
596
604
let n_snarks = fixed_chunk_indices. last ( ) . expect ( "N_SNARKS >= 2" ) ;
597
- let pows_of_256 = {
598
- let mut pows_of_256 = vec ! [ one. clone( ) ] ;
599
- for ( exponent, pow_of_256) in ( 1 ..=POWS_OF_256 ) . zip_eq (
600
- std:: iter:: successors ( Some ( Fr :: from ( 256 ) ) , |n| Some ( n * Fr :: from ( 256 ) ) )
601
- . take ( POWS_OF_256 ) ,
602
- ) {
603
- let pow_cell =
604
- rlc_config. load_private ( region, & pow_of_256, & mut rlc_config_offset) ?;
605
- let fixed_pow_cell = rlc_config
606
- . pow_of_two_hundred_and_fifty_six_cell ( pow_cell. cell ( ) . region_index , exponent) ;
607
- region. constrain_equal ( pow_cell. cell ( ) , fixed_pow_cell) ?;
608
- pows_of_256. push ( pow_cell) ;
609
- }
610
- pows_of_256
611
- } ;
612
- let two_fifty_six = pows_of_256[ 1 ] . clone ( ) ;
613
605
614
606
// read randomness challenges for RLC computations.
615
607
let r_keccak =
0 commit comments