mldsa44

package
v0.0.0-...-25cf834 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Code = multicodec.Code(0x131a)

Code is the Multicodec code for `mldsa44-priv`. It is not (yet) present in the go-multicodec table, so it is spelled out here to keep `did:key` and signer encodings identical to those produced before the `multikey` restructuring.

https://github.com/multiformats/multicodec/blob/6bd718d6cb68e6714dea92758d7654aa1f9974b3/table.csv#L224

Variables

This section is empty.

Functions

func Encode

func Encode(signer Signer) []byte

func Format

func Format(signer multikey.Signer) string

func GenerateIssuer

func GenerateIssuer() (multikey.Issuer, error)

Types

type Signer

type Signer []byte

func Decode

func Decode(b []byte) (Signer, error)

Decode decodes a buffer of an ML-DSA-44 signer multiformat varint (0x131a) + 32 byte ML-DSA-44 private key seed.

func FromRaw

func FromRaw(b []byte) (Signer, error)

FromRaw takes raw 32 byte ML-DSA-44 private key seed bytes and tags with the ML-DSA-44 signer multiformat code, returning an ML-DSA-44 signer.

func Generate

func Generate() (Signer, error)

func Parse

func Parse(str string) (Signer, error)

Parse parses a multibase encoded string containing an ML-DSA-44 signer multiformat varint (0x131a) + 32 byte ML-DSA-44 private key seed.

func (Signer) Bytes

func (s Signer) Bytes() []byte

Bytes returns the private key bytes with multiformat prefix varint.

func (Signer) Code

func (s Signer) Code() multicodec.Code

func (Signer) KeyDID

func (s Signer) KeyDID() did.DID

func (Signer) PrivateKey

func (s Signer) PrivateKey() any

func (Signer) PublicKey

func (s Signer) PublicKey() any

func (Signer) Raw

func (s Signer) Raw() []byte

Raw encodes the bytes of the private key without multiformats tags.

func (Signer) Sign

func (s Signer) Sign(msg []byte) []byte

Sign produces a deterministic ML-DSA-44 signature over msg. Determinism means signing the same message with the same key always yields the same signature.

func (Signer) SignatureAlgorithm

func (s Signer) SignatureAlgorithm() varsig.Algorithm

func (Signer) Verifier

func (s Signer) Verifier() ucan.Verifier

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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