Struct winter_math::fields::f128::BaseElement [−][src]
pub struct BaseElement(_);Expand description
Represents a base field element.
Internal values are stored in their canonical form in the range [0, M). The backing type is
u128.
Implementations
Trait Implementations
Performs the += operation. Read more
Returns the “default value” for a type. Read more
Reads a sequence of bytes from the provided source, attempts to deserialize these bytes
into Self, and returns the result. Read more
fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError> where
R: ByteReader,
fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError> where
R: ByteReader,
Reads a sequence of bytes from the provided source, attempts to deserialize these bytes
into a vector with the specified number of Self elements, and returns the result. Read more
Performs the /= operation. Read more
Defines a quadratic extension of the base field over an irreducible polynomial x2 - x - 1. Thus, an extension element is defined as α + β * φ, where φ is a root of this polynomial, and α and β are base field elements.
Returns a product of a and b in the field defined by this extension.
Returns Frobenius automorphisms for x in the field defined by this extension.
Returns true if this extension is supported for the underlying base field.
Cubic extension for this field is not implemented as quadratic extension already provides sufficient security level.
Returns a product of a and b in the field defined by this extension.
Returns Frobenius automorphisms for x in the field defined by this extension.
Returns true if this extension is supported for the underlying base field.
type PositiveInteger = u128
type PositiveInteger = u128
A type defining positive integers big enough to describe a field modulus for
Self::BaseField with no loss of precision. Read more
type BaseField = Self
type BaseField = Self
Base field type for this finite field. For prime fields, BaseField should be set
to Self. Read more
Number of bytes needed to encode an element
True if internal representation of the element is the same as its canonical representation.
Returns a multiplicative inverse of this field element. If this element is ZERO, ZERO is returned. Read more
Converts a list of elements into a list of bytes. Read more
Converts a list of bytes into a list of field elements. Read more
Returns a vector of length n initialized with all ZERO elements. Read more
Converts a list of field elements into a list of elements in the underlying base field. Read more
Exponentiates this field element by power parameter.
Performs the *= operation. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Size of Self in bytes. Read more
sage: MODULUS = 2^128 - 45 * 2^40 + 1
sage: GF(MODULUS).is_prime_field()
True
sage: GF(MODULUS).order()
340282366920938463463374557953744961537
sage: is_odd((MODULUS - 1) / 2^40)
True
sage: k = (MODULUS - 1) / 2^40
sage: GF(MODULUS).primitive_element()^k
23953097886125630542083529559205016746
The number of bits needed to represents Self::MODULUS.
Returns byte representation of the field modulus in little-endian byte order.
Returns a canonical integer representation of this field element.
Returns the root of unity of order 2^n. Read more
Performs the -= operation. Read more
Converts a slice of bytes into a field element; returns error if the value encoded in bytes is not a valid field element. The bytes are assumed to be in little-endian byte order.
Auto Trait Implementations
impl RefUnwindSafe for BaseElement
impl Send for BaseElement
impl Sync for BaseElement
impl Unpin for BaseElement
impl UnwindSafe for BaseElement
Blanket Implementations
Mutably borrows from an owned value. Read more
