Leancrypto 1.7.2
Post-Quantum Cryptographic Library
Data Structures | Enumerations | Functions
lc_bike.h File Reference
#include "ext_headers.h"
+ Include dependency graph for lc_bike.h:

Go to the source code of this file.

Data Structures

struct  lc_bike_sk
 BIKE secret key. More...
 
struct  lc_bike_pk
 BIKE public key. More...
 
struct  lc_bike_ct
 BIKE ciphertext. More...
 
struct  lc_bike_ss
 BIKE shared secret. More...
 
union  lc_bike_sk.key
 
union  lc_bike_pk.key
 
union  lc_bike_ct.key
 
union  lc_bike_ss.key
 

Enumerations

enum  lc_bike_type { LC_BIKE_UNKNOWN , LC_BIKE_5 , LC_BIKE_3 , LC_BIKE_1 }
 
enum  lc_bike_alg_operation {
  lc_alg_operation_bike_unknown , lc_alg_operation_bike_keygen , lc_alg_operation_bike_enc , lc_alg_operation_bike_dec ,
  lc_alg_operation_bike_enc_kdf , lc_alg_operation_bike_dec_kdf
}
 

Functions

enum lc_bike_type lc_bike_sk_type (const struct lc_bike_sk *sk)
 Obtain BIKE type from secret key. More...
 
enum lc_bike_type lc_bike_pk_type (const struct lc_bike_pk *pk)
 Obtain BIKE type from public key. More...
 
enum lc_bike_type lc_bike_ct_type (const struct lc_bike_ct *ct)
 Obtain BIKE type from BIKE ciphertext. More...
 
enum lc_bike_type lc_bike_ss_type (const struct lc_bike_ss *ss)
 Obtain BIKE type from shared secret. More...
 
LC_PURE unsigned int lc_bike_sk_size (enum lc_bike_type bike_type)
 Return the size of the BIKE secret key. More...
 
LC_PURE unsigned int lc_bike_pk_size (enum lc_bike_type bike_type)
 Return the size of the BIKE public key. More...
 
LC_PURE unsigned int lc_bike_ct_size (enum lc_bike_type bike_type)
 Return the size of the BIKE ciphertext. More...
 
LC_PURE unsigned int lc_bike_ss_size (enum lc_bike_type bike_type)
 Return the size of the BIKE shared secret. More...
 
int lc_bike_sk_load (struct lc_bike_sk *sk, const uint8_t *src_key, size_t src_key_len)
 Load a BIKE secret key provided with a buffer into the leancrypto data structure. More...
 
int lc_bike_pk_load (struct lc_bike_pk *pk, const uint8_t *src_key, size_t src_key_len)
 Load a BIKE public key provided with a buffer into the leancrypto data structure. More...
 
int lc_bike_ct_load (struct lc_bike_ct *ct, const uint8_t *src_key, size_t src_key_len)
 Load a BIKE ciphertext key provided with a buffer into the leancrypto data structure. More...
 
int lc_bike_ss_load (struct lc_bike_ss *ss, const uint8_t *src_key, size_t src_key_len)
 Load a BIKE shared secret provided with a buffer into the leancrypto data structure. More...
 
int lc_bike_sk_ptr (uint8_t **bike_key, size_t *bike_key_len, struct lc_bike_sk *sk)
 Obtain the reference to the BIKE key and its length. More...
 
int lc_bike_pk_ptr (uint8_t **bike_key, size_t *bike_key_len, struct lc_bike_pk *pk)
 Obtain the reference to the BIKE key and its length. More...
 
int lc_bike_ct_ptr (uint8_t **bike_ct, size_t *bike_ct_len, struct lc_bike_ct *ct)
 Obtain the reference to the BIKE ciphertext and its length. More...
 
int lc_bike_ss_ptr (uint8_t **bike_ss, size_t *bike_ss_len, struct lc_bike_ss *ss)
 Obtain the reference to the BIKE shared secret and its length. More...
 
int lc_bike_keypair (struct lc_bike_pk *pk, struct lc_bike_sk *sk, struct lc_rng_ctx *rng_ctx, enum lc_bike_type bike_type)
 Generates public and private key for IND-CCA2-secure BIKE key encapsulation mechanism. More...
 
int lc_bike_keypair_from_seed (struct lc_bike_pk *pk, struct lc_bike_sk *sk, const uint8_t *seed, size_t seedlen, enum lc_bike_type bike_type)
 Generates BIKE public and private key from a given seed. More...
 
int lc_bike_enc (struct lc_bike_ct *ct, struct lc_bike_ss *ss, const struct lc_bike_pk *pk)
 Key encapsulation. More...
 
int lc_bike_enc_kdf (struct lc_bike_ct *ct, uint8_t *ss, size_t ss_len, const struct lc_bike_pk *pk)
 Key encapsulation with KDF applied to shared secret. More...
 
int lc_bike_dec (struct lc_bike_ss *ss, const struct lc_bike_ct *ct, const struct lc_bike_sk *sk)
 Key decapsulation. More...
 
int lc_bike_dec_kdf (uint8_t *ss, size_t ss_len, const struct lc_bike_ct *ct, const struct lc_bike_sk *sk)
 Key decapsulation with KDF applied to shared secret. More...
 
enum lc_alg_status_val lc_bike_alg_status (const enum lc_bike_type bike_type, const enum lc_bike_alg_operation operation)
 Obtain algorithm status. More...
 

Data Structure Documentation

◆ lc_bike_sk

struct lc_bike_sk

BIKE secret key.

Definition at line 81 of file lc_bike.h.

Data Fields
enum lc_bike_type bike_type
union lc_bike_sk.key key

◆ lc_bike_pk

struct lc_bike_pk

BIKE public key.

Definition at line 99 of file lc_bike.h.

Data Fields
enum lc_bike_type bike_type
union lc_bike_pk.key key

◆ lc_bike_ct

struct lc_bike_ct

BIKE ciphertext.

Definition at line 117 of file lc_bike.h.

Data Fields
enum lc_bike_type bike_type
union lc_bike_ct.key key

◆ lc_bike_ss

struct lc_bike_ss

BIKE shared secret.

Definition at line 135 of file lc_bike.h.

Data Fields
enum lc_bike_type bike_type
union lc_bike_ss.key key

◆ lc_bike_sk.key

union lc_bike_sk.key

Definition at line 83 of file lc_bike.h.

◆ lc_bike_pk.key

union lc_bike_pk.key

Definition at line 101 of file lc_bike.h.

◆ lc_bike_ct.key

union lc_bike_ct.key

Definition at line 119 of file lc_bike.h.

◆ lc_bike_ss.key

union lc_bike_ss.key

Definition at line 137 of file lc_bike.h.

Enumeration Type Documentation

◆ lc_bike_alg_operation

Enumerator
lc_alg_operation_bike_unknown 

Unknown operation

lc_alg_operation_bike_keygen 

BIKE: key generation operation

lc_alg_operation_bike_enc 

BIKE: encapsulation operation

lc_alg_operation_bike_dec 

BIKE: decapsulation operation

lc_alg_operation_bike_enc_kdf 

BIKE: encapsulation operation with KDF

lc_alg_operation_bike_dec_kdf 

BIKE: decapsulation operation with KDF

Definition at line 480 of file lc_bike.h.

◆ lc_bike_type

Enumerator
LC_BIKE_UNKNOWN 
LC_BIKE_5 

Unknown key type

LC_BIKE_3 

BIKE 5

LC_BIKE_1 

BIKE 3

Definition at line 46 of file lc_bike.h.