dsatest

package
v0.0.0-...-0bbbf19 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(t testing.TB, priv *dsa.PrivateKey, rand io.Reader)

GenerateKey generates a public&private key pair. The Parameters of the [PrivateKey] must already be valid (see GenerateParameters).

func GenerateParameters

func GenerateParameters(t testing.TB, params *dsa.Parameters, rand io.Reader, sizes dsa.ParameterSizes)

GenerateParameters puts a random, valid set of DSA parameters into params. This function can take many seconds, even on fast machines.

func Sign

func Sign(t testing.TB, rand io.Reader, priv *dsa.PrivateKey, hash []byte) (r, s *big.Int)

Sign signs an arbitrary length hash (which should be the result of hashing a larger message) using the private key, priv. It returns the signature as a pair of integers. The security of the private key depends on the entropy of rand.

Note that FIPS 186-3 section 4.6 specifies that the hash should be truncated to the byte-length of the subgroup. This function does not perform that truncation itself.

Be aware that calling Sign with an attacker-controlled [PrivateKey] may require an arbitrary amount of CPU.

Types

This section is empty.

Jump to

Keyboard shortcuts

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