package mldsa_eddsa
import "github.com/ProtonMail/go-crypto/openpgp/mldsa_eddsa"
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
- func Sign(priv *PrivateKey, message []byte) (dSig, ecSig []byte, err error)
- func Validate(priv *PrivateKey) (err error)
- func Verify(pub *PublicKey, message, dSig, ecSig []byte) bool
- type PrivateKey
- func GenerateKey(rand io.Reader, algId uint8, c ecc.EdDSACurve, d sign.Scheme) (priv *PrivateKey, err error)
- func (priv *PrivateKey) DeriveMlDsaKeys(seed []byte, overridePublicKey bool) (err error)
- type PublicKey
Constants ¶
const (
MlDsaSeedLen = 32
)
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 ¶
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
}
Source Files ¶
- Version
- v1.1.6-proton
- Published
- Feb 27, 2025
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 1 hour ago –
Tools for package owners.