Skip to main content

decrypt

Function decrypt 

Source
fn decrypt<R: TryCryptoRng + ?Sized>(
    rng: Option<&mut R>,
    priv_key: &PrivateKey,
    ciphertext: &[u8],
) -> Result<Vec<u8>>
Expand description

Decrypts a plaintext using RSA and the padding scheme from PKCS#1 v1.5.

If an rng is passed, it uses RSA blinding to avoid timing side-channel attacks.

Implements draft-irtf-cfrg-rsa-guidance-10 ยง7.2. Padding validity remains secret: only the final message and its selected length are returned.