BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mecs.h File Reference
#include "mecsctx.h"
#include <bitpunch/config.h>
#include <bitpunch/math/gf2.h>
#include <bitpunch/math/gf2x.h>
#include <bitpunch/code/codectx.h>

Go to the source code of this file.

Functions

int BPU_mecsEncrypt (BPU_T_GF2_Vector *ct, const BPU_T_GF2_Vector *pt, const BPU_T_Mecs_Ctx *ctx)
 Encrypt plaintext (pt) and save it to cipher text. More...
 
int BPU_mecsDecrypt (BPU_T_GF2_Vector *pt, BPU_T_GF2_Vector *ct, const BPU_T_Mecs_Ctx *ctx)
 Decrypt cipher text (ct) and save it to plain text. More...
 
int BPU_mecsGenKeyPair (BPU_T_Mecs_Ctx *ctx)
 Key generation, first must be initialized context using BPU_mecsInitCtx(). More...
 

Function Documentation

int BPU_mecsDecrypt ( BPU_T_GF2_Vector pt,
BPU_T_GF2_Vector ct,
const BPU_T_Mecs_Ctx ctx 
)

Decrypt cipher text (ct) and save it to plain text.

Decrypt cipher text (ct) and save it to plain text. All strctures must be allocated before use.

Parameters
ptplain text
ctcipher text
ctxMcEliece context
Returns
0 - succes, else error

Definition at line 45 of file mecs.c.

int BPU_mecsEncrypt ( BPU_T_GF2_Vector ct,
const BPU_T_GF2_Vector pt,
const BPU_T_Mecs_Ctx ctx 
)

Encrypt plaintext (pt) and save it to cipher text.

Encrypt plaintext (pt) and save it to cipher text. All strctures must be allocated before use.

Parameters
ctcipher text
ptplain text
ctxMcEliece context
Returns
0 - succes, else error

Definition at line 33 of file mecs.c.

int BPU_mecsGenKeyPair ( BPU_T_Mecs_Ctx ctx)

Key generation, first must be initialized context using BPU_mecsInitCtx().

Key generation, first must be initialized context using BPU_mecsInitCtx().

Parameters
ctxMcEliece context
Returns
0 - success, else error

Definition at line 55 of file mecs.c.