hbsh

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HBSH

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

HBSH is a cipher using the HBSH encryption mode.

func New

func New(stream StreamCipher, block cipher.Block, hash TweakableHash) *HBSH

New returns an HBSH cipher using the specified primitives.

func (*HBSH) Decrypt

func (h *HBSH) Decrypt(block, tweak []byte) []byte

Decrypt decrypts block using the specified tweak. The block must be at least 16 bytes. The size of the tweak is restricted by the underlying primitives.

func (*HBSH) Encrypt

func (h *HBSH) Encrypt(block, tweak []byte) []byte

Encrypt encrypts block using the specified tweak. The block must be at least 16 bytes. The size of the tweak is restricted by the underlying primitives.

type StreamCipher

type StreamCipher interface {
	XORKeyStream(msg, nonce []byte)
}

A StreamCipher xors msg with a keystream, modified by a nonce.

type TweakableHash

type TweakableHash interface {
	Sum(dst, src, tweak []byte) []byte
}

TweakableHash is a tweakable cryptographic hash function. It appends the hash of src to dst and returns it.

Jump to

Keyboard shortcuts

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