Fr

Struct Fr 

pub struct Fr(/* private fields */);
Expand description

This represents an element of $\mathbb{F}_r$ where

r = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001

is the scalar field of the BN254 curve.

Implementations§

§

impl Fr

pub const fn zero() -> Fr

Returns zero, the additive identity.

pub const fn one() -> Fr

Returns one, the multiplicative identity.

pub fn invert(&self) -> CtOption<Fr>

Returns the multiplicative inverse of the element. If it is zero, the method fails.

pub fn jacobi(&self) -> i64

pub const fn from_raw(val: [u64; 4]) -> Fr

Converts from an integer represented in little endian into its (congruent) $field representation.

pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Fr>

Attempts to convert a little-endian byte representation of a scalar into a Fr, failing if the input is not canonical.

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

Converts an element of Fr into a byte representation in little-endian byte order.

§

impl Fr

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

Adds rhs to self, returning the result.

§

impl Fr

pub const fn double(&self) -> Fr

Doubles this field element.

pub const fn square(&self) -> Fr

Squares this element.

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

Multiplies rhs by self, returning the result.

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

Subtracts rhs from self, returning the result.

pub const fn neg(&self) -> Fr

Negates self.

§

impl Fr

pub const fn size() -> usize

Trait Implementations§

§

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

§

type Output = Fr

The resulting type after applying the + operator.
§

