crypto

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMessageAuthFailed = errors.New("message authentication failed")

Functions

func Decrypt

func Decrypt(in io.Reader, out io.Writer, size int64, key *[32]byte) error

Decrypt decrypts data using 256-bit AES-CTR and provides message authentication verifying the HMAC-512_256 signature.

func Encrypt

func Encrypt(in io.Reader, out io.Writer, key *[32]byte) error

Encrypt encrypts data using 256-bit AES-CTR and provides message authentication by signing the data with HMAC-512_256.

func NewEncryptionKey

func NewEncryptionKey() *[32]byte

NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt(). It panics if the source of randomness fails.

func NewRandomIV

func NewRandomIV() []byte

NewRandomIV generates a random 128-bit IV for use with AES encryption. It panics if the source of randomness fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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