kyber: go.dedis.ch/kyber/encrypt/ecies Index | Files

package ecies

import "go.dedis.ch/kyber/encrypt/ecies"

Package ecies implements the Elliptic Curve Integrated Encryption Scheme (ECIES).

Index

Package Files

ecies.go

func Decrypt Uses

func Decrypt(group kyber.Group, private kyber.Scalar, ctx []byte, hash func() hash.Hash) ([]byte, error)

Decrypt first computes a shared DH key using the received ephemeral elliptic curve point (stored in the first part of ctx), then HKDF-derives a symmetric key (and nonce) from that, and finally uses these values to decrypt the given ciphertext (stored in the second part of ctx) via AES-GCM. If the hash input parameter is nil then SHA256 is used as a default. Decrypt returns the plaintext message or an error.

func Encrypt Uses

func Encrypt(group kyber.Group, public kyber.Point, message []byte, hash func() hash.Hash) ([]byte, error)

Encrypt first computes a shared DH key using the given public key, then HKDF-derives a symmetric key (and nonce) from that, and finally uses these values to encrypt the given message via AES-GCM. If the hash input parameter is nil then SHA256 is used as a default. Encrypt returns a byte slice containing the ephemeral elliptic curve point of the DH key exchange and the ciphertext or an error.

Package ecies imports 9 packages (graph). Updated 2019-10-19. Refresh now. Tools for package owners.