Trait scuttlebutt::field::SmallBinaryField
source · 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:
Selfisrepr(transparent)to au64Selfconsists of 63 or fewer bits that are stored in the lower bits of theu64.- The upper bits of the
u64are 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§
sourcefn from_lower_bits(x: u64) -> Self
fn from_lower_bits(x: u64) -> Self
Produce a field element of Self by zeroing the upper bits of x.
Provided Methods§
Object Safety§
This trait is not object safe.