pub unsafe trait SmallBinaryField: FiniteField<PrimeField = F2> + TransparentWrapper<u64> + Zeroable {
    // Required methods
    fn from_lower_bits(x: u64) -> Self;
    fn reduce(x: U64x2) -> Self;

    // Provided method
    fn reduce_vectored<const N: usize>(
        uppers: [U64x2; N],
        lowers: [U64x2; N]
    ) -> [U64x2; N]
       where ArrayUnrolledOps: UnrollableArraySize<N> { ... }
}
Expand description

A GF(2) extension field such that:

  1. Self is repr(transparent) to a u64
  2. Self consists of 63 or fewer bits that are stored in the lower bits of the u64.
  3. The upper bits of the u64 are zero.

§Safety

All the requirements above must be met when this trait is unsafe impl’d.

Note that types which implement SmallBinaryField, do not need to (and probably should not) implement [bytemuck::Pod]. This type wraps a POD u64, but this type has additional requirements on its set of values, compared to a u64.

Required Methods§

source

fn from_lower_bits(x: u64) -> Self

Produce a field element of Self by zeroing the upper bits of x.

source

fn reduce(x: U64x2) -> Self

Reduce the result of a single 128-bit carryless multiply of two Self values modulo [FiniteField::reduce_multiplication_over()]

Provided Methods§

source

fn reduce_vectored<const N: usize>( uppers: [U64x2; N], lowers: [U64x2; N] ) -> [U64x2; N]
where ArrayUnrolledOps: UnrollableArraySize<N>,

Reduce the result of several 128-bit carryless multiply operations over [FiniteField::reduce_multiplication_over()].

Object Safety§

This trait is not object safe.

Implementors§