#[repr(transparent)]
pub struct ExtElem(_);
Expand description

Instances of ExtElem are elements of a finite field F_p^4. They are represented as elements of F_p[X] / (X^4 + 11). This large finite field (about 2^128 elements) is used when the security of operations depends on the size of the field. The field extension ExtElem has Elem as a subfield, so operations on elements of each are compatible. The irreducible polynomial x^4 + 11 was chosen because 11 is the simplest choice of BETA for x^4 + BETA that makes this polynomial irreducible.

Implementations§

Explicitly construct an ExtElem from parts.

Create an ExtElem from an Elem.

Create an ExtElem from a raw integer.

Return the base field term of an Elem.

Return Elem as a vector of base field values.

Trait Implementations§

Addition for Baby Bear ExtElem

The resulting type after applying the + operator.

Simple addition case for Baby Bear ExtElem

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

Generate a random field element uniformly.

Raise a ExtElem to a power of n.

Compute the multiplicative inverse of an ExtElem.

Invalid, a value that is not a member of the field. This should only be used with the “is_valid” or “unwrap_or_zero” methods.
Zero, the additive identity.
One, the multiplicative identity.
How many u32 words are required to hold a single element
Import a number into the field from the natural numbers.
Represent a field element as a sequence of u32s
Interpret a sequence of u32s as a field element
Returns true if this element is not INVALID. Unlike most methods, this may be called on an INVALID element.
Returns 0 if this element is INVALID, else the value of this element. Unlike most methods, this may be called on an INVALID element.
Returns this element, but checks to make sure it’s valid.
Interprets a slice of these elements as u32s. These elements may not be INVALID.
Interprets a slice of these elements as u32s. These elements may potentially be INVALID.
Interprets a slice of u32s as a slice of these elements. These elements may not be INVALID.
Interprets a slice of u32s as a slice of these elements. These elements may be INVALID.

Returns the subelements of a Elem.

Construct a field element
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Multiplication by a Baby Bear Elem

The resulting type after applying the * operator.

Multiplication for a subfield Elem by an ExtElem

The resulting type after applying the * operator.
The resulting type after applying the * operator.
Performs the * operation. Read more

Simple multiplication case by a Baby Bear Elem

Performs the *= operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Subtraction for Baby Bear ExtElem

The resulting type after applying the - operator.

Simple subtraction case for Baby Bear ExtElem

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
Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
If this function returns true, then it must be valid to reinterpret bits as &Self.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more