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

Go to the source code of this file.

Data Structures

struct  _BPU_T_GF2_16x_Vector
 
struct  _BPU_T_GF2_16x_Matrix
 
struct  _BPU_T_GF2_16x_Poly
 

Macros

#define BPU_gf2xPolyNull(d_pointer)
 Copy Polynomial. More...
 

Typedefs

typedef uint16_t BPU_T_GF2_16x
 
typedef uint32_t BPU_T_GF2_32x
 
typedef struct
_BPU_T_GF2_16x_Vector 
BPU_T_GF2_16x_Vector
 
typedef struct
_BPU_T_GF2_16x_Matrix 
BPU_T_GF2_16x_Matrix
 
typedef struct _BPU_T_GF2_16x_Poly BPU_T_GF2_16x_Poly
 

Functions

void BPU_gf2xMatNull (BPU_T_GF2_16x_Matrix *mat)
 
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...
 
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_gf2xPolyFree (BPU_T_GF2_16x_Poly **p)
 

Macro Definition Documentation

#define BPU_gf2xPolyNull (   d_pointer)
Value:
memset((void *) ((d_pointer)->coef), 0, sizeof(BPU_T_GF2_16x)*((d_pointer)->max_deg + 1));\
(d_pointer)->deg = -1
uint16_t BPU_T_GF2_16x
Definition: gf2xtypes.h:26

Copy Polynomial.

Set Polynomial values to 0.

Parameters
d_pointer[out]pointer to GF2_16x polynomial

Definition at line 64 of file gf2xtypes.h.

Typedef Documentation

typedef uint16_t BPU_T_GF2_16x

Polynomial representation over GF2, max deg f < 16

Definition at line 26 of file gf2xtypes.h.

Matrix representation over GF2_16x.

Representation of polynomial.

GF2_16x Vector representation

typedef uint32_t BPU_T_GF2_32x

Polynomial representation over GF2, max deg f < 32

Definition at line 31 of file gf2xtypes.h.

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.