2323
2424// Note: these will all currently be represented as bytes32 even though they could be smaller
2525openvm_algebra_guest:: moduli_macros:: moduli_declare! {
26- Seven { modulus = "7" } ,
27- Mod1e18 { modulus = "1000000000000000003" } ,
2826 Mersenne61 { modulus = "0x1fffffffffffffff" } ,
2927}
3028
@@ -67,7 +65,6 @@ fn materialize_ecc_chip<T: WeierstrassPoint + CyclicGroup>() {
6765pub fn main ( ) {
6866 // Since we don't explicitly call setup functions anymore, we must ensure every declared modulus
6967 // and curve chip is materialized.
70- materialize_modular_chip :: < Mod1e18 > ( ) ;
7168 materialize_modular_chip :: < Secp256k1Coord > ( ) ;
7269 materialize_modular_chip :: < Secp256k1Scalar > ( ) ;
7370 materialize_modular_chip :: < P256Coord > ( ) ;
@@ -77,7 +74,6 @@ pub fn main() {
7774 materialize_modular_chip :: < Bls12_381Fp > ( ) ;
7875 materialize_modular_chip :: < Bls12_381Scalar > ( ) ;
7976 materialize_modular_chip :: < Mersenne61 > ( ) ;
80- materialize_modular_chip :: < Seven > ( ) ;
8177
8278 materialize_complex_chip ! ( Bn254Fp2 , Bn254Fp ) ;
8379 materialize_complex_chip ! ( Bls12_381Fp2 , Bls12_381Fp ) ;
@@ -87,14 +83,6 @@ pub fn main() {
8783 materialize_ecc_chip :: < Bn254G1Affine > ( ) ;
8884 materialize_ecc_chip :: < Bls12_381G1Affine > ( ) ;
8985
90- let [ one, six] = [ 1 , 6 ] . map ( Seven :: from_u32) ;
91- assert_eq ! ( one + six, Seven :: ZERO ) ;
92-
93- let y = Mod1e18 :: from_u32 ( 100 ) ;
94- let y = ( & y * & y) * & y;
95- let y = y. clone ( ) * y. clone ( ) * y. clone ( ) ;
96- assert_eq ! ( y + Mod1e18 :: from_u32( 3 ) , Mod1e18 :: ZERO ) ;
97-
9886 let mut bytes = [ 0u8 ; 32 ] ;
9987 bytes[ 7 ] = 1 << 5 ; // 2^61 = modulus + 1
10088 let mut res = Mersenne61 :: from_le_bytes_unchecked ( & bytes) ; // No need to start from reduced representation
0 commit comments