pub trait TOfNCryptosystem {
    type PublicKey: EncryptionKey;
    type SecretKey: PartialDecryptionKey<Self::PublicKey>;

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

An asymmetric threshold cryptosystem is a system of methods to encrypt plaintexts into ciphertexts, but instead of having a single secret key to decrypt them back into plaintexts, we require a given number of parties to decrypt with their own partial key. If enough parties partially decrypt, the resulting shares can be combined into the original plaintext. Still, anyone who has access to the public key can perform encryptions.

We denote a threshold cryptosystem using a tuple like (t, n). This means that t parties can collectively decrypt, and that there are in total n partial keys.

The struct that implements an TOfNCryptosystem 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 to encrypt plaintexts.

The secret key used to partially decrypt 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.

Implementors