BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
codectx.c File Reference
#include "codectx.h"
#include <stdlib.h>
#include <bitpunch/debugio.h>
#include <bitpunch/errorcodes.h>
#include <bitpunch/math/gf2types.h>
#include <bitpunch/code/goppa/goppa.h>
#include <bitpunch/code/qcmdpc/qcmdpc.h>

Go to the source code of this file.

Functions

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 code type. More...
 
int BPU_codeInitMathCtx (BPU_T_Math_Ctx **ctx, const uint16_t m, const uint16_t t, const BPU_T_GF2_16x mod)
 BPU_codeInitMathCtx. More...
 
void BPU_codeFreeCtx (BPU_T_Code_Ctx **ctx)
 BPU_codeFreeCtx. More...
 
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. More...
 
void BPU_codeFreeParamsGoppa (BPU_T_UN_Code_Params *params)
 BPU_codeFreeParamsGoppa. More...
 
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)
 
void BPU_codeFreeParamsQcmdpc (BPU_T_UN_Code_Params *params)
 

Function Documentation

void BPU_codeFreeCtx ( BPU_T_Code_Ctx **  ctx)

BPU_codeFreeCtx.

Parameters
ctx

Definition at line 161 of file codectx.c.

void BPU_codeFreeParamsGoppa ( BPU_T_UN_Code_Params params)

BPU_codeFreeParamsGoppa.

Parameters
params

Definition at line 191 of file codectx.c.

void BPU_codeFreeParamsQcmdpc ( BPU_T_UN_Code_Params params)

Free memory for params.

Parameters
paramspointer to structure

Definition at line 199 of file codectx.c.

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 code type.

Parameters
ctx
params
type
Returns

Definition at line 31 of file codectx.c.

int BPU_codeInitMathCtx ( BPU_T_Math_Ctx **  ctx,
const uint16_t  m,
const uint16_t  t,
const BPU_T_GF2_16x  mod 
)

BPU_codeInitMathCtx.

Parameters
ctx
m
t
mod
Returns

Definition at line 126 of file codectx.c.

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.

Parameters
params
m
t
mod
Returns

Definition at line 187 of file codectx.c.

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 
)

Wrapper for param initialization. After work you have to free memory using call BPU_codeFreeParamsQcmdpc

Parameters
paramspointer to structure
msize of cyclic matrix
n0number of cyclic matrices
wweight of parity-check matrix row
tcount of errors
Returns
[description]

Definition at line 195 of file codectx.c.