forked from sleepybishop/nanorq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable2.h
211 lines (205 loc) · 14.9 KB
/
table2.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#ifndef NANORQ_TABLE2_H
#define NANORQ_TABLE2_H
#include <stdint.h>
static const uint16_t K_padded[] = {
10, 12, 18, 20, 26, 30, 32, 36, 42, 46, 48,
49, 55, 60, 62, 69, 75, 84, 88, 91, 95, 97,
101, 114, 119, 125, 127, 138, 140, 149, 153, 160, 166,
168, 179, 181, 185, 187, 200, 213, 217, 225, 236, 242,
248, 257, 263, 269, 280, 295, 301, 305, 324, 337, 341,
347, 355, 362, 368, 372, 380, 385, 393, 405, 418, 428,
434, 447, 453, 466, 478, 486, 491, 497, 511, 526, 532,
542, 549, 557, 563, 573, 580, 588, 594, 600, 606, 619,
633, 640, 648, 666, 675, 685, 693, 703, 718, 728, 736,
747, 759, 778, 792, 802, 811, 821, 835, 845, 860, 870,
891, 903, 913, 926, 938, 950, 963, 977, 989, 1002, 1020,
1032, 1050, 1074, 1085, 1099, 1111, 1136, 1152, 1169, 1183, 1205,
1220, 1236, 1255, 1269, 1285, 1306, 1347, 1361, 1389, 1404, 1420,
1436, 1461, 1477, 1502, 1522, 1539, 1561, 1579, 1600, 1616, 1649,
1673, 1698, 1716, 1734, 1759, 1777, 1800, 1824, 1844, 1863, 1887,
1906, 1926, 1954, 1979, 2005, 2040, 2070, 2103, 2125, 2152, 2195,
2217, 2247, 2278, 2315, 2339, 2367, 2392, 2416, 2447, 2473, 2502,
2528, 2565, 2601, 2640, 2668, 2701, 2737, 2772, 2802, 2831, 2875,
2906, 2938, 2979, 3015, 3056, 3101, 3151, 3186, 3224, 3265, 3299,
3344, 3387, 3423, 3466, 3502, 3539, 3579, 3616, 3658, 3697, 3751,
3792, 3840, 3883, 3924, 3970, 4015, 4069, 4112, 4165, 4207, 4252,
4318, 4365, 4418, 4468, 4513, 4567, 4626, 4681, 4731, 4780, 4838,
4901, 4954, 5008, 5063, 5116, 5172, 5225, 5279, 5334, 5391, 5449,
5506, 5566, 5637, 5694, 5763, 5823, 5896, 5975, 6039, 6102, 6169,
6233, 6296, 6363, 6427, 6518, 6589, 6655, 6730, 6799, 6878, 6956,
7033, 7108, 7185, 7281, 7360, 7445, 7520, 7596, 7675, 7770, 7855,
7935, 8030, 8111, 8194, 8290, 8377, 8474, 8559, 8654, 8744, 8837,
8928, 9019, 9111, 9206, 9303, 9400, 9497, 9601, 9708, 9813, 9916,
10017, 10120, 10241, 10351, 10458, 10567, 10676, 10787, 10899, 11015, 11130,
11245, 11358, 11475, 11590, 11711, 11829, 11956, 12087, 12208, 12333, 12460,
12593, 12726, 12857, 13002, 13143, 13284, 13417, 13558, 13695, 13833, 13974,
14115, 14272, 14415, 14560, 14713, 14862, 15011, 15170, 15325, 15496, 15651,
15808, 15977, 16161, 16336, 16505, 16674, 16851, 17024, 17195, 17376, 17559,
17742, 17929, 18116, 18309, 18503, 18694, 18909, 19126, 19325, 19539, 19740,
19939, 20152, 20355, 20564, 20778, 20988, 21199, 21412, 21629, 21852, 22073,
22301, 22536, 22779, 23010, 23252, 23491, 23730, 23971, 24215, 24476, 24721,
24976, 25230, 25493, 25756, 26022, 26291, 26566, 26838, 27111, 27392, 27682,
27959, 28248, 28548, 28845, 29138, 29434, 29731, 30037, 30346, 30654, 30974,
31285, 31605, 31948, 32272, 32601, 32932, 33282, 33623, 33961, 34302, 34654,
35031, 35395, 35750, 36112, 36479, 36849, 37227, 37606, 37992, 38385, 38787,
39176, 39576, 39980, 40398, 40816, 41226, 41641, 42067, 42490, 42916, 43388,
43840, 44279, 44729, 45183, 45638, 46104, 46574, 47047, 47523, 48007, 48489,
48976, 49470, 49978, 50511, 51017, 51530, 52062, 52586, 53114, 53650, 54188,
54735, 55289, 55843, 56403};
static const uint16_t K_max = 56403;
static const uint16_t K_padded_size = sizeof(K_padded) / sizeof(K_padded[0]);
static const uint16_t J_K_padded[] = {
254, 630, 682, 293, 80, 566, 860, 267, 822, 506, 589, 87, 520, 159, 235,
157, 502, 334, 583, 66, 352, 365, 562, 5, 603, 721, 28, 660, 829, 900,
930, 814, 661, 693, 780, 605, 551, 777, 491, 396, 764, 843, 646, 557, 608,
265, 505, 722, 263, 999, 874, 160, 575, 210, 513, 503, 558, 932, 404, 520,
846, 485, 728, 554, 471, 641, 732, 193, 934, 864, 790, 912, 617, 587, 800,
923, 998, 92, 497, 559, 667, 912, 262, 152, 526, 268, 212, 45, 898, 527,
558, 460, 5, 895, 996, 282, 513, 865, 870, 239, 452, 862, 852, 643, 543,
447, 321, 287, 12, 251, 30, 621, 555, 127, 400, 91, 916, 935, 691, 299,
282, 824, 536, 596, 28, 947, 162, 536, 1000, 251, 673, 559, 923, 81, 478,
198, 137, 75, 29, 231, 532, 58, 60, 964, 624, 502, 636, 986, 950, 735,
866, 203, 83, 14, 522, 226, 282, 88, 636, 860, 324, 424, 999, 682, 814,
979, 538, 278, 580, 773, 911, 506, 628, 282, 309, 858, 442, 654, 82, 428,
442, 283, 538, 189, 438, 912, 1, 167, 272, 209, 927, 386, 653, 669, 431,
793, 588, 777, 939, 864, 627, 265, 976, 988, 507, 640, 15, 667, 24, 877,
240, 720, 93, 919, 635, 174, 647, 820, 56, 485, 210, 124, 546, 954, 262,
927, 957, 726, 583, 782, 37, 758, 777, 104, 476, 113, 313, 102, 501, 332,
786, 99, 658, 794, 37, 471, 94, 873, 918, 945, 211, 341, 11, 578, 494,
694, 252, 451, 83, 689, 488, 214, 17, 469, 263, 309, 984, 123, 360, 863,
122, 522, 539, 181, 64, 387, 967, 843, 999, 76, 142, 599, 576, 176, 392,
332, 291, 913, 608, 212, 696, 931, 326, 228, 706, 144, 83, 743, 187, 654,
359, 493, 369, 981, 276, 647, 389, 80, 396, 580, 873, 15, 976, 584, 267,
876, 642, 794, 78, 736, 882, 251, 434, 204, 256, 106, 375, 148, 496, 88,
826, 71, 925, 760, 130, 641, 400, 480, 76, 665, 910, 467, 964, 625, 362,
759, 728, 343, 113, 137, 308, 800, 177, 961, 958, 72, 732, 145, 577, 305,
50, 351, 175, 727, 902, 409, 776, 586, 451, 287, 246, 222, 563, 839, 897,
409, 618, 439, 95, 448, 133, 938, 423, 90, 640, 922, 250, 367, 447, 559,
121, 623, 450, 253, 106, 863, 148, 427, 138, 794, 247, 562, 53, 135, 21,
201, 169, 70, 386, 226, 3, 769, 590, 672, 713, 967, 368, 348, 119, 503,
181, 394, 189, 210, 62, 273, 554, 936, 483, 397, 241, 500, 12, 958, 524,
8, 100, 339, 804, 510, 18, 412, 394, 830, 535, 199, 27, 298, 368, 755,
379, 73, 387, 457, 761, 855, 370, 261, 299, 920, 269, 862, 349, 103, 115,
93, 982, 432, 340, 173, 421, 330, 624, 233, 362, 963, 471};
static const uint16_t S_H_W[][3] = {
{7, 10, 17}, {7, 10, 19}, {11, 10, 29}, {11, 10, 31},
{11, 10, 37}, {11, 10, 41}, {11, 10, 43}, {11, 10, 47},
{11, 10, 53}, {13, 10, 59}, {13, 10, 61}, {13, 10, 61},
{13, 10, 67}, {13, 10, 71}, {13, 10, 73}, {13, 10, 79},
{17, 10, 89}, {17, 10, 97}, {17, 10, 101}, {17, 10, 103},
{17, 10, 107}, {17, 10, 109}, {17, 10, 113}, {19, 10, 127},
{19, 10, 131}, {19, 10, 137}, {19, 10, 139}, {19, 10, 149},
{19, 10, 151}, {23, 10, 163}, {23, 10, 167}, {23, 10, 173},
{23, 10, 179}, {23, 10, 181}, {23, 10, 191}, {23, 10, 193},
{23, 10, 197}, {23, 10, 199}, {23, 10, 211}, {23, 10, 223},
{29, 10, 233}, {29, 10, 241}, {29, 10, 251}, {29, 10, 257},
{29, 10, 263}, {29, 10, 271}, {29, 10, 277}, {29, 10, 283},
{29, 10, 293}, {29, 10, 307}, {29, 10, 313}, {29, 10, 317},
{31, 10, 337}, {31, 10, 349}, {31, 10, 353}, {31, 10, 359},
{31, 10, 367}, {31, 10, 373}, {31, 10, 379}, {37, 10, 389},
{37, 10, 397}, {37, 10, 401}, {37, 10, 409}, {37, 10, 421},
{37, 10, 433}, {37, 10, 443}, {37, 10, 449}, {37, 10, 461},
{37, 10, 467}, {37, 10, 479}, {37, 10, 491}, {37, 10, 499},
{37, 10, 503}, {37, 10, 509}, {37, 10, 523}, {41, 10, 541},
{41, 10, 547}, {41, 10, 557}, {41, 10, 563}, {41, 10, 571},
{41, 10, 577}, {41, 10, 587}, {41, 10, 593}, {41, 10, 601},
{41, 10, 607}, {41, 10, 613}, {41, 10, 619}, {41, 10, 631},
{43, 10, 647}, {43, 10, 653}, {43, 10, 661}, {47, 10, 683},
{47, 10, 691}, {47, 10, 701}, {47, 10, 709}, {47, 10, 719},
{47, 10, 733}, {47, 10, 743}, {47, 10, 751}, {47, 10, 761},
{47, 10, 773}, {53, 10, 797}, {53, 10, 811}, {53, 10, 821},
{53, 10, 829}, {53, 10, 839}, {53, 10, 853}, {53, 10, 863},
{53, 10, 877}, {53, 10, 887}, {53, 10, 907}, {53, 10, 919},
{53, 10, 929}, {53, 10, 941}, {53, 10, 953}, {59, 10, 971},
{59, 10, 983}, {59, 10, 997}, {59, 10, 1009}, {59, 10, 1021},
{59, 10, 1039}, {59, 10, 1051}, {59, 11, 1069}, {59, 11, 1093},
{59, 11, 1103}, {59, 11, 1117}, {59, 11, 1129}, {59, 11, 1153},
{61, 11, 1171}, {61, 11, 1187}, {61, 11, 1201}, {61, 11, 1223},
{61, 11, 1237}, {67, 11, 1259}, {67, 11, 1277}, {67, 11, 1291},
{67, 11, 1307}, {67, 11, 1327}, {67, 11, 1367}, {67, 11, 1381},
{67, 11, 1409}, {67, 11, 1423}, {67, 11, 1439}, {71, 11, 1459},
{71, 11, 1483}, {71, 11, 1499}, {71, 11, 1523}, {71, 11, 1543},
{71, 11, 1559}, {73, 11, 1583}, {73, 11, 1601}, {73, 11, 1621},
{73, 11, 1637}, {73, 11, 1669}, {79, 11, 1699}, {79, 11, 1723},
{79, 11, 1741}, {79, 11, 1759}, {79, 11, 1783}, {79, 11, 1801},
{79, 11, 1823}, {79, 11, 1847}, {79, 11, 1867}, {83, 11, 1889},
{83, 11, 1913}, {83, 11, 1931}, {83, 11, 1951}, {83, 11, 1979},
{83, 11, 2003}, {83, 11, 2029}, {89, 11, 2069}, {89, 11, 2099},
{89, 11, 2131}, {89, 11, 2153}, {89, 11, 2179}, {89, 11, 2221},
{89, 11, 2243}, {89, 11, 2273}, {97, 11, 2311}, {97, 11, 2347},
{97, 11, 2371}, {97, 11, 2399}, {97, 11, 2423}, {97, 11, 2447},
{97, 11, 2477}, {97, 11, 2503}, {97, 11, 2531}, {97, 11, 2557},
{97, 11, 2593}, {101, 11, 2633}, {101, 11, 2671}, {101, 11, 2699},
{101, 11, 2731}, {101, 11, 2767}, {101, 11, 2801}, {103, 11, 2833},
{103, 11, 2861}, {107, 11, 2909}, {107, 11, 2939}, {107, 11, 2971},
{107, 11, 3011}, {109, 11, 3049}, {109, 11, 3089}, {113, 11, 3137},
{113, 11, 3187}, {113, 11, 3221}, {113, 11, 3259}, {113, 11, 3299},
{127, 11, 3347}, {127, 11, 3391}, {127, 11, 3433}, {127, 11, 3469},
{127, 11, 3511}, {127, 11, 3547}, {127, 11, 3583}, {127, 11, 3623},
{127, 11, 3659}, {127, 11, 3701}, {127, 11, 3739}, {127, 11, 3793},
{127, 11, 3833}, {127, 11, 3881}, {127, 11, 3923}, {131, 11, 3967},
{131, 11, 4013}, {131, 11, 4057}, {131, 11, 4111}, {137, 11, 4159},
{137, 11, 4211}, {137, 11, 4253}, {137, 11, 4297}, {137, 11, 4363},
{137, 11, 4409}, {139, 11, 4463}, {139, 11, 4513}, {149, 11, 4567},
{149, 11, 4621}, {149, 11, 4679}, {149, 11, 4733}, {149, 11, 4783},
{149, 11, 4831}, {149, 11, 4889}, {149, 11, 4951}, {149, 11, 5003},
{151, 11, 5059}, {151, 11, 5113}, {157, 11, 5171}, {157, 11, 5227},
{157, 11, 5279}, {157, 11, 5333}, {157, 11, 5387}, {157, 11, 5443},
{163, 11, 5507}, {163, 11, 5563}, {163, 11, 5623}, {163, 11, 5693},
{163, 11, 5749}, {167, 11, 5821}, {167, 11, 5881}, {167, 11, 5953},
{173, 11, 6037}, {173, 11, 6101}, {173, 11, 6163}, {173, 11, 6229},
{179, 11, 6299}, {179, 11, 6361}, {179, 11, 6427}, {179, 11, 6491},
{179, 11, 6581}, {181, 11, 6653}, {181, 11, 6719}, {191, 11, 6803},
{191, 11, 6871}, {191, 11, 6949}, {191, 11, 7027}, {191, 11, 7103},
{191, 11, 7177}, {191, 11, 7253}, {193, 11, 7351}, {197, 11, 7433},
{197, 11, 7517}, {197, 11, 7591}, {199, 11, 7669}, {211, 11, 7759},
{211, 11, 7853}, {211, 11, 7937}, {211, 11, 8017}, {211, 11, 8111},
{211, 11, 8191}, {211, 11, 8273}, {211, 11, 8369}, {223, 11, 8467},
{223, 11, 8563}, {223, 11, 8647}, {223, 11, 8741}, {223, 11, 8831},
{223, 11, 8923}, {223, 11, 9013}, {223, 11, 9103}, {227, 11, 9199},
{227, 11, 9293}, {229, 11, 9391}, {233, 11, 9491}, {233, 11, 9587},
{239, 11, 9697}, {239, 11, 9803}, {239, 11, 9907}, {239, 11, 10009},
{241, 11, 10111}, {251, 11, 10223}, {251, 11, 10343}, {251, 11, 10453},
{251, 11, 10559}, {251, 11, 10667}, {257, 11, 10781}, {257, 11, 10891},
{257, 12, 11003}, {257, 12, 11119}, {263, 12, 11239}, {263, 12, 11353},
{269, 12, 11471}, {269, 12, 11587}, {269, 12, 11701}, {269, 12, 11821},
{271, 12, 11941}, {277, 12, 12073}, {277, 12, 12203}, {277, 12, 12323},
{281, 12, 12451}, {281, 12, 12577}, {293, 12, 12721}, {293, 12, 12853},
{293, 12, 12983}, {293, 12, 13127}, {293, 12, 13267}, {307, 12, 13421},
{307, 12, 13553}, {307, 12, 13693}, {307, 12, 13829}, {307, 12, 13967},
{307, 12, 14107}, {311, 12, 14251}, {311, 12, 14407}, {313, 12, 14551},
{317, 12, 14699}, {317, 12, 14851}, {331, 12, 15013}, {331, 12, 15161},
{331, 12, 15319}, {331, 12, 15473}, {331, 12, 15643}, {337, 12, 15803},
{337, 12, 15959}, {337, 12, 16127}, {347, 12, 16319}, {347, 12, 16493},
{347, 12, 16661}, {349, 12, 16831}, {353, 12, 17011}, {353, 12, 17183},
{359, 12, 17359}, {359, 12, 17539}, {367, 12, 17729}, {367, 12, 17911},
{367, 12, 18097}, {373, 12, 18289}, {373, 12, 18481}, {379, 12, 18679},
{379, 12, 18869}, {383, 12, 19087}, {389, 12, 19309}, {389, 12, 19507},
{397, 12, 19727}, {397, 12, 19927}, {401, 12, 20129}, {401, 12, 20341},
{409, 12, 20551}, {409, 12, 20759}, {419, 13, 20983}, {419, 13, 21191},
{419, 13, 21401}, {419, 13, 21613}, {431, 13, 21841}, {431, 13, 22063},
{431, 13, 22283}, {433, 13, 22511}, {439, 13, 22751}, {439, 13, 22993},
{443, 13, 23227}, {449, 13, 23473}, {457, 13, 23719}, {457, 13, 23957},
{457, 13, 24197}, {461, 13, 24443}, {467, 13, 24709}, {467, 13, 24953},
{479, 13, 25219}, {479, 13, 25471}, {479, 13, 25733}, {487, 13, 26003},
{487, 13, 26267}, {491, 13, 26539}, {499, 13, 26821}, {499, 13, 27091},
{503, 13, 27367}, {509, 13, 27653}, {521, 13, 27953}, {521, 13, 28229},
{521, 13, 28517}, {523, 13, 28817}, {541, 13, 29131}, {541, 13, 29423},
{541, 13, 29717}, {541, 13, 30013}, {547, 13, 30323}, {547, 13, 30631},
{557, 14, 30949}, {557, 14, 31267}, {563, 14, 31583}, {569, 14, 31907},
{571, 14, 32251}, {577, 14, 32579}, {587, 14, 32917}, {587, 14, 33247},
{593, 14, 33601}, {593, 14, 33941}, {599, 14, 34283}, {607, 14, 34631},
{607, 14, 34981}, {613, 14, 35363}, {619, 14, 35731}, {631, 14, 36097},
{631, 14, 36457}, {641, 14, 36833}, {641, 14, 37201}, {643, 14, 37579},
{653, 14, 37967}, {653, 14, 38351}, {659, 14, 38749}, {673, 14, 39163},
{673, 14, 39551}, {677, 14, 39953}, {683, 14, 40361}, {691, 15, 40787},
{701, 15, 41213}, {701, 15, 41621}, {709, 15, 42043}, {709, 15, 42467},
{719, 15, 42899}, {727, 15, 43331}, {727, 15, 43801}, {733, 15, 44257},
{739, 15, 44701}, {751, 15, 45161}, {751, 15, 45613}, {757, 15, 46073},
{769, 15, 46549}, {769, 15, 47017}, {787, 15, 47507}, {787, 15, 47981},
{787, 15, 48463}, {797, 15, 48953}, {809, 15, 49451}, {809, 15, 49943},
{821, 15, 50461}, {821, 16, 50993}, {827, 16, 51503}, {839, 16, 52027},
{853, 16, 52571}, {853, 16, 53093}, {857, 16, 53623}, {863, 16, 54163},
{877, 16, 54713}, {877, 16, 55259}, {883, 16, 55817}, {907, 16, 56393},
{907, 16, 56951}};
#endif