71 if ((*ctx)->exp_table) {
72 free((*ctx)->exp_table);
74 if ((*ctx)->log_table) {
75 free((*ctx)->log_table);
BPU_T_GF2_16x BPU_gf2xMulMod(BPU_T_GF2_16x a, BPU_T_GF2_16x b, BPU_T_GF2_16x mod)
Multiplication over Galois field, modulus mod.
BPU_T_GF2_16x * exp_table
there are all elements referenced by i, so at i-th index is g^i element, g - generator ...
BPU_T_GF2_16x mod
polynomial modulus
void BPU_mathFreeCtx(BPU_T_Math_Ctx **ctx)
Free dynamiccaly or statically allocated Aritmetic_Data structure.
int BPU_gf2xGetDeg(BPU_T_GF2_32x poly)
Get degree of polynomial over GF2.
BPU_T_GF2_16x * log_table
there are all indexes referenced by element, so alpha elemnet (g^i) -> i
#define BPU_printError(fmt,...)
print error message with filename, line
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.
int ord
group ord, number of elements
uint8_t mod_deg
modulo degree, galois finite field GF(2^m)