Skip to main content

blind_modulus

Function blind_modulus 

Source
pub(crate) fn blind_modulus<R: TryCryptoRng + ?Sized>(
    rng: &mut R,
    prime: &Odd<BoxedUint>,
) -> Result<Odd<BoxedUint>>
Expand description

Multiply a CRT prime by a fresh random odd factor, using public storage widths.

With r uniform over 128 bits, g = 2*r + 1 is positive and odd and retains all 128 bits of randomness. Odd factors permit Montgomery arithmetic without rejection sampling. https://www.ietf.org/archive/id/draft-irtf-cfrg-rsa-guidance-10.html#section-6.5