Expand description

Implementation of the different encryption/decryption mechanisms used in chain-vote, including their corresponding structures. In particular, we use (lifted) ElGamal cryptosystem, and combine with ChaCha stream cipher to produce a hybrid encryption scheme.

Structs

  • ElGamal ciphertext. Given a message M represented by a group element, and ElGamal ciphertext consists of (r * G; M + r * PublicKey), where r is a random Scalar.
  • Hybrid Ciphertext (which can be found in section 2.1.3 of the Treasury spec) is defined by (g^r, AESEnd_k(m)), where k = h^r and r is taken uniformly at random from Zp. h is and ElGamal public key.
  • ElGamal keypair
  • ElGamal public key. pk = sk * G, where sk is the SecretKey and G is the group generator.
  • ElGamal secret key
  • The hybrid encryption scheme uses a group element as a representation of the symmetric key. This facilitates its exchange using ElGamal keypairs.