BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mathctx.c File Reference
#include "mathctx.h"
#include "gf2x.h"
#include <bitpunch/debugio.h>
#include <stdlib.h>

Go to the source code of this file.

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

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.