secretbox

package
v0.0.0-...-2243100 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

SecretKey encapsulates a secret key so that it can be used in AEAD cipher operations methods: Open and Seal.

func Load

func Load(b *[32]byte) *SecretKey

Load loads a SecretKey.

func New

func New() *SecretKey

New returns a new SecretKey.

func (*SecretKey) Bytes

func (s *SecretKey) Bytes() []byte

Bytes returns the secret key as a byte slice.

func (*SecretKey) Open

func (s *SecretKey) Open(ciphertext []byte) ([]byte, error)

Open decrypts the ciphertext and returns the plaintext or an error.

func (*SecretKey) Seal

func (s *SecretKey) Seal(plaintext []byte) []byte

Seal encrypts the plaintext and returns the ciphertext.

Jump to

Keyboard shortcuts

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