eax

package module
v0.0.0-...-9e3b619 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Build Status GoDoc codecov.io

EAX implementation from old Go crypto package converted to modern Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEAXDecrypter

func NewEAXDecrypter(c cipher.Block, iv []byte, hdr []byte, tagBytes int, r io.Reader) io.Reader

NewEAXDecrypter creates and returns a new EAX decrypter using the given cipher c, initialization vector iv, associated data hdr, and tag length tagBytes. The encrypter's Read method decrypts and returns data read from r. At r's EOF, the encrypter checks the final authenticating tag and returns an EAXTagError if the tag is invalid. In that case, the message should be discarded. Note that the data stream returned from Read cannot be assumed to be valid, authenticated data until Read returns 0, nil to signal the end of the data.

func NewEAXEncrypter

func NewEAXEncrypter(c cipher.Block, iv []byte, hdr []byte, tagBytes int, w io.Writer) io.WriteCloser

NewEAXEncrypter creates and returns a new EAX encrypter using the given cipher c, initialization vector iv, associated data hdr, and tag length tagBytes. The encrypter's Write method encrypts the data it receives and writes that data to w. The encrypter's Close method writes a final authenticating tag to w.

Types

type EAXTagError

type EAXTagError struct {
	Read     []byte
	Computed []byte
}

An EAXTagError is returned when the message has failed to authenticate, because the tag at the end of the message stream (Read) does not match the tag computed from the message itself (Computed).

func (*EAXTagError) Error

func (e *EAXTagError) Error() string

Jump to

Keyboard shortcuts

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