slhdsa

package
v1.22.21 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package slhdsa implements SLH-DSA (Stateless Hash-based Digital Signature Algorithm) This is a stub implementation for development purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode represents different security levels of SLH-DSA

const (
	// SLHDSA128f provides 128-bit security (fast variant)
	SLHDSA128f Mode = iota
	// SLHDSA128s provides 128-bit security (small variant)
	SLHDSA128s
	// SLHDSA192f provides 192-bit security (fast variant)
	SLHDSA192f
	// SLHDSA192s provides 192-bit security (small variant)
	SLHDSA192s
	// SLHDSA256f provides 256-bit security (fast variant)
	SLHDSA256f
	// SLHDSA256s provides 256-bit security (small variant)
	SLHDSA256s
)

type PrivateKey

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

PrivateKey represents an SLH-DSA private key

func GenerateKey

func GenerateKey(mode Mode, rand io.Reader) (*PrivateKey, error)

GenerateKey generates a new SLH-DSA key pair

func PrivateKeyFromBytes

func PrivateKeyFromBytes(mode Mode, data []byte) (*PrivateKey, error)

FromBytes deserializes a private key

func (*PrivateKey) Bytes

func (priv *PrivateKey) Bytes() []byte

Bytes returns the serialized private key

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypto.PublicKey

Public returns the public key

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs a message with the private key

type PublicKey

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

PublicKey represents an SLH-DSA public key

func PublicKeyFromBytes

func PublicKeyFromBytes(mode Mode, data []byte) (*PublicKey, error)

FromBytes deserializes a public key

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() []byte

Bytes returns the serialized public key

func (*PublicKey) Verify

func (pub *PublicKey) Verify(message, signature []byte) bool

Verify verifies a signature with the public key

Jump to

Keyboard shortcuts

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