cipher

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher interface {
	Scheme() Scheme

	// Seal encrypts and authenticates plaintext and
	// appends the result to dst, returning the updated slice.
	// The nonce must be Scheme().NonceSize() bytes long.
	Seal(dst, nonce, plaintext []byte) []byte

	// Open decrypts and authenticates ciphertext and, if successful,
	// appends the resulting plaintext to dst, returning the updated slice.
	// The nonce must be Scheme().NonceSize() bytes long.
	Open(dst, nonce, ciphertext []byte) ([]byte, error)
}

Cipher represents an authenticated cipher.

type Scheme

type Scheme interface {
	KeySize() int
	NonceSize() int
	Overhead() int

	Unpack(key []byte) (Cipher, error)
}

Scheme type.

func AESGCM128

func AESGCM128() Scheme

AESGCM128 returns AES128-GCM scheme.

func AESGCM192

func AESGCM192() Scheme

AESGCM192 returns AES192-GCM scheme.

func AESGCM256

func AESGCM256() Scheme

AESGCM256 returns AES256-GCM scheme.

func XChaCha20Poly1305

func XChaCha20Poly1305() Scheme

XChaCha20Poly1305 returns XChaCha20-Poly1305 scheme.

Jump to

Keyboard shortcuts

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