Leancrypto 1.6.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_hqc.h File Reference
#include "ext_headers.h"
Include dependency graph for lc_hqc.h:

Go to the source code of this file.

Data Structures

struct  lc_hqc_sk
 HQC secret key. More...
struct  lc_hqc_pk
 HQC public key. More...
struct  lc_hqc_ct
 HQC ciphertext. More...
struct  lc_hqc_ss
 HQC shared secret. More...
union  lc_hqc_sk.key
union  lc_hqc_pk.key
union  lc_hqc_ct.key
union  lc_hqc_ss.key

Enumerations

enum  lc_hqc_type { LC_HQC_UNKNOWN , LC_HQC_256 , LC_HQC_192 , LC_HQC_128 }

Functions

enum lc_hqc_type lc_hqc_sk_type (const struct lc_hqc_sk *sk)
 Obtain HQC type from secret key.
enum lc_hqc_type lc_hqc_pk_type (const struct lc_hqc_pk *pk)
 Obtain HQC type from public key.
enum lc_hqc_type lc_hqc_ct_type (const struct lc_hqc_ct *ct)
 Obtain HQC type from HQC ciphertext.
enum lc_hqc_type lc_hqc_ss_type (const struct lc_hqc_ss *ss)
 Obtain HQC type from shared secret.
LC_PURE unsigned int lc_hqc_sk_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC secret key.
LC_PURE unsigned int lc_hqc_pk_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC public key.
LC_PURE unsigned int lc_hqc_ct_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC ciphertext.
LC_PURE unsigned int lc_hqc_ss_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC shared secret.
int lc_hqc_sk_load (struct lc_hqc_sk *sk, const uint8_t *src_key, size_t src_key_len)
 Load a HQC secret key provided with a buffer into the leancrypto data structure.
int lc_hqc_pk_load (struct lc_hqc_pk *pk, const uint8_t *src_key, size_t src_key_len)
 Load a HQC public key provided with a buffer into the leancrypto data structure.
int lc_hqc_ct_load (struct lc_hqc_ct *ct, const uint8_t *src_key, size_t src_key_len)
 Load a HQC ciphertext key provided with a buffer into the leancrypto data structure.
int lc_hqc_ss_load (struct lc_hqc_ss *ss, const uint8_t *src_key, size_t src_key_len)
 Load a HQC shared secret provided with a buffer into the leancrypto data structure.
int lc_hqc_sk_ptr (uint8_t **hqc_key, size_t *hqc_key_len, struct lc_hqc_sk *sk)
 Obtain the reference to the HQC key and its length.
int lc_hqc_pk_ptr (uint8_t **hqc_key, size_t *hqc_key_len, struct lc_hqc_pk *pk)
 Obtain the reference to the HQC key and its length.
int lc_hqc_ct_ptr (uint8_t **hqc_ct, size_t *hqc_ct_len, struct lc_hqc_ct *ct)
 Obtain the reference to the HQC ciphertext and its length.
int lc_hqc_ss_ptr (uint8_t **hqc_ss, size_t *hqc_ss_len, struct lc_hqc_ss *ss)
 Obtain the reference to the HQC shared secret and its length.
int lc_hqc_keypair (struct lc_hqc_pk *pk, struct lc_hqc_sk *sk, struct lc_rng_ctx *rng_ctx, enum lc_hqc_type hqc_type)
 Generates public and private key for IND-CCA2-secure HQC key encapsulation mechanism.
int lc_hqc_keypair_from_seed (struct lc_hqc_pk *pk, struct lc_hqc_sk *sk, const uint8_t *seed, size_t seedlen, enum lc_hqc_type hqc_type)
 Generates HQC public and private key from a given seed.
int lc_hqc_enc (struct lc_hqc_ct *ct, struct lc_hqc_ss *ss, const struct lc_hqc_pk *pk)
 Key encapsulation.
int lc_hqc_enc_kdf (struct lc_hqc_ct *ct, uint8_t *ss, size_t ss_len, const struct lc_hqc_pk *pk)
 Key encapsulation with KDF applied to shared secret.
int lc_hqc_dec (struct lc_hqc_ss *ss, const struct lc_hqc_ct *ct, const struct lc_hqc_sk *sk)
 Key decapsulation.
int lc_hqc_dec_kdf (uint8_t *ss, size_t ss_len, const struct lc_hqc_ct *ct, const struct lc_hqc_sk *sk)
 Key decapsulation with KDF applied to shared secret.

Data Structure Documentation

◆ lc_hqc_sk

struct lc_hqc_sk

HQC secret key.

Definition at line 81 of file lc_hqc.h.

Data Fields
enum lc_hqc_type hqc_type
union lc_hqc_sk.key key

◆ lc_hqc_pk

struct lc_hqc_pk

HQC public key.

Definition at line 99 of file lc_hqc.h.

Data Fields
enum lc_hqc_type hqc_type
union lc_hqc_pk.key key

◆ lc_hqc_ct

struct lc_hqc_ct

HQC ciphertext.

Definition at line 117 of file lc_hqc.h.

Data Fields
enum lc_hqc_type hqc_type
union lc_hqc_ct.key key

◆ lc_hqc_ss

struct lc_hqc_ss

HQC shared secret.

Definition at line 135 of file lc_hqc.h.

Data Fields
enum lc_hqc_type hqc_type
union lc_hqc_ss.key key

◆ lc_hqc_sk.key

union lc_hqc_sk.key

Definition at line 83 of file lc_hqc.h.

◆ lc_hqc_pk.key

union lc_hqc_pk.key

Definition at line 101 of file lc_hqc.h.

◆ lc_hqc_ct.key

union lc_hqc_ct.key

Definition at line 119 of file lc_hqc.h.

◆ lc_hqc_ss.key

union lc_hqc_ss.key

Definition at line 137 of file lc_hqc.h.

Enumeration Type Documentation

◆ lc_hqc_type

Enumerator
LC_HQC_UNKNOWN 
LC_HQC_256 

Unknown key type

LC_HQC_192 

HQC 256

LC_HQC_128 

HQC 192

Definition at line 46 of file lc_hqc.h.