BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mathctx.h File Reference
#include "gf2xtypes.h"

Go to the source code of this file.

Data Structures

struct  _BPU_T_Math_Ctx
 

Macros

#define BPU_GF2_POLY_DEG_5   0x3b
 
#define BPU_GF2_POLY_DEG_6   0x43
 
#define BPU_GF2_POLY_DEG_10   0x71d
 
#define BPU_GF2_POLY_DEG_11   0x805
 

Typedefs

typedef struct _BPU_T_Math_Ctx BPU_T_Math_Ctx
 

Functions

int BPU_mathInitCtx (BPU_T_Math_Ctx **ctx, const BPU_T_GF2_16x g, const BPU_T_GF2_16x mod)
 Precalculate logaritmic and exponencial tables and initialize structure Aritmetic_Data. More...
 
void BPU_mathFreeCtx (BPU_T_Math_Ctx **ctx)
 Free dynamiccaly or statically allocated Aritmetic_Data structure. More...
 

Macro Definition Documentation

#define BPU_GF2_POLY_DEG_10   0x71d

Definition at line 26 of file mathctx.h.

#define BPU_GF2_POLY_DEG_11   0x805

Definition at line 27 of file mathctx.h.

#define BPU_GF2_POLY_DEG_5   0x3b

Definition at line 24 of file mathctx.h.

#define BPU_GF2_POLY_DEG_6   0x43

Definition at line 25 of file mathctx.h.

Typedef Documentation

Representation of aritmetics data.

Function Documentation

void BPU_mathFreeCtx ( BPU_T_Math_Ctx **  ctx)

Free dynamiccaly or statically allocated Aritmetic_Data structure.

Free dynamiccaly or statically allocated Aritmetic_Data structure.

Parameters
aaaddress of Aritmetic_Data structure
is_dyn0 - staticaly allocated Aritmetic_Data object or 1 when dynamically

Definition at line 67 of file mathctx.c.

int BPU_mathInitCtx ( BPU_T_Math_Ctx **  ctx,
const BPU_T_GF2_16x  g,
const BPU_T_GF2_16x  mod 
)

Precalculate logaritmic and exponencial tables and initialize structure Aritmetic_Data.

Precalculate logaritmic and exponencial tables and initialize structure Aritmetic_Data

Parameters
gis a group generator
modmodulus, ireducible polynomial
Returns
number of elements or < 0 means error

Definition at line 24 of file mathctx.c.