Documentation
¶
Index ¶
- Constants
- func DeserializeDRY(bytes []byte, expectedSize int, typeName string) ([]byte, error)
- func GenerateKeyPair(rand io.Reader, mode Mode) (*PrivateKey, *PublicKey, error)
- func SerializeDRY(data []byte, expectedSize int, typeName string) ([]byte, error)
- type BatchKEM
- type EncapsulationResult
- type Mode
- type PrivateKey
- type PublicKey
Constants ¶
const ( // ML-KEM-512 (Level 1 security) MLKEM512PublicKeySize = mlkem512.PublicKeySize MLKEM512PrivateKeySize = mlkem512.PrivateKeySize MLKEM512CiphertextSize = mlkem512.CiphertextSize // ML-KEM-768 (Level 3 security) MLKEM768PublicKeySize = mlkem768.PublicKeySize MLKEM768PrivateKeySize = mlkem768.PrivateKeySize MLKEM768CiphertextSize = mlkem768.CiphertextSize // ML-KEM-1024 (Level 5 security) MLKEM1024PublicKeySize = mlkem1024.PublicKeySize MLKEM1024PrivateKeySize = mlkem1024.PrivateKeySize MLKEM1024CiphertextSize = mlkem1024.CiphertextSize )
Security parameters for ML-KEM (Module Lattice Key Encapsulation Mechanism)
Variables ¶
This section is empty.
Functions ¶
func DeserializeDRY ¶
DeserializeDRY provides unified deserialization
func GenerateKeyPair ¶
GenerateKeyPair generates a new ML-KEM key pair using REAL implementation
Types ¶
type BatchKEM ¶
type BatchKEM struct {
// contains filtered or unexported fields
}
Batch operations for better throughput
func NewBatchKEM ¶
NewBatchKEM creates a batch KEM processor
type EncapsulationResult ¶
type EncapsulationResult struct {
Ciphertext []byte
}
EncapsulationResult holds the result of encapsulation
type PrivateKey ¶
type PrivateKey struct {
PublicKey *PublicKey
// contains filtered or unexported fields
}
PrivateKey represents an ML-KEM private key
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) (sharedSecret []byte, err error)
Decapsulate recovers the shared secret from ciphertext using REAL implementation
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 ciphertext and shared secret using REAL implementation