cryptstate

package module
v0.0.0-...-042ca66 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: BSD-3-Clause Imports: 10 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 {
	sync.Mutex

	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
ocb2 module

Jump to

Keyboard shortcuts

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