dsa

package
v0.0.0-...-66b4571 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Level2 = iota
	Level3
	Level5
)

Variables

This section is empty.

Functions

func ReadGzip

func ReadGzip(path string) ([]byte, error)

Like os.ReadFile, but gunzip first.

Types

type API

type API interface {
	Scheme() string
	GenerateKeyPair(seed [common.SeedSize]byte) (fips204.PublicKey, fips204.PrivateKey)
	Sign(secretBytes []byte, msgBytes []byte, rnd [32]byte) []byte
	Verify(publicBytes, signatureBytes []byte, msgBytes []byte) bool

	MarshalPublicKey(pk fips204.PublicKey) []byte
	MarshalPrivateKey(sk fips204.PrivateKey) []byte
	UnmarshalPublicKey(buf []byte) fips204.PublicKey
	UnmarshalPrivateKey(buf []byte) fips204.PrivateKey

	IsPublicKeyValid(srcPk, targetPk fips204.PublicKey) bool
	IsPrivateKeyValid(srcSk, targetSk fips204.PrivateKey) bool
}

func WithFIPS204

func WithFIPS204(l Level) API

type DSA

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

func (*DSA) GenerateKeyPair

func (d *DSA) GenerateKeyPair(seed [common.SeedSize]byte) (fips204.PublicKey, fips204.PrivateKey)

func (*DSA) IsPrivateKeyValid

func (d *DSA) IsPrivateKeyValid(srcSk, targetSk fips204.PrivateKey) bool

func (*DSA) IsPublicKeyValid

func (d *DSA) IsPublicKeyValid(srcPk, targetPk fips204.PublicKey) bool

func (*DSA) MarshalPrivateKey

func (d *DSA) MarshalPrivateKey(sk fips204.PrivateKey) []byte

func (*DSA) MarshalPublicKey

func (d *DSA) MarshalPublicKey(pk fips204.PublicKey) []byte

func (*DSA) Scheme

func (d *DSA) Scheme() string

func (*DSA) Sign

func (d *DSA) Sign(secretBytes []byte, msgBytes []byte, rnd [32]byte) []byte

func (*DSA) UnmarshalPrivateKey

func (d *DSA) UnmarshalPrivateKey(buf []byte) fips204.PrivateKey

func (*DSA) UnmarshalPublicKey

func (d *DSA) UnmarshalPublicKey(buf []byte) fips204.PublicKey

func (*DSA) Verify

func (d *DSA) Verify(publicBytes, signatureBytes []byte, msgBytes []byte) bool

type HexBytes

type HexBytes []byte

func (HexBytes) MarshalJSON

func (b HexBytes) MarshalJSON() ([]byte, error)

func (*HexBytes) UnmarshalJSON

func (b *HexBytes) UnmarshalJSON(data []byte) (err error)

type Level

type Level int

func ToLevel

func ToLevel(algorithm string) Level

func (Level) String

func (l Level) String() string

Directories

Path Synopsis
internal
sign
Package sign implements Module Lattice Digital Signature Algorithm (ML-DSA) (Dilithium) scheme.
Package sign implements Module Lattice Digital Signature Algorithm (ML-DSA) (Dilithium) scheme.
protocol
fips204
Package fips204 implements the ML-DSA (Module Lattice Digital Signature Algorithm) protocol as standardized in NIST FIPS 204.
Package fips204 implements the ML-DSA (Module Lattice Digital Signature Algorithm) protocol as standardized in NIST FIPS 204.

Jump to

Keyboard shortcuts

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