cipher

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMixedKeys

func NewMixedKeys() (pk1, sk1, pk2, sk2 *[32]byte, err error)

func NewRPC11Keys

func NewRPC11Keys() (pk1, sk1, pk2, sk2 *[32]byte, err error)

func NewRPC15Keys

func NewRPC15Keys() (pk1, sk1, pk2, sk2 *[32]byte, err error)

Types

type API

type API interface {
	// Seal returns an authenticated and encrypted version of the supplied
	// data. Seal appends the encrypted data to the supplied buf and the
	// the returned slice points to the newly encrypted data that can be used
	// as the argument to Open (it includes he MAC).
	Seal(buf, data []byte) ([]byte, error)

	// Open authenticates and decrypts a box produced by Seal and returns true
	// on success. The decrypted data is appended to buf and the returned slice
	// points to the newly decrypted data.
	Open(buf, data []byte) ([]byte, bool)

	// ChannelBinding Returns a byte slice that is unique for the the
	// particular cipher (and the parties between which it is operating).
	// Having both parties assert out of the band that they are indeed
	// participating in a connection with that channel binding value is
	// sufficient to authenticate the data received through the cipher.
	ChannelBinding() []byte

	// Overhead is the max difference between the plaintext and ciphertext sizes.
	Overhead() int
}

API provides an API for testing ciphers used for encrypting messages sent by message pipe implementations. This interface is used solely for testing and is intended to allow for a single set of tests to be used for multiple cipher implementations in the future.

func NewMixedCiphers

func NewMixedCiphers() (c1, c2 API, err error)

func NewRPC11Ciphers

func NewRPC11Ciphers() (c1, c2 API, err error)

func NewRPC15Ciphers

func NewRPC15Ciphers() (c1, c2 API, err error)

Jump to

Keyboard shortcuts

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