Skip to main content

Module poly_basis

Module poly_basis 

Source
Expand description

Raw polynomial coordinates for GF(2^128) modulo x^128 + x^7 + x^2 + x + 1.

Prefer the typed field for ordinary arithmetic. These helpers are for buffers whose representation the caller manages.

The coordinates stay a bare integer on purpose. Wrapped, the two bases look alike, and a value in the wrong one is silently wrong.

Structs§

LowStageTwiddles
The twiddles of the lowest LOW_STAGES stages of a single-column additive transform.

Constants§

HAS_HARDWARE_CLMUL
Whether multiplication and squaring use hardware carryless multiplication.
LOW_STAGES
Stages LowStageTwiddles::forward runs together, over runs of 2^LOW_STAGES elements.

Functions§

butterfly_forward
Apply (lo, hi) -> (lo + scalar*hi, lo + (scalar + 1)*hi) in place.
butterfly_inverse
Undo butterfly_forward with the same scalar.
from_tower
The polynomial-basis coordinates of a tower element.
from_tower_slice
The polynomial-basis coordinates of a whole slice of tower-basis bit patterns.
mul
Multiply two elements expressed in polynomial coordinates.
mul_slice
Multiply every polynomial-basis element by the same scalar.
square
The square of an element, given and returned in the polynomial basis.
to_tower
The tower element with the given polynomial-basis coordinates.
to_tower_slice
The tower-basis bit patterns of a whole slice of polynomial-basis coordinates.