newhope

package
v0.0.0-...-78b1f44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: BSD-3-Clause, ISC, OpenSSL Imports: 5 Imported by: 0

Documentation

Overview

package newhope contains a post-quantum key agreement algorithm, reimplemented from the reference implementation at https://github.com/tpoeppelmann/newhope.

Note that this package does not interoperate with the reference implementation.

Index

Constants

View Source
const (

	// offerMsgLen is the length, in bytes, of the offering (first) message of
	// the key exchange.
	OfferMsgLen = encodedPolyLen + 32

	// acceptMsgLen is the length, in bytes, of the accepting (second) message
	// of the key exchange.
	AcceptMsgLen = encodedPolyLen + 256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key [32]uint8

Key is the result of a key agreement.

func Accept

func Accept(rand io.Reader, offerMsg []byte) (sharedKey Key, acceptMsg []byte, err error)

Accept processes a message generated by |Offer| and returns a reply message and the shared key.

type Poly

type Poly [n]uint16

Poly is a polynomial of n coefficients.

func Offer

func Offer(rand io.Reader) (offerMsg []byte, sFreq *Poly)

Offer starts a new key exchange. It returns a message that should be transmitted to the peer, and a polynomial that must be retained in order to complete the exchange.

func (*Poly) Finish

func (sk *Poly) Finish(acceptMsg []byte) (sharedKey Key, err error)

Finish processes the reply from the peer and returns the shared key.

Jump to

Keyboard shortcuts

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