File tree 6 files changed +5
-14
lines changed
6 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl Fp2Extension {
36
36
pub fn generate_complex_init ( & self , modular_config : & ModularExtension ) -> String {
37
37
fn get_index_of_modulus ( modulus : & BigUint , modular_config : & ModularExtension ) -> usize {
38
38
modular_config
39
- . supported_modulus
39
+ . supported_moduli
40
40
. iter ( )
41
41
. position ( |m| m == modulus)
42
42
. expect ( "Modulus used in Fp2Extension not found in ModularExtension" )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl ModularExtension {
36
36
// Generates a call to the moduli_init! macro with moduli in the correct order
37
37
pub fn generate_moduli_init ( & self ) -> String {
38
38
let supported_moduli = self
39
- . supported_modulus
39
+ . supported_moduli
40
40
. iter ( )
41
41
. map ( |modulus| format ! ( "\" {}\" " , modulus) )
42
42
. collect :: < Vec < String > > ( )
Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ use core::{
54
54
pub use field:: Field ;
55
55
#[ cfg( not( target_os = "zkvm" ) ) ]
56
56
use num_bigint:: BigUint ;
57
- pub use once_cell;
58
57
pub use openvm_algebra_complex_macros as complex_macros;
59
58
pub use openvm_algebra_moduli_macros as moduli_macros;
60
59
#[ cfg( target_os = "zkvm" ) ]
Original file line number Diff line number Diff line change @@ -1081,10 +1081,6 @@ pub fn moduli_init(input: TokenStream) -> TokenStream {
1081
1081
}
1082
1082
} ) ;
1083
1083
1084
- setup_all_moduli. push ( quote:: quote_spanned! { span. into( ) =>
1085
- #setup_function( ) ;
1086
- } ) ;
1087
-
1088
1084
setups. push ( quote:: quote_spanned! { span. into( ) =>
1089
1085
#[ allow( non_snake_case) ]
1090
1086
#[ no_mangle]
Original file line number Diff line number Diff line change @@ -14,13 +14,9 @@ openvm_algebra_moduli_macros::moduli_declare! {
14
14
}
15
15
}
16
16
17
- openvm_algebra_moduli_macros:: moduli_init!(
18
- "0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F"
19
- ) ;
17
+ openvm:: init!( ) ;
20
18
21
19
pub fn main ( ) {
22
- setup_all_moduli ( ) ;
23
-
24
20
let a = Secp256k1Coord :: from_u32 ( 4 ) ;
25
21
let sqrt = a. sqrt ( ) ;
26
22
assert_eq ! ( sqrt, Some ( Secp256k1Coord :: from_u32( 2 ) ) ) ;
Original file line number Diff line number Diff line change @@ -168,7 +168,8 @@ mod tests {
168
168
169
169
#[ test]
170
170
fn test_sqrt ( ) -> Result < ( ) > {
171
- let elf = build_example_program_at_path ( get_programs_dir ! ( ) , "sqrt" ) ?;
171
+ let config = Rv32ModularConfig :: new ( vec ! [ SECP256K1_CONFIG . modulus. clone( ) ] ) ;
172
+ let elf = build_example_program_at_path ( get_programs_dir ! ( ) , "sqrt" , & config) ?;
172
173
let openvm_exe = VmExe :: from_elf (
173
174
elf,
174
175
Transpiler :: < F > :: default ( )
@@ -177,7 +178,6 @@ mod tests {
177
178
. with_extension ( Rv32IoTranspilerExtension )
178
179
. with_extension ( ModularTranspilerExtension ) ,
179
180
) ?;
180
- let config = Rv32ModularConfig :: new ( vec ! [ SECP256K1_CONFIG . modulus. clone( ) ] ) ;
181
181
air_test ( config, openvm_exe) ;
182
182
Ok ( ( ) )
183
183
}
You can’t perform that action at this time.
0 commit comments