Struct decaf377::fields::fr::u64::wrapper::Fr

source ·
pub struct Fr(/* private fields */);

Implementations§

source§

impl Fr

source

pub const ZERO: Self = _

source

pub const ONE: Self = _

source

pub fn to_bytes_le(&self) -> [u8; 32]

source

pub fn square(&self) -> Fr

source

pub fn inverse(&self) -> Option<Fr>

source

pub fn add(self, other: &Fr) -> Fr

source

pub fn sub(self, other: &Fr) -> Fr

source

pub fn mul(self, other: &Fr) -> Fr

source

pub fn neg(self) -> Fr

source§

impl Fr

source

pub const MODULUS_LIMBS: [u64; 4] = _

source

pub const MODULUS_MINUS_ONE_DIV_TWO_LIMBS: [u64; 4] = _

source

pub const MODULUS_BIT_SIZE: u32 = 251u32

source

pub const TRACE_LIMBS: [u64; 4] = _

source

pub const TRACE_MINUS_ONE_DIV_TWO_LIMBS: [u64; 4] = _

source

pub const TWO_ADICITY: u32 = 1u32

source

pub const MULTIPLICATIVE_GENERATOR: Self = _

source

pub const TWO_ADIC_ROOT_OF_UNITY: Self = _

source

pub const FIELD_SIZE_POWER_OF_TWO: Self = _

source

pub fn from_le_bytes_mod_order(bytes: &[u8]) -> Self

source

pub fn from_bytes_checked(bytes: &[u8; 32]) -> Result<Self, EncodingError>

Convert bytes into an Fr element, returning None if these bytes are not already reduced.

This means that values that cannot be produced by encoding a field element will return None, enforcing canonical serialization.

source

pub fn to_bytes(&self) -> [u8; 32]

source

pub fn rand<R: CryptoRngCore>(rng: &mut R) -> Self

Sample a random field element uniformly.

Trait Implementations§

source§

impl<'a> Add<&'a Fr> for Fr

source§

type Output = Fr

The resulting type after applying the + operator.
source§

fn add(self, other: &Self) -> Self

Performs the + operation. Read more
source§

impl<'a> Add<&'a mut Fr> for Fr

source§

type Output = Fr

The resulting type after applying the + operator.
source§

fn add(self, other: &'a mut Self) -> Self

Performs the + operation. Read more
source§

impl<'a> AddAssign<&'a Fr> for Fr

source§

fn add_assign(&mut self, other: &Self)

Performs the += operation. Read more
source§

impl<'a> AddAssign<&'a mut Fr> for Fr

source§

fn add_assign(&mut self, other: &'a mut Self)

Performs the += operation. Read more
source§

impl Clone for Fr

source§

fn clone(&self) -> Fr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Distribution<Fr> for Standard

source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fr

Generate a random value of T, using rng as the source of randomness.
source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
source§

impl<'a> Div<&'a Fr> for Fr

source§

type Output = Fr

The resulting type after applying the / operator.
source§

fn div(self, other: &Self) -> Self

Performs the / operation. Read more
source§

impl<'a> Div<&'a mut Fr> for Fr

source§

type Output = Fr

The resulting type after applying the / operator.
source§

fn div(self, other: &'a mut Self) -> Self

Performs the / operation. Read more
source§

impl<'a> DivAssign<&'a Fr> for Fr

source§

fn div_assign(&mut self, other: &Self)

Performs the /= operation. Read more
source§

impl<'a> DivAssign<&'a mut Fr> for Fr

source§

fn div_assign(&mut self, other: &'a mut Self)

Performs the /= operation. Read more
source§

impl From<Fr> for BigInt<4>

source§

fn from(fr: Fr) -> Self

Converts to this type from the input type.
source§

impl From<Fr> for BigUint

source§

fn from(other: Fr) -> Self

Converts to this type from the input type.
source§

impl<'a, 'b> Mul<&'b Fr> for &'a Element

source§

type Output = Element

The resulting type after applying the * operator.
source§

fn mul(self, point: &'b Fr) -> Element

Performs the * operation. Read more
source§

impl<'b> Mul<&'b Fr> for Element

source§

type Output = Element

The resulting type after applying the * operator.
source§

fn mul(self, other: &'b Fr) -> Element

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Fr> for Fr

source§

type Output = Fr

The resulting type after applying the * operator.
source§

fn mul(self, other: &Self) -> Self

Performs the * operation. Read more
source§

impl<'a> Mul<&'a mut Fr> for Fr

source§

type Output = Fr

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a mut Self) -> Self

Performs the * operation. Read more
source§

impl<'a> Mul<Fr> for &'a Element

source§

type Output = Element

The resulting type after applying the * operator.
source§

fn mul(self, other: Fr) -> Element

Performs the * operation. Read more
source§

impl Mul<Fr> for Element

source§

type Output = Element

The resulting type after applying the * operator.
source§

fn mul(self, other: Fr) -> Element

Performs the * operation. Read more
source§

impl<'b> MulAssign<&'b Fr> for Element

source§

fn mul_assign(&mut self, point: &'b Fr)

Performs the *= operation. Read more
source§

impl<'a> MulAssign<&'a Fr> for Fr

source§

fn mul_assign(&mut self, other: &Self)

Performs the *= operation. Read more
source§

impl<'a> MulAssign<&'a mut Fr> for Fr

source§

fn mul_assign(&mut self, other: &'a mut Self)

Performs the *= operation. Read more
source§

impl MulAssign<Fr> for Element

source§

fn mul_assign(&mut self, other: Fr)

Performs the *= operation. Read more
source§

impl PartialEq for Fr

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Product<&'a Fr> for Fr

source§

fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
source§

impl<'a> Sub<&'a Fr> for Fr

source§

type Output = Fr

The resulting type after applying the - operator.
source§

fn sub(self, other: &Self) -> Self

Performs the - operation. Read more
source§

impl<'a> Sub<&'a mut Fr> for Fr

source§

type Output = Fr

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a mut Self) -> Self

Performs the - operation. Read more
source§

impl<'a> SubAssign<&'a Fr> for Fr

source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
source§

impl<'a> SubAssign<&'a mut Fr> for Fr

source§

fn sub_assign(&mut self, other: &'a mut Self)

Performs the -= operation. Read more
source§

impl<'a> Sum<&'a Fr> for Fr

source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Zeroize for Fr

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for Fr

source§

impl Eq for Fr

Auto Trait Implementations§

§

impl Freeze for Fr

§

impl RefUnwindSafe for Fr

§

impl Send for Fr

§

impl Sync for Fr

§

impl Unpin for Fr

§

impl UnwindSafe for Fr

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CanonicalSerializeHashExt for T

source§

fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

source§

fn hash_uncompressed<H>( &self, ) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<F> ToConstraintField<F> for F
where F: PrimeField,

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UniformRand for T

§

fn rand<R>(rng: &mut R) -> T
where R: Rng + ?Sized,

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T, F> DomainCoeff<F> for T
where F: FftField, T: Copy + Send + Sync + Add<Output = T> + Sub<Output = T> + AddAssign + SubAssign + Zero + MulAssign<F> + Debug + PartialEq,