x25519

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 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

func ValidScalar added in v0.4.0

func ValidScalar(s *Scalar) bool

ValidScalar returns whether a secret X25519 scalar was properly constructed.

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