Documentation ¶
Overview ¶
Package xwing implements the hybrid quantum-resistant key encapsulation method X-Wing, which combines X25519, ML-KEM-768, and SHA3-256 as specified in draft-connolly-cfrg-xwing-kem-01.
Future v0 versions of this package might introduce backwards incompatible changes to implement changes to draft-connolly-cfrg-xwing-kem or FIPS 203.
Index ¶
- Constants
- func Decapsulate(decapsulationKey, ciphertext []byte) (sharedKey []byte, err error)
- func Encapsulate(encapsulationKey []byte) (ciphertext, sharedKey []byte, err error)
- func GenerateKey() (encapsulationKey, decapsulationKey []byte, err error)
- func NewKeyFromSeed(seed []byte) (encapsulationKey, decapsulationKey []byte, err error)
Constants ¶
const ( CiphertextSize = mlkem768.CiphertextSize + 32 EncapsulationKeySize = mlkem768.EncapsulationKeySize + 32 DecapsulationKeySize = mlkem768.DecapsulationKeySize + 32 + 32 SeedSize = mlkem768.SeedSize + 32 )
Variables ¶
This section is empty.
Functions ¶
func Decapsulate ¶
Decapsulate generates a shared key from a ciphertext and a decapsulation key. If the decapsulation key or the ciphertext are not valid, Decapsulate returns an error.
The shared key must be kept secret.
func Encapsulate ¶
Encapsulate generates a shared key and an associated ciphertext from an encapsulation key, drawing random bytes from crypto/rand. If the encapsulation key is not valid, Encapsulate returns an error.
The shared key must be kept secret.
func GenerateKey ¶
GenerateKey generates an encapsulation key and a corresponding decapsulation key, drawing random bytes from crypto/rand.
The decapsulation key must be kept secret.
func NewKeyFromSeed ¶
NewKeyFromSeed deterministically generates an encapsulation key and a corresponding decapsulation key from a 96-byte seed. The seed must be uniformly random.
Types ¶
This section is empty.