pub struct GeneralField { /* private fields */ }
Expand description

Implements field arithmetic compatible with all IrreducablePolynomials.

Recall that there are two strategies for optimizing field arithmetic in GF(2^8): accessing direct multiplication and division tables, and manipulating logarithms and exponentials. The latter method requires fewer operations, but is only possible if the given IrreducablePolynomial is primitive.

This struct uses direct multiplication and division tables for its operations, and is compatible with all IrreducablePolynomials, including primitive ones. Operations are expected to be less performant than those implemented by PrimitivePolynomialField, with the exception of vector operations, which may be accelerated in both using multiplication and division tables. See the Field documentation for more details regarding vector operations.

Implementations§

Constructs a new GeneralField with all tables initialized.

Trait Implementations§

Returns the polynomial modulo which all operations are performed.
Returns the result of src * scale in this field.
Returns the result of src / scale in this field. Read more
Returns the result of 2^x in this field.
Returns the result of scale * 2^x in this field.
Adds scale * src[0..len] into dst[0..len] in place.
Multiplies dst[0..len] by scale in place.
Divides dst[0..len] by scale in place. Read more
Adds left and right, returning their sum.
Subtracts right from left, returning the difference.
Adds src[0..len] into dst[0..len].
Adds src into dst in place, over the smallest common length. Read more
Adds src[0..len] into dst[0..len]. Read more
Adds src * scale into dst in place, over the smallest common length. Read more
Adds src[0..len] * scale into dst[0..len]. Read more
Subtracts src[0..len] from dst[0..len] in place.
Subracts scale * src[0..len] from dst[0..len] in place.
Subtracts src from dst in place, over the smallest common length. Read more
Subtracts src[0..len] from dst[0..len] in place. Read more
Subtracts scale * src from dst in place, over the smallest common length. Read more
Subtracts scale * src[0..len] from dst[0..len] in place. Read more
Multiplies dst by scale in place.
Divides dst by scale in place. 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

Returns the argument unchanged.

Calls U::from(self).

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

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.