crypto_bigint/modular/add.rs
1use crate::{Odd, Uint};
2
3pub(crate) const fn add_montgomery_form<const LIMBS: usize>(
4 a: &Uint<LIMBS>,
5 b: &Uint<LIMBS>,
6 modulus: &Odd<Uint<LIMBS>>,
7) -> Uint<LIMBS> {
8 a.add_mod(b, &modulus.0)
9}
10
11pub(crate) const fn double_montgomery_form<const LIMBS: usize>(
12 a: &Uint<LIMBS>,
13 modulus: &Odd<Uint<LIMBS>>,
14) -> Uint<LIMBS> {
15 a.double_mod(&modulus.0)
16}