Skip to main content

Field

Trait Field 

Source
pub trait Field:
    Copy
    + Default
    + Debug
    + PartialEq {
    type Int: PrimInt + Default + Debug + From<u8> + Into<u128> + Into<Self::Long> + Truncate<u128>;
    type Long: PrimInt + From<Self::Int>;
    type LongLong: PrimInt;

    const Q: Self::Int;
    const QL: Self::Long;
    const QLL: Self::LongLong;
    const BARRETT_SHIFT: usize;
    const BARRETT_MULTIPLIER: Self::LongLong;

    // Required methods
    fn small_reduce(x: Self::Int) -> Self::Int;
    fn barrett_reduce(x: Self::Long) -> Self::Int;
}

Required Associated Constants§

Source

const Q: Self::Int

Source

const QL: Self::Long

Source

const QLL: Self::LongLong

Source

const BARRETT_SHIFT: usize

Source

const BARRETT_MULTIPLIER: Self::LongLong

Required Associated Types§

Required Methods§

Source

fn small_reduce(x: Self::Int) -> Self::Int

Source

fn barrett_reduce(x: Self::Long) -> Self::Int

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.

Implementors§

Source§

impl Field for BaseField

Source§

const Q: Self::Int = 8_380_417

Source§

const QL: Self::Long = 8_380_417

Source§

const QLL: Self::LongLong = 8_380_417

Source§

const BARRETT_SHIFT: usize

Source§

const BARRETT_MULTIPLIER: Self::LongLong

Source§

type Int = u32

Source§

type Long = u64

Source§

type LongLong = u128