Trait fpe::ff1::Numeral [−][src]
pub trait Numeral {
type Bytes: AsRef<[u8]>;
fn from_bytes(s: impl Iterator<Item = u8>) -> Self;
fn to_bytes(&self, b: usize) -> Self::Bytes;
fn add_mod_exp(self, other: Self, radix: u32, m: usize) -> Self;
fn sub_mod_exp(self, other: Self, radix: u32, m: usize) -> Self;
}
Expand description
An integer.
Associated Types
Required methods
fn from_bytes(s: impl Iterator<Item = u8>) -> Self
fn from_bytes(s: impl Iterator<Item = u8>) -> Self
Returns the integer interpreted from the given bytes in big-endian order.
Returns the big-endian byte representation of this integer.
fn add_mod_exp(self, other: Self, radix: u32, m: usize) -> Self
fn add_mod_exp(self, other: Self, radix: u32, m: usize) -> Self
Compute (self + other) mod radix^m
fn sub_mod_exp(self, other: Self, radix: u32, m: usize) -> Self
fn sub_mod_exp(self, other: Self, radix: u32, m: usize) -> Self
Compute (self - other) mod radix^m