cipher

package
v0.0.0-...-0b3308b Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: MPL-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBlock

func FromBlock(newCipher func(key []byte) (cipher.Block, error),
	newHash func() hash.Hash, blockLen, keyLen, hashLen int,
	key []byte, options ...interface{}) abstract.Cipher

Construct a general message Cipher from a Block cipher and a cryptographic Hash.

func FromSponge

func FromSponge(sponge Sponge, key []byte, options ...interface{}) abstract.Cipher

SpongeCipher builds a general message Cipher from a Sponge function.

func FromStream

func FromStream(newStream func(key []byte) cipher.Stream,
	newHash func() hash.Hash, blockLen, keyLen, hashLen int,
	key []byte, options ...interface{}) abstract.Cipher

Construct a general message Cipher from a Stream cipher and a cryptographic Hash.

func NewAEAD

func NewAEAD(c abstract.Cipher) cipher.AEAD

Wrap an abstract message Cipher to implement the Authenticated Encryption with Associated Data (AEAD) interface.

func NewHash

func NewHash(cipher func(key []byte, options ...interface{}) abstract.Cipher, size int) hash.Hash

Types

type Block

type Block cipher.Block

type Padding

type Padding byte

Padding is an Option to configure the multi-rate padding byte to be used with a Sponge cipher.

func (Padding) String

func (p Padding) String() string

type Sponge

type Sponge interface {

	// XOR src data into sponge's internal state,
	// transform its state, and copy resulting state into dst.
	// Buffers must be either Rate or Rate+Capacity bytes long.
	Transform(dst, src []byte)

	// Return the number of data bytes the sponge can aborb in one block.
	Rate() int

	// Return the sponge's secret state capacity in bytes.
	Capacity() int

	// Create a copy of this Sponge with identical state
	Clone() Sponge
}

Sponge is an interface representing a primitive sponge function.

type Stream

type Stream cipher.Stream

Directories

Path Synopsis
Package aes implements the general Cipher interface using AES, SHA2, and HMAC.
Package aes implements the general Cipher interface using AES, SHA2, and HMAC.
This package exists runs comparative benchmarks across several alternative Cipher implementations.
This package exists runs comparative benchmarks across several alternative Cipher implementations.
Package NORX implements the experimental NORX cipher.
Package NORX implements the experimental NORX cipher.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.

Jump to

Keyboard shortcuts

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