authenc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthtagMismatch = fmt.Errorf("Authtag mismatch")

AuthtagMismatch is returned by AuthDec if authentication of the ciphertext failed.

Functions

func AuthDec

func AuthDec(key []byte, input []byte) ([]byte, error)

AuthDec performs authenticated decryption of the provided input using the provided key. See AuthEnc for more details.

On success the plaintext is returned together with a nil error.

func AuthEnc

func AuthEnc(randr io.Reader, key []byte, plaintext []byte) ([]byte, error)

AuthEnc performs authenticated encryption of the provided input using the provided key. AES-128 is used in CBC mode with HMAC-SHA256 in encrypt-then-authenticate mode. The output is IV || ciphertext || auth-tag, where "||" is concatenation of byte slices.

On success the ciphertext is returned together with a nil error.

See also AuthDec.

Types

This section is empty.

Jump to

Keyboard shortcuts

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