pub trait TowerLevel: Field + Sealed {
type Repr: Copy;
const LOG_BITS: usize;
// Required methods
fn from_repr(r: Self::Repr) -> Self;
fn to_repr(self) -> Self::Repr;
fn mul_alpha(self) -> Self;
fn from_le_byte_iter(bytes: impl Iterator<Item = u8>) -> Self;
fn cantor_basis(i: usize) -> Self;
}Expand description
One level of the Wiedemann tower, GF(2^(2^k)), in whichever basis carries it.
The tower fixes each level as an abstract field, not as a set of bit patterns.
An implementation may hold its elements in any F_2-basis of that field.
What it may not do is report a Cantor basis other than the image of the tower’s own.
That is what makes every transform agree whichever representation runs it.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn from_repr(r: Self::Repr) -> Self
fn from_repr(r: Self::Repr) -> Self
Build an element from a bit pattern, discarding the bits above 2^LOG_BITS.
Sourcefn mul_alpha(self) -> Self
fn mul_alpha(self) -> Self
Multiply by the tower’s generator X_{k−1} of this level over the one below.
Sourcefn from_le_byte_iter(bytes: impl Iterator<Item = u8>) -> Self
fn from_le_byte_iter(bytes: impl Iterator<Item = u8>) -> Self
Build an element from the next RawDataSerializable::NUM_BYTES bytes of a
little-endian byte stream, discarding the bits above 2^LOG_BITS.
§Panics
Panics if the stream ends before a whole element has been read.
Sourcefn cantor_basis(i: usize) -> Self
fn cantor_basis(i: usize) -> Self
The i-th vector of the Cantor basis of this level.
§Panics
Panics if i is at least the bit width 2^LOG_BITS of this level.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".