Struct ark_ff::fields::models::Fp256[][src]

pub struct Fp256<P>(pub BigInteger256, _);
Expand description

Represents an element of the prime field F_p, where p == P::MODULUS. This type can represent elements in any field of size at most 256 bits.

Implementations

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Reads Self from reader.

Reads Self from reader without compression.

Reads self from reader without compression, and without performing validity checks. Should be used only when the input is trusted. Read more

Reads Self and Flags from reader. Returns empty flags by default. Read more

Serializes self into writer. It is left up to a particular type for how it strikes the serialization efficiency vs compression tradeoff. For standard types (e.g. bool, lengths, etc.) typically an uncompressed form is used, whereas for algebraic types compressed forms are used. Read more

Serializes self into writer without compression.

Serializes self into writer without compression, and without performing validity checks. Should be used only when there is no danger of adversarial manipulation of the output. Read more

Serializes self and flags into writer.

Serializes self and flags into writer.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Outputs a string containing the value of self, chunked up into 64-bit limbs.

Formats the value using the given formatter. Read more

Returns self * other.inverse() if other.inverse() is Some, and panics otherwise.

The resulting type after applying the / operator.

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Computes self *= other.inverse() if other.inverse() is Some, and panics otherwise.

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Returns the 2^s root of unity.

Returns the 2^s * small_subgroup_base^small_subgroup_base_adicity root of unity if a small subgroup is defined. Read more

Returns the multiplicative generator of char() - 1 order.

Returns the root of unity of order n, if one exists. If no small multiplicative subgroup is defined, this is the 2-adic root of unity of order n (for n a power of 2). If a small multiplicative subgroup is defined, this is the root of unity of order n for the larger subgroup generated by FftParams::LARGE_SUBGROUP_ROOT_OF_UNITY (for n = 2^i * FftParams::SMALL_SUBGROUP_BASE^j for some i, j). Read more

The Frobenius map has no effect in a prime field.

Returns the extension degree of this field with respect to Self::BasePrimeField. Read more

Convert a slice of base prime field elements into a field element. If the slice length != Self::extension_degree(), must return None. Read more

Returns self + self.

Doubles self in place.

Returns the characteristic of the field, in little-endian representation. Read more

Returns a field element with an extra sign bit used for group parsing if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output. Read more

Returns self * self.

Squares self in place.

Computes the multiplicative inverse of self if self is nonzero.

Returns a field element if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output. Read more

Exponentiates this element by a number represented with u64 limbs, least significant limb first. Read more

Exponentiates a field element f by a number represented with u64 limbs, using a precomputed table containing as many powers of 2 of f as the 1 + the floor of log2 of the exponent exp, starting from the 1st power. That is, powers_of_2 should equal &[p, p^2, p^4, ..., p^(2^n)] when exp has at most n bits. Read more

Converts Self::BigInteger into Self

Panics

This method panics if int is larger than P::MODULUS.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Reads Self from reader.

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

The associated error which can be returned from parsing.

Feeds this value into the given Hasher. Read more

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

Performs the conversion.

Performs the conversion.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

Returns the multiplicative identity element of Self, 1. Read more

Returns true if self is equal to the multiplicative identity. Read more

Sets self to the multiplicative identity element of Self, 1.

Note that this implementation of Ord compares field elements viewing them as integers in the range 0, 1, …, P::MODULUS - 1. However, other implementations of PrimeField might choose a different ordering, and as such, users should use this Ord for applications where any ordering suffices (like in a BTreeMap), and not in applications where a particular ordering is required.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Note that this implementation of PartialOrd compares field elements viewing them as integers in the range 0, 1, …, P::MODULUS - 1. However, other implementations of PrimeField might choose a different ordering, and as such, users should use this PartialOrd for applications where any ordering suffices (like in a BTreeMap), and not in applications where a particular ordering is required.

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

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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

Returns a prime field element from its underlying representation.

Returns the underlying representation of the prime field element.

Reads bytes in big-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them. Read more

Reads bytes in little-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them. Read more

Return the QNR^t, for t defined by 2^s * t = MODULUS - 1, and t coprime to 2. Read more

Returns the field size in bits.

Returns the trace.

Returns the trace minus one divided by two.

Returns the modulus minus one divided by two.

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

Returns a LegendreSymbol, which indicates whether this field element is 1 : a quadratic residue 0 : equal to 0 -1 : a quadratic non-residue Read more

Returns the square root of self, if it exists.

Sets self to be the square root of self, if it exists.

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

Serializes self into writer.

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

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

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.