sec

package
v0.0.0-...-6f70bfd Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

sec is an implementation of Noise_IK_25519_ChaChaPoly_BLAKE2b protocol.

Trevor Perrin. 2016. The Noise Protocol Framework. https://noiseprotocol.org/noise.pdf

Noise test vectors can be found at https://raw.githubusercontent.com/centromere/cacophony/master/vectors/cacophony.txt

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AEAD

type AEAD interface {
	Seal(dst []byte, nonce uint64, plaintext, additionalData []byte) []byte
	Open(dst []byte, nonce uint64, ciphertext, additionalData []byte) ([]byte, error)
}

See The CipherState object section of Noise. This implementation delegates nonce concerns to the user.

type Handshake

type Handshake interface {
	ReadMessage(r io.Reader, payloadLen uint16) (payload []byte, err error)
	WriteMessage(w io.Writer, payload []byte) error
	Split() (c1 AEAD, c2 AEAD, handshakeHash []byte)
}

func NewHandshake

func NewHandshake(prologue []byte, localStaticPrivateKey, remoteStaticPublicKey []byte, rand io.Reader, role Role) Handshake

type Role

type Role int
const (
	InitiatorRole Role = 1
	ResponderRole Role = 2
)

Jump to

Keyboard shortcuts

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