x25519

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: ISC Imports: 2 Imported by: 0

Documentation

Overview

Package x25519 implements ECDHE over curve25519.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KX

type KX struct {
	Public
	Scalar // secret
}

KX is the client-generated public and secret portions of a key exchange.

func New

func New(rand io.Reader) (*KX, error)

New begins a new key exchange by generating a public and secret value. Public portions must be exchanged between parties to derive a shared secret key.

func (*KX) SharedKey

func (kx *KX) SharedKey(theirPublic *Public) []byte

SharedKey computes a shared key with the other party from our secret value and their public value. The result should be securely hashed before usage.

type Public

type Public [32]byte

type Scalar

type Scalar [32]byte

Jump to

Keyboard shortcuts

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