49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
//
|
|
// Created by zemon on 29.07.2022.
|
|
//
|
|
|
|
#ifndef PDM_FIR_TEST_POLYGALOIS256_H
|
|
#define PDM_FIR_TEST_POLYGALOIS256_H
|
|
|
|
#include "stdint.h"
|
|
#include "Galois256.h"
|
|
#include "stddef.h"
|
|
|
|
//f(x) = data[0]x^0 + data[1]x^1 ....
|
|
typedef struct {
|
|
uint8_t *data;
|
|
size_t length;
|
|
} tPolyGalois256;
|
|
|
|
size_t sPolyGalois256HighestDegree(tPolyGalois256 *poly);
|
|
|
|
void vPolyGalois256Mul(tGalois256 *gf, tPolyGalois256 *first, tPolyGalois256 *second, tPolyGalois256 *result);
|
|
|
|
void vPolyGalois256Copy(tPolyGalois256 *source, tPolyGalois256 *target);
|
|
|
|
void vPolyGalois256CopyRevers(tPolyGalois256 *source, tPolyGalois256 *target);
|
|
|
|
void vPolyGalois256Revers(tPolyGalois256 *source);
|
|
|
|
void vPolyGalois256FormalDerivative(tPolyGalois256 *source, tPolyGalois256 *derivative);
|
|
|
|
uint8_t iPolyGalois256GetMax(tPolyGalois256 *source);
|
|
|
|
uint8_t iPolyGalois256Value(tGalois256 *gf, tPolyGalois256 *env, uint8_t input);
|
|
|
|
uint8_t iPolyGalois256IsZero(tPolyGalois256 *source);
|
|
|
|
void vPolyGalois256DividePolynomials(
|
|
tGalois256 *gf,
|
|
tPolyGalois256 *remainder_out,
|
|
tPolyGalois256 *divisor
|
|
);
|
|
|
|
void vPolyGalois256MulNumberSelf(tGalois256 *gf, tPolyGalois256 *poly, uint8_t number);
|
|
|
|
void vPolyGalois256Scale(tGalois256 *gf, tPolyGalois256 *orgn, uint8_t number, tPolyGalois256 *result);
|
|
|
|
void vPolyGalois256Add(tGalois256 *gf, tPolyGalois256 *first, tPolyGalois256 *second, tPolyGalois256 *result);
|
|
|
|
#endif //PDM_FIR_TEST_POLYGALOIS256_H
|