Trait rsa::PaddingScheme

source ·
pub trait PaddingScheme {
    fn decrypt<Rng: CryptoRngCore, Priv: PrivateKey>(
        self,
        rng: Option<&mut Rng>,
        priv_key: &Priv,
        ciphertext: &[u8]
    ) -> Result<Vec<u8>>; fn encrypt<Rng: CryptoRngCore, Pub: PublicKey>(
        self,
        rng: &mut Rng,
        pub_key: &Pub,
        msg: &[u8]
    ) -> Result<Vec<u8>>; }
Expand description

Padding scheme used for encryption.

Required Methods§

Decrypt the given message using the given private key.

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

Encrypt the given message using the given public key.

Implementors§