Struct gridiron::fp_480::Fp480 [−][src]
pub struct Fp480 { /* fields omitted */ }
Methods
impl Fp480
[src]
impl Fp480
pub fn normalize_assign(&mut self, extra_limb: u64)
[src]
pub fn normalize_assign(&mut self, extra_limb: u64)
Take the extra limb and incorporate that into the existing value by modding by the prime.
pub fn normalize(self, extra_limb: u64) -> Fp480
[src]
pub fn normalize(self, extra_limb: u64) -> Fp480
Take the extra limb and incorporate that into the existing value by modding by the prime.
pub fn to_bytes_array(&self) -> [u8; 60]
[src]
pub fn to_bytes_array(&self) -> [u8; 60]
Convert the value to a byte array which is NUMBYTES
long.
pub fn exp_by_squaring(y: Fp480, x: &Fp480, n: &Fp480) -> Fp480
[src]
pub fn exp_by_squaring(y: Fp480, x: &Fp480, n: &Fp480) -> Fp480
pub fn div2(&self) -> Fp480
[src]
pub fn div2(&self) -> Fp480
Divide the value by 2.
pub fn square(&self) -> Fp480
[src]
pub fn square(&self) -> Fp480
Square the value. Same as a value times itself, but slightly more performant.
pub fn is_even(&self) -> bool
[src]
pub fn is_even(&self) -> bool
Check to see if the value is even.
pub fn new(digits: [u64; 8]) -> Fp480
[src]
pub fn new(digits: [u64; 8]) -> Fp480
Create a new instance given the raw limbs form. Note that this is least significant bit first.
pub fn new_from_u64(x: u64) -> Fp480
[src]
pub fn new_from_u64(x: u64) -> Fp480
Convenience function to create a value from a single limb.
pub fn to_str_decimal(self) -> String
[src]
pub fn to_str_decimal(self) -> String
Write out the value in decimal form.
pub fn to_str_hex(&self) -> String
[src]
pub fn to_str_hex(&self) -> String
Write out the value in hex.
pub fn create_naf(&self) -> Vec<i8>
[src]
pub fn create_naf(&self) -> Vec<i8>
Create a Non-Adjacent form of the value. return - Vector which represents the NAF of value.
pub fn quadratic_residue(&self) -> bool
[src]
pub fn quadratic_residue(&self) -> bool
pub fn reduce_barrett(a: &[u64; 16]) -> [u64; 8]
[src]
pub fn reduce_barrett(a: &[u64; 16]) -> [u64; 8]
Trait Implementations
impl PartialEq for Fp480
[src]
impl PartialEq for Fp480
fn eq(&self, other: &Fp480) -> bool
[src]
fn eq(&self, other: &Fp480) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Fp480) -> bool
[src]
fn ne(&self, other: &Fp480) -> bool
This method tests for !=
.
impl Eq for Fp480
[src]
impl Eq for Fp480
impl Ord for Fp480
[src]
impl Ord for Fp480
fn cmp(&self, other: &Fp480) -> Ordering
[src]
fn cmp(&self, other: &Fp480) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Clone for Fp480
[src]
impl Clone for Fp480
fn clone(&self) -> Fp480
[src]
fn clone(&self) -> Fp480
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Fp480
[src]
impl Copy for Fp480
impl Debug for Fp480
[src]
impl Debug for Fp480
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for Fp480
[src]
impl Display for Fp480
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl LowerHex for Fp480
[src]
impl LowerHex for Fp480
Prints the hex value of the number in big endian (most significant digit on the left and least on the right) to make debugging easier.
fn fmt(&self, fmtr: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, fmtr: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Deref for Fp480
[src]
impl Deref for Fp480
type Target = [u64; 8]
The resulting type after dereferencing.
fn deref(&self) -> &[u64; 8]
[src]
fn deref(&self) -> &[u64; 8]
Dereferences the value.
impl PartialOrd for Fp480
[src]
impl PartialOrd for Fp480
fn partial_cmp(&self, other: &Fp480) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Fp480) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Zero for Fp480
[src]
impl Zero for Fp480
fn zero() -> Self
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl One for Fp480
[src]
impl One for Fp480
fn one() -> Self
[src]
fn one() -> Self
Returns the multiplicative identity element of Self
, 1
. Read more
fn is_one(&self) -> bool
[src]
fn is_one(&self) -> bool
Returns true
if self
is equal to the multiplicative identity. Read more
impl Add for Fp480
[src]
impl Add for Fp480
type Output = Fp480
The resulting type after applying the +
operator.
fn add(self, other: Fp480) -> Fp480
[src]
fn add(self, other: Fp480) -> Fp480
Performs the +
operation.
impl AddAssign for Fp480
[src]
impl AddAssign for Fp480
fn add_assign(&mut self, other: Fp480)
[src]
fn add_assign(&mut self, other: Fp480)
Performs the +=
operation.
impl Sub for Fp480
[src]
impl Sub for Fp480
type Output = Fp480
The resulting type after applying the -
operator.
fn sub(self, other: Fp480) -> Fp480
[src]
fn sub(self, other: Fp480) -> Fp480
Performs the -
operation.
impl SubAssign for Fp480
[src]
impl SubAssign for Fp480
fn sub_assign(&mut self, other: Fp480)
[src]
fn sub_assign(&mut self, other: Fp480)
Performs the -=
operation.
impl Mul for Fp480
[src]
impl Mul for Fp480
type Output = Fp480
The resulting type after applying the *
operator.
fn mul(self, rhs: Fp480) -> Fp480
[src]
fn mul(self, rhs: Fp480) -> Fp480
Performs the *
operation.
impl Mul<u64> for Fp480
[src]
impl Mul<u64> for Fp480
type Output = Fp480
The resulting type after applying the *
operator.
fn mul(self, rhs: u64) -> Fp480
[src]
fn mul(self, rhs: u64) -> Fp480
Performs the *
operation.
impl MulAssign for Fp480
[src]
impl MulAssign for Fp480
fn mul_assign(&mut self, rhs: Fp480)
[src]
fn mul_assign(&mut self, rhs: Fp480)
Performs the *=
operation.
impl Inv for Fp480
[src]
impl Inv for Fp480
type Output = Fp480
The result after applying the operator.
fn inv(self) -> Fp480
[src]
fn inv(self) -> Fp480
Returns the multiplicative inverse of self
. Read more
impl Pow<u64> for Fp480
[src]
impl Pow<u64> for Fp480
type Output = Fp480
The result after applying the operator.
fn pow(self, rhs: u64) -> Fp480
[src]
fn pow(self, rhs: u64) -> Fp480
Returns self
to the power rhs
. Read more
impl Pow<Fp480> for Fp480
[src]
impl Pow<Fp480> for Fp480
type Output = Fp480
The result after applying the operator.
fn pow(self, rhs: Fp480) -> Fp480
[src]
fn pow(self, rhs: Fp480) -> Fp480
Returns self
to the power rhs
. Read more
impl Div for Fp480
[src]
impl Div for Fp480
type Output = Fp480
The resulting type after applying the /
operator.
fn div(self, rhs: Fp480) -> Fp480
[src]
fn div(self, rhs: Fp480) -> Fp480
Performs the /
operation.
impl Neg for Fp480
[src]
impl Neg for Fp480
type Output = Fp480
The resulting type after applying the -
operator.
fn neg(self) -> Fp480
[src]
fn neg(self) -> Fp480
Performs the unary -
operation.
impl BitAnd<Fp480> for Fp480
[src]
impl BitAnd<Fp480> for Fp480
type Output = Fp480
The resulting type after applying the &
operator.
fn bitand(self, rhs: Fp480) -> Fp480
[src]
fn bitand(self, rhs: Fp480) -> Fp480
Performs the &
operation.
impl BitAndAssign<Fp480> for Fp480
[src]
impl BitAndAssign<Fp480> for Fp480
fn bitand_assign(&mut self, rhs: Fp480)
[src]
fn bitand_assign(&mut self, rhs: Fp480)
Performs the &=
operation.
impl BitAnd<u64> for Fp480
[src]
impl BitAnd<u64> for Fp480
type Output = Fp480
The resulting type after applying the &
operator.
fn bitand(self, rhs: u64) -> Fp480
[src]
fn bitand(self, rhs: u64) -> Fp480
Performs the &
operation.
impl BitAndAssign<u64> for Fp480
[src]
impl BitAndAssign<u64> for Fp480
fn bitand_assign(&mut self, rhs: u64)
[src]
fn bitand_assign(&mut self, rhs: u64)
Performs the &=
operation.
impl From<u64> for Fp480
[src]
impl From<u64> for Fp480
impl From<u32> for Fp480
[src]
impl From<u32> for Fp480
impl From<u8> for Fp480
[src]
impl From<u8> for Fp480
impl From<i64> for Fp480
[src]
impl From<i64> for Fp480
impl From<i32> for Fp480
[src]
impl From<i32> for Fp480
impl From<i8> for Fp480
[src]
impl From<i8> for Fp480
impl From<[u8; 60]> for Fp480
[src]
impl From<[u8; 60]> for Fp480
Assume element zero is most sig
impl Default for Fp480
[src]
impl Default for Fp480
impl From<[u8; 64]> for Fp480
[src]
impl From<[u8; 64]> for Fp480