Struct ring::arithmetic::bigint::modulus::OwnedModulus
source · pub struct OwnedModulus<M> {
limbs: BoxedLimbs<M>,
n0: N0,
len_bits: BitLength,
}
Expand description
The modulus m for a ring ℤ/mℤ, along with the precomputed values needed for efficient Montgomery multiplication modulo m. The value must be odd and larger than 2. The larger-than-1 requirement is imposed, at least, by the modular inversion code.
Fields§
§limbs: BoxedLimbs<M>
§n0: N0
§len_bits: BitLength
Implementations§
source§impl<M> OwnedModulus<M>
impl<M> OwnedModulus<M>
pub(crate) fn from_be_bytes(input: Input<'_>) -> Result<Self, KeyRejected>
pub fn verify_less_than<L>(&self, l: &Modulus<'_, L>) -> Result<(), Unspecified>
pub fn to_elem<L>( &self, l: &Modulus<'_, L>, ) -> Result<Elem<L, Unencoded>, Unspecified>
pub(crate) fn modulus(&self, cpu_features: Features) -> Modulus<'_, M>
pub fn len_bits(&self) -> BitLength
source§impl<M: PublicModulus> OwnedModulus<M>
impl<M: PublicModulus> OwnedModulus<M>
pub fn be_bytes( &self, ) -> LeadingZerosStripped<impl ExactSizeIterator<Item = u8> + Clone + '_> ⓘ
Trait Implementations§
source§impl<M: PublicModulus> Clone for OwnedModulus<M>
impl<M: PublicModulus> Clone for OwnedModulus<M>
Auto Trait Implementations§
impl<M> Freeze for OwnedModulus<M>
impl<M> RefUnwindSafe for OwnedModulus<M>where
M: RefUnwindSafe,
impl<M> Send for OwnedModulus<M>where
M: Send,
impl<M> Sync for OwnedModulus<M>where
M: Sync,
impl<M> Unpin for OwnedModulus<M>where
M: Unpin,
impl<M> UnwindSafe for OwnedModulus<M>where
M: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)