ecdh

package
Version: v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package ecdh implements ECDH encryption, suitable for OpenPGP, as specified in RFC 6637, section 8.

Package ecdh implements ECDH encryption, suitable for OpenPGP, as specified in RFC 6637, section 8.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(priv *PrivateKey, vsG, m, curveOID, fingerprint []byte) (msg []byte, err error)

func Encrypt

func Encrypt(random io.Reader, pub *PublicKey, msg, curveOID, fingerprint []byte) (vsG, c []byte, err error)

func X25519Decrypt

func X25519Decrypt(priv *PrivateKey, vsG, m, curveOID, fingerprint []byte) (msg []byte, err error)

func X25519Encrypt

func X25519Encrypt(random io.Reader, pub *PublicKey, msg, curveOID, fingerprint []byte) (vsG, c []byte, err error)

func X25519GenerateParams

func X25519GenerateParams(rand io.Reader) (priv [32]byte, x [32]byte, err error)

Types

type KDF

type KDF struct {
	Hash   algorithm.Hash
	Cipher algorithm.Cipher
}

type PrivateKey

type PrivateKey struct {
	PublicKey
	D []byte
}

func GenerateKey

func GenerateKey(c elliptic.Curve, kdf KDF, rand io.Reader) (priv *PrivateKey, err error)

func X25519GenerateKey

func X25519GenerateKey(rand io.Reader, kdf KDF) (priv *PrivateKey, err error)

type PublicKey

type PublicKey struct {
	ecc.CurveType
	elliptic.Curve
	X, Y *big.Int
	KDF
}

Source Files

Jump to

Keyboard shortcuts

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