Trait ff::PrimeFieldRepr [] [src]

pub trait PrimeFieldRepr: Sized + Copy + Clone + Eq + Ord + Send + Sync + Debug + 'static + Rand + AsRef<[u64]> + From<u64> {
    fn sub_noborrow(&mut self, other: &Self) -> bool;
    fn add_nocarry(&mut self, other: &Self) -> bool;
    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 mul2(&mut self);
}

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

Subtract another reprensetation from this one, returning the borrow bit.

Add another representation to this one, returning the carry bit.

Compute the number of bits needed to encode this number.

Returns true iff this number is zero.

Returns true iff this number is odd.

Returns true iff this number is even.

Performs a rightwise bitshift of this number, effectively dividing it by 2.

Performs a leftwise bitshift of this number, effectively multiplying it by 2. Overflow is ignored.

Implementors