struct OQS_KEM
Key encapsulation mechanism object
Includes
#include <kem.h>
Members
const char * | method_name |
const char * | alg_version |
uint8_t | claimed_nist_level |
bool | ind_cca |
size_t | length_public_key |
size_t | length_secret_key |
size_t | length_ciphertext |
size_t | length_shared_secret |
OQS_STATUS(* | keypair)(uint8_t *public_key, uint8_t *secret_key) |
OQS_STATUS(* | encaps)(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key) |
OQS_STATUS(* | decaps)(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key) |
keypair
OQS_STATUS(* keypair)(uint8_t *public_key, uint8_t *secret_key)
Keypair generation algorithm.
Caller is responsible for allocating sufficient memory for public_key
and secret_key
, based on the length_*
members in this object or the per-scheme compile-time macros OQS_KEM_*_length_*
.
Parameters
| public_key | The public key represented as a byte string. |
| secret_key | The secret key represented as a byte string. |
Returns
OQS_SUCCESS or OQS_ERROR
encaps
OQS_STATUS(* encaps)(uint8_t *ciphertext, uint8_t *shared_secret, const uint8_t *public_key)
Encapsulation algorithm.
Caller is responsible for allocating sufficient memory for ciphertext
and shared_secret
, based on the length_*
members in this object or the per-scheme compile-time macros OQS_KEM_*_length_*
.
Parameters
| ciphertext | The ciphertext (encapsulation) represented as a byte string. |
| shared_secret | The shared secret represented as a byte string. |
| public_key | The public key represented as a byte string. |
Returns
OQS_SUCCESS or OQS_ERROR
decaps
OQS_STATUS(* decaps)(uint8_t *shared_secret, const uint8_t *ciphertext, const uint8_t *secret_key)
Decapsulation algorithm.
Caller is responsible for allocating sufficient memory for shared_secret
, based on the length_*
members in this object or the per-scheme compile-time macros OQS_KEM_*_length_*
.
Parameters
| shared_secret | The shared secret represented as a byte string. |
| ciphertext | The ciphertext (encapsulation) represented as a byte string. |
| secret_key | The secret key represented as a byte string. |
Returns
OQS_SUCCESS or OQS_ERROR