crypto-bigint 0.7.5

Pure Rust implementation of a big integer library which has been designed from the ground-up for use in cryptographic applications. Provides constant-time, no_std-friendly implementations of modern formulas using const generics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::Limb;
use crate::{Odd, primitives};

impl Odd<Limb> {
    /// Returns the multiplicative inverse of the argument modulo 2^N, where
    /// 2^N is the capacity of a [`Limb`].
    pub(crate) const fn multiplicative_inverse(self) -> Limb {
        cpubits::cpubits! {
            32 => {
                Limb(primitives::u32_invert_odd(self.as_ref().0))
            }
            64 => {
                Limb(primitives::u64_invert_odd(self.as_ref().0))
            }
        }
    }
}