mldsa_eddsa

package
v1.1.4-proton Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package mldsa_eddsa implements hybrid ML-DSA + EdDSA encryption, suitable for OpenPGP, experimental. It follows the specs https://www.ietf.org/archive/id/draft-ietf-openpgp-pqc-05.html#name-composite-signature-schemes

Index

Constants

View Source
const (
	MlDsaSeedLen = 32
)

Variables

This section is empty.

Functions

func Sign

func Sign(priv *PrivateKey, message []byte) (dSig, ecSig []byte, err error)

Sign generates a ML-DSA + EdDSA composite signature as specified in https://www.ietf.org/archive/id/draft-ietf-openpgp-pqc-05.html#name-signature-generation

func Validate

func Validate(priv *PrivateKey) (err error)

Validate checks that the public key corresponds to the private key

func Verify

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

Verify verifies a ML-DSA + EdDSA composite signature as specified in https://www.ietf.org/archive/id/draft-ietf-openpgp-pqc-05.html#name-signature-verification

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	SecretEc        []byte
	SecretMldsa     sign.PrivateKey
	SecretMldsaSeed []byte
}

func GenerateKey

func GenerateKey(rand io.Reader, algId uint8, c ecc.EdDSACurve, d sign.Scheme) (priv *PrivateKey, err error)

GenerateKey generates a ML-DSA + EdDSA composite key as specified in https://www.ietf.org/archive/id/draft-ietf-openpgp-pqc-05.html#name-key-generation-procedure-2

func (*PrivateKey) DeriveMlDsaKeys

func (priv *PrivateKey) DeriveMlDsaKeys(seed []byte, overridePublicKey bool) (err error)

DeriveMlDsaKeys derives the ML-DSA keys from the provided seed and stores them inside priv.

type PublicKey

type PublicKey struct {
	AlgId       uint8
	Curve       ecc.EdDSACurve
	Mldsa       sign.Scheme
	PublicPoint []byte
	PublicMldsa sign.PublicKey
}

Jump to

Keyboard shortcuts

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