enc

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0, MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SecretBoxNonceSize = 24
	SecretBoxKeySize   = 32
)

Variables

View Source
var (
	ErrInvalidKey    = fmt.Errorf("invalid key")
	ErrInvalidNonce  = fmt.Errorf("invalid nonce")
	ErrCannotDecrypt = fmt.Errorf("unable to decrypt message")
	ErrCannotEncrypt = fmt.Errorf("unable to encrypt message")
)

Functions

This section is empty.

Types

type SharedKey

type SharedKey interface {
	DeriveNonce(input []byte) ([]byte, error)

	Open(payload []byte) ([]byte, error)
	Seal(encrypted []byte) ([]byte, error)

	OpenWithNonce(payload []byte, nonce []byte) ([]byte, error)
	SealWithNonce(encrypted []byte, nonce []byte) ([]byte, error)
}

func NewSecretbox

func NewSecretbox(key []byte) (SharedKey, error)

Jump to

Keyboard shortcuts

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