Struct scicrypt::threshold_cryptosystems::integer_el_gamal::NOfNIntegerElGamal [−][src]
pub struct NOfNIntegerElGamal;
Expand description
N-out-of-N Threshold ElGamal cryptosystem over integers: Extension of ElGamal that requires n out of n parties to successfully decrypt. For this scheme there exists an efficient distributed key generation protocol.
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.
type PartialKey = Integer
type PartialKey = Integer
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,
key_count_n: usize,
rng: &mut SecureRng<R>
) -> (<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PublicKey, Vec<<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PartialKey, Global>) where
R: RngCore + CryptoRng,
pub fn generate_keys<R>(
security_param: &BitsOfSecurity,
key_count_n: usize,
rng: &mut SecureRng<R>
) -> (<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PublicKey, Vec<<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PartialKey, Global>) where
R: RngCore + CryptoRng,
Generate a public and private key pair using a cryptographic RNG.
pub fn encrypt<R>(
plaintext: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::Plaintext,
public_key: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PublicKey,
rng: &mut SecureRng<R>
) -> <NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::Ciphertext where
R: RngCore + CryptoRng,
pub fn encrypt<R>(
plaintext: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::Plaintext,
public_key: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PublicKey,
rng: &mut SecureRng<R>
) -> <NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::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: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PartialKey
) -> <NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare
pub fn partially_decrypt(
rich_ciphertext: &RichIntegerElGamalCiphertext<'_>,
partial_key: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PartialKey
) -> <NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare
Partially decrypt the ciphertext using a partial key and its related public key.
pub fn combine(
decryption_shares: &[<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare],
public_key: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PublicKey
) -> Result<<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::Plaintext, DecryptionError>
pub fn combine(
decryption_shares: &[<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare],
public_key: &<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::PublicKey
) -> Result<<NOfNIntegerElGamal as AsymmetricNOfNCryptosystem>::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