[][src]Struct rusty_gadgets::field_element::FieldElement

pub struct FieldElement { /* fields omitted */ }

Methods

impl FieldElement[src]

pub fn size() -> BigUint[src]

The prime field size.

pub fn max_value() -> BigUint[src]

pub fn max_bits() -> usize[src]

The number of bits needed to encode every field element.

pub fn zero() -> Self[src]

pub fn one() -> Self[src]

pub fn neg_one() -> Self[src]

The additive inverse of 1.

pub fn random(rng: &mut impl Rng) -> Self[src]

Return a random field element, uniformly distributed in [0, size()).

pub fn is_zero(&self) -> bool[src]

pub fn is_nonzero(&self) -> bool[src]

pub fn is_one(&self) -> bool[src]

pub fn multiplicative_inverse(&self) -> FieldElement[src]

pub fn integer_division(&self, rhs: FieldElement) -> FieldElement[src]

pub fn integer_modulus(&self, rhs: FieldElement) -> FieldElement[src]

pub fn bits(&self) -> usize[src]

The number of bits needed to encode this particular field element.

pub fn bit(&self, i: usize) -> bool[src]

Return the i'th least significant bit. So, for example, x.bit(0) returns the least significant bit of x.

Trait Implementations

impl Ord for FieldElement[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Eq for FieldElement[src]

impl Clone for FieldElement[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialOrd<FieldElement> for FieldElement[src]

impl PartialEq<FieldElement> for FieldElement[src]

impl From<BigUint> for FieldElement[src]

impl From<u128> for FieldElement[src]

impl From<bool> for FieldElement[src]

impl From<FieldElement> for LinearCombination[src]

impl Display for FieldElement[src]

impl Debug for FieldElement[src]

impl FromStr for FieldElement[src]

type Err = ParseBigIntError

The associated error which can be returned from parsing.

impl Add<FieldElement> for FieldElement[src]

type Output = FieldElement

The resulting type after applying the + operator.

impl Sub<FieldElement> for FieldElement[src]

type Output = FieldElement

The resulting type after applying the - operator.

impl Mul<FieldElement> for FieldElement[src]

type Output = FieldElement

The resulting type after applying the * operator.

impl Mul<u128> for FieldElement[src]

type Output = FieldElement

The resulting type after applying the * operator.

impl Mul<FieldElement> for LinearCombination[src]

type Output = LinearCombination

The resulting type after applying the * operator.

impl Div<FieldElement> for FieldElement[src]

type Output = FieldElement

The resulting type after applying the / operator.

impl Neg for FieldElement[src]

type Output = FieldElement

The resulting type after applying the - operator.

impl AddAssign<FieldElement> for FieldElement[src]

impl SubAssign<FieldElement> for FieldElement[src]

impl MulAssign<FieldElement> for FieldElement[src]

impl MulAssign<u128> for FieldElement[src]

impl MulAssign<FieldElement> for LinearCombination[src]

impl Shl<usize> for FieldElement[src]

type Output = FieldElement

The resulting type after applying the << operator.

impl Hash for FieldElement[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]