testingutil

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BA

func BA(
	b *testing.B,
	tests []CipherSize,
	do func(b *testing.B, bitSize int),
	skip bool,
)

Bench All

func BBD

func BBD(
	b *testing.B,
	keySize int,
	additionalSize int,
	srcSize int,
	init BI,
	do BD,
	skip bool,
)

Block Bench Do

func BBDA

func BBDA(
	b *testing.B,
	sizes []CipherSize,
	additionalSize int,
	srcSize int,
	init BI,
	do BD,
	skip bool,
)

Block Bench Do All

func BBN

func BBN(
	b *testing.B,
	keySize int,
	additionalSize int,
	init BI,
	skip bool,
)

Block Bench New

func BBNA

func BBNA(
	b *testing.B,
	sizes []CipherSize,
	additionalSize int,
	init BI,
	skip bool,
)

Block Bench New All

func BTD

func BTD(
	t *testing.T,
	init BI,
	do BD,
	testCases []BlockTestCase,
	skip bool,
)

Block Test Decrypt

func BTE

func BTE(
	t *testing.T,
	init BI,
	do BD,
	testCases []BlockTestCase,
	skip bool,
)

Block Test Encrypt

func BTSC

func BTSC(
	t *testing.T,
	keySize int,
	additionalSize int,
	srcSize int,
	init BI,
	do BD,
	skip bool,
)

Block Test Src changing

func BTSCA

func BTSCA(
	t *testing.T,
	sizes []CipherSize,
	additionalSize int,
	srcSize int,
	init BI,
	do BD,
	skip bool,
)

Block Test Src changing All

func BTTC

func BTTC(
	t *testing.T,
	keySize int,
	additionalSize int,
	srcSize int,
	rndFitSize int,
	init BI,
	DoA BD,
	DoB BD,
	skip bool,
)

Block Test Two Cipher

func CD

func CD(data interface{}, dst, src []byte)

func CE

func CE(data interface{}, dst, src []byte)

func HB

func HB(
	b *testing.B,
	h hash.Hash,
	inputSize int,
	skip bool,
)

Hash Bench

func HBA

func HBA(
	b *testing.B,
	sizes []CipherSize,
	newHash func(size int) hash.Hash,
	inputSize int,
	skip bool,
)

Hash Bench All

func HT

func HT(
	t *testing.T,
	h hash.Hash,
	testCases []HashTestCase,
	skip bool,
)

Hash Test

func HTA

func HTA(
	t *testing.T,
	tests []CipherSize,
	do func(*testing.T, int),
	skip bool,
)

Hash Test All

func HTS

func HTS(
	t *testing.T,
	hashSize int,
	sum1 HS,
	sum2 HS,
	skip bool,
)

Hash Test Sum

func HTSA

func HTSA(
	t *testing.T,
	sizes []CipherSize,
	h1New func(size int) hash.Hash,
	h2New func(size int) hash.Hash,
	skip bool,
)

Hash Test Sum All

func HTSW

func HTSW(
	t *testing.T,
	h hash.Hash,
	skip bool,
)

Hash Test ShortWrite

func HTSWA

func HTSWA(
	t *testing.T,
	sizes []CipherSize,
	newHash func(size int) hash.Hash,
	skip bool,
)

Hash Test ShortWrite All

func TA

func TA(
	t *testing.T,
	tests []CipherSize,
	do func(t *testing.T, bitSize int),
	skip bool,
)

Test All

Types

type BD

type BD func(c interface{}, dst, src []byte) // Block Do

type BI

type BI func(key, additional []byte) (interface{}, error) // Block Init

func BIW

func BIW(f func(key []byte) (cipher.Block, error)) BI

Block Init Wrap

type BlockTestCase

type BlockTestCase struct {
	Reverse bool
	Key     string // hex
	Plain   string // hex
	Secure  string // hex
	IV      string // initialization vector, in hex

	KeyBytes    []byte
	PlainBytes  []byte
	SecureBytes []byte
	IVBytes     []byte
}

Block TestCase

type CipherSize

type CipherSize struct {
	Name string
	Size int
}

type HS

type HS func(dst, src []byte) []byte // Hash Sum

type HashTestCase

type HashTestCase struct {
	Msg string // input, in hex
	MD  string // output, in hex

	MsgBytes []byte
	MDBytes  []byte
}

Hash TestCase

Jump to

Keyboard shortcuts

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