Struct crypto_bigint::BoxedUint
source · pub struct BoxedUint { /* private fields */ }
Available on crate feature
alloc
only.Expand description
Fixed-precision heap-allocated big unsigned integer.
Alternative to the stack-allocated Uint
but with a
fixed precision chosen at runtime instead of compile time.
Unlike many other heap-allocated big integer libraries, this type is not arbitrary precision and will wrap at its fixed-precision rather than automatically growing.
Implementations§
source§impl BoxedUint
impl BoxedUint
sourcepub fn max(bits_precision: usize) -> Option<Self>
pub fn max(bits_precision: usize) -> Option<Self>
Get the maximum value for a given number of bits of precision.
Returns None
if the number of bits is not a multiple of the
Limb
size.
sourcepub fn from_words(words: &[Word]) -> Self
pub fn from_words(words: &[Word]) -> Self
sourcepub fn as_words_mut(&mut self) -> &mut [Word]
pub fn as_words_mut(&mut self) -> &mut [Word]
Borrow the inner limbs as a mutable array of Word
s.
sourcepub fn as_limbs_mut(&mut self) -> &mut [Limb]
pub fn as_limbs_mut(&mut self) -> &mut [Limb]
Borrow the limbs of this BoxedUint
mutably.
sourcepub fn into_limbs(self) -> Vec<Limb>
pub fn into_limbs(self) -> Vec<Limb>
Convert this BoxedUint
into its inner limbs.
Trait Implementations§
source§impl CheckedAdd<&BoxedUint> for BoxedUint
impl CheckedAdd<&BoxedUint> for BoxedUint
source§impl ConstantTimeEq for BoxedUint
impl ConstantTimeEq for BoxedUint
source§impl PartialEq for BoxedUint
impl PartialEq for BoxedUint
impl Eq for BoxedUint
Auto Trait Implementations§
impl RefUnwindSafe for BoxedUint
impl Send for BoxedUint
impl Sync for BoxedUint
impl Unpin for BoxedUint
impl UnwindSafe for BoxedUint
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