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

Go to the source code of this file.

Functions

int BPU_gf2xMatMalloc (BPU_T_GF2_16x_Matrix **m, int rows, int cols)
 Allocate memory for matrix. More...
 
int BPU_gf2xVecMalloc (BPU_T_GF2_16x_Vector **vec, int size)
 BPU_gf2xVecMalloc Malloc vector structure. More...
 
void BPU_gf2xVecFree (BPU_T_GF2_16x_Vector **vec)
 BPU_gf2xVecFree Free vector structure. More...
 
void BPU_gf2xMatFree (BPU_T_GF2_16x_Matrix **m)
 Free dynamically or statically allocated matrix. More...
 
void BPU_gf2xPolyFree (BPU_T_GF2_16x_Poly **p)
 
int BPU_gf2xPolyMalloc (BPU_T_GF2_16x_Poly **p, int16_t max_deg)
 
int BPU_gf2xPolyResize (BPU_T_GF2_16x_Poly *p, int16_t max_deg)
 BPU_gf2xPolyResize Resize polynomial, increase max deg. More...
 
int BPU_gf2xPolyMallocCoef (BPU_T_GF2_16x_Poly *p, int16_t max_deg)
 BPU_gf2xPolyMallocCoef Malloc internal coeficients for polynomial. More...
 
void BPU_gf2xMatNull (BPU_T_GF2_16x_Matrix *mat)
 

Function Documentation

void BPU_gf2xMatFree ( BPU_T_GF2_16x_Matrix **  m)

Free dynamically or statically allocated matrix.

Free dynamically or statically allocated matrix.

Parameters
[out]*maddress of matrix object

Definition at line 86 of file gf2xtypes.c.

int BPU_gf2xMatMalloc ( BPU_T_GF2_16x_Matrix **  m,
int  rows,
int  cols 
)

Allocate memory for matrix.

Allocate memory for matrix. After work you have to free memory using call BPU_freeMat.

Parameters
[out]mmatrix to be allocated
[in]rowsrows
[in]colscols
Returns
on succes 0, else error

Definition at line 28 of file gf2xtypes.c.

void BPU_gf2xMatNull ( BPU_T_GF2_16x_Matrix mat)

Definition at line 148 of file gf2xtypes.c.

void BPU_gf2xPolyFree ( BPU_T_GF2_16x_Poly **  p)

dealloc memory

Parameters
p

Definition at line 102 of file gf2xtypes.c.

int BPU_gf2xPolyMalloc ( BPU_T_GF2_16x_Poly **  p,
int16_t  max_deg 
)

Malloc memory for polynomial and zero-initialize

Parameters
prepresentation of polynomial (every element is one coeficient)
max_degmax degree of polynomial
Returns

Definition at line 111 of file gf2xtypes.c.

int BPU_gf2xPolyMallocCoef ( BPU_T_GF2_16x_Poly p,
int16_t  max_deg 
)

BPU_gf2xPolyMallocCoef Malloc internal coeficients for polynomial.

Parameters
p
max_deg
Returns

Definition at line 128 of file gf2xtypes.c.

int BPU_gf2xPolyResize ( BPU_T_GF2_16x_Poly p,
int16_t  max_deg 
)

BPU_gf2xPolyResize Resize polynomial, increase max deg.

Parameters
p
max_deg
Returns

Definition at line 121 of file gf2xtypes.c.

void BPU_gf2xVecFree ( BPU_T_GF2_16x_Vector **  vec)

BPU_gf2xVecFree Free vector structure.

Parameters
vec

Definition at line 77 of file gf2xtypes.c.

int BPU_gf2xVecMalloc ( BPU_T_GF2_16x_Vector **  vec,
int  size 
)

BPU_gf2xVecMalloc Malloc vector structure.

Parameters
vec
size
Returns

Definition at line 60 of file gf2xtypes.c.