Galois256/Galois256.h

36 lines
813 B
C

//
// Created by zemon on 24.07.2022.
//
#ifndef PDM_FIR_TEST_GALOIS256_H
#define PDM_FIR_TEST_GALOIS256_H
#include "stdint.h"
typedef struct {
uint8_t base_degree;
uint8_t *irreducible_polynomial;
int32_t field_elements_limit;
int32_t pow_table[256];
int32_t log_table[256];
} tGalois256;
void iGalois256Init(tGalois256 *env);
int32_t iGalois256Add(tGalois256 *env, int one, int two);
int32_t iGalois256Sub(tGalois256 *env, int one, int two);
int32_t iGalois256Mul(tGalois256 *env, int one, int two);
int32_t iGalois256Div(tGalois256 *env, int dividable, int divider);
int32_t iGalois256Pow(tGalois256 *env, int base, int degree);
int32_t iGalois256LogValue(tGalois256 *env, int degree);
int32_t iGalois256PowValue(tGalois256 *env, int degree);
#endif //PDM_FIR_TEST_GALOIS256_H