modes

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptCBC

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

func DecryptGCM

func DecryptGCM(block cipher.Block, nonce []byte, ciphertext *[]byte) (*[]byte, error)

func EncryptCBC

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

func EncryptGCM

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

func Padding

func Padding(srcPtr *[]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