Documentation ¶
Overview ¶
Package ecies provides an implementation of the ECIES scheme.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultHash = sha256.New
DefaultHash is the default hash to use with ECIES
Functions ¶
func Decrypt ¶
Decrypt does almost the same as Encrypt: the ephemereal static DH exchange, and the derivation of the symmetric key. It finally tries to decrypt the ciphertext and returns the plaintext if successful, an error otherwise.
func Encrypt ¶
func Encrypt(g kyber.Group, fn func() hash.Hash, public kyber.Point, msg []byte) (*drand.ECIES, error)
Encrypt performs a ephemereal-static DH exchange, creates the shared key from it using a KDF scheme (hkdf from Go at the time of writing) and then computes the ciphertext using a AEAD scheme (AES-GCM from Go at the time of writing). This methods returns the ephemeral point of the DH exchange, the ciphertext and the associated nonce. It returns an error if something went wrong during the encryption.
Types ¶
This section is empty.