pub struct BigInt {
pub limbs: Vec<u64>,
}Expand description
A big unsigned integer stored as little-endian 64-bit limbs.
Fields§
§limbs: Vec<u64>Limbs in little-endian order (limbs[0] is least significant).
Implementations§
Source§impl BigInt
impl BigInt
Sourcepub fn from_be_bytes(bytes: &[u8]) -> Self
pub fn from_be_bytes(bytes: &[u8]) -> Self
From big-endian bytes (as in RSA wire format).
Sourcepub fn to_be_bytes(&self, min_len: usize) -> Vec<u8> ⓘ
pub fn to_be_bytes(&self, min_len: usize) -> Vec<u8> ⓘ
Convert to big-endian bytes, padded to at least min_len bytes.
Sourcepub fn random(bits: usize, rng: &mut dyn FnMut(&mut [u8])) -> Self
pub fn random(bits: usize, rng: &mut dyn FnMut(&mut [u8])) -> Self
Generate a random BigInt with exactly bits bits using the provided RNG callback.
Sourcepub fn random_odd(bits: usize, rng: &mut dyn FnMut(&mut [u8])) -> Self
pub fn random_odd(bits: usize, rng: &mut dyn FnMut(&mut [u8])) -> Self
Generate a random odd BigInt with exactly bits bits.
Source§impl BigInt
impl BigInt
Source§impl BigInt
impl BigInt
Trait Implementations§
Source§impl Ord for BigInt
impl Ord for BigInt
Source§impl PartialOrd for BigInt
impl PartialOrd for BigInt
impl Eq for BigInt
Auto Trait Implementations§
impl Freeze for BigInt
impl RefUnwindSafe for BigInt
impl Send for BigInt
impl Sync for BigInt
impl Unpin for BigInt
impl UnsafeUnpin for BigInt
impl UnwindSafe for BigInt
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