Struct scicrypt::threshold_cryptosystems::integer_el_gamal::TOfNIntegerElGamal [−][src]
pub struct TOfNIntegerElGamal;
Expand description
Threshold ElGamal cryptosystem over integers: Extension of ElGamal that requires t out of n parties to successfully decrypt.
Trait Implementations
The type of the encrypted plaintexts.
type RichCiphertext = RichIntegerElGamalCiphertext<'pk>
type RichCiphertext = RichIntegerElGamalCiphertext<'pk>
Rich representation of a ciphertext that associates it with the corresponding public key. This allows for performing homomorphic operations using operator overloading, among others. Read more
type PublicKey = IntegerElGamalPublicKey
type PublicKey = IntegerElGamalPublicKey
The type of the encryption key.
The type of the partial key.
The type of a decryption share, which can be combined with $t - 1$ other shares to finish decryption. Read more
pub fn generate_keys<R>(
security_param: &BitsOfSecurity,
threshold_t: usize,
key_count_n: usize,
rng: &mut SecureRng<R>
) -> (<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PublicKey, Vec<<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PartialKey, Global>) where
R: RngCore + CryptoRng,
pub fn generate_keys<R>(
security_param: &BitsOfSecurity,
threshold_t: usize,
key_count_n: usize,
rng: &mut SecureRng<R>
) -> (<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PublicKey, Vec<<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PartialKey, Global>) where
R: RngCore + CryptoRng,
Generate a public and private key pair using a cryptographic RNG.
pub fn encrypt<R>(
plaintext: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::Plaintext,
public_key: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PublicKey,
rng: &mut SecureRng<R>
) -> <TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::Ciphertext where
R: RngCore + CryptoRng,
pub fn encrypt<R>(
plaintext: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::Plaintext,
public_key: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PublicKey,
rng: &mut SecureRng<R>
) -> <TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::Ciphertext where
R: RngCore + CryptoRng,
Encrypt the plaintext using the public key and a cryptographic RNG.
pub fn partially_decrypt(
rich_ciphertext: &RichIntegerElGamalCiphertext<'_>,
partial_key: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PartialKey
) -> <TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::DecryptionShare
pub fn partially_decrypt(
rich_ciphertext: &RichIntegerElGamalCiphertext<'_>,
partial_key: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PartialKey
) -> <TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::DecryptionShare
Partially decrypt the ciphertext using a partial key and its related public key.
pub fn combine(
decryption_shares: &[<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::DecryptionShare],
public_key: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PublicKey
) -> Result<<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::Plaintext, DecryptionError>
pub fn combine(
decryption_shares: &[<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::DecryptionShare],
public_key: &<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::PublicKey
) -> Result<<TOfNIntegerElGamal as AsymmetricTOfNCryptosystem>::Plaintext, DecryptionError>
Combine t decryption shares belonging to distinct partial keys to finish decryption. It is the responsibility of the programmer to supply the right number of decryption shares to this function. Read more