decapsulate static method
Decapsulates the given ciphertext using the provided private key to recover the shared secret.
This method takes a ciphertext generated during the encapsulation process and a private key, and uses them to retrieve the original shared secret.
Parameters:
c
: The ciphertext to be decapsulated.sk
: The private key corresponding to the public key used in encapsulation.
Returns:
A Uint8List
containing the shared secret.
Implementation
static Uint8List decapsulate(Uint8List c, Uint8List sk) {
Uint8List ss = Uint8List(KYBER_SSBYTES);
cryptokemdec(ss, c, sk);
return ss;
}