slhdsa

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package slhdsa implements SLH-DSA as specified in NIST FIPS 205 (https://doi.org/10.6028/NIST.FIPS.205). The implementation is constant time assuming that the underlying hashing primitives are constant time.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SLH_DSA_SHA2_128s defines parameters for SLH-DSA-SHA2-128s.
	SLH_DSA_SHA2_128s = newParams(param128s, hashParamSha2C1)
	// SLH_DSA_SHAKE_128s defines parameters for SLH-DSA-SHAKE-128s.
	SLH_DSA_SHAKE_128s = newParams(param128s, hashParamShake)
	// SLH_DSA_SHA2_128f defines parameters for SLH-DSA-SHA2-128f.
	SLH_DSA_SHA2_128f = newParams(param128f, hashParamSha2C1)
	// SLH_DSA_SHAKE_128f defines parameters for SLH-DSA-SHAKE-128f.
	SLH_DSA_SHAKE_128f = newParams(param128f, hashParamShake)
	// SLH_DSA_SHA2_192s defines parameters for SLH-DSA-SHA2-192s.
	SLH_DSA_SHA2_192s = newParams(param192s, hashParamSha2C35)
	// SLH_DSA_SHAKE_192s defines parameters for SLH-DSA-SHAKE-192s.
	SLH_DSA_SHAKE_192s = newParams(param192s, hashParamShake)
	// SLH_DSA_SHA2_192f defines parameters for SLH-DSA-SHA2-192f.
	SLH_DSA_SHA2_192f = newParams(param192f, hashParamSha2C35)
	// SLH_DSA_SHAKE_192f defines parameters for SLH-DSA-SHAKE-192f.
	SLH_DSA_SHAKE_192f = newParams(param192f, hashParamShake)
	// SLH_DSA_SHA2_256s defines parameters for SLH-DSA-SHA2-256s.
	SLH_DSA_SHA2_256s = newParams(param256s, hashParamSha2C35)
	// SLH_DSA_SHAKE_256s defines parameters for SLH-DSA-SHAKE-256s.
	SLH_DSA_SHAKE_256s = newParams(param256s, hashParamShake)
	// SLH_DSA_SHA2_256f defines parameters for SLH-DSA-SHA2-256f.
	SLH_DSA_SHA2_256f = newParams(param256f, hashParamSha2C35)
	// SLH_DSA_SHAKE_256f defines parameters for SLH-DSA-SHAKE-256f.
	SLH_DSA_SHAKE_256f = newParams(param256f, hashParamShake)
)

Matching parameter set names as in Table 2 of the SLH-DSA specification.

Functions

This section is empty.

Types

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey represents an SLH-DSA public key.

func (*PublicKey) Encode

func (pk *PublicKey) Encode() []byte

Encode encodes a public key.

func (*PublicKey) Verify

func (pk *PublicKey) Verify(msg []byte, sig []byte, ctx []byte) error

Verify is the standard verification function. This is Algorithm 24 (slh_verify) of the SLH-DSA specification.

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

SecretKey represents an SLH-DSA secret key.

func (*SecretKey) Encode

func (sk *SecretKey) Encode() []byte

Encode encodes a secret key.

func (*SecretKey) PublicKey

func (sk *SecretKey) PublicKey() *PublicKey

PublicKey returns the public key corresponding to a secret key.

func (*SecretKey) Sign

func (sk *SecretKey) Sign(msg []byte, ctx []byte) ([]byte, error)

Sign is the standard signing function. This is Algorithm 22 (slh_sign) of the SLH-DSA specification.

func (*SecretKey) SignDeterministic

func (sk *SecretKey) SignDeterministic(msg []byte, ctx []byte) ([]byte, error)

SignDeterministic signs deterministically. This is Algorithm 22 (slh_sign) of the SLH-DSA specification with PK.seed as randomness.

Jump to

Keyboard shortcuts

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