Struct scicrypt::threshold_cryptosystems::curve_el_gamal::NOfNCurveElGamal [−][src]
pub struct NOfNCurveElGamal;
Expand description
N-out-of-N Threshold ElGamal cryptosystem over elliptic curves: 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
type Plaintext = RistrettoPoint
type Plaintext = RistrettoPoint
The type of the plaintexts to be encrypted.
type Ciphertext = CurveElGamalCiphertext
type Ciphertext = CurveElGamalCiphertext
The type of the encrypted plaintexts.
type RichCiphertext = RichCurveElGamalCiphertext<'pk>
type RichCiphertext = RichCurveElGamalCiphertext<'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 = RistrettoPoint
type PublicKey = RistrettoPoint
The type of the encryption key.
type PartialKey = Scalar
type PartialKey = Scalar
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>
) -> (<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PublicKey, Vec<<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PartialKey, Global>) where
R: RngCore + CryptoRng,
pub fn generate_keys<R>(
security_param: &BitsOfSecurity,
key_count_n: usize,
rng: &mut SecureRng<R>
) -> (<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PublicKey, Vec<<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PartialKey, Global>) where
R: RngCore + CryptoRng,
Generate a public and private key pair using a cryptographic RNG.
pub fn encrypt<R>(
plaintext: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::Plaintext,
public_key: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PublicKey,
rng: &mut SecureRng<R>
) -> <NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::Ciphertext where
R: RngCore + CryptoRng,
pub fn encrypt<R>(
plaintext: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::Plaintext,
public_key: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PublicKey,
rng: &mut SecureRng<R>
) -> <NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::Ciphertext where
R: RngCore + CryptoRng,
Encrypt the plaintext using the public key and a cryptographic RNG.
pub fn partially_decrypt(
rich_ciphertext: &RichCurveElGamalCiphertext<'_>,
partial_key: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PartialKey
) -> <NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare
pub fn partially_decrypt(
rich_ciphertext: &RichCurveElGamalCiphertext<'_>,
partial_key: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PartialKey
) -> <NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare
Partially decrypt the ciphertext using a partial key and its related public key.
pub fn combine(
decryption_shares: &[<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare],
_public_key: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PublicKey
) -> Result<<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::Plaintext, DecryptionError>
pub fn combine(
decryption_shares: &[<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::DecryptionShare],
_public_key: &<NOfNCurveElGamal as AsymmetricNOfNCryptosystem>::PublicKey
) -> Result<<NOfNCurveElGamal 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