ecdh

package module
v0.0.0-...-fe4fe74 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

README

ECDH

Build Status

This is a go implementation of elliptical curve diffie-hellman key exchange method. It supports the NIST curves (and any curves using the elliptic.Curve go interface) as well as djb's curve25519.

The library handles generating of keys, generating a shared secret, and the (un)marshalling of the elliptical curve keys into slices of bytes.

This library was built off of the

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDH

type ECDH interface {
	GenerateKey(io.Reader) (crypto.PrivateKey, crypto.PublicKey, error)
	Marshal(crypto.PublicKey) []byte
	Unmarshal([]byte) (crypto.PublicKey, bool)
	GenerateSharedSecret(crypto.PrivateKey, crypto.PublicKey) ([]byte, error)
}

The main interface for ECDH key exchange.

func NewCurve25519ECDH

func NewCurve25519ECDH() ECDH

NewCurve25519ECDH creates a new ECDH instance that uses djb's curve25519 elliptical curve.

func NewEllipticECDH

func NewEllipticECDH(curve elliptic.Curve) ECDH

NewEllipticECDH creates a new instance of ECDH with the given elliptic.Curve curve to use as the elliptical curve for elliptical curve diffie-hellman.

Jump to

Keyboard shortcuts

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