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
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.
CypherText is the cyphertext generated by ElGamal encryption.
KeyPair is a pair of ElGamal
Message is an ElGamal message.
PrivateKey is an ElGamal private key. It's just a
Scalar. The key is just an integer
between 1 and q-1, where q is the order of the group
PublicKey is an ElGamal public key. It's just a
The key is computed as g^x, where g is the generator
of the group G of order q, and x a
Error is the library error type.
decrypt decrypts a
CypherText into a
encrypt encrypts a
Message into a
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.