ecies

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 12 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL