pub type Fp = Bn254Fp;
Aliased Type§
struct Fp(/* private fields */);
Implementations
Trait Implementations§
Source§impl Field for Fp
impl Field for Fp
Source§const ZERO: Self = <Self as IntMod>::ZERO
const ZERO: Self = <Self as IntMod>::ZERO
The zero element of the field, the additive identity.
Source§const ONE: Self = <Self as IntMod>::ONE
const ONE: Self = <Self as IntMod>::ONE
The one element of the field, the multiplicative identity.
type SelfRef<'a> = &'a Bn254Fp
Source§fn double_assign(&mut self)
fn double_assign(&mut self)
Doubles
self
in-place.Source§fn square_assign(&mut self)
fn square_assign(&mut self)
Square
self
in-placeSource§impl<'a> AddAssign<&'a Bn254Fp> for Bn254Fp
impl<'a> AddAssign<&'a Bn254Fp> for Bn254Fp
Source§fn add_assign(&mut self, other: &'a Bn254Fp)
fn add_assign(&mut self, other: &'a Bn254Fp)
Performs the
+=
operation. Read moreSource§impl AddAssign for Bn254Fp
impl AddAssign for Bn254Fp
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moreSource§impl<'de> Deserialize<'de> for Bn254Fp
impl<'de> Deserialize<'de> for Bn254Fp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> DivAssignUnsafe<&'a Bn254Fp> for Bn254Fp
impl<'a> DivAssignUnsafe<&'a Bn254Fp> for Bn254Fp
Source§fn div_assign_unsafe(&mut self, other: &'a Bn254Fp)
fn div_assign_unsafe(&mut self, other: &'a Bn254Fp)
Undefined behaviour when denominator is not coprime to N
Source§impl DivAssignUnsafe for Bn254Fp
impl DivAssignUnsafe for Bn254Fp
Source§fn div_assign_unsafe(&mut self, other: Self)
fn div_assign_unsafe(&mut self, other: Self)
Undefined behaviour when denominator is not coprime to N
Source§impl IntMod for Bn254Fp
impl IntMod for Bn254Fp
Source§fn assert_reduced(&self)
fn assert_reduced(&self)
If self
is not in its canonical form, the proof will fail to verify.
This means guest execution will never terminate (either successfully or
unsuccessfully) if self
is not in its canonical form.
Source§const NUM_LIMBS: usize = 32usize
const NUM_LIMBS: usize = 32usize
Number of limbs used to internally represent an element of
Self
.Source§type Repr = [u8; 32]
type Repr = [u8; 32]
Underlying representation of IntMod. Usually of the form
[u8; NUM_LIMBS]
.Source§type SelfRef<'a> = &'a Bn254Fp
type SelfRef<'a> = &'a Bn254Fp
SelfRef<'a>
should almost always be &'a Self
. This is a way to include implementations of binary operations where both sides are &'a Self
.Source§fn from_repr(repr: Self::Repr) -> Self
fn from_repr(repr: Self::Repr) -> Self
Creates a new IntMod from an instance of Repr.
Does not enforce the integer value of
bytes
must be less than the modulus.Source§fn from_le_bytes(bytes: &[u8]) -> Self
fn from_le_bytes(bytes: &[u8]) -> Self
Creates a new IntMod from an array of bytes, little endian.
Does not enforce the integer value of
bytes
must be less than the modulus.Source§fn from_be_bytes(bytes: &[u8]) -> Self
fn from_be_bytes(bytes: &[u8]) -> Self
Creates a new IntMod from an array of bytes, big endian.
Does not enforce the integer value of
bytes
must be less than the modulus.Source§fn from_u8(val: u8) -> Self
fn from_u8(val: u8) -> Self
Creates a new IntMod from a u8.
Does not enforce the integer value of
bytes
must be less than the modulus.Source§fn from_u32(val: u32) -> Self
fn from_u32(val: u32) -> Self
Creates a new IntMod from a u32.
Does not enforce the integer value of
bytes
must be less than the modulus.Source§fn from_u64(val: u64) -> Self
fn from_u64(val: u64) -> Self
Creates a new IntMod from a u64.
Does not enforce the integer value of
bytes
must be less than the modulus.Source§fn as_le_bytes(&self) -> &[u8] ⓘ
fn as_le_bytes(&self) -> &[u8] ⓘ
Value of this IntMod as an array of bytes, little endian.
Source§fn to_be_bytes(&self) -> [u8; 32]
fn to_be_bytes(&self) -> [u8; 32]
Value of this IntMod as an array of bytes, big endian.
Source§fn modulus_biguint() -> BigUint
fn modulus_biguint() -> BigUint
Modulus N as a BigUint.
Source§fn from_biguint(biguint: BigUint) -> Self
fn from_biguint(biguint: BigUint) -> Self
Creates a new IntMod from a BigUint.
Source§fn as_biguint(&self) -> BigUint
fn as_biguint(&self) -> BigUint
Value of this IntMod as a BigUint.
fn neg_assign(&mut self)
Source§fn double_assign(&mut self)
fn double_assign(&mut self)
Doubles
self
in-place.Source§fn square_assign(&mut self)
fn square_assign(&mut self)
Squares
self
in-place.Source§fn is_reduced(&self) -> bool
fn is_reduced(&self) -> bool
Is the integer representation of
self
less than the modulus?Source§impl<'a> MulAssign<&'a Bn254Fp> for Bn254Fp
impl<'a> MulAssign<&'a Bn254Fp> for Bn254Fp
Source§fn mul_assign(&mut self, other: &'a Bn254Fp)
fn mul_assign(&mut self, other: &'a Bn254Fp)
Performs the
*=
operation. Read moreSource§impl MulAssign for Bn254Fp
impl MulAssign for Bn254Fp
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moreSource§impl Reduce for Bn254Fp
impl Reduce for Bn254Fp
Source§fn reduce_le_bytes(bytes: &[u8]) -> Self
fn reduce_le_bytes(bytes: &[u8]) -> Self
Interpret the given bytes as an integer and perform a modular reduction.
fn reduce_be_bytes(bytes: &[u8]) -> Self
Source§impl<'a> SubAssign<&'a Bn254Fp> for Bn254Fp
impl<'a> SubAssign<&'a Bn254Fp> for Bn254Fp
Source§fn sub_assign(&mut self, other: &'a Bn254Fp)
fn sub_assign(&mut self, other: &'a Bn254Fp)
Performs the
-=
operation. Read moreSource§impl SubAssign for Bn254Fp
impl SubAssign for Bn254Fp
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read more