pub struct BigInt { /* private fields */ }Expand description
BigInt wrapper around clock-bigint’s U256.
Implementations§
Source§impl BigInt
impl BigInt
Sourcepub fn from_limbs(limbs: &[u64; 4]) -> Self
pub fn from_limbs(limbs: &[u64; 4]) -> Self
Create a BigInt from u64 limbs (little-endian).
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Self
pub fn from_bytes(bytes: &[u8; 32]) -> Self
Create a BigInt from bytes (little-endian).
Sourcepub fn mul(&self, rhs: &Self) -> Self
pub fn mul(&self, rhs: &Self) -> Self
Constant-time multiplication with proper overflow handling.
Returns the full 256-bit product. For modular arithmetic, the caller is responsible for reduction if needed.
Sourcepub fn mul_wide(&self, rhs: &Self) -> (Self, Self)
pub fn mul_wide(&self, rhs: &Self) -> (Self, Self)
Wide multiplication returning the full 512-bit result as (low, high) BigInts.
Trait Implementations§
Source§impl BigIntOps for BigInt
impl BigIntOps for BigInt
impl Copy 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 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