Documentation
¶
Overview ¶
Package cpseg provides an implementation of the CPS-EG public key encryption system, an IND-CCA2 variant of ElGamal described by Seurin and Treger:
In this paper, we propose a very simple modification to Schnorr-Signed ElGamal encryption such that the resulting scheme is semantically secure under adaptive chosen-ciphertext attacks (IND-CCA2- secure) in the ROM under the Decisional Diffie-Hellman assumption. In fact, we even prove that our new scheme is plaintext-aware in the ROM as defined by Bellare et al. (CRYPTO ’98).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDecrypt = errors.New("message authentication failed")
ErrDecrypt is returned by Decrypt when the message cannot be decrypted.
Functions ¶
func Decrypt ¶
func Decrypt(priv *PrivateKey, Y, R, A, s *big.Int) ([]byte, error)
Decrypt decrypts the given message with the given private key. If the message is not decryptable (i.e., it's been modified or isn't a valid ciphertext), it returns nil.
func GenerateKey ¶
func GenerateKey(priv *PrivateKey, rng io.Reader) (err error)
GenerateKey generates a public & private key pair. The Parameters of the PrivateKey must already be valid.
Types ¶
type Parameters ¶
Parameters represents the domain parameters for a key. These parameters can be shared across many keys.
type PrivateKey ¶
PrivateKey represents a CPS-EG private key.
type PublicKey ¶
type PublicKey struct { Parameters H *big.Int }
PublicKey represents a CPS-EG public key.