Leancrypto 1.7.2
Post-Quantum Cryptographic Library
Data Structures | Enumerations | Functions
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 }
 
enum  lc_hqc_alg_operation {
  lc_alg_operation_hqc_unknown , lc_alg_operation_hqc_keygen , lc_alg_operation_hqc_enc , lc_alg_operation_hqc_dec ,
  lc_alg_operation_hqc_enc_kdf , lc_alg_operation_hqc_dec_kdf
}
 

Functions

enum lc_hqc_type lc_hqc_sk_type (const struct lc_hqc_sk *sk)
 Obtain HQC type from secret key. More...
 
enum lc_hqc_type lc_hqc_pk_type (const struct lc_hqc_pk *pk)
 Obtain HQC type from public key. More...
 
enum lc_hqc_type lc_hqc_ct_type (const struct lc_hqc_ct *ct)
 Obtain HQC type from HQC ciphertext. More...
 
enum lc_hqc_type lc_hqc_ss_type (const struct lc_hqc_ss *ss)
 Obtain HQC type from shared secret. More...
 
LC_PURE unsigned int lc_hqc_sk_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC secret key. More...
 
LC_PURE unsigned int lc_hqc_pk_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC public key. More...
 
LC_PURE unsigned int lc_hqc_ct_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC ciphertext. More...
 
LC_PURE unsigned int lc_hqc_ss_size (enum lc_hqc_type hqc_type)
 Return the size of the HQC shared secret. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int lc_hqc_enc (struct lc_hqc_ct *ct, struct lc_hqc_ss *ss, const struct lc_hqc_pk *pk)
 Key encapsulation. More...
 
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. More...
 
int lc_hqc_dec (struct lc_hqc_ss *ss, const struct lc_hqc_ct *ct, const struct lc_hqc_sk *sk)
 Key decapsulation. More...
 
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. More...
 
enum lc_alg_status_val lc_hqc_alg_status (const enum lc_hqc_type hqc_type, const enum lc_hqc_alg_operation operation)
 Obtain algorithm status. More...
 

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_alg_operation

Enumerator
lc_alg_operation_hqc_unknown 

Unknown operation

lc_alg_operation_hqc_keygen 

HQC: key generation operation

lc_alg_operation_hqc_enc 

HQC: encapsulation operation

lc_alg_operation_hqc_dec 

HQC: decapsulation operation

lc_alg_operation_hqc_enc_kdf 

HQC: encapsulation operation with KDF

lc_alg_operation_hqc_dec_kdf 

HQC: decapsulation operation with KDF

Definition at line 476 of file lc_hqc.h.

◆ 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.