pub enum NsField {
Prime(u64),
Gf4,
}Expand description
The coefficient field of the general engine. Elements are u64-encoded: Prime(p) uses the residues
0..p; Gf4 uses 2-bit pairs a + b·ω in the basis {1, ω} with ω² = ω + 1 (value a | b<<1).
Variants§
Implementations§
Source§impl NsField
impl NsField
Sourcepub fn characteristic(self) -> u64
pub fn characteristic(self) -> u64
The field characteristic (p, resp. 2) — the only parameter NS degree actually depends on.
pub fn add(self, a: u64, b: u64) -> u64
pub fn neg(self, a: u64) -> u64
pub fn sub(self, a: u64, b: u64) -> u64
pub fn mul(self, a: u64, b: u64) -> u64
Trait Implementations§
impl Copy for NsField
impl Eq for NsField
impl StructuralPartialEq for NsField
Auto Trait Implementations§
impl Freeze for NsField
impl RefUnwindSafe for NsField
impl Send for NsField
impl Sync for NsField
impl Unpin for NsField
impl UnsafeUnpin for NsField
impl UnwindSafe for NsField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more