-
Notifications
You must be signed in to change notification settings - Fork 4
/
gf2_4_tables.h
63 lines (56 loc) · 2.64 KB
/
gf2_4_tables.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* these tables were generated with polynomial: 19 */
#ifndef GF2_4_TABLES
#define GF2_4_TABLES
/* clang-format off */
static const uint8_t GF2_4_LOG[] =
{
15, 0, 1, 4, 2, 8, 5, 10, 3, 14, 9, 7, 6, 13, 11, 12,
};
static const uint8_t GF2_4_EXP[] =
{
1, 2, 4, 8, 3, 6, 12, 11, 5, 10, 7, 14, 15, 13, 9, 1,
2, 4, 8, 3, 6, 12, 11, 5, 10, 7, 14, 15, 13, 9,};
static const uint8_t GF2_4_INV[] =
{
0, 1, 9, 14, 13, 11, 7, 6, 15, 2, 12, 5, 10, 4, 3, 8,
};
static const uint8_t GF2_4_SHUF_LO[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 2, 4, 6, 8, 10, 12, 14, 3, 1, 7, 5, 11, 9, 15, 13,
0, 3, 6, 5, 12, 15, 10, 9, 11, 8, 13, 14, 7, 4, 1, 2,
0, 4, 8, 12, 3, 7, 11, 15, 6, 2, 14, 10, 5, 1, 13, 9,
0, 5, 10, 15, 7, 2, 13, 8, 14, 11, 4, 1, 9, 12, 3, 6,
0, 6, 12, 10, 11, 13, 7, 1, 5, 3, 9, 15, 14, 8, 2, 4,
0, 7, 14, 9, 15, 8, 1, 6, 13, 10, 3, 4, 2, 5, 12, 11,
0, 8, 3, 11, 6, 14, 5, 13, 12, 4, 15, 7, 10, 2, 9, 1,
0, 9, 1, 8, 2, 11, 3, 10, 4, 13, 5, 12, 6, 15, 7, 14,
0, 10, 7, 13, 14, 4, 9, 3, 15, 5, 8, 2, 1, 11, 6, 12,
0, 11, 5, 14, 10, 1, 15, 4, 7, 12, 2, 9, 13, 6, 8, 3,
0, 12, 11, 7, 5, 9, 14, 2, 10, 6, 1, 13, 15, 3, 4, 8,
0, 13, 9, 4, 1, 12, 8, 5, 2, 15, 11, 6, 3, 14, 10, 7,
0, 14, 15, 1, 13, 3, 2, 12, 9, 7, 6, 8, 4, 10, 11, 5,
0, 15, 13, 2, 9, 6, 4, 11, 1, 14, 12, 3, 8, 7, 5, 10,
};
static const uint8_t GF2_4_SHUF_HI[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 16, 32, 48, 64, 80, 96,112,128,144,160,176,192,208,224,240,
0, 32, 64, 96,128,160,192,224, 48, 16,112, 80,176,144,240,208,
0, 48, 96, 80,192,240,160,144,176,128,208,224,112, 64, 16, 32,
0, 64,128,192, 48,112,176,240, 96, 32,224,160, 80, 16,208,144,
0, 80,160,240,112, 32,208,128,224,176, 64, 16,144,192, 48, 96,
0, 96,192,160,176,208,112, 16, 80, 48,144,240,224,128, 32, 64,
0,112,224,144,240,128, 16, 96,208,160, 48, 64, 32, 80,192,176,
0,128, 48,176, 96,224, 80,208,192, 64,240,112,160, 32,144, 16,
0,144, 16,128, 32,176, 48,160, 64,208, 80,192, 96,240,112,224,
0,160,112,208,224, 64,144, 48,240, 80,128, 32, 16,176, 96,192,
0,176, 80,224,160, 16,240, 64,112,192, 32,144,208, 96,128, 48,
0,192,176,112, 80,144,224, 32,160, 96, 16,208,240, 48, 64,128,
0,208,144, 64, 16,192,128, 80, 32,240,176, 96, 48,224,160,112,
0,224,240, 16,208, 48, 32,192,144,112, 96,128, 64,160,176, 80,
0,240,208, 32,144, 96, 64,176, 16,224,192, 48,128,112, 80,160,
};
/* clang-format on */
#endif