Crate elgamal_curve25519

Source
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 ElGamal PublicKey and PrivateKey.
  • Message is an ElGamal message.
  • PrivateKey is an ElGamal private key. It’s just a wrapper around Scalar. 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 around CompressedRistretto. The key is computed as g^x, where g is the generator of the group G of order q, and x a PrivateKey.

Enums§

  • Error is the library error type.

Functions§

  • decrypt decrypts a CypherText into a Message.
  • encrypt encrypts a Message into a CypherText.

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.