testing

package
v0.0.0-...-9f44e2d Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package testing contains test cases useful for testing AES functions against reference implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRfcHex

func FromRfcHex(s string) []byte

FromRfcHex decodes a hex string that may contain spaces, as used in test vectors in RFCs. Panic if the input is illegal.

Types

type CmacTestCase

type CmacTestCase struct {
	Key []byte
	Msg []byte
	Mac []byte
}

CmacTestCase represents a test case for AES-CMAC generated using the reference implementation from RFC 4493.

func CmacCases

func CmacCases() []CmacTestCase

CmacCases returns test cases for AES-CMAC.

func (CmacTestCase) String

func (c CmacTestCase) String() string

type DblTestCase

type DblTestCase struct {
	Input  []byte
	Output []byte
}

DblTestCase represents a test case for dbl() generated using a reference implementation.

func DblCases

func DblCases() []DblTestCase

DblCases returns test cases for dbl.

func (DblTestCase) String

func (c DblTestCase) String() string

type EncryptTestCase

type EncryptTestCase struct {
	Key        []byte
	Plaintext  []byte
	Associated [][]byte
	Output     []byte
}

EncryptTestCase represents a test case for Encrypt() generated using a reference implementation.

func EncryptCases

func EncryptCases() []EncryptTestCase

EncryptCases returns test cases for Encrypt.

func (EncryptTestCase) String

func (c EncryptTestCase) String() string

type GenerateSubkeyTestCase

type GenerateSubkeyTestCase struct {
	Key []byte
	K1  []byte
	K2  []byte
}

GenerateSubkeyTestCase represents a test case for generateSubkey generated using the reference implementation from RFC 4493.

func GenerateSubkeyCases

func GenerateSubkeyCases() []GenerateSubkeyTestCase

GenerateSubkeyCases returns test cases for generateSubkey.

func (GenerateSubkeyTestCase) String

func (c GenerateSubkeyTestCase) String() string

type S2vTestCase

type S2vTestCase struct {
	Key     []byte
	Strings [][]byte
	Output  []byte
}

S2vTestCase represents a test case for S2V() generated using a reference implementation.

func S2vCases

func S2vCases() []S2vTestCase

S2vCases returns test cases for S2V.

func (S2vTestCase) String

func (c S2vTestCase) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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