Documentation
¶
Overview ¶
Package mldsa implements ML-DSA (Module-Lattice-Based Digital Signature Algorithm) using Cloudflare's circl library with automatic CGO optimizations when available.
Index ¶
Constants ¶
View Source
const ( MLDSA44PublicKeySize = mldsa44.PublicKeySize MLDSA44PrivateKeySize = mldsa44.PrivateKeySize MLDSA44SignatureSize = mldsa44.SignatureSize MLDSA65PublicKeySize = mldsa65.PublicKeySize MLDSA65PrivateKeySize = mldsa65.PrivateKeySize MLDSA65SignatureSize = mldsa65.SignatureSize MLDSA87PublicKeySize = mldsa87.PublicKeySize MLDSA87PrivateKeySize = mldsa87.PrivateKeySize MLDSA87SignatureSize = mldsa87.SignatureSize )
Size constants for each mode
Variables ¶
Functions ¶
func GetPublicKeySize ¶ added in v1.4.18
GetPublicKeySize returns the size of a public key for the given mode
func GetSignatureSize ¶ added in v1.4.18
GetSignatureSize returns the size of a signature for the given mode
Types ¶
type PrivateKey ¶
type PrivateKey struct {
PublicKey *PublicKey
// contains filtered or unexported fields
}
PrivateKey represents an ML-DSA private key
func GenerateKey ¶
func GenerateKey(rand io.Reader, mode Mode) (*PrivateKey, error)
GenerateKey generates a new ML-DSA key pair using circl
func PrivateKeyFromBytes ¶
func PrivateKeyFromBytes(mode Mode, data []byte) (*PrivateKey, error)
PrivateKeyFromBytes deserializes a private key
func (*PrivateKey) Bytes ¶
func (priv *PrivateKey) Bytes() []byte
Bytes returns the serialized private key
func (*PrivateKey) Public ¶ added in v1.4.18
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 using circl
Click to show internal directories.
Click to hide internal directories.