cryptstate

package
v0.0.0-...-32d363e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportedModes

func SupportedModes() []string

SupportedModes returns the list of supported CryptoModes.

Types

type CryptState

type CryptState struct {
	Key       []byte
	EncryptIV []byte
	DecryptIV []byte

	LastGoodTime int64

	Good         uint32
	Late         uint32
	Lost         uint32
	Resync       uint32
	RemoteGood   uint32
	RemoteLate   uint32
	RemoteLost   uint32
	RemoteResync uint32
	// contains filtered or unexported fields
}

func (*CryptState) Decrypt

func (cs *CryptState) Decrypt(dst, src []byte) error

func (*CryptState) Encrypt

func (cs *CryptState) Encrypt(dst, src []byte)

func (*CryptState) GenerateKey

func (cs *CryptState) GenerateKey(mode string) error

func (*CryptState) Overhead

func (cs *CryptState) Overhead() int

Overhead returns the length, in bytes, that a ciphertext is longer than a plaintext.

func (*CryptState) SetKey

func (cs *CryptState) SetKey(mode string, key []byte, eiv []byte, div []byte) error

type CryptoMode

type CryptoMode interface {
	NonceSize() int
	KeySize() int
	Overhead() int

	SetKey([]byte)
	Encrypt(dst []byte, src []byte, nonce []byte)
	Decrypt(dst []byte, src []byte, nonce []byte) bool
}

Directories

Path Synopsis
Package ocb2 implements the version 2 of the OCB authenticated-encryption algorithm.
Package ocb2 implements the version 2 of the OCB authenticated-encryption algorithm.

Jump to

Keyboard shortcuts

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