Skip to main content

montgomery_mul

Function montgomery_mul 

Source
pub(crate) fn montgomery_mul(
    x: &BoxedUint,
    y: &BoxedUint,
    out: &mut BoxedUint,
    modulus: &BoxedUint,
    mod_neg_inv: Limb,
)
Expand description

Computes Montgomery multiplication of x and y into out, that is out = x * y * 2^(-n*W) mod m assuming k = -1/m mod 2^W, where W is the bit size of the limb, and n * W is the full bit size of the integer.

NOTE: out is assumed to be pre-zeroized.