Documentation
¶
Overview ¶
Package mlkem provides Go bindings to the C implementation from https://github.com/pq-code-package/mlkem-native.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ParameterSet ¶
type ParameterSet int
const ( MLKEM512 ParameterSet MLKEM768 MLKEM1024 )
func (ParameterSet) GenerateKeypair ¶
func (parms ParameterSet) GenerateKeypair(rand io.Reader) (SecretKey, error)
GenerateKeypair generates a keypair, reading the seed from rand.
func (ParameterSet) ImportPublicKey ¶
func (parms ParameterSet) ImportPublicKey(pk []byte) (PublicKey, error)
ImportPublicKey imports the given public key.
type PublicKey ¶
type PublicKey interface {
// ParameterSet returns the parameter set associated with this key.
ParameterSet() ParameterSet
// Encapsulate performs key encapsulation with the given public key, reading randomness from rand.
Encapsulate(rand io.Reader) (secret []byte, ciphertext []byte, err error)
// Bytes returns the public key in FIPS-203 format as a byte slice.
Bytes() []byte
}
PublicKey represents an ML-KEM public key.
type SecretKey ¶
type SecretKey interface {
// ParameterSet returns the parameter set associated with this key.
ParameterSet() ParameterSet
// Decapsulate recovers the shared secret from the ciphertext.
Decapsulate(ciphertext []byte) ([]byte, error)
// PublicKey returns the public key associated with this key.
PublicKey() PublicKey
// Bytes returns the expanded secret key in FIPS-203 format as a byte slice.
Bytes() []byte
// Seed returns the secret seed as a byte slice.
Seed() []byte
}
SecretKey represents an ML-KEM secret key.
Click to show internal directories.
Click to hide internal directories.