pub trait UnsignedMulPrimitives {
type FP: TowerField;
type FExpBase: TowerField + ExtensionField<Self::FP>;
const BIT_LENGTH: usize;
// Required methods
fn mul(x: Self::FP, y: Self::FP) -> (Self::FP, Self::FP);
fn generator() -> Self::FExpBase;
fn shifted_generator() -> Self::FExpBase;
// Provided method
fn is_bit_set_at(a: Self::FP, index: usize) -> bool { ... }
}
Expand description
Helper trait to create Multiplication gadgets for unsigned integers of different bit lengths.
Required Associated Constants§
const BIT_LENGTH: usize
Required Associated Types§
type FP: TowerField
type FExpBase: TowerField + ExtensionField<Self::FP>
Required Methods§
Sourcefn mul(x: Self::FP, y: Self::FP) -> (Self::FP, Self::FP)
fn mul(x: Self::FP, y: Self::FP) -> (Self::FP, Self::FP)
Computes the unsigned primitive mul of x*y = z
and returns the tuple (z_high, z_low)
representing the high and low bits respectively.
fn generator() -> Self::FExpBase
Sourcefn shifted_generator() -> Self::FExpBase
fn shifted_generator() -> Self::FExpBase
Returns the generator shifted by the bit length of Self::FP
.
Provided Methods§
fn is_bit_set_at(a: Self::FP, index: usize) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.