[][src]Function nettle::rsa::decrypt_pkcs1_insecure

pub fn decrypt_pkcs1_insecure<R: Random>(
    public: &PublicKey,
    private: &PrivateKey,
    random: &mut R,
    ciphertext: &[u8]
) -> Result<Box<[u8]>>

Decrypts ciphertext using public/private. Returns the resulting plaintext.

The ciphertext expected to be padded using RSAES-PKCS1-v1_5.

Important note:

Side-channel leakage from the caller's use of length and return value may still provide an oracle useable for a Bleichenbacher-style chosen ciphertext attack.

If you know the size of the plaintext in advance, it is better to use decrypt_pkcs1.

Errors

Returns InvalidArgument if ciphertext is of a different size than public's modulo. Returns DecryptionFailed if the decryption failed.