pqcrypto

package
v1.16.48 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: GPL-3.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm int

Algorithm represents post-quantum cryptographic algorithm types

const (
	// AlgoClassical represents traditional ECDSA (secp256k1)
	AlgoClassical Algorithm = iota

	// ML-DSA (Module-Lattice-Based Digital Signature Algorithm) - FIPS 204
	AlgoMLDSA44 // ML-DSA-44 (128-bit security)
	AlgoMLDSA65 // ML-DSA-65 (192-bit security)
	AlgoMLDSA87 // ML-DSA-87 (256-bit security)

	// ML-KEM (Module-Lattice-Based Key Encapsulation Mechanism) - FIPS 203
	AlgoMLKEM512  // ML-KEM-512 (128-bit security)
	AlgoMLKEM768  // ML-KEM-768 (192-bit security)
	AlgoMLKEM1024 // ML-KEM-1024 (256-bit security)

	// SLH-DSA (Stateless Hash-Based Digital Signature Algorithm) - FIPS 205
	AlgoSLHDSA128s // SLH-DSA-128s (128-bit security, small)
	AlgoSLHDSA192s // SLH-DSA-192s (192-bit security, small)
	AlgoSLHDSA256s // SLH-DSA-256s (256-bit security, small)

	// Hybrid modes combining classical and post-quantum
	AlgoHybridSecp256k1MLDSA // Hybrid: secp256k1 + ML-DSA
	AlgoHybridSecp256k1MLKEM // Hybrid: secp256k1 + ML-KEM
)

type MLDSAKey added in v1.16.39

type MLDSAKey struct {
	PublicKey  []byte
	PrivateKey []byte
}

MLDSAKey represents an ML-DSA key pair

type MLKEMKey added in v1.16.39

type MLKEMKey struct {
	PublicKey  MLKEMPublicKey
	PrivateKey []byte
}

MLKEMKey represents an ML-KEM key pair

type MLKEMPublicKey added in v1.16.39

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

MLKEMPublicKey represents an ML-KEM public key

func (*MLKEMPublicKey) Bytes added in v1.16.39

func (pk *MLKEMPublicKey) Bytes() []byte

Bytes returns the public key bytes

type PQSigner

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

PQSigner provides post-quantum cryptographic signing capabilities

func NewPQSigner

func NewPQSigner(algo Algorithm) (*PQSigner, error)

NewPQSigner creates a new post-quantum signer with the specified algorithm

func (*PQSigner) Address

func (s *PQSigner) Address() common.Address

Address returns the Ethereum address for this signer

func (*PQSigner) Decapsulate

func (s *PQSigner) Decapsulate(ciphertext []byte) (sharedSecret []byte, err error)

Decapsulate performs key decapsulation (KEM) if supported

func (*PQSigner) Encapsulate

func (s *PQSigner) Encapsulate(publicKey []byte) (ciphertext []byte, sharedSecret []byte, err error)

Encapsulate performs key encapsulation (KEM) if supported

func (*PQSigner) Sign

func (s *PQSigner) Sign(message []byte) ([]byte, error)

Sign signs a message using the configured algorithm

type SLHDSAKey added in v1.16.39

type SLHDSAKey struct {
	PublicKey  []byte
	PrivateKey []byte
}

SLHDSAKey represents an SLH-DSA key pair

Jump to

Keyboard shortcuts

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