Trait fff::PrimeFieldRepr [−][src]
pub trait PrimeFieldRepr: Sized + Copy + Clone + Eq + Ord + Send + Sync + Default + Debug + Display + 'static + AsRef<[u64]> + AsMut<[u64]> + From<u64> + Serialize + Deserialize<'static> {}Show methods
fn sub_noborrow(&mut self, other: &Self); fn add_nocarry(&mut self, other: &Self); fn num_bits(&self) -> u32; fn is_zero(&self) -> bool; fn is_odd(&self) -> bool; fn is_even(&self) -> bool; fn div2(&mut self); fn shr(&mut self, amt: u32); fn mul2(&mut self); fn shl(&mut self, amt: u32); fn write_be<W: Write>(&self, writer: W) -> Result<()> { ... } fn read_be<R: Read>(&mut self, reader: R) -> Result<()> { ... } fn write_le<W: Write>(&self, writer: W) -> Result<()> { ... } fn read_le<R: Read>(&mut self, reader: R) -> Result<()> { ... }
Expand description
This trait represents a wrapper around a biginteger which can encode any element of a particular
prime field. It is a smart wrapper around a sequence of u64
limbs, least-significant digit
first.
Required methods
fn sub_noborrow(&mut self, other: &Self)
[src]
fn sub_noborrow(&mut self, other: &Self)
[src]Subtract another represetation from this one.
fn add_nocarry(&mut self, other: &Self)
[src]
fn add_nocarry(&mut self, other: &Self)
[src]Add another representation to this one.
fn num_bits(&self) -> u32
[src]
fn num_bits(&self) -> u32
[src]Compute the number of bits needed to encode this number. Always a multiple of 64.
Provided methods
fn write_be<W: Write>(&self, writer: W) -> Result<()>
[src]
fn write_be<W: Write>(&self, writer: W) -> Result<()>
[src]Writes this PrimeFieldRepr
as a big endian integer.
fn read_be<R: Read>(&mut self, reader: R) -> Result<()>
[src]
fn read_be<R: Read>(&mut self, reader: R) -> Result<()>
[src]Reads a big endian integer into this representation.