keygen

package module
v0.0.0-...-de1bc18 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: ISC Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ECDSA

func ECDSA(c elliptic.Curve, secret []byte) (*ecdsa.PrivateKey, error)

ECDSA generates an ECDSA key deterministically from a random secret.

The secret must be at least 128 bits long and should be at least 192 bits long for multi-user security. The secret should not be reused.

This function instantiates HMAC_DRBG with SHA-256 according to NIST SP 800-90A Rev. 1, and uses it for a procedure equivalent to that in FIPS 186-5, Appendix A.2.2. For FIPS 186-5 compliance, the secret must contain at least 192, 288, and 384 bits of entropy for P-256, P-384, and P-521, respectively. (3/2 of the required security strength, per SP 800-90A Rev. 1, Section 8.6.7 and SP 800-57 Part 1 Rev. 5, Section 5.6.1.1.) SHA-256 is appropriate for all three curves, as per SP 800-90Ar1, Section 10.1 and SP 800-57 Part 1 Rev. 5, Section 5.6.1.2.

The output MAY CHANGE until this package reaches v1.0.0.

func ECDSALegacy

func ECDSALegacy(c elliptic.Curve, rand io.Reader) (*ecdsa.PrivateKey, error)

ECDSALegacy generates an ECDSA key deterministically from a random stream in a way compatible with Go 1.19's ecdsa.GenerateKey.

It uses the procedure given in FIPS 186-5, Appendix A.2.1.

Note that ECDSALegacy may leak bits of the key through timing side-channels.

Types

This section is empty.

Jump to

Keyboard shortcuts

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