Documentation ¶
Overview ¶
Package testutil is a collection of test utilities for the AEAD crypter.
Index ¶
Constants ¶
View Source
const ( ValidResult = "valid" InvalidResult = "invalid" )
Constants indicating whether the test vector is valid or not.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CryptoTestVector ¶
type CryptoTestVector struct { Desc string ID int Key, Plaintext, Ciphertext, Tag, Nonce, Aad []byte Result string AllocateDst bool }
CryptoTestVector is a struct representing a test vector for an S2AAEADCrypter instance.
func ParseWycheProofTestVectors ¶
func ParseWycheProofTestVectors(jsonFilePath string, shouldFilter func(TestGroup) bool, t *testing.T) []CryptoTestVector
ParseWycheProofTestVectors takes a path to a WycheProof test vector, a test group filter, and returns the resulting CryptoTestVector. The test group filter will be used to filter out unsupported test inputs.
type TestFile ¶
type TestFile struct {
TestGroups []TestGroup `json:"testGroups"`
}
TestFile is a struct for a WycheProof test file.
type TestGroup ¶
type TestGroup struct { IVSize int `json:"ivSize"` KeySize int `json:"keySize"` TagSize int `json:"tagSize"` Tests []TestVector `json:"tests"` }
TestGroup is a struct for a WycheProof test group.
type TestVector ¶
type TestVector struct { TcID int `json:"tcId"` Comment string `json:"comment"` Key string `json:"key"` IV string `json:"iv"` Aad string `json:"aad"` Msg string `json:"msg"` Ct string `json:"ct"` Tag string `json:"tag"` Result string `json:"result"` }
TestVector is a struct for a WycheProof test vector.
Click to show internal directories.
Click to hide internal directories.