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)

method_name

const char * method_name

Printable string representing the name of the key encapsulation mechanism.


alg_version

const char * alg_version

Printable string representing the version of the cryptographic algorithm.

Implementations with the same method_name and same alg_version will be interoperable. See README.md for information about algorithm compatibility.


claimed_nist_level

uint8_t claimed_nist_level

The NIST security level (1, 2, 3, 4, 5) claimed in this algorithm's original NIST submission.


ind_cca

bool ind_cca

Whether the KEM offers IND-CCA security (TRUE) or IND-CPA security (FALSE).


length_public_key

size_t length_public_key

The length, in bytes, of public keys for this KEM.


length_secret_key

size_t length_secret_key

The length, in bytes, of secret keys for this KEM.


length_ciphertext

size_t length_ciphertext

The length, in bytes, of ciphertexts for this KEM.


length_shared_secret

size_t length_shared_secret

The length, in bytes, of shared secrets for this KEM.


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



Copyright © Open Quantum Safe a Series of LF Projects, LLC.
For website terms of use, trademark policy, and other project policies, please see https://lfprojects.org.
This site uses Just the Docs, a documentation theme for Jekyll. Background image by Rick Doble.