Contains the public API for the HQC CCA-secure Key Encapsulation Mechanism. More...
Go to the source code of this file.
Functions | |
| QSC_EXPORT_API bool | qsc_hqc_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_hqc_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. | |
| void | qsc_hqc_seeded_encapsulate (uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, const uint8_t seed[QSC_HQC_SEED_SIZE]) |
| Generates cipher text and shared secret for given public key and a random seed. | |
| QSC_EXPORT_API bool | qsc_hqc_generate_keypair (uint8_t *publickey, uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t)) |
| Generates a Kyber public/private key pair. | |
| QSC_EXPORT_API void | qsc_hqc_generate_seeded_keypair (uint8_t *publickey, uint8_t *privatekey, uint8_t *seed) |
| Generates public and private key for the CCA-Secure Kyber key encapsulation mechanism using input seeds. | |
Contains the public API for the HQC CCA-secure Key Encapsulation Mechanism.
The Hamming Quasi-Cyclic (HQC) key encapsulation mechanism provides functionality for generating key pairs, encapsulating a shared secret using a public key, and decapsulating the shared secret using a private key.
This interface supports the HQC parameter sets corresponding to NIST security categories 1, 3, and 5. The active implementation is selected at compile time using one of the parameter guard macros QSC_HQC_S1N2321, QSC_HQC_S3N4602, or QSC_HQC_S5N7333.
| QSC_EXPORT_API bool qsc_hqc_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_HQC_SHAREDSECRET_SIZE). |
| ciphertext | [const uint8_t*] Pointer to the ciphertext array (size QSC_HQC_CIPHERTEXT_SIZE). |
| privatekey | [const uint8_t*] Pointer to the secret key array (size QSC_HQC_PRIVATEKEY_SIZE). |
| QSC_EXPORT_API bool qsc_hqc_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_HQC_SHAREDSECRET_SIZE). |
| ciphertext | [uint8_t*] Pointer to the output ciphertext array (size QSC_HQC_CIPHERTEXT_SIZE). |
| publickey | [const uint8_t*] Pointer to the public key array (size QSC_HQC_PUBLICKEY_SIZE). |
| rng_generate | [bool (*)(uint8_t*, size_t)] Pointer to a random generator function. |
| QSC_EXPORT_API bool qsc_hqc_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_HQC_PUBLICKEY_SIZE) |
| privatekey | [uint8_t*] Pointer to the output private key array (size QSC_HQC_PRIVATEKEY_SIZE) |
| rng_generate | [bool (*)(uint8_t*, size_t)] Pointer to a random generator function. |
| QSC_EXPORT_API void qsc_hqc_generate_seeded_keypair | ( | uint8_t * | publickey, |
| uint8_t * | privatekey, | ||
| uint8_t * | seed ) |
Generates public and private key for the CCA-Secure Kyber key encapsulation mechanism using input seeds.
| publickey | [uint8_t*] Pointer to output public key (an already allocated array of HQC_PUBLICKEY_SIZE bytes) |
| privatekey | [uint8_t*] Pointer to output private key (an already allocated array of HQC_SECRETKEY_SIZE bytes) |
| seed | [uint8_t*] Pointer to the random seed |
| void qsc_hqc_seeded_encapsulate | ( | uint8_t * | secret, |
| uint8_t * | ciphertext, | ||
| const uint8_t * | publickey, | ||
| const uint8_t | seed[QSC_HQC_SEED_SIZE] ) |
Generates cipher text and shared secret for given public key and a random seed.
| ct | [uint8_t*] Pointer to output cipher text (an already allocated array of HQC_CIPHERTEXT_SIZE bytes) |
| ss | [uint8_t*] Pointer to output shared secret (an already allocated array of HQC_BYTES bytes) |
| pk | [const uint8_t*] Pointer to input public key (an already allocated array of HQC_PUBLICKEY_SIZE bytes) |
| seed | [const uint8_t*] Pointer to the random seed (a populated random array of QSC_HQC_SEED_SIZE bytes) |