forked from yeliqseu/streamc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgalois.h
21 lines (21 loc) · 773 Bytes
/
galois.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*-------------------- galois.h ---------------------------------
* Internal header file of Galois field implementation.
*--------------------------------------------------------------*/
#ifndef GALOIS_H
#define GALOIS_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifndef GALOIS
#define GALOIS
typedef unsigned char GF_ELEMENT;
#endif
// Galois field arithmetic routines
int constructField(int gf_power);
uint8_t galois_add(uint8_t a, uint8_t b);
uint8_t galois_sub(uint8_t a, uint8_t b);
uint8_t galois_multiply(uint8_t a, uint8_t b);
uint8_t galois_divide(uint8_t a, uint8_t b);
void galois_multiply_region(uint8_t *src, uint8_t multiplier, int bytes);
void galois_multiply_add_region(uint8_t *dst, uint8_t *src, uint8_t multiplier, int bytes);
#endif