Expand description
§ElGamal Homomorphic Encryption Library
A Rust library for ElGamal Homomorphic Encryption. ElGamal encryption is only
usable for small values (32 bytes) and so it’s generally used in hybrid encryption
schemes.
This library implements ElGamal multiplicative homomorphic encryption, so
messages can be multiplicatevely aggregated by multiplying their cyphertexts.
Aggregated cyphertexts can be decrypted only if they have the same recipient
and only by that recipient.
The scheme has different applications, ranging from online voting systems to
secure multy-party computation for cryptocurrencies.
Structs§
CypherText
is the cyphertext generated by ElGamal encryption.KeyPair
is a pair of ElGamalPublicKey
andPrivateKey
.Message
is an ElGamal message.PrivateKey
is an ElGamal private key. It’s just a wrapper aroundScalar
. The key is just an integer between 1 and q-1, where q is the order of the group G.PublicKey
is an ElGamal public key. It’s just a wrapper aroundCompressedRistretto
. The key is computed as g^x, where g is the generator of the group G of order q, and x aPrivateKey
.
Enums§
Error
is the library error type.
Functions§
decrypt
decrypts aCypherText
into aMessage
.encrypt
encrypts aMessage
into aCypherText
.
Type Aliases§
Result
is the type used for fallible outputs. It’s an alias to the Result type in standard library whith error the library Error type.