Documentation
¶
Index ¶
Constants ¶
const ( // ML-KEM-512 (Level 1 security) MLKEM512PublicKeySize = 800 MLKEM512PrivateKeySize = 1632 MLKEM512CiphertextSize = 768 // ML-KEM-768 (Level 3 security) MLKEM768PublicKeySize = 1184 MLKEM768PrivateKeySize = 2400 MLKEM768CiphertextSize = 1088 // ML-KEM-1024 (Level 5 security) MLKEM1024PublicKeySize = 1568 MLKEM1024PrivateKeySize = 3168 MLKEM1024CiphertextSize = 1568 )
Security parameters for ML-KEM (Module Lattice Key Encapsulation Mechanism)
Variables ¶
This section is empty.
Functions ¶
func DeserializeDRY ¶
DeserializeDRY provides unified deserialization
Types ¶
type BatchKEM ¶
type BatchKEM struct {
// contains filtered or unexported fields
}
Batch operations for better throughput
func NewBatchKEM ¶
NewBatchKEM creates a batch KEM processor
func (*BatchKEM) EncapsulateBatch ¶
func (b *BatchKEM) EncapsulateBatch(rand io.Reader) ([]*EncapsulationResult, error)
EncapsulateBatch performs batch encapsulation
type EncapsulationResult ¶
type EncapsulationResult struct {
Ciphertext []byte
}
EncapsulationResult contains the ciphertext and shared secret
type PrivateKey ¶
type PrivateKey struct {
PublicKey PublicKey
// contains filtered or unexported fields
}
PrivateKey represents an ML-KEM private key
func GenerateKeyPair ¶
func GenerateKeyPair(rand io.Reader, mode Mode) (*PrivateKey, error)
GenerateKeyPair generates a new ML-KEM key pair
func GenerateKeyPairDRY ¶
func GenerateKeyPairDRY(random io.Reader, mode Mode) (*PrivateKey, error)
GenerateKeyPairDRY generates a key pair using DRY principles
func GenerateKeyPairOptimized ¶
func GenerateKeyPairOptimized(rand io.Reader, mode Mode) (*PrivateKey, error)
Optimized key generation with pre-allocated buffers
func PrivateKeyFromBytes ¶
func PrivateKeyFromBytes(data []byte, mode Mode) (*PrivateKey, error)
PrivateKeyFromBytes reconstructs a private key from bytes
func (*PrivateKey) Bytes ¶
func (priv *PrivateKey) Bytes() []byte
Bytes returns the private key as bytes
func (*PrivateKey) Decapsulate ¶
func (priv *PrivateKey) Decapsulate(ciphertext []byte) ([]byte, error)
Decapsulate recovers the shared secret from ciphertext
func (*PrivateKey) DecapsulateDRY ¶
func (priv *PrivateKey) DecapsulateDRY(ciphertext []byte) ([]byte, error)
DecapsulateDRY performs decapsulation using DRY principles
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey represents an ML-KEM public key
func PublicKeyFromBytes ¶
PublicKeyFromBytes reconstructs a public key from bytes
func (*PublicKey) Encapsulate ¶
func (pub *PublicKey) Encapsulate(rand io.Reader) (*EncapsulationResult, error)
Encapsulate generates a shared secret and ciphertext
func (*PublicKey) EncapsulateDRY ¶
func (pub *PublicKey) EncapsulateDRY(random io.Reader) (*EncapsulationResult, error)
EncapsulateDRY performs encapsulation using DRY principles