[−][src]Struct jubjub::Fq
Represents an element of GF(q)
.
Methods
impl Fq
[src]
pub const fn zero() -> Fq
[src]
Returns zero, the additive identity.
pub const fn one() -> Fq
[src]
Returns one, the multiplicative identity.
pub fn double(&self) -> Fq
[src]
Doubles this field element.
pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Fq>
[src]
Attempts to convert a little-endian byte representation of
a field element into an element of Fq
, failing if the input
is not canonical (is not smaller than q).
pub fn to_bytes(&self) -> [u8; 32]
[src]
Converts an element of Fq
into a byte representation in
little-endian byte order.
pub fn from_bytes_wide(bytes: &[u8; 64]) -> Fq
[src]
Converts a 512-bit little endian integer into an element of Fq by reducing modulo q.
pub const fn from_raw(val: [u64; 4]) -> Self
[src]
Converts from an integer represented in little endian into its (congruent) representation in Fq.
pub const fn square(&self) -> Fq
[src]
Squares this element.
pub fn sqrt(&self) -> CtOption<Self>
[src]
Computes the square root of this element, if it exists.
pub fn pow(&self, by: &[u64; 4]) -> Self
[src]
Exponentiates self
by by
, where by
is a
little-endian order integer exponent.
pub fn pow_vartime(&self, by: &[u64; 4]) -> Self
[src]
Exponentiates self
by by
, where by
is a
little-endian order integer exponent.
This operation is variable time with respect to the exponent. If the exponent is fixed, this operation is effectively constant time.
pub fn invert(&self) -> CtOption<Self>
[src]
Computes the multiplicative inverse of this element, failing if the element is zero.
Trait Implementations
impl PartialEq<Fq> for Fq
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Fq
[src]
impl<'a, 'b> Add<&'b Fq> for &'a Fq
[src]
type Output = Fq
The resulting type after applying the +
operator.
fn add(self, rhs: &'b Fq) -> Fq
[src]
impl<'b> Add<&'b Fq> for Fq
[src]
type Output = Fq
The resulting type after applying the +
operator.
fn add(self, rhs: &'b Fq) -> Fq
[src]
impl<'a> Add<Fq> for &'a Fq
[src]
impl Add<Fq> for Fq
[src]
impl<'a, 'b> Sub<&'b Fq> for &'a Fq
[src]
type Output = Fq
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Fq) -> Fq
[src]
impl<'b> Sub<&'b Fq> for Fq
[src]
type Output = Fq
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Fq) -> Fq
[src]
impl<'a> Sub<Fq> for &'a Fq
[src]
impl Sub<Fq> for Fq
[src]
impl<'a, 'b> Mul<&'b Fq> for &'a Fq
[src]
type Output = Fq
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Fq) -> Fq
[src]
impl<'b> Mul<&'b Fq> for Fq
[src]
type Output = Fq
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Fq) -> Fq
[src]
impl<'a> Mul<Fq> for &'a Fq
[src]
impl Mul<Fq> for Fq
[src]
impl<'a> Neg for &'a Fq
[src]
impl Neg for Fq
[src]
impl AddAssign<Fq> for Fq
[src]
fn add_assign(&mut self, rhs: Fq)
[src]
impl<'b> AddAssign<&'b Fq> for Fq
[src]
fn add_assign(&mut self, rhs: &'b Fq)
[src]
impl SubAssign<Fq> for Fq
[src]
fn sub_assign(&mut self, rhs: Fq)
[src]
impl<'b> SubAssign<&'b Fq> for Fq
[src]
fn sub_assign(&mut self, rhs: &'b Fq)
[src]
impl MulAssign<Fq> for Fq
[src]
fn mul_assign(&mut self, rhs: Fq)
[src]
impl<'b> MulAssign<&'b Fq> for Fq
[src]
fn mul_assign(&mut self, rhs: &'b Fq)
[src]
impl Debug for Fq
[src]
impl From<u64> for Fq
[src]
impl<'a> From<&'a Fq> for [u8; 32]
[src]
impl Copy for Fq
[src]
impl Clone for Fq
[src]
fn clone(&self) -> Fq
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Fq
[src]
impl ConstantTimeEq for Fq
[src]
impl ConditionallySelectable for Fq
[src]
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
[src]
fn conditional_assign(&mut self, other: &Self, choice: Choice)
[src]
Conditionally assign other
to self
, according to choice
. Read more
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
[src]
Conditionally swap self
and other
if choice == 1
; otherwise, reassign both unto themselves. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: Neg,
<&'a T as Neg>::Output == T,
[src]
T: ConditionallySelectable,
&'a T: Neg,
<&'a T as Neg>::Output == T,