[][src]Struct r1cs::Element

pub struct Element<F: Field> { /* fields omitted */ }

An element of a prime field.

Methods

impl<F: Field> Element<F>[src]

pub fn zero() -> Self[src]

pub fn one() -> Self[src]

pub fn largest_element() -> Self[src]

pub fn to_biguint(&self) -> &BigUint[src]

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) -> Self[src]

pub fn multiplicative_inverse_or_zero(&self) -> Self[src]

Like multiplicative_inverse, except that zero is mapped to itself rather than causing a panic.

pub fn exponentiation(&self, power: &Self) -> Self[src]

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

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

pub fn gcd(&self, rhs: &Self) -> Self[src]

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

pub fn max_bits() -> usize[src]

The number of bits needed to encode every element of F.

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. Return false for outside of range.

Trait Implementations

impl<F: Field> From<Element<F>> for Expression<F>[src]

impl<'_, F: Field> From<&'_ Element<F>> for Expression<F>[src]

impl<F: Field> From<BigUint> for Element<F>[src]

impl<F: Field> From<usize> for Element<F>[src]

impl<F: Field> From<u128> for Element<F>[src]

impl<F: Field> From<u64> for Element<F>[src]

impl<F: Field> From<u32> for Element<F>[src]

impl<F: Field> From<u16> for Element<F>[src]

impl<F: Field> From<u8> for Element<F>[src]

impl<F: Field> From<bool> for Element<F>[src]

impl<F: Field> Clone for Element<F>[src]

impl<F: Field> Eq for Element<F>[src]

impl<F: Field> Ord for Element<F>[src]

impl<F: Field> PartialEq<Element<F>> for Element<F>[src]

impl<F: Field> PartialOrd<Element<F>> for Element<F>[src]

impl<F: Field> Display for Element<F>[src]

impl<F: Debug + Field> Debug for Element<F>[src]

impl<F: Field> Div<Element<F>> for Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the / operator.

impl<'_, F: Field> Div<&'_ Element<F>> for Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the / operator.

impl<'_, F: Field> Div<Element<F>> for &'_ Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the / operator.

impl<'_, '_, F: Field> Div<&'_ Element<F>> for &'_ Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the / operator.

impl<F: Field> Div<Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the / operator.

impl<'_, F: Field> Div<&'_ Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the / operator.

impl<'_, F: Field> Div<Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the / operator.

impl<'_, '_, F: Field> Div<&'_ Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the / operator.

impl<F: Field> Div<u128> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the / operator.

impl<'_, F: Field> Div<u128> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the / operator.

impl<F: Field> Sub<Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the - operator.

impl<'_, F: Field> Sub<&'_ Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the - operator.

impl<'_, F: Field> Sub<Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the - operator.

impl<'_, '_, F: Field> Sub<&'_ Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the - operator.

impl<F: Field> FromStr for Element<F>[src]

type Err = ParseBigIntError

The associated error which can be returned from parsing.

impl<F: Field> Add<Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the + operator.

impl<'_, F: Field> Add<&'_ Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the + operator.

impl<'_, F: Field> Add<Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the + operator.

impl<'_, '_, F: Field> Add<&'_ Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the + operator.

impl<F: Field> Mul<Element<F>> for Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the * operator.

impl<'_, F: Field> Mul<&'_ Element<F>> for Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the * operator.

impl<'_, F: Field> Mul<Element<F>> for &'_ Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the * operator.

impl<'_, '_, F: Field> Mul<&'_ Element<F>> for &'_ Expression<F>[src]

type Output = Expression<F>

The resulting type after applying the * operator.

impl<F: Field> Mul<Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the * operator.

impl<'_, F: Field> Mul<&'_ Element<F>> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the * operator.

impl<'_, F: Field> Mul<Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the * operator.

impl<'_, '_, F: Field> Mul<&'_ Element<F>> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the * operator.

impl<F: Field> Mul<u128> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the * operator.

impl<'_, F: Field> Mul<u128> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the * operator.

impl<F: Field> Neg for Element<F>[src]

type Output = Element<F>

The resulting type after applying the - operator.

impl<'_, F: Field> Neg for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the - operator.

impl<F: Field> AddAssign<Element<F>> for Element<F>[src]

impl<'_, F: Field> AddAssign<&'_ Element<F>> for Element<F>[src]

impl<F: Field> SubAssign<Element<F>> for Element<F>[src]

impl<'_, F: Field> SubAssign<&'_ Element<F>> for Element<F>[src]

impl<F: Field> MulAssign<Element<F>> for Expression<F>[src]

impl<'_, F: Field> MulAssign<&'_ Element<F>> for Expression<F>[src]

impl<F: Field> MulAssign<Element<F>> for Element<F>[src]

impl<'_, F: Field> MulAssign<&'_ Element<F>> for Element<F>[src]

impl<F: Field> MulAssign<u128> for Element<F>[src]

impl<F: Field> DivAssign<Element<F>> for Expression<F>[src]

impl<'_, F: Field> DivAssign<&'_ Element<F>> for Expression<F>[src]

impl<F: Field> DivAssign<Element<F>> for Element<F>[src]

impl<'_, F: Field> DivAssign<&'_ Element<F>> for Element<F>[src]

impl<F: Field> DivAssign<u128> for Element<F>[src]

impl<F: Field> Shl<usize> for Element<F>[src]

type Output = Element<F>

The resulting type after applying the << operator.

impl<'_, F: Field> Shl<usize> for &'_ Element<F>[src]

type Output = Element<F>

The resulting type after applying the << operator.

impl<F: Field> Hash for Element<F>[src]

Auto Trait Implementations

impl<F> !Send for Element<F>

impl<F> !Sync for Element<F>

impl<F> Unpin for Element<F>

impl<F> UnwindSafe for Element<F> where
    F: RefUnwindSafe

impl<F> RefUnwindSafe for Element<F> where
    F: RefUnwindSafe

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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]