Trait UnsignedMulPrimitives

Source
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§

Required Associated Types§

Required Methods§

Source

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.

Source

fn generator() -> Self::FExpBase

Source

fn shifted_generator() -> Self::FExpBase

Returns the generator shifted by the bit length of Self::FP.

Provided Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl UnsignedMulPrimitives for u32

Source§

impl UnsignedMulPrimitives for u64

Implementors§