testsuite

package
v1.0.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchSuite

func BenchSuite[PubT crypto.PublicKey, PrivT crypto.PrivateKey](b *testing.B, harness TestHarness[PubT, PrivT])

func TestSuite

func TestSuite[PubT crypto.PublicKey, PrivT crypto.PrivateKey](t *testing.T, harness TestHarness[PubT, PrivT])

Types

type TestHarness

type TestHarness[PubT crypto.PublicKey, PrivT crypto.PrivateKey] struct {
	Name string

	GenerateKeyPair func() (PubT, PrivT, error)

	PublicKeyFromBytes              func(b []byte) (PubT, error)
	PublicKeyFromPublicKeyMultibase func(multibase string) (PubT, error)
	PublicKeyFromX509DER            func(bytes []byte) (PubT, error)
	PublicKeyFromX509PEM            func(str string) (PubT, error)

	PrivateKeyFromBytes    func(b []byte) (PrivT, error)
	PrivateKeyFromPKCS8DER func(bytes []byte) (PrivT, error)
	PrivateKeyFromPKCS8PEM func(str string) (PrivT, error)

	MultibaseCode uint64

	DefaultHash crypto.Hash
	OtherHashes []crypto.Hash

	PublicKeyBytesSize  int
	PrivateKeyBytesSize int
	SignatureBytesSize  int
}

Jump to

Keyboard shortcuts

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