mldsa

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 mldsa implements ML-DSA (Module-Lattice-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 ML-DSA

const (
	// MLDSA44 provides 128-bit security
	MLDSA44 Mode = iota
	// MLDSA65 provides 192-bit security
	MLDSA65
	// MLDSA87 provides 256-bit security
	MLDSA87
)

type PrivateKey

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

PrivateKey represents an ML-DSA private key

func GenerateKey

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

GenerateKey generates a new ML-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 ML-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