encapsulate

fun encapsulate(randomProvider: RandomProvider = DefaultRandomProvider): KyberEncapsulationResult

Encapsulates this KyberEncapsulationKey into a KyberCipherText and generates a Shared Secret Key using the DefaultRandomProvider.

This method is the ML-KEM.Encaps() specified in NIST FIPS 203.

Return

KyberEncapsulationResult - Contains the Cipher Text and the generated Shared Secret Key.

Parameters

randomProvider

(Optional) RandomProvider to use when generating the plaintext.