PQLR
Postquantum Crypto Library by QAPP
|
Typedefs | |
typedef struct mceliece_st * | mceliece_t |
McEliece algorithm instance handle. More... | |
Enumerations | |
enum | mceliece_parameterset_t { mceliece348864 , mceliece460896 , mceliece6688128 , mceliece6960119 , mceliece8192128 , mceliece348864f , mceliece460896f , mceliece6688128f , mceliece6960119f , mceliece8192128f , mceliece_last } |
Possible mceliece parameters sets. More... | |
Functions | |
PQLR_API mceliece_t | mceliece_new (mceliece_parameterset_t parameterset) |
Creates mceliece instance initialized by parameterset. More... | |
PQLR_API void | mceliece_free (mceliece_t mceliece) |
Frees mceliece instance and all corresponding resources. More... | |
PQLR_API uint32_t | mceliece_get_initiator_public_length (mceliece_t mceliece) |
Obtains initiator's public key length for the current mceliece instance. More... | |
PQLR_API uint32_t | mceliece_get_initiator_secret_length (mceliece_t mceliece) |
Obtains initiator's secret key length for the current mceliece instance. More... | |
PQLR_API uint32_t | mceliece_get_ciphertext_length (mceliece_t mceliece) |
Obtains ciphertext length for the current mceliece instance. More... | |
PQLR_API uint32_t | mceliece_get_shared_secret_length (mceliece_t mceliece) |
Obtains shared secret length for the current mceliece instance. More... | |
PQLR_API pqlr_t | mceliece_to_pqlr (mceliece_t mceliece) |
Casts mceliece instance to pqlr instance. More... | |
PQLR_API mceliece_t | mceliece_duplicate (const mceliece_t mceliece) |
Duplicates context of mceliece instance. More... | |
PQLR_API void | mceliece_keygen (const mceliece_t mceliece, uint8_t *public_key, uint8_t *secret_key) |
Initial step of key distribution. Generates a key pair for key distribution initiator. More... | |
PQLR_API void | mceliece_key_encap (const mceliece_t mceliece, const uint8_t *public_key, uint8_t *ciphertext, uint8_t *session_key) |
Key encapsulation. More... | |
PQLR_API void | mceliece_key_decap (const mceliece_t mceliece, const uint8_t *secret_key, const uint8_t *ciphertext, uint8_t *session_key) |
Key decapsulation. More... | |
This module provides McEliece algorithm implementation, which is finite state machine for secure distribution of secret between two counterparties. The distributed secret is theoretically tolerant to attacks performed by quantum computers. Entry point is mceliece_keygen
Key distribution algorithm consists of sequential function calls on two sides: initiator (e.g. server side) and responder (e.g. client side).
public key
.public key
to responder.ciphertext
and session key
.session key
.session key
In order to use any McEliece key distribution functions, add the following include:
Example code is listed below:
typedef struct mceliece_st* mceliece_t |
McEliece algorithm instance handle.
PQLR_API mceliece_t mceliece_duplicate | ( | const mceliece_t | mceliece | ) |
Duplicates context of mceliece instance.
mceliece | instance to duplicate |
PQLR_API void mceliece_free | ( | mceliece_t | mceliece | ) |
Frees mceliece instance and all corresponding resources.
mceliece | instance to free |
PQLR_API uint32_t mceliece_get_ciphertext_length | ( | mceliece_t | mceliece | ) |
Obtains ciphertext length for the current mceliece instance.
mceliece | initialized mceliece instance |
PQLR_API uint32_t mceliece_get_initiator_public_length | ( | mceliece_t | mceliece | ) |
Obtains initiator's public key length for the current mceliece instance.
mceliece | initialized mceliece instance |
PQLR_API uint32_t mceliece_get_initiator_secret_length | ( | mceliece_t | mceliece | ) |
Obtains initiator's secret key length for the current mceliece instance.
mceliece | initialized mceliece instance |
PQLR_API uint32_t mceliece_get_shared_secret_length | ( | mceliece_t | mceliece | ) |
Obtains shared secret length for the current mceliece instance.
mceliece | initialized mceliece instance |
PQLR_API void mceliece_key_decap | ( | const mceliece_t | mceliece, |
const uint8_t * | secret_key, | ||
const uint8_t * | ciphertext, | ||
uint8_t * | session_key | ||
) |
Key decapsulation.
mceliece | McEliece algorithm context. If NULL , the fatal error occurs. | |
secret_key | Secret key buffer. If NULL , the fatal error occurs. (mceliece_keygen) | |
ciphertext | Ciphertext buffer. If NULL , the fatal error occurs. | |
[out] | session_key | Session key buffer. |
PQLR_API void mceliece_key_encap | ( | const mceliece_t | mceliece, |
const uint8_t * | public_key, | ||
uint8_t * | ciphertext, | ||
uint8_t * | session_key | ||
) |
Key encapsulation.
mceliece | McEliece algorithm context. If NULL , the fatal error occurs. | |
public_key | Public key buffer. If NULL , the fatal error occurs. | |
[out] | ciphertext | Ciphertext buffer. Must point to array of uint8_t with elements count at least mceliece_get_ciphertext_length . If NULL , the fatal error occurs. |
[out] | session_key | Session key buffer. Must point to array of uint8_t with elements count at least mceliece_get_initiator_key_length . If NULL , the fatal error occurs. |
PQLR_API void mceliece_keygen | ( | const mceliece_t | mceliece, |
uint8_t * | public_key, | ||
uint8_t * | secret_key | ||
) |
Initial step of key distribution. Generates a key pair for key distribution initiator.
mceliece | McEliece algorithm context. If NULL , the fatal error occurs. | |
[out] | public_key | Public key buffer. Must point to array of uint8_t with elements count at least mceliece_get_initiator_public_length . If NULL , the fatal error occurs. |
[out] | secret_key | Secret key buffer. Must point to array of uint8_t with elements count at least mceliece_get_initiator_secret_length . If NULL , the fatal error occurs. |
PQLR_API mceliece_t mceliece_new | ( | mceliece_parameterset_t | parameterset | ) |
Creates mceliece instance initialized by parameterset.
parameterset | McEliece configuration parameters set (see mceliece_parameterset_t for availible options). |
NULL
if out of memory PQLR_API pqlr_t mceliece_to_pqlr | ( | mceliece_t | mceliece | ) |
Casts mceliece instance to pqlr instance.
mceliece | initialized mceliece instance |
NULL
if mceliece is NULL