fn add(self, rhs: &'b Fr) -> Fr

Performs the + operation. Read more
§

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

§

type Output = Fr

The resulting type after applying the + operator.
§

fn add(self, rhs: &'b Fr) -> Fr

Performs the + operation. Read more
§

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

§

type Output = Fr

The resulting type after applying the + operator.
§

fn add(self, rhs: Fr) -> Fr

Performs the + operation. Read more
§

impl Add for Fr

§

type Output = Fr

The resulting type after applying the + operator.
§

fn add(self, rhs: Fr) -> Fr

Performs the + operation. Read more
§

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

§

fn add_assign(&mut self, rhs: &'b Fr)

Performs the += operation. Read more
§

impl AddAssign for Fr

§

fn add_assign(&mut self, rhs: Fr)

Performs the += operation. Read more
§

impl Clone for Fr

§

fn clone(&self) -> Fr

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl ConditionallySelectable for Fr

§

fn conditional_select(a: &Fr, b: &Fr, choice: Choice) -> Fr

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
§

impl ConstantTimeEq for Fr

§

fn ct_eq(&self, other: &Fr) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
§

impl Debug for Fr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Fr

§

fn default() -> Fr

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Fr

§

fn deserialize<D>( deserializer: D, ) -> Result<Fr, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Field for Fr

§

fn invert(&self) -> CtOption<Fr>

Returns the multiplicative inverse of the element. If it is zero, the method fails.

§

const ZERO: Fr

The zero element of the field, the additive identity.
§

const ONE: Fr

The one element of the field, the multiplicative identity.
§

fn random(rng: impl RngCore) -> Fr

Returns an element chosen uniformly at random using a user-provided RNG.
§

fn double(&self) -> Fr

Doubles this element.
§

fn square(&self) -> Fr

Squares this element.
§

fn sqrt(&self) -> CtOption<Fr>

Returns the square root of the field element, if it is quadratic residue. Read more
§

fn sqrt_ratio(num: &Fr, div: &Fr) -> (Choice, Fr)

Computes: Read more
§

fn is_zero(&self) -> Choice

Returns true iff this element is zero.
§

fn is_zero_vartime(&self) -> bool

Returns true iff this element is zero. Read more
§

fn cube(&self) -> Self

Cubes this element.
§

fn sqrt_alt(&self) -> (Choice, Self)

Equivalent to Self::sqrt_ratio(self, one()). Read more
§

fn pow<S>(&self, exp: S) -> Self
where S: AsRef<[u64]>,

Exponentiates self by exp, where exp is a little-endian order integer exponent. Read more
§

fn pow_vartime<S>(&self, exp: S) -> Self
where S: AsRef<[u64]>,

Exponentiates self by exp, where exp is a little-endian order integer exponent. Read more
§

impl<'a> From<&'a Fr> for [u8; 32]

§

fn from(value: &'a Fr) -> [u8; 32]

Converts to this type from the input type.
§

impl From<[u64; 4]> for Fr

§

fn from(digits: [u64; 4]) -> Fr

Converts to this type from the input type.
§

impl From<Fr> for [u64; 4]

§

fn from(elt: Fr) -> [u64; 4]

Converts to this type from the input type.
§

impl From<Fr> for [u8; 32]

§

fn from(value: Fr) -> [u8; 32]

Converts to this type from the input type.
§

impl From<bool> for Fr

§

fn from(bit: bool) -> Fr

Converts to this type from the input type.
§

impl From<u64> for Fr

Available on crate feature bn256-table only.
§

fn from(val: u64) -> Fr

Converts to this type from the input type.
§

impl FromUniformBytes<64> for Fr

§

fn from_uniform_bytes(bytes: &[u8; 64]) -> Fr

Converts a 512-bit little endian integer into an Fr by reducing by the modulus.

§

impl Hash for Fr

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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

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

impl Legendre for Fr

§

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

§

type Output = Fr

The resulting type after applying the * operator.
§

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

Performs the * operation. Read more
§

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

§

type Output = Fr

The resulting type after applying the * operator.
§

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

Performs the * operation. Read more
§

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

§

type Output = Fr

The resulting type after applying the * operator.
§

fn mul(self, rhs: Fr) -> Fr

Performs the * operation. Read more
§

impl Mul for Fr

§

type Output = Fr

The resulting type after applying the * operator.
§

fn mul(self, rhs: Fr) -> Fr

Performs the * operation. Read more
§

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

§

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

Performs the *= operation. Read more
§

impl MulAssign for Fr

§

fn mul_assign(&mut self, rhs: Fr)

Performs the *= operation. Read more
§

impl<'a> Neg for &'a Fr

§

type Output = Fr

The resulting type after applying the - operator.
§

fn neg(self) -> Fr

Performs the unary - operation. Read more
§

impl Neg for Fr

§

type Output = Fr

The resulting type after applying the - operator.
§

fn neg(self) -> Fr

Performs the unary - operation. Read more
§

impl Ord for Fr

§

fn cmp(&self, other: &Fr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Fr

§

fn eq(&self, other: &Fr) -> 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.
§

impl PartialOrd for Fr

§

fn partial_cmp(&self, other: &Fr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PrimeField for Fr

§

const NUM_BITS: u32 = 254

How many bits are needed to represent an element of this field.
§

const CAPACITY: u32 = 253

How many bits of information can be reliably stored in the field element. Read more
§

const MODULUS: &'static str = MODULUS_STR

Modulus of the field written as a string for debugging purposes. Read more
§

const MULTIPLICATIVE_GENERATOR: Fr = GENERATOR

A fixed multiplicative generator of modulus - 1 order. This element must also be a quadratic nonresidue. Read more
§

const ROOT_OF_UNITY: Fr = ROOT_OF_UNITY

The 2^s root of unity. Read more
§

const ROOT_OF_UNITY_INV: Fr = ROOT_OF_UNITY_INV

Inverse of [Self::ROOT_OF_UNITY].
§

const TWO_INV: Fr = TWO_INV

Inverse of $2$ in the field.
§

const DELTA: Fr = DELTA

Generator of the t-order multiplicative subgroup. Read more
§

const S: u32 = S

An integer s satisfying the equation 2^s * t = modulus - 1 with t odd. Read more
§

type Repr = [u8; 32]

The prime field can be converted back and forth into this binary representation.
§

fn from_repr(repr: <Fr as PrimeField>::Repr) -> CtOption<Fr>

Attempts to convert a byte representation of a field element into an element of this prime field, failing if the input is not canonical (is not smaller than the field’s modulus). Read more
§

fn to_repr(&self) -> <Fr as PrimeField>::Repr

Converts an element of the prime field into the standard byte representation for this field. Read more
§

fn is_odd(&self) -> Choice

Returns true iff this element is odd.
§

fn from_str_vartime(s: &str) -> Option<Self>

Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string. Read more
§

fn from_u128(v: u128) -> Self

Obtains a field element congruent to the integer v. Read more
§

fn from_repr_vartime(repr: Self::Repr) -> Option<Self>

Attempts to convert a byte representation of a field element into an element of this prime field, failing if the input is not canonical (is not smaller than the field’s modulus). Read more
§

fn is_even(&self) -> Choice

Returns true iff this element is even.
§

impl PrimeFieldBits for Fr

Available on crate feature bits only.
§

type ReprBits = [u64; 4]

The backing store for a bit representation of a prime field element.
§

fn to_le_bits(&self) -> BitArray<<Fr as PrimeFieldBits>::ReprBits>

Converts an element of the prime field into a little-endian sequence of bits.
§

fn char_le_bits() -> BitArray<<Fr as PrimeFieldBits>::ReprBits>

Returns the bits of the field characteristic (the modulus) in little-endian order.
§

impl<T> Product<T> for Fr
where T: Borrow<Fr>,

§

fn product<I>(iter: I) -> Fr
where I: Iterator<Item = T>,

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

impl ScalarField for Fr

§

fn to_u64_limbs(self, num_limbs: usize, bit_len: usize) -> Vec<u64>

Returns the base 2<sup>bit_len</sup> little endian representation of the [ScalarField] element up to num_limbs number of limbs (truncates any extra limbs). Read more
§

fn to_bytes_le(&self) -> Vec<u8>

Returns the little endian byte representation of the element.
§

fn get_lower_32(&self) -> u32

Gets the least significant 32 bits of the field element.
§

fn get_lower_64(&self) -> u64

Gets the least significant 64 bits of the field element.
§

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

Creates a field element from a little endian byte representation. Read more
§

impl SerdeObject for Fr

§

fn from_raw_bytes_unchecked(bytes: &[u8]) -> Fr

The purpose of unchecked functions is to read the internal memory representation of a type from bytes as quickly as possible. No sanitization checks are performed to ensure the bytes represent a valid object. As such this function should only be used internally as an extension of machine memory. It should not be used to deserialize externally provided data.
§

fn from_raw_bytes(bytes: &[u8]) -> Option<Fr>

§

fn to_raw_bytes(&self) -> Vec<u8>

§

fn read_raw_unchecked<R>(reader: &mut R) -> Fr
where R: Read,

The purpose of unchecked functions is to read the internal memory representation of a type from disk as quickly as possible. No sanitization checks are performed to ensure the bytes represent a valid object. This function should only be used internally when some machine state cannot be kept in memory (e.g., between runs) and needs to be reloaded as quickly as possible.
§

fn read_raw<R>(reader: &mut R) -> Result<Fr, Error>
where R: Read,

§

fn write_raw<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

§

impl Serialize for Fr

§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

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

§

type Output = Fr

The resulting type after applying the - operator.
§

fn sub(self, rhs: &'b Fr) -> Fr

Performs the - operation. Read more
§

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

§

type Output = Fr

The resulting type after applying the - operator.
§

fn sub(self, rhs: &'b Fr) -> Fr

Performs the - operation. Read more
§

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

§

type Output = Fr

The resulting type after applying the - operator.
§

fn sub(self, rhs: Fr) -> Fr

Performs the - operation. Read more
§

impl Sub for Fr

§

type Output = Fr

The resulting type after applying the - operator.
§

fn sub(self, rhs: Fr) -> Fr

Performs the - operation. Read more
§

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

§

fn sub_assign(&mut self, rhs: &'b Fr)

Performs the -= operation. Read more
§

impl SubAssign for Fr

§

fn sub_assign(&mut self, rhs: Fr)

Performs the -= operation. Read more
§

impl<T> Sum<T> for Fr
where T: Borrow<Fr>,

§

fn sum<I>(iter: I) -> Fr
where I: Iterator<Item = T>,

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

impl WithSmallOrderMulGroup<3> for Fr

§

const ZETA: Fr = ZETA

A field element of small multiplicative order $N$. Read more
§

impl Copy for Fr

§

impl Eq for Fr

§

impl StructuralPartialEq 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§

§

impl<T> AlignerFor<1> for T

§

type Aligner = AlignTo1<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<1024> for T

§

type Aligner = AlignTo1024<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<128> for T

§

type Aligner = AlignTo128<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<16> for T

§

type Aligner = AlignTo16<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<16384> for T

§

type Aligner = AlignTo16384<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<2> for T

§

type Aligner = AlignTo2<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<2048> for T

§

type Aligner = AlignTo2048<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<256> for T

§

type Aligner = AlignTo256<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<32> for T

§

type Aligner = AlignTo32<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<32768> for T

§

type Aligner = AlignTo32768<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<4> for T

§

type Aligner = AlignTo4<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<4096> for T

§

type Aligner = AlignTo4096<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<512> for T

§

type Aligner = AlignTo512<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<64> for T

§

type Aligner = AlignTo64<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<8> for T

§

type Aligner = AlignTo8<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<8192> for T

§

type Aligner = AlignTo8192<T>

The AlignTo* type which aligns Self to ALIGNMENT.
Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<F> BigPrimeField for F
where F: ScalarField + From<[u64; 4]>,

§

fn from_u64_digits(val: &[u64]) -> F

Converts a slice of u64 to [BigPrimeField] 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> ConditionallyNegatable for T
where T: ConditionallySelectable, &'a T: for<'a> Neg<Output = T>,

Source§

fn conditional_negate(&mut self, choice: Choice)

Negate self if choice == Choice(1); otherwise, leave it unchanged. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

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

§

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

Compare self to key and return true if they are equal.
§

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<F> FieldOps for F
where F: PrimeField,

§

fn invert(&self) -> Option<F>

Returns multiplicative inversion if any.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

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

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

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<F> LoadedScalar<F> for F
where F: PrimeField,

§

type Loader = NativeLoader

[Loader].
§

fn loader(&self) -> &NativeLoader

Returns [Loader].
§

fn pow_var(&self, exp: &F, _: usize) -> F

Returns power to exponent, where exponent is also [LoadedScalar]. If Loader is for Halo2, then exp must have at most exp_max_bits bits (otherwise constraints will fail). Read more
§

fn square(&self) -> Self

Returns square.
§

fn invert(&self) -> Option<Self>

Returns inverse if any.
§

fn pow_const(&self, exp: u64) -> Self

Returns power to exponent.
§

fn powers(&self, n: usize) -> Vec<Self>

Returns powers up to exponent n-1.
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

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
§

impl<'a, T> RCowCompatibleRef<'a> for T
where T: Clone + 'a,

§

type RefC = &'a T

The (preferably) ffi-safe equivalent of &Self.
§

type ROwned = T

The owned version of Self::RefC.
§

fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC

Converts a reference to an FFI-safe type
§

fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T

Converts an FFI-safe type to a reference
§

impl<S> ROExtAcc for S

§

fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F

Gets a reference to a field, determined by offset. Read more
§

fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F

Gets a muatble reference to a field, determined by offset. Read more
§

fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F

Gets a const pointer to a field, the field is determined by offset. Read more
§

fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F

Gets a mutable pointer to a field, determined by offset. Read more
§

impl<S> ROExtOps<Aligned> for S

§

fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more
§

fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Aligned>, right: &mut S)

Swaps a field (determined by offset) with the same field in right. Read more
§

fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> F
where F: Copy,

Gets a copy of a field (determined by offset). The field is determined by offset. Read more
§

impl<S> ROExtOps<Unaligned> for S

§

fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more
§

fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, right: &mut S)

Swaps a field (determined by offset) with the same field in right. Read more
§

fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> F
where F: Copy,

Gets a copy of a field (determined by offset). The field is determined by offset. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<F, Fp, Pt, FC> Selectable<F, Reduced<Pt, Fp>> for FC
where F: BigPrimeField, Pt: Clone, FC: Selectable<F, Pt>,

§

fn select( &self, ctx: &mut Context<F>, a: Reduced<Pt, Fp>, b: Reduced<Pt, Fp>, sel: AssignedValue<F>, ) -> Reduced<Pt, Fp>

§

fn select_by_indicator( &self, ctx: &mut Context<F>, a: &impl AsRef<[Reduced<Pt, Fp>]>, coeffs: &[AssignedValue<F>], ) -> Reduced<Pt, Fp>

§

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

§

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

Compares the address of self with the address of other. Read more
§

fn piped<F, U>(self, f: F) -> U
where F: FnOnce(Self) -> U, Self: Sized,

Emulates the pipeline operator, allowing method syntax in more places. Read more
§

fn piped_ref<'a, F, U>(&'a self, f: F) -> U
where F: FnOnce(&'a Self) -> U,

The same as piped except that the function takes &Self Useful for functions that take &Self instead of Self. Read more
§

fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U
where F: FnOnce(&'a mut Self) -> U,

The same as piped, except that the function takes &mut Self. Useful for functions that take &mut Self instead of Self.
§

fn mutated<F>(self, f: F) -> Self
where F: FnOnce(&mut Self), Self: Sized,

Mutates self using a closure taking self by mutable reference, passing it along the method chain. Read more
§

fn observe<F>(self, f: F) -> Self
where F: FnOnce(&Self), Self: Sized,

Observes the value of self, passing it along unmodified. Useful in long method chains. Read more
§

fn into_<T>(self) -> T
where Self: Into<T>,

Performs a conversion with Into. using the turbofish .into_::<_>() syntax. Read more
§

fn as_ref_<T>(&self) -> &T
where Self: AsRef<T>, T: ?Sized,

Performs a reference to reference conversion with AsRef, using the turbofish .as_ref_::<_>() syntax. Read more
§

fn as_mut_<T>(&mut self) -> &mut T
where Self: AsMut<T>, T: ?Sized,

Performs a mutable reference to mutable reference conversion with AsMut, using the turbofish .as_mut_::<_>() syntax. Read more
§

fn drop_(self)
where Self: Sized,

Drops self using method notation. Alternative to std::mem::drop. Read more
§

impl<F> SerdePrimeField for F
where F: PrimeField + SerdeObject,

§

fn read<R>(reader: &mut R, format: SerdeFormat) -> Result<Self, Error>
where R: Read,

Reads a field element as bytes from the buffer according to the format: Read more
§

fn write<W>(&self, writer: &mut W, format: SerdeFormat) -> Result<(), Error>
where W: Write,

Writes a field element as bytes to the buffer according to the format: Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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
§

impl<This> TransmuteElement for This
where This: ?Sized,

§

unsafe fn transmute_element<T>(self) -> Self::TransmutedPtr
where Self: CanTransmuteElement<T>,

Transmutes the element type of this pointer.. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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> TypeIdentity for T
where T: ?Sized,

§

type Type = T

This is always Self.
§

fn into_type(self) -> Self::Type
where Self: Sized, Self::Type: Sized,

Converts a value back to the original type.
§

fn as_type(&self) -> &Self::Type

Converts a reference back to the original type.
§

fn as_type_mut(&mut self) -> &mut Self::Type

Converts a mutable reference back to the original type.
§

fn into_type_box(self: Box<Self>) -> Box<Self::Type>

Converts a box back to the original type.
§

fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>

Converts an Arc back to the original type. Read more
§

fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>

Converts an Rc back to the original type. Read more
§

fn from_type(this: Self::Type) -> Self
where Self: Sized, Self::Type: Sized,

Converts a value back to the original type.
§

fn from_type_ref(this: &Self::Type) -> &Self

Converts a reference back to the original type.
§

fn from_type_mut(this: &mut Self::Type) -> &mut Self

Converts a mutable reference back to the original type.
§

fn from_type_box(this: Box<Self::Type>) -> Box<Self>

Converts a box back to the original type.
§

fn from_type_arc(this: Arc<Self::Type>) -> Arc<Self>

Converts an Arc back to the original type.
§

fn from_type_rc(this: Rc<Self::Type>) -> Rc<Self>

Converts an Rc back to the original type.
§

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T, Scalar> FftGroup<Scalar> for T
where Scalar: Field, T: Copy + Send + Sync + 'static + GroupOpsOwned + ScalarMulOwned<Scalar>,

§

impl<T, Scalar> FftGroup<Scalar> for T
where Scalar: Field, T: Copy + Send + Sync + 'static + GroupOpsOwned + ScalarMulOwned<Scalar>,

§

impl<F> FieldExt for F
where F: PrimeField + FromUniformBytes<64> + Ord,

§

impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
where T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + AddAssign<Rhs> + SubAssign<Rhs>,

§

impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
where T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + AddAssign<Rhs> + SubAssign<Rhs>,

§

impl<T, Rhs, Output> GroupOpsOwned<Rhs, Output> for T
where T: for<'r> GroupOps<&'r Rhs, Output>,

§

impl<T, Rhs, Output> GroupOpsOwned<Rhs, Output> for T
where T: for<'r> GroupOps<&'r Rhs, Output>,

§

impl<T, Rhs, Output> ScalarMul<Rhs, Output> for T
where T: Mul<Rhs, Output = Output> + MulAssign<Rhs>,

§

impl<T, Rhs, Output> ScalarMul<Rhs, Output> for T
where T: Mul<Rhs, Output = Output> + MulAssign<Rhs>,

§

impl<T, Rhs, Output> ScalarMulOwned<Rhs, Output> for T
where T: for<'r> ScalarMul<&'r Rhs, Output>,

§

impl<T, Rhs, Output> ScalarMulOwned<Rhs, Output> for T
where T: for<'r> ScalarMul<&'r Rhs, Output>,

§

impl<T> SyncDeps for T

§

impl<This> ValidTag_Bounds for This
where This: Debug + Clone + PartialEq,