modes

package
v0.0.0-...-bfe60c0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptCBC

func DecryptCBC(block cipher.Block, keyMac, msg []byte) ([]byte, error)

func DecryptGCM

func DecryptGCM(block cipher.Block, msg []byte) ([]byte, error)

func EncryptCBC

func EncryptCBC(block cipher.Block, keyMac []byte, cipherTextBuf bytes.Buffer, msg []byte) ([]byte, error)

func EncryptGCM

func EncryptGCM(block cipher.Block, cipherTextBuf bytes.Buffer, msg []byte) ([]byte, error)

func Padding

func Padding(src []byte, blocksize int) ([]byte, []byte)

return src, dst

func Unpadding

func Unpadding(dst []byte) []byte

return dst

Types

type BlockMode

type BlockMode interface {
	BlockSize() int
	CryptBlocks(dst, src []byte) error
}

func NewCBCDecrypter

func NewCBCDecrypter(b cipher.Block, iv []byte) (BlockMode, error)

func NewCBCEncrypter

func NewCBCEncrypter(b cipher.Block, iv []byte) (BlockMode, error)

type Stream

type Stream interface {
	XORKeyStream(dst, src []byte) error
}

Jump to

Keyboard shortcuts

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