decaf377::fields::fr::u64::wrapper

Struct 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,