Documentation
¶
Index ¶
- func BoundarySlices(t *testing.T, size int) (start, end []byte)
- func FetchModule(t *testing.T, module, version string) string
- func MustMinimumFIPS140ModuleVersion(tb testing.TB, min string)
- func MustSupportFIPS140(tb testing.TB)
- func NoExtraMethods(t *testing.T, ms any, allowed ...string)
- func RerunWithFIPS140Enabled(t *testing.T)
- func RerunWithFIPS140Enforced(t *testing.T)
- func SkipTestAllocations(t *testing.T)
- func TestAEAD(t *testing.T, mAEAD MakeAEAD)
- func TestAllImplementations(t *testing.T, pkg string, f func(t *testing.T))
- func TestBlock(t *testing.T, keySize int, mb MakeBlock)
- func TestBlockMode(t *testing.T, block cipher.Block, makeEncrypter, makeDecrypter MakeBlockMode)
- func TestHash(t *testing.T, mh MakeHash)
- func TestStream(t *testing.T, ms MakeStream)
- func TestStreamFromBlock(t *testing.T, block cipher.Block, ...)
- type MakeAEAD
- type MakeBlock
- type MakeBlockMode
- type MakeHash
- type MakeStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoundarySlices ¶ added in go1.27.0
BoundarySlices allocates a pair of slices of the given size one at the start of a page, another at the end. Any access beyond or before the slice boundaries should cause a fault.
func FetchModule ¶ added in go1.24.0
FetchModule fetches the module at the given version and returns the directory containing its source tree. It skips the test if fetching modules is not possible in this environment.
func MustMinimumFIPS140ModuleVersion ¶ added in go1.27.0
MustMinimumFIPS140ModuleVersion skips the test if compiled against a lower minor version of the FIPS 140-3 module than min (such as "v1.26.0").
func MustSupportFIPS140 ¶ added in go1.26.0
func NoExtraMethods ¶ added in go1.25.0
NoExtraMethods checks that the concrete type of *ms has no exported methods beyond the methods of the interface type of *ms, and any others specified in the allowed list.
These methods are accessible through interface upgrades, so they end up part of the API even if undocumented per Hyrum's Law.
ms must be a pointer to a non-nil interface.
func RerunWithFIPS140Enabled ¶ added in go1.27.0
func RerunWithFIPS140Enforced ¶ added in go1.27.0
func SkipTestAllocations ¶ added in go1.24.0
SkipTestAllocations skips the test if there are any factors that interfere with allocation optimizations.
func TestAEAD ¶ added in go1.24.0
TestAEAD performs a set of tests on cipher.AEAD implementations, checking the documented requirements of NonceSize, Overhead, Seal and Open.
func TestAllImplementations ¶ added in go1.24.0
TestAllImplementations runs the provided test function with each available implementation of the package registered with crypto/internal/impl. If there are no alternative implementations for pkg, f is invoked directly once.
func TestBlock ¶ added in go1.24.0
TestBlock performs a set of tests on cipher.Block implementations, checking the documented requirements of BlockSize, Encrypt, and Decrypt.
func TestBlockMode ¶ added in go1.24.0
func TestBlockMode(t *testing.T, block cipher.Block, makeEncrypter, makeDecrypter MakeBlockMode)
TestBlockMode performs a set of tests on cipher.BlockMode implementations, checking the documented requirements of CryptBlocks.
func TestHash ¶
TestHash performs a set of tests on hash.Hash implementations, checking the documented requirements of Write, Sum, Reset, Size, and BlockSize.
func TestStream ¶ added in go1.24.0
func TestStream(t *testing.T, ms MakeStream)
TestStream performs a set of tests on cipher.Stream implementations, checking the documented requirements of XORKeyStream.
func TestStreamFromBlock ¶ added in go1.24.0
func TestStreamFromBlock(t *testing.T, block cipher.Block, blockMode func(b cipher.Block, iv []byte) cipher.Stream)
TestStreamFromBlock creates a Stream from a cipher.Block used in a cipher.BlockMode. It addresses Issue 68377 by checking for a panic when the BlockMode uses an IV with incorrect length. For a valid IV, it also runs all TestStream tests on the resulting stream.
Types ¶
type MakeAEAD ¶ added in go1.24.0
MakeAEAD returns a cipher.AEAD instance.
Multiple calls to MakeAEAD must return equivalent instances, so for example the key must be fixed.
type MakeBlockMode ¶ added in go1.24.0
MakeBlockMode returns a cipher.BlockMode instance. It expects len(iv) == b.BlockSize().
type MakeStream ¶ added in go1.24.0
MakeStream returns a cipher.Stream instance.
Multiple calls to MakeStream must return equivalent instances, so for example the key and/or IV must be fixed.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package wycheproof provides helper utilities for writing tests that rely on Wycheproof test vector schemas and JSON vector data.
|
Package wycheproof provides helper utilities for writing tests that rely on Wycheproof test vector schemas and JSON vector data. |