1 /* Stuff specific to the CCSDS (255,223) RS codec
2  * (255,223) code over GF(256). Note: the conventional basis is still
3  * used; the dual-basis mappings are performed in [en|de]code_rs_ccsds.c
4  *
5  * Copyright 2003 Phil Karn, KA9Q
6  * May be used under the terms of the GNU Lesser General Public License (LGPL)
7  */
8 typedef unsigned char data_t;
9 
mod255(int x)10 static inline int mod255(int x){
11   while (x >= 255) {
12     x -= 255;
13     x = (x >> 8) + (x & 255);
14   }
15   return x;
16 }
17 #define MODNN(x) mod255(x)
18 
19 extern data_t CCSDS_alpha_to[];
20 extern data_t CCSDS_index_of[];
21 extern data_t CCSDS_poly[];
22 
23 #define MM 8
24 #define NN 255
25 #define ALPHA_TO CCSDS_alpha_to
26 #define INDEX_OF CCSDS_index_of
27 #define GENPOLY CCSDS_poly
28 #define NROOTS 32
29 #define FCR 112
30 #define PRIM 11
31 #define IPRIM 116
32 #define PAD pad
33 
34