33 #if defined(BPU_CONF_MECS_CCA2_POINTCHEVAL_GOPPA) || defined(BPU_CONF_MECS_CCA2_POINTCHEVAL_QCMDPC)
58 #ifdef BPU_CONF_ENCRYPTION
61 #ifdef BPU_CONF_DECRYPTION
64 #ifdef BPU_CONF_KEY_GEN
75 #ifdef BPU_CONF_MECS_CCA2_POINTCHEVAL_GOPPA
77 #ifdef BPU_CONF_ENCRYPTION
80 #ifdef BPU_CONF_DECRYPTION
83 #ifdef BPU_CONF_KEY_GEN
96 #ifdef BPU_CONF_ENCRYPTION
99 #ifdef BPU_CONF_DECRYPTION
102 #ifdef BPU_CONF_KEY_GEN
113 #ifdef BPU_CONF_MECS_CCA2_POINTCHEVAL_QCMDPC
115 #ifdef BPU_CONF_ENCRYPTION
118 #ifdef BPU_CONF_DECRYPTION
121 #ifdef BPU_CONF_KEY_GEN
164 switch (ctx_p->
type) {
166 #ifdef BPU_CONF_MECS_CCA2_POINTCHEVAL_GOPPA
174 #ifdef BPU_CONF_MECS_CCA2_POINTCHEVAL_QCMDPC
BPU_T_Code_Ctx * code_ctx
basic qc-mdpc mecs, without any conversion
uint16_t pt_len
PT len in bits.
void BPU_codeFreeParamsGoppa(BPU_T_UN_Code_Params *params)
BPU_codeFreeParamsGoppa.
int BPU_mecsPointchevalCCA2Encrypt(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const BPU_T_Mecs_Ctx *ctx)
BPU_mecsPointchevalCCA2Encrypt.
void BPU_codeFreeParamsQcmdpc(BPU_T_UN_Code_Params *params)
int BPU_mecsBasicDecrypt(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const BPU_T_Mecs_Ctx *ctx)
int(* _encrypt)(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const struct _BPU_T_Mecs_Ctx *ctx)
int BPU_mecsInitParamsGoppa(BPU_T_UN_Mecs_Params *params, const uint16_t m, const uint16_t t, const BPU_T_GF2_16x mod)
int BPU_codeInitCtx(BPU_T_Code_Ctx **ctx, const BPU_T_UN_Code_Params *params, const BPU_T_EN_Code_Types type)
BPU_codeInitCtx Initialize (register) code functions encode, decode and code spec structure based on ...
int(* _genKeyPair)(struct _BPU_T_Code_Ctx *ctx)
uint16_t msg_len
Code dimenzion.
#define BPU_printError(fmt,...)
print error message with filename, line
int BPU_codeInitParamsQcmdpc(BPU_T_UN_Code_Params *params, const uint16_t m, const uint16_t n0, const uint16_t w, const uint16_t t)
int BPU_mecsInitCtx(BPU_T_Mecs_Ctx **ctx, const BPU_T_UN_Mecs_Params *params, const BPU_T_EN_Mecs_Types type)
Initialize (register) mecs functions for encryption, decryption and key gen based on type...
basic mecs, without any conversion
#define BPU_printDebug(fmt,...)
print debug message with filename, line
void BPU_mecsFreeParamsQcmdpc(BPU_T_UN_Mecs_Params *params)
enum _BPU_T_EN_Mecs_Types BPU_T_EN_Mecs_Types
Possible types of MECS.
int BPU_mecsPointchevalCCA2Decrypt(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const BPU_T_Mecs_Ctx *ctx)
BPU_mecsPointchevalCCA2Decrypt.
int BPU_mecsFreeCtx(BPU_T_Mecs_Ctx **ctx)
int(* _decrypt)(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const struct _BPU_T_Mecs_Ctx *ctx)
uint16_t ct_len
CT len in bits.
void BPU_mecsFreeParamsGoppa(BPU_T_UN_Mecs_Params *params)
int BPU_mecsInitParamsQcmdpc(BPU_T_UN_Mecs_Params *params, const uint16_t m, const uint16_t n0, const uint16_t w, const uint16_t t)
void BPU_codeFreeCtx(BPU_T_Code_Ctx **ctx)
BPU_codeFreeCtx.
adapted Pointcheval's cca2 conversion
int BPU_codeInitParamsGoppa(BPU_T_UN_Code_Params *params, const uint16_t m, const uint16_t t, const BPU_T_GF2_16x mod)
BPU_codeInitParamsGoppa.
int BPU_mecsBasicEncrypt(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const BPU_T_Mecs_Ctx *ctx)
#define BPU_EC_MECS_TYPE_NOT_SUPPORTED
adapted Pointcheval's cca2 conversion for qcmdpc
int BPU_mecsQcmdpcGenKeys(BPU_T_Code_Ctx *ctx)
int BPU_goppaGenCode(BPU_T_Code_Ctx *ctx)
BPU_goppaGenCode Generate random code based on params.
uint16_t code_len
Code len.