Contains the public API for the FIPS 203 implementation of the Kyber CCA-secure Key Encapsulation Mechanism. More...
Go to the source code of this file.
Functions | |
QSC_EXPORT_API bool | qsc_kyber_decapsulate (uint8_t *secret, const uint8_t *ciphertext, const uint8_t *privatekey) |
Decapsulates the shared secret for a given ciphertext using a private key. | |
QSC_EXPORT_API bool | qsc_kyber_decrypt (uint8_t *secret, const uint8_t *ciphertext, const uint8_t *privatekey) |
Decrypts the shared secret for a given ciphertext using a private key. | |
QSC_EXPORT_API void | qsc_kyber_encapsulate (uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, bool(*rng_generate)(uint8_t *, size_t)) |
Encapsulates a shared secret key using a public key. | |
QSC_EXPORT_API void | qsc_kyber_encrypt (uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, const uint8_t seed[QSC_KYBER_SEED_SIZE]) |
Encrypts to encapsulate a shared secret key using a public key. | |
QSC_EXPORT_API void | qsc_kyber_generate_keypair (uint8_t *publickey, uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t)) |
Generates a Kyber public/private key pair. | |
Contains the public API for the FIPS 203 implementation of the Kyber CCA-secure Key Encapsulation Mechanism.
The Kyber key encapsulation mechanism (KEM) provides functionality for generating key pairs, encapsulating a shared secret using a public key, and decapsulating the shared secret using a private key. It is the FIPS 203 Kyber implementation with an additional K=5 parameter to enhance security.
QSC_EXPORT_API bool qsc_kyber_decapsulate | ( | uint8_t * | secret, |
const uint8_t * | ciphertext, | ||
const uint8_t * | privatekey ) |
Decapsulates the shared secret for a given ciphertext using a private key.
Combines the ciphertext with the private key to derive the shared secret.
secret | [uint8_t*] Pointer to the output shared secret key (array of QSC_KYBER_SHAREDSECRET_SIZE). |
ciphertext | [const uint8_t*] Pointer to the ciphertext array (size QSC_KYBER_CIPHERTEXT_SIZE). |
privatekey | [const uint8_t*] Pointer to the secret key array (size QSC_KYBER_PRIVATEKEY_SIZE). |
QSC_EXPORT_API bool qsc_kyber_decrypt | ( | uint8_t * | secret, |
const uint8_t * | ciphertext, | ||
const uint8_t * | privatekey ) |
Decrypts the shared secret for a given ciphertext using a private key.
Alternative decryption function; functionally equivalent to decapsulation.
secret | [uint8_t*] Pointer to the output shared secret key (array of QSC_KYBER_SHAREDSECRET_SIZE). |
ciphertext | [const uint8_t*] Pointer to the ciphertext array (size QSC_KYBER_CIPHERTEXT_SIZE). |
privatekey | [const uint8_t*] Pointer to the secret key array (size QSC_KYBER_PRIVATEKEY_SIZE). |
QSC_EXPORT_API void qsc_kyber_encapsulate | ( | uint8_t * | secret, |
uint8_t * | ciphertext, | ||
const uint8_t * | publickey, | ||
bool(* | rng_generate )(uint8_t *, size_t) ) |
Encapsulates a shared secret key using a public key.
Generates ciphertext and a shared secret; used for key encapsulation.
secret | [uint8_t*] Pointer to the output shared secret key (array of QSC_KYBER_SHAREDSECRET_SIZE). |
ciphertext | [uint8_t*] Pointer to the output ciphertext array (size QSC_KYBER_CIPHERTEXT_SIZE). |
publickey | [const uint8_t*] Pointer to the public key array (size QSC_KYBER_PUBLICKEY_SIZE). |
rng_generate | [bool (*)(uint8_t*, size_t)] Pointer to a random generator function. |
QSC_EXPORT_API void qsc_kyber_encrypt | ( | uint8_t * | secret, |
uint8_t * | ciphertext, | ||
const uint8_t * | publickey, | ||
const uint8_t | seed[QSC_KYBER_SEED_SIZE] ) |
Encrypts to encapsulate a shared secret key using a public key.
Generates ciphertext and a shared secret based on a public key and a given seed.
secret | [uint8_t*] Pointer to the output shared secret key (array of QSC_KYBER_SHAREDSECRET_SIZE). |
ciphertext | [uint8_t*] Pointer to the output ciphertext array (size QSC_KYBER_CIPHERTEXT_SIZE). |
publickey | [const uint8_t*] Pointer to the public key array (size QSC_KYBER_PUBLICKEY_SIZE). |
seed | [const uint8_t[QSC_KYBER_SEED_SIZE]] Pointer to the random seed array. |
QSC_EXPORT_API void qsc_kyber_generate_keypair | ( | uint8_t * | publickey, |
uint8_t * | privatekey, | ||
bool(* | rng_generate )(uint8_t *, size_t) ) |
Generates a Kyber public/private key pair.
Produces a key pair for the Kyber key encapsulation mechanism.
publickey | [uint8_t*] Pointer to the output public key array (size QSC_KYBER_PUBLICKEY_SIZE). |
privatekey | [uint8_t*] Pointer to the output private key array (size QSC_KYBER_PRIVATEKEY_SIZE). |
rng_generate | [bool (*)(uint8_t*, size_t)] Pointer to a random generator function. |