Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHash = sha256.New
Functions ¶
func Decrypt ¶
func Decrypt(g kyber.Group, fn func() hash.Hash, priv kyber.Scalar, o *drand.ECIESObject) ([]byte, error)
Decrypts 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.ECIESObject, error)
Encrypts 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.
Click to show internal directories.
Click to hide internal directories.