pub trait AsymmetricCryptosystem {
    type PublicKey: EncryptionKey;
    type SecretKey: DecryptionKey<Self::PublicKey>;

    fn setup(security_parameter: &BitsOfSecurity) -> Self;
    fn generate_keys<R: SecureRng>(
        &self,
        rng: &mut GeneralRng<R>
    ) -> (Self::PublicKey, Self::SecretKey); }
Expand description

An asymmetric cryptosystem is a system of methods to encrypt plaintexts into ciphertexts, and decrypt those ciphertexts back into plaintexts. Anyone who has access to the public key can perform encryptions, but only those with the secret key can decrypt.

The struct that implements an AsymmetricCryptosystem will hold the general parameters of that cryptosystem. Depending on the cryptosystem, those parameters could play an important role in deciding the level of security. As such, each cryptosystem should clearly indicate these.

Required Associated Types

The public key, used for encrypting plaintexts.

The secret key, used for decrypting ciphertexts.

Required Methods

Sets up an instance of this cryptosystem with parameters satisfying the security parameter.

Generate a public and private key pair using a cryptographic RNG. The level of security is determined by the computational security_parameter.

Implementors