Skip to content

Commit 1992a04

Browse files
Remove impl_field argument from guest-libs
1 parent c599136 commit 1992a04

File tree

5 files changed

+5
-62
lines changed

5 files changed

+5
-62
lines changed

guest-libs/ff_derive/guest/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ fn openvm_struct_impl(ast: &syn::ItemStruct, modulus: &BigUint) -> proc_macro2::
277277
quote! {
278278
::openvm_algebra_moduli_macros::moduli_declare! {
279279
#struct_ident {
280-
modulus = #modulus_str,
281-
impl_field = true
280+
modulus = #modulus_str
282281
}
283282
}
284283
}

guest-libs/k256/guest/src/internal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pub const fn seven_le() -> [u8; 32] {
2121
}
2222

2323
moduli_declare! {
24-
Secp256k1Coord { modulus = "0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F", impl_field = true },
25-
Secp256k1Scalar { modulus = "0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141", impl_field = true },
24+
Secp256k1Coord { modulus = "0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F" },
25+
Secp256k1Scalar { modulus = "0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141" },
2626
}
2727

2828
sw_declare! {

guest-libs/p256/guest/src/internal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use crate::P256;
1414
// --- Define the OpenVM modular arithmetic and ecc types ---
1515

1616
moduli_declare! {
17-
P256Coord { modulus = "0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff", impl_field = true },
18-
P256Scalar { modulus = "0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", impl_field = true },
17+
P256Coord { modulus = "0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff" },
18+
P256Scalar { modulus = "0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551" },
1919
}
2020

2121
// from_const_bytes is little endian

guest-libs/pairing/guest/src/bls12_381/mod.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,6 @@ pub type Scalar = Bls12_381Scalar;
4141
pub type G1Affine = Bls12_381G1Affine;
4242
pub use g2::G2Affine;
4343

44-
impl Field for Fp {
45-
type SelfRef<'a> = &'a Self;
46-
const ZERO: Self = <Self as IntMod>::ZERO;
47-
const ONE: Self = <Self as IntMod>::ONE;
48-
49-
fn double_assign(&mut self) {
50-
IntMod::double_assign(self);
51-
}
52-
53-
fn square_assign(&mut self) {
54-
IntMod::square_assign(self);
55-
}
56-
}
57-
58-
impl Field for Scalar {
59-
type SelfRef<'a> = &'a Self;
60-
const ZERO: Self = <Self as IntMod>::ZERO;
61-
const ONE: Self = <Self as IntMod>::ONE;
62-
63-
fn double_assign(&mut self) {
64-
IntMod::double_assign(self);
65-
}
66-
67-
fn square_assign(&mut self) {
68-
IntMod::square_assign(self);
69-
}
70-
}
71-
7244
// https://hackmd.io/@benjaminion/bls12-381#Cofactor
7345
// BLS12-381: The from_xy function will allow constructing elements that lie on the curve
7446
// but aren't actually in the cyclic subgroup of prime order that is usually called G1.

guest-libs/pairing/guest/src/bn254/mod.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,6 @@ pub type Scalar = Bn254Scalar;
4242
pub type G1Affine = Bn254G1Affine;
4343
pub use g2::G2Affine;
4444

45-
impl Field for Fp {
46-
type SelfRef<'a> = &'a Self;
47-
const ZERO: Self = <Self as IntMod>::ZERO;
48-
const ONE: Self = <Self as IntMod>::ONE;
49-
50-
fn double_assign(&mut self) {
51-
IntMod::double_assign(self);
52-
}
53-
54-
fn square_assign(&mut self) {
55-
IntMod::square_assign(self);
56-
}
57-
}
58-
59-
impl Field for Scalar {
60-
type SelfRef<'a> = &'a Self;
61-
const ZERO: Self = <Self as IntMod>::ZERO;
62-
const ONE: Self = <Self as IntMod>::ONE;
63-
64-
fn double_assign(&mut self) {
65-
IntMod::double_assign(self);
66-
}
67-
68-
fn square_assign(&mut self) {
69-
IntMod::square_assign(self);
70-
}
71-
}
72-
7345
impl CyclicGroup for G1Affine {
7446
// https://eips.ethereum.org/EIPS/eip-197
7547
const GENERATOR: Self = G1Affine {

0 commit comments

Comments
 (0)