Skip to main content

HardwareField

Trait HardwareField 

Source
pub trait HardwareField: TowerField + PackableField {
    // Required methods
    fn to_hardware(self) -> Flat<Self>;
    fn from_hardware(value: Flat<Self>) -> Self;
    fn add_hardware(lhs: Flat<Self>, rhs: Flat<Self>) -> Flat<Self>;
    fn add_hardware_packed(
        lhs: PackedFlat<Self>,
        rhs: PackedFlat<Self>,
    ) -> PackedFlat<Self>;
    fn mul_hardware(lhs: Flat<Self>, rhs: Flat<Self>) -> Flat<Self>;
    fn mul_hardware_packed(
        lhs: PackedFlat<Self>,
        rhs: PackedFlat<Self>,
    ) -> PackedFlat<Self>;
    fn mul_hardware_scalar_packed(
        lhs: PackedFlat<Self>,
        rhs: Flat<Self>,
    ) -> PackedFlat<Self>;
    fn tower_bit_from_hardware(value: Flat<Self>, bit_idx: usize) -> u8;
}
Expand description

Trait for Hardware Isomorphism acceleration.

Required Methods§

Source

fn to_hardware(self) -> Flat<Self>

Convert standard Tower element to hardware basis (Isomorphic).

Source

fn from_hardware(value: Flat<Self>) -> Self

Convert hardware element back to Tower basis.

Source

fn add_hardware(lhs: Flat<Self>, rhs: Flat<Self>) -> Flat<Self>

Sum two elements assuming they are already in hardware basis.

Source

fn add_hardware_packed( lhs: PackedFlat<Self>, rhs: PackedFlat<Self>, ) -> PackedFlat<Self>

Sum packed vectors in hardware basis.

Source

fn mul_hardware(lhs: Flat<Self>, rhs: Flat<Self>) -> Flat<Self>

Multiply two elements assuming they are already in hardware basis.

Source

fn mul_hardware_packed( lhs: PackedFlat<Self>, rhs: PackedFlat<Self>, ) -> PackedFlat<Self>

Multiply packed vectors in hardware basis.

Source

fn mul_hardware_scalar_packed( lhs: PackedFlat<Self>, rhs: Flat<Self>, ) -> PackedFlat<Self>

Multiply packed vectors by a scalar in hardware basis.

Source

fn tower_bit_from_hardware(value: Flat<Self>, bit_idx: usize) -> u8

Extracts the bit_idx bit of the canonical Tower representation directly from the Hardware (Flat) representation without a full basis conversion. Strictly constant time.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§