OXYGENHUB
◆ switch-says oxygen / vendor / crc-fast / src / crc16 / consts.rs
36.0 KiB · Rust · last changed Strata: the cloud stores send through ureq, so every release target links 1 month ago source blame history raw
1
// Copyright 2025 Don MacAskill. Licensed under MIT or Apache-2.0.
2
3
#![allow(dead_code)]
4
5
use crate::consts::{
6
    NAME_CRC16_ARC, NAME_CRC16_CDMA2000, NAME_CRC16_CMS, NAME_CRC16_DDS_110, NAME_CRC16_DECT_R,
7
    NAME_CRC16_DECT_X, NAME_CRC16_DNP, NAME_CRC16_EN_13757, NAME_CRC16_GENIBUS, NAME_CRC16_GSM,
8
    NAME_CRC16_IBM_3740, NAME_CRC16_IBM_SDLC, NAME_CRC16_ISO_IEC_14443_3_A, NAME_CRC16_KERMIT,
9
    NAME_CRC16_LJ1200, NAME_CRC16_M17, NAME_CRC16_MAXIM_DOW, NAME_CRC16_MCRF4XX, NAME_CRC16_MODBUS,
10
    NAME_CRC16_NRSC_5, NAME_CRC16_OPENSAFETY_A, NAME_CRC16_OPENSAFETY_B, NAME_CRC16_PROFIBUS,
11
    NAME_CRC16_RIELLO, NAME_CRC16_SPI_FUJITSU, NAME_CRC16_T10_DIF, NAME_CRC16_TELEDISK,
12
    NAME_CRC16_TMS37157, NAME_CRC16_UMTS, NAME_CRC16_USB, NAME_CRC16_XMODEM,
13
};
14
use crate::structs::Algorithm;
15
use crate::CrcAlgorithm;
16
use crate::CrcParams;
17
18
// Native CRC-16 algorithm constants matching the CRC catalogue specification
19
// https://reveng.sourceforge.io/crc-catalogue/all.htm
20
21
pub const CRC_16_ARC: Algorithm<u16> = Algorithm {
22
    width: 16,
23
    poly: 0x8005,
24
    init: 0x0,
25
    refin: true,
26
    refout: true,
27
    xorout: 0x0,
28
    check: 0xbb3d,
29
    residue: 0x0,
30
};
31
32
pub const CRC_16_CDMA2000: Algorithm<u16> = Algorithm {
33
    width: 16,
34
    poly: 0xc867,
35
    init: 0xffff,
36
    refin: false,
37
    refout: false,
38
    xorout: 0x0,
39
    check: 0x4c06,
40
    residue: 0x0,
41
};
42
43
pub const CRC_16_CMS: Algorithm<u16> = Algorithm {
44
    width: 16,
45
    poly: 0x8005,
46
    init: 0xffff,
47
    refin: false,
48
    refout: false,
49
    xorout: 0x0,
50
    check: 0xaee7,
51
    residue: 0x0,
52
};
53
54
pub const CRC_16_DDS_110: Algorithm<u16> = Algorithm {
55
    width: 16,
56
    poly: 0x8005,
57
    init: 0x800d,
58
    refin: false,
59
    refout: false,
60
    xorout: 0x0,
61
    check: 0x9ecf,
62
    residue: 0x0,
63
};
64
65
pub const CRC_16_DECT_R: Algorithm<u16> = Algorithm {
66
    width: 16,
67
    poly: 0x0589,
68
    init: 0x0,
69
    refin: false,
70
    refout: false,
71
    xorout: 0x1,
72
    check: 0x007e,
73
    residue: 0x0589,
74
};
75
76
pub const CRC_16_DECT_X: Algorithm<u16> = Algorithm {
77
    width: 16,
78
    poly: 0x0589,
79
    init: 0x0,
80
    refin: false,
81
    refout: false,
82
    xorout: 0x0,
83
    check: 0x007f,
84
    residue: 0x0,
85
};
86
87
pub const CRC_16_DNP: Algorithm<u16> = Algorithm {
88
    width: 16,
89
    poly: 0x3d65,
90
    init: 0x0,
91
    refin: true,
92
    refout: true,
93
    xorout: 0xffff,
94
    check: 0xea82,
95
    residue: 0x66c5,
96
};
97
98
pub const CRC_16_EN_13757: Algorithm<u16> = Algorithm {
99
    width: 16,
100
    poly: 0x3d65,
101
    init: 0x0,
102
    refin: false,
103
    refout: false,
104
    xorout: 0xffff,
105
    check: 0xc2b7,
106
    residue: 0xa366,
107
};
108
109
pub const CRC_16_GENIBUS: Algorithm<u16> = Algorithm {
110
    width: 16,
111
    poly: 0x1021,
112
    init: 0xffff,
113
    refin: false,
114
    refout: false,
115
    xorout: 0xffff,
116
    check: 0xd64e,
117
    residue: 0x1d0f,
118
};
119
120
pub const CRC_16_GSM: Algorithm<u16> = Algorithm {
121
    width: 16,
122
    poly: 0x1021,
123
    init: 0x0,
124
    refin: false,
125
    refout: false,
126
    xorout: 0xffff,
127
    check: 0xce3c,
128
    residue: 0x1d0f,
129
};
130
131
pub const CRC_16_IBM_3740: Algorithm<u16> = Algorithm {
132
    width: 16,
133
    poly: 0x1021,
134
    init: 0xffff,
135
    refin: false,
136
    refout: false,
137
    xorout: 0x0,
138
    check: 0x29b1,
139
    residue: 0x0,
140
};
141
142
pub const CRC_16_IBM_SDLC: Algorithm<u16> = Algorithm {
143
    width: 16,
144
    poly: 0x1021,
145
    init: 0xffff,
146
    refin: true,
147
    refout: true,
148
    xorout: 0xffff,
149
    check: 0x906e,
150
    residue: 0xf0b8,
151
};
152
153
pub const CRC_16_ISO_IEC_14443_3_A: Algorithm<u16> = Algorithm {
154
    width: 16,
155
    poly: 0x1021,
156
    init: 0xc6c6,
157
    refin: true,
158
    refout: true,
159
    xorout: 0x0,
160
    check: 0xbf05,
161
    residue: 0x0,
162
};
163
164
pub const CRC_16_KERMIT: Algorithm<u16> = Algorithm {
165
    width: 16,
166
    poly: 0x1021,
167
    init: 0x0,
168
    refin: true,
169
    refout: true,
170
    xorout: 0x0,
171
    check: 0x2189,
172
    residue: 0x0,
173
};
174
175
pub const CRC_16_LJ1200: Algorithm<u16> = Algorithm {
176
    width: 16,
177
    poly: 0x6f63,
178
    init: 0x0,
179
    refin: false,
180
    refout: false,
181
    xorout: 0x0,
182
    check: 0xbdf4,
183
    residue: 0x0,
184
};
185
186
pub const CRC_16_M17: Algorithm<u16> = Algorithm {
187
    width: 16,
188
    poly: 0x5935,
189
    init: 0xffff,
190
    refin: false,
191
    refout: false,
192
    xorout: 0x0,
193
    check: 0x772b,
194
    residue: 0x0,
195
};
196
197
pub const CRC_16_MAXIM_DOW: Algorithm<u16> = Algorithm {
198
    width: 16,
199
    poly: 0x8005,
200
    init: 0x0,
201
    refin: true,
202
    refout: true,
203
    xorout: 0xffff,
204
    check: 0x44c2,
205
    residue: 0xb001,
206
};
207
208
pub const CRC_16_MCRF4XX: Algorithm<u16> = Algorithm {
209
    width: 16,
210
    poly: 0x1021,
211
    init: 0xffff,
212
    refin: true,
213
    refout: true,
214
    xorout: 0x0,
215
    check: 0x6f91,
216
    residue: 0x0,
217
};
218
219
pub const CRC_16_MODBUS: Algorithm<u16> = Algorithm {
220
    width: 16,
221
    poly: 0x8005,
222
    init: 0xffff,
223
    refin: true,
224
    refout: true,
225
    xorout: 0x0,
226
    check: 0x4b37,
227
    residue: 0x0,
228
};
229
230
pub const CRC_16_NRSC_5: Algorithm<u16> = Algorithm {
231
    width: 16,
232
    poly: 0x080b,
233
    init: 0xffff,
234
    refin: true,
235
    refout: true,
236
    xorout: 0x0,
237
    check: 0xa066,
238
    residue: 0x0,
239
};
240
241
pub const CRC_16_OPENSAFETY_A: Algorithm<u16> = Algorithm {
242
    width: 16,
243
    poly: 0x5935,
244
    init: 0x0,
245
    refin: false,
246
    refout: false,
247
    xorout: 0x0,
248
    check: 0x5d38,
249
    residue: 0x0,
250
};
251
252
pub const CRC_16_OPENSAFETY_B: Algorithm<u16> = Algorithm {
253
    width: 16,
254
    poly: 0x755b,
255
    init: 0x0,
256
    refin: false,
257
    refout: false,
258
    xorout: 0x0,
259
    check: 0x20fe,
260
    residue: 0x0,
261
};
262
263
pub const CRC_16_PROFIBUS: Algorithm<u16> = Algorithm {
264
    width: 16,
265
    poly: 0x1dcf,
266
    init: 0xffff,
267
    refin: false,
268
    refout: false,
269
    xorout: 0xffff,
270
    check: 0xa819,
271
    residue: 0xe394,
272
};
273
274
pub const CRC_16_RIELLO: Algorithm<u16> = Algorithm {
275
    width: 16,
276
    poly: 0x1021,
277
    init: 0xb2aa,
278
    refin: true,
279
    refout: true,
280
    xorout: 0x0,
281
    check: 0x63d0,
282
    residue: 0x0,
283
};
284
285
pub const CRC_16_SPI_FUJITSU: Algorithm<u16> = Algorithm {
286
    width: 16,
287
    poly: 0x1021,
288
    init: 0x1d0f,
289
    refin: false,
290
    refout: false,
291
    xorout: 0x0,
292
    check: 0xe5cc,
293
    residue: 0x0,
294
};
295
296
pub const CRC_16_T10_DIF: Algorithm<u16> = Algorithm {
297
    width: 16,
298
    poly: 0x8bb7,
299
    init: 0x0,
300
    refin: false,
301
    refout: false,
302
    xorout: 0x0,
303
    check: 0xd0db,
304
    residue: 0x0,
305
};
306
307
pub const CRC_16_TELEDISK: Algorithm<u16> = Algorithm {
308
    width: 16,
309
    poly: 0xa097,
310
    init: 0x0,
311
    refin: false,
312
    refout: false,
313
    xorout: 0x0,
314
    check: 0x0fb3,
315
    residue: 0x0,
316
};
317
318
pub const CRC_16_TMS37157: Algorithm<u16> = Algorithm {
319
    width: 16,
320
    poly: 0x1021,
321
    init: 0x89ec,
322
    refin: true,
323
    refout: true,
324
    xorout: 0x0,
325
    check: 0x26b1,
326
    residue: 0x0,
327
};
328
329
pub const CRC_16_UMTS: Algorithm<u16> = Algorithm {
330
    width: 16,
331
    poly: 0x8005,
332
    init: 0x0,
333
    refin: false,
334
    refout: false,
335
    xorout: 0x0,
336
    check: 0xfee8,
337
    residue: 0x0,
338
};
339
340
pub const CRC_16_USB: Algorithm<u16> = Algorithm {
341
    width: 16,
342
    poly: 0x8005,
343
    init: 0xffff,
344
    refin: true,
345
    refout: true,
346
    xorout: 0xffff,
347
    check: 0xb4c8,
348
    residue: 0xb001,
349
};
350
351
pub const CRC_16_XMODEM: Algorithm<u16> = Algorithm {
352
    width: 16,
353
    poly: 0x1021,
354
    init: 0x0,
355
    refin: false,
356
    refout: false,
357
    xorout: 0x0,
358
    check: 0x31c3,
359
    residue: 0x0,
360
};
361
362
// width=16 poly=0x8005 init=0x0000 refin=true refout=true xorout=0x0000 check=0xbb3d residue=0x0000 name="CRC-16/ARC"
363
pub const CRC16_ARC: CrcParams = CrcParams {
364
    name: NAME_CRC16_ARC,
365
    algorithm: CrcAlgorithm::Crc16Arc,
366
    width: 16,
367
    poly: CRC_16_ARC.poly as u64,
368
    init: CRC_16_ARC.init as u64,
369
    init_algorithm: CRC_16_ARC.init as u64, // 0x0000 is symmetric under bit-reversal
370
    refin: CRC_16_ARC.refin,
371
    refout: CRC_16_ARC.refout,
372
    xorout: CRC_16_ARC.xorout as u64,
373
    check: CRC_16_ARC.check as u64,
374
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_REFLECTED),
375
};
376
377
// width=16 poly=0xc867 init=0xffff refin=false refout=false xorout=0x0000 check=0x4c06 residue=0x0000 name="CRC-16/CDMA2000"
378
pub const CRC16_CDMA2000: CrcParams = CrcParams {
379
    name: NAME_CRC16_CDMA2000,
380
    algorithm: CrcAlgorithm::Crc16Cdma2000,
381
    width: 16,
382
    poly: CRC_16_CDMA2000.poly as u64,
383
    init: CRC_16_CDMA2000.init as u64,
384
    init_algorithm: CRC_16_CDMA2000.init as u64,
385
    refin: CRC_16_CDMA2000.refin,
386
    refout: CRC_16_CDMA2000.refout,
387
    xorout: CRC_16_CDMA2000.xorout as u64,
388
    check: CRC_16_CDMA2000.check as u64,
389
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_C867_FORWARD),
390
};
391
392
// width=16 poly=0x8005 init=0xffff refin=false refout=false xorout=0x0000 check=0xaee7 residue=0x0000 name="CRC-16/CMS"
393
pub const CRC16_CMS: CrcParams = CrcParams {
394
    name: NAME_CRC16_CMS,
395
    algorithm: CrcAlgorithm::Crc16Cms,
396
    width: 16,
397
    poly: CRC_16_CMS.poly as u64,
398
    init: CRC_16_CMS.init as u64,
399
    init_algorithm: CRC_16_CMS.init as u64,
400
    refin: CRC_16_CMS.refin,
401
    refout: CRC_16_CMS.refout,
402
    xorout: CRC_16_CMS.xorout as u64,
403
    check: CRC_16_CMS.check as u64,
404
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_FORWARD),
405
};
406
407
// width=16 poly=0x8005 init=0x800d refin=false refout=false xorout=0x0000 check=0x9ecf residue=0x0000 name="CRC-16/DDS-110"
408
pub const CRC16_DDS_110: CrcParams = CrcParams {
409
    name: NAME_CRC16_DDS_110,
410
    algorithm: CrcAlgorithm::Crc16Dds110,
411
    width: 16,
412
    poly: CRC_16_DDS_110.poly as u64,
413
    init: CRC_16_DDS_110.init as u64,
414
    init_algorithm: CRC_16_DDS_110.init as u64,
415
    refin: CRC_16_DDS_110.refin,
416
    refout: CRC_16_DDS_110.refout,
417
    xorout: CRC_16_DDS_110.xorout as u64,
418
    check: CRC_16_DDS_110.check as u64,
419
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_FORWARD),
420
};
421
422
// width=16 poly=0x0589 init=0x0000 refin=false refout=false xorout=0x0001 check=0x007e residue=0x0589 name="CRC-16/DECT-R"
423
pub const CRC16_DECT_R: CrcParams = CrcParams {
424
    name: NAME_CRC16_DECT_R,
425
    algorithm: CrcAlgorithm::Crc16DectR,
426
    width: 16,
427
    poly: CRC_16_DECT_R.poly as u64,
428
    init: CRC_16_DECT_R.init as u64,
429
    init_algorithm: CRC_16_DECT_R.init as u64,
430
    refin: CRC_16_DECT_R.refin,
431
    refout: CRC_16_DECT_R.refout,
432
    xorout: CRC_16_DECT_R.xorout as u64,
433
    check: CRC_16_DECT_R.check as u64,
434
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_0589_FORWARD),
435
};
436
437
// width=16 poly=0x0589 init=0x0000 refin=false refout=false xorout=0x0000 check=0x007f residue=0x0000 name="CRC-16/DECT-X"
438
pub const CRC16_DECT_X: CrcParams = CrcParams {
439
    name: NAME_CRC16_DECT_X,
440
    algorithm: CrcAlgorithm::Crc16DectX,
441
    width: 16,
442
    poly: CRC_16_DECT_X.poly as u64,
443
    init: CRC_16_DECT_X.init as u64,
444
    init_algorithm: CRC_16_DECT_X.init as u64,
445
    refin: CRC_16_DECT_X.refin,
446
    refout: CRC_16_DECT_X.refout,
447
    xorout: CRC_16_DECT_X.xorout as u64,
448
    check: CRC_16_DECT_X.check as u64,
449
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_0589_FORWARD),
450
};
451
452
// width=16 poly=0x3d65 init=0x0000 refin=true refout=true xorout=0xffff check=0xea82 residue=0x66c5 name="CRC-16/DNP"
453
pub const CRC16_DNP: CrcParams = CrcParams {
454
    name: NAME_CRC16_DNP,
455
    algorithm: CrcAlgorithm::Crc16Dnp,
456
    width: 16,
457
    poly: CRC_16_DNP.poly as u64,
458
    init: CRC_16_DNP.init as u64,
459
    init_algorithm: CRC_16_DNP.init as u64, // 0x0000 is symmetric under bit-reversal
460
    refin: CRC_16_DNP.refin,
461
    refout: CRC_16_DNP.refout,
462
    xorout: CRC_16_DNP.xorout as u64,
463
    check: CRC_16_DNP.check as u64,
464
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_3D65_REFLECTED),
465
};
466
467
// width=16 poly=0x3d65 init=0x0000 refin=false refout=false xorout=0xffff check=0xc2b7 residue=0xa366 name="CRC-16/EN-13757"
468
pub const CRC16_EN_13757: CrcParams = CrcParams {
469
    name: NAME_CRC16_EN_13757,
470
    algorithm: CrcAlgorithm::Crc16En13757,
471
    width: 16,
472
    poly: CRC_16_EN_13757.poly as u64,
473
    init: CRC_16_EN_13757.init as u64,
474
    init_algorithm: CRC_16_EN_13757.init as u64,
475
    refin: CRC_16_EN_13757.refin,
476
    refout: CRC_16_EN_13757.refout,
477
    xorout: CRC_16_EN_13757.xorout as u64,
478
    check: CRC_16_EN_13757.check as u64,
479
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_3D65_FORWARD),
480
};
481
482
// width=16 poly=0x1021 init=0xffff refin=false refout=false xorout=0xffff check=0xd64e residue=0x1d0f name="CRC-16/GENIBUS"
483
pub const CRC16_GENIBUS: CrcParams = CrcParams {
484
    name: NAME_CRC16_GENIBUS,
485
    algorithm: CrcAlgorithm::Crc16Genibus,
486
    width: 16,
487
    poly: CRC_16_GENIBUS.poly as u64,
488
    init: CRC_16_GENIBUS.init as u64,
489
    init_algorithm: CRC_16_GENIBUS.init as u64,
490
    refin: CRC_16_GENIBUS.refin,
491
    refout: CRC_16_GENIBUS.refout,
492
    xorout: CRC_16_GENIBUS.xorout as u64,
493
    check: CRC_16_GENIBUS.check as u64,
494
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_FORWARD),
495
};
496
497
// width=16 poly=0x1021 init=0x0000 refin=false refout=false xorout=0xffff check=0xce3c residue=0x1d0f name="CRC-16/GSM"
498
pub const CRC16_GSM: CrcParams = CrcParams {
499
    name: NAME_CRC16_GSM,
500
    algorithm: CrcAlgorithm::Crc16Gsm,
501
    width: 16,
502
    poly: CRC_16_GSM.poly as u64,
503
    init: CRC_16_GSM.init as u64,
504
    init_algorithm: CRC_16_GSM.init as u64,
505
    refin: CRC_16_GSM.refin,
506
    refout: CRC_16_GSM.refout,
507
    xorout: CRC_16_GSM.xorout as u64,
508
    check: CRC_16_GSM.check as u64,
509
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_FORWARD),
510
};
511
512
// width=16 poly=0x1021 init=0xffff refin=false refout=false xorout=0x0000 check=0x29b1 residue=0x0000 name="CRC-16/IBM-3740"
513
pub const CRC16_IBM_3740: CrcParams = CrcParams {
514
    name: NAME_CRC16_IBM_3740,
515
    algorithm: CrcAlgorithm::Crc16Ibm3740,
516
    width: 16,
517
    poly: CRC_16_IBM_3740.poly as u64,
518
    init: CRC_16_IBM_3740.init as u64,
519
    init_algorithm: CRC_16_IBM_3740.init as u64,
520
    refin: CRC_16_IBM_3740.refin,
521
    refout: CRC_16_IBM_3740.refout,
522
    xorout: CRC_16_IBM_3740.xorout as u64,
523
    check: CRC_16_IBM_3740.check as u64,
524
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_FORWARD),
525
};
526
527
// width=16 poly=0x1021 init=0xffff refin=true refout=true xorout=0xffff check=0x906e residue=0xf0b8 name="CRC-16/IBM-SDLC"
528
pub const CRC16_IBM_SDLC: CrcParams = CrcParams {
529
    name: NAME_CRC16_IBM_SDLC,
530
    algorithm: CrcAlgorithm::Crc16IbmSdlc,
531
    width: 16,
532
    poly: CRC_16_IBM_SDLC.poly as u64,
533
    init: CRC_16_IBM_SDLC.init as u64,
534
    init_algorithm: CRC_16_IBM_SDLC.init as u64, // 0xFFFF is symmetric under bit-reversal
535
    refin: CRC_16_IBM_SDLC.refin,
536
    refout: CRC_16_IBM_SDLC.refout,
537
    xorout: CRC_16_IBM_SDLC.xorout as u64,
538
    check: CRC_16_IBM_SDLC.check as u64,
539
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_REVERSE),
540
};
541
542
// width=16 poly=0x1021 init=0xc6c6 refin=true refout=true xorout=0x0000 check=0xbf05 residue=0x0000 name="CRC-16/ISO-IEC-14443-3-A"
543
pub const CRC16_ISO_IEC_14443_3_A: CrcParams = CrcParams {
544
    name: NAME_CRC16_ISO_IEC_14443_3_A,
545
    algorithm: CrcAlgorithm::Crc16IsoIec144433A,
546
    width: 16,
547
    poly: CRC_16_ISO_IEC_14443_3_A.poly as u64,
548
    init: CRC_16_ISO_IEC_14443_3_A.init as u64,
549
    // 0xC6C6 bit-reversed = 0x6363; pre-computed to avoid runtime reversal
550
    init_algorithm: 0x6363,
551
    refin: CRC_16_ISO_IEC_14443_3_A.refin,
552
    refout: CRC_16_ISO_IEC_14443_3_A.refout,
553
    xorout: CRC_16_ISO_IEC_14443_3_A.xorout as u64,
554
    check: CRC_16_ISO_IEC_14443_3_A.check as u64,
555
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_REVERSE),
556
};
557
558
// width=16 poly=0x1021 init=0x0000 refin=true refout=true xorout=0x0000 check=0x2189 residue=0x0000 name="CRC-16/KERMIT"
559
pub const CRC16_KERMIT: CrcParams = CrcParams {
560
    name: NAME_CRC16_KERMIT,
561
    algorithm: CrcAlgorithm::Crc16Kermit,
562
    width: 16,
563
    poly: CRC_16_KERMIT.poly as u64,
564
    init: CRC_16_KERMIT.init as u64,
565
    init_algorithm: CRC_16_KERMIT.init as u64, // 0x0000 is symmetric under bit-reversal
566
    refin: CRC_16_KERMIT.refin,
567
    refout: CRC_16_KERMIT.refout,
568
    xorout: CRC_16_KERMIT.xorout as u64,
569
    check: CRC_16_KERMIT.check as u64,
570
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_REVERSE),
571
};
572
573
// width=16 poly=0x6f63 init=0x0000 refin=false refout=false xorout=0x0000 check=0xbdf4 residue=0x0000 name="CRC-16/LJ1200"
574
pub const CRC16_LJ1200: CrcParams = CrcParams {
575
    name: NAME_CRC16_LJ1200,
576
    algorithm: CrcAlgorithm::Crc16Lj1200,
577
    width: 16,
578
    poly: CRC_16_LJ1200.poly as u64,
579
    init: CRC_16_LJ1200.init as u64,
580
    init_algorithm: CRC_16_LJ1200.init as u64,
581
    refin: CRC_16_LJ1200.refin,
582
    refout: CRC_16_LJ1200.refout,
583
    xorout: CRC_16_LJ1200.xorout as u64,
584
    check: CRC_16_LJ1200.check as u64,
585
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_6F63_FORWARD),
586
};
587
588
// width=16 poly=0x5935 init=0xffff refin=false refout=false xorout=0x0000 check=0x772b residue=0x0000 name="CRC-16/M17"
589
pub const CRC16_M17: CrcParams = CrcParams {
590
    name: NAME_CRC16_M17,
591
    algorithm: CrcAlgorithm::Crc16M17,
592
    width: 16,
593
    poly: CRC_16_M17.poly as u64,
594
    init: CRC_16_M17.init as u64,
595
    init_algorithm: CRC_16_M17.init as u64,
596
    refin: CRC_16_M17.refin,
597
    refout: CRC_16_M17.refout,
598
    xorout: CRC_16_M17.xorout as u64,
599
    check: CRC_16_M17.check as u64,
600
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_5935_FORWARD),
601
};
602
603
// width=16 poly=0x8005 init=0x0000 refin=true refout=true xorout=0xffff check=0x44c2 residue=0xb001 name="CRC-16/MAXIM-DOW"
604
pub const CRC16_MAXIM_DOW: CrcParams = CrcParams {
605
    name: NAME_CRC16_MAXIM_DOW,
606
    algorithm: CrcAlgorithm::Crc16MaximDow,
607
    width: 16,
608
    poly: CRC_16_MAXIM_DOW.poly as u64,
609
    init: CRC_16_MAXIM_DOW.init as u64,
610
    init_algorithm: CRC_16_MAXIM_DOW.init as u64, // 0x0000 is symmetric under bit-reversal
611
    refin: CRC_16_MAXIM_DOW.refin,
612
    refout: CRC_16_MAXIM_DOW.refout,
613
    xorout: CRC_16_MAXIM_DOW.xorout as u64,
614
    check: CRC_16_MAXIM_DOW.check as u64,
615
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_REFLECTED),
616
};
617
618
// width=16 poly=0x1021 init=0xffff refin=true refout=true xorout=0x0000 check=0x6f91 residue=0x0000 name="CRC-16/MCRF4XX"
619
pub const CRC16_MCRF4XX: CrcParams = CrcParams {
620
    name: NAME_CRC16_MCRF4XX,
621
    algorithm: CrcAlgorithm::Crc16Mcrf4xx,
622
    width: 16,
623
    poly: CRC_16_MCRF4XX.poly as u64,
624
    init: CRC_16_MCRF4XX.init as u64,
625
    init_algorithm: CRC_16_MCRF4XX.init as u64, // 0xFFFF is symmetric under bit-reversal
626
    refin: CRC_16_MCRF4XX.refin,
627
    refout: CRC_16_MCRF4XX.refout,
628
    xorout: CRC_16_MCRF4XX.xorout as u64,
629
    check: CRC_16_MCRF4XX.check as u64,
630
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_REVERSE),
631
};
632
633
// width=16 poly=0x8005 init=0xffff refin=true refout=true xorout=0x0000 check=0x4b37 residue=0x0000 name="CRC-16/MODBUS"
634
pub const CRC16_MODBUS: CrcParams = CrcParams {
635
    name: NAME_CRC16_MODBUS,
636
    algorithm: CrcAlgorithm::Crc16Modbus,
637
    width: 16,
638
    poly: CRC_16_MODBUS.poly as u64,
639
    init: CRC_16_MODBUS.init as u64,
640
    init_algorithm: CRC_16_MODBUS.init as u64, // 0xFFFF is symmetric under bit-reversal
641
    refin: CRC_16_MODBUS.refin,
642
    refout: CRC_16_MODBUS.refout,
643
    xorout: CRC_16_MODBUS.xorout as u64,
644
    check: CRC_16_MODBUS.check as u64,
645
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_REFLECTED),
646
};
647
648
// width=16 poly=0x080b init=0xffff refin=true refout=true xorout=0x0000 check=0xa066 residue=0x0000 name="CRC-16/NRSC-5"
649
pub const CRC16_NRSC_5: CrcParams = CrcParams {
650
    name: NAME_CRC16_NRSC_5,
651
    algorithm: CrcAlgorithm::Crc16Nrsc5,
652
    width: 16,
653
    poly: CRC_16_NRSC_5.poly as u64,
654
    init: CRC_16_NRSC_5.init as u64,
655
    init_algorithm: CRC_16_NRSC_5.init as u64, // 0xFFFF is symmetric under bit-reversal
656
    refin: CRC_16_NRSC_5.refin,
657
    refout: CRC_16_NRSC_5.refout,
658
    xorout: CRC_16_NRSC_5.xorout as u64,
659
    check: CRC_16_NRSC_5.check as u64,
660
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_080B_REFLECTED),
661
};
662
663
// width=16 poly=0x5935 init=0x0000 refin=false refout=false xorout=0x0000 check=0x5d38 residue=0x0000 name="CRC-16/OPENSAFETY-A"
664
pub const CRC16_OPENSAFETY_A: CrcParams = CrcParams {
665
    name: NAME_CRC16_OPENSAFETY_A,
666
    algorithm: CrcAlgorithm::Crc16OpensafetyA,
667
    width: 16,
668
    poly: CRC_16_OPENSAFETY_A.poly as u64,
669
    init: CRC_16_OPENSAFETY_A.init as u64,
670
    init_algorithm: CRC_16_OPENSAFETY_A.init as u64,
671
    refin: CRC_16_OPENSAFETY_A.refin,
672
    refout: CRC_16_OPENSAFETY_A.refout,
673
    xorout: CRC_16_OPENSAFETY_A.xorout as u64,
674
    check: CRC_16_OPENSAFETY_A.check as u64,
675
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_5935_FORWARD),
676
};
677
678
// width=16 poly=0x755b init=0x0000 refin=false refout=false xorout=0x0000 check=0x20fe residue=0x0000 name="CRC-16/OPENSAFETY-B"
679
pub const CRC16_OPENSAFETY_B: CrcParams = CrcParams {
680
    name: NAME_CRC16_OPENSAFETY_B,
681
    algorithm: CrcAlgorithm::Crc16OpensafetyB,
682
    width: 16,
683
    poly: CRC_16_OPENSAFETY_B.poly as u64,
684
    init: CRC_16_OPENSAFETY_B.init as u64,
685
    init_algorithm: CRC_16_OPENSAFETY_B.init as u64,
686
    refin: CRC_16_OPENSAFETY_B.refin,
687
    refout: CRC_16_OPENSAFETY_B.refout,
688
    xorout: CRC_16_OPENSAFETY_B.xorout as u64,
689
    check: CRC_16_OPENSAFETY_B.check as u64,
690
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_755B_FORWARD),
691
};
692
693
// width=16 poly=0x1dcf init=0xffff refin=false refout=false xorout=0xffff check=0xa819 residue=0xe394 name="CRC-16/PROFIBUS"
694
pub const CRC16_PROFIBUS: CrcParams = CrcParams {
695
    name: NAME_CRC16_PROFIBUS,
696
    algorithm: CrcAlgorithm::Crc16Profibus,
697
    width: 16,
698
    poly: CRC_16_PROFIBUS.poly as u64,
699
    init: CRC_16_PROFIBUS.init as u64,
700
    init_algorithm: CRC_16_PROFIBUS.init as u64,
701
    refin: CRC_16_PROFIBUS.refin,
702
    refout: CRC_16_PROFIBUS.refout,
703
    xorout: CRC_16_PROFIBUS.xorout as u64,
704
    check: CRC_16_PROFIBUS.check as u64,
705
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1DCF_FORWARD),
706
};
707
708
// width=16 poly=0x1021 init=0xb2aa refin=true refout=true xorout=0x0000 check=0x63d0 residue=0x0000 name="CRC-16/RIELLO"
709
pub const CRC16_RIELLO: CrcParams = CrcParams {
710
    name: NAME_CRC16_RIELLO,
711
    algorithm: CrcAlgorithm::Crc16Riello,
712
    width: 16,
713
    poly: CRC_16_RIELLO.poly as u64,
714
    init: CRC_16_RIELLO.init as u64,
715
    // 0xB2AA bit-reversed = 0x554D; pre-computed to avoid runtime reversal
716
    init_algorithm: 0x554D,
717
    refin: CRC_16_RIELLO.refin,
718
    refout: CRC_16_RIELLO.refout,
719
    xorout: CRC_16_RIELLO.xorout as u64,
720
    check: CRC_16_RIELLO.check as u64,
721
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_REVERSE),
722
};
723
724
// width=16 poly=0x1021 init=0x1d0f refin=false refout=false xorout=0x0000 check=0xe5cc residue=0x0000 name="CRC-16/SPI-FUJITSU"
725
pub const CRC16_SPI_FUJITSU: CrcParams = CrcParams {
726
    name: NAME_CRC16_SPI_FUJITSU,
727
    algorithm: CrcAlgorithm::Crc16SpiFujitsu,
728
    width: 16,
729
    poly: CRC_16_SPI_FUJITSU.poly as u64,
730
    init: CRC_16_SPI_FUJITSU.init as u64,
731
    init_algorithm: CRC_16_SPI_FUJITSU.init as u64,
732
    refin: CRC_16_SPI_FUJITSU.refin,
733
    refout: CRC_16_SPI_FUJITSU.refout,
734
    xorout: CRC_16_SPI_FUJITSU.xorout as u64,
735
    check: CRC_16_SPI_FUJITSU.check as u64,
736
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_FORWARD),
737
};
738
739
// width=16 poly=0x8bb7 init=0x0000 refin=false refout=false xorout=0x0000 check=0xd0db residue=0x0000 name="CRC-16/T10-DIF"
740
pub const CRC16_T10_DIF: CrcParams = CrcParams {
741
    name: NAME_CRC16_T10_DIF,
742
    algorithm: CrcAlgorithm::Crc16T10Dif,
743
    width: 16,
744
    poly: CRC_16_T10_DIF.poly as u64,
745
    init: CRC_16_T10_DIF.init as u64,
746
    init_algorithm: CRC_16_T10_DIF.init as u64,
747
    refin: CRC_16_T10_DIF.refin,
748
    refout: CRC_16_T10_DIF.refout,
749
    xorout: CRC_16_T10_DIF.xorout as u64,
750
    check: CRC_16_T10_DIF.check as u64,
751
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8BB7_FORWARD),
752
};
753
754
// width=16 poly=0xa097 init=0x0000 refin=false refout=false xorout=0x0000 check=0x0fb3 residue=0x0000 name="CRC-16/TELEDISK"
755
pub const CRC16_TELEDISK: CrcParams = CrcParams {
756
    name: NAME_CRC16_TELEDISK,
757
    algorithm: CrcAlgorithm::Crc16Teledisk,
758
    width: 16,
759
    poly: CRC_16_TELEDISK.poly as u64,
760
    init: CRC_16_TELEDISK.init as u64,
761
    init_algorithm: CRC_16_TELEDISK.init as u64,
762
    refin: CRC_16_TELEDISK.refin,
763
    refout: CRC_16_TELEDISK.refout,
764
    xorout: CRC_16_TELEDISK.xorout as u64,
765
    check: CRC_16_TELEDISK.check as u64,
766
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_A097_FORWARD),
767
};
768
769
// width=16 poly=0x1021 init=0x89ec refin=true refout=true xorout=0x0000 check=0x26b1 residue=0x0000 name="CRC-16/TMS37157"
770
pub const CRC16_TMS37157: CrcParams = CrcParams {
771
    name: NAME_CRC16_TMS37157,
772
    algorithm: CrcAlgorithm::Crc16Tms37157,
773
    width: 16,
774
    poly: CRC_16_TMS37157.poly as u64,
775
    init: CRC_16_TMS37157.init as u64,
776
    // 0x89EC bit-reversed = 0x3791; pre-computed to avoid runtime reversal
777
    init_algorithm: 0x3791,
778
    refin: CRC_16_TMS37157.refin,
779
    refout: CRC_16_TMS37157.refout,
780
    xorout: CRC_16_TMS37157.xorout as u64,
781
    check: CRC_16_TMS37157.check as u64,
782
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_REVERSE),
783
};
784
785
// width=16 poly=0x8005 init=0x0000 refin=false refout=false xorout=0x0000 check=0xfee8 residue=0x0000 name="CRC-16/UMTS"
786
pub const CRC16_UMTS: CrcParams = CrcParams {
787
    name: NAME_CRC16_UMTS,
788
    algorithm: CrcAlgorithm::Crc16Umts,
789
    width: 16,
790
    poly: CRC_16_UMTS.poly as u64,
791
    init: CRC_16_UMTS.init as u64,
792
    init_algorithm: CRC_16_UMTS.init as u64,
793
    refin: CRC_16_UMTS.refin,
794
    refout: CRC_16_UMTS.refout,
795
    xorout: CRC_16_UMTS.xorout as u64,
796
    check: CRC_16_UMTS.check as u64,
797
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_FORWARD),
798
};
799
800
// width=16 poly=0x8005 init=0xffff refin=true refout=true xorout=0xffff check=0xb4c8 residue=0xb001 name="CRC-16/USB"
801
pub const CRC16_USB: CrcParams = CrcParams {
802
    name: NAME_CRC16_USB,
803
    algorithm: CrcAlgorithm::Crc16Usb,
804
    width: 16,
805
    poly: CRC_16_USB.poly as u64,
806
    init: CRC_16_USB.init as u64,
807
    init_algorithm: CRC_16_USB.init as u64, // 0xFFFF is symmetric under bit-reversal
808
    refin: CRC_16_USB.refin,
809
    refout: CRC_16_USB.refout,
810
    xorout: CRC_16_USB.xorout as u64,
811
    check: CRC_16_USB.check as u64,
812
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_8005_REFLECTED),
813
};
814
815
// width=16 poly=0x1021 init=0x0000 refin=false refout=false xorout=0x0000 check=0x31c3 residue=0x0000 name="CRC-16/XMODEM"
816
pub const CRC16_XMODEM: CrcParams = CrcParams {
817
    name: NAME_CRC16_XMODEM,
818
    algorithm: CrcAlgorithm::Crc16Xmodem,
819
    width: 16,
820
    poly: CRC_16_XMODEM.poly as u64,
821
    init: CRC_16_XMODEM.init as u64,
822
    init_algorithm: CRC_16_XMODEM.init as u64,
823
    refin: CRC_16_XMODEM.refin,
824
    refout: CRC_16_XMODEM.refout,
825
    xorout: CRC_16_XMODEM.xorout as u64,
826
    check: CRC_16_XMODEM.check as u64,
827
    keys: crate::CrcKeysStorage::from_keys_fold_256(KEYS_1021_FORWARD),
828
};
829
830
pub const KEYS_8005_FORWARD: [u64; 23] = [
831
    0x0000000000000000,
832
    0x8663000000000000,
833
    0x8617000000000000,
834
    0x8665000000000000,
835
    0x8077000000000000,
836
    0x8663000000000000,
837
    0x807b000000000000,
838
    0x00000001fffbffe7,
839
    0x0000000180050000,
840
    0x6a7a000000000000,
841
    0x5ccb000000000000,
842
    0x006b000000000000,
843
    0xedb3000000000000,
844
    0xf997000000000000,
845
    0x8c47000000000000,
846
    0xbffa000000000000,
847
    0x861b000000000000,
848
    0xeac3000000000000,
849
    0xed6b000000000000,
850
    0xf557000000000000,
851
    0x806f000000000000,
852
    0xf337000000000000,
853
    0x867b000000000000,
854
];
855
856
pub const KEYS_8005_REFLECTED: [u64; 23] = [
857
    0x0000000000000000,
858
    0x0000000000018cc2,
859
    0x000000000001d0c2,
860
    0x0000000000014cc2,
861
    0x000000000001dc02,
862
    0x0000000000018cc2,
863
    0x000000000001bc02,
864
    0x00000001cfffbfff,
865
    0x0000000000014003,
866
    0x000000000000bcac,
867
    0x000000000001a674,
868
    0x000000000001ac00,
869
    0x0000000000019b6e,
870
    0x000000000001d33e,
871
    0x000000000001c462,
872
    0x000000000000bffa,
873
    0x000000000001b0c2,
874
    0x00000000000186ae,
875
    0x000000000001ad6e,
876
    0x000000000001d55e,
877
    0x000000000001ec02,
878
    0x000000000001d99e,
879
    0x000000000001bcc2,
880
];
881
882
pub const KEYS_C867_FORWARD: [u64; 23] = [
883
    0x0000000000000000,
884
    0x1473000000000000,
885
    0x7386000000000000,
886
    0x8388000000000000,
887
    0x1494000000000000,
888
    0x1473000000000000,
889
    0xb4eb000000000000,
890
    0x00000001bcf9ccb5,
891
    0x00000001c8670000,
892
    0x7b7c000000000000,
893
    0xe363000000000000,
894
    0x594f000000000000,
895
    0xd7bc000000000000,
896
    0x47ca000000000000,
897
    0x971e000000000000,
898
    0x6acb000000000000,
899
    0xbd49000000000000,
900
    0x9f17000000000000,
901
    0x1db5000000000000,
902
    0xd834000000000000,
903
    0x70c7000000000000,
904
    0xb010000000000000,
905
    0x7d8b000000000000,
906
];
907
908
pub const KEYS_0589_FORWARD: [u64; 23] = [
909
    0x0000000000000000,
910
    0xc2ee000000000000,
911
    0xf795000000000000,
912
    0x58e7000000000000,
913
    0x9aad000000000000,
914
    0xc2ee000000000000,
915
    0xa847000000000000,
916
    0x0000000105981d3f,
917
    0x0000000105890000,
918
    0x5230000000000000,
919
    0x3315000000000000,
920
    0xd59f000000000000,
921
    0x67c9000000000000,
922
    0x148c000000000000,
923
    0x4da7000000000000,
924
    0xf6c1000000000000,
925
    0x5890000000000000,
926
    0x0523000000000000,
927
    0xd0cf000000000000,
928
    0x7cd2000000000000,
929
    0x1624000000000000,
930
    0xf411000000000000,
931
    0x1d58000000000000,
932
];
933
934
pub const KEYS_3D65_REFLECTED: [u64; 23] = [
935
    0x0000000000000000,
936
    0x0000000000001612,
937
    0x0000000000004d8c,
938
    0x0000000000017d88,
939
    0x000000000001b860,
940
    0x0000000000001612,
941
    0x000000000000c2e8,
942
    0x00000000f81e8e39,
943
    0x0000000000014d79,
944
    0x000000000001b406,
945
    0x0000000000000400,
946
    0x000000000000c654,
947
    0x0000000000006f94,
948
    0x00000000000140ba,
949
    0x000000000000aa92,
950
    0x0000000000000020,
951
    0x00000000000058b2,
952
    0x000000000001c116,
953
    0x0000000000009664,
954
    0x0000000000015cfa,
955
    0x000000000001c458,
956
    0x000000000000cdc0,
957
    0x000000000000b470,
958
];
959
960
pub const KEYS_3D65_FORWARD: [u64; 23] = [
961
    0x0000000000000000,
962
    0x90d0000000000000,
963
    0x6364000000000000,
964
    0x237d000000000000,
965
    0x0c3b000000000000,
966
    0x90d0000000000000,
967
    0x2e86000000000000,
968
    0x0000000138e2f03e,
969
    0x000000013d650000,
970
    0xc05b000000000000,
971
    0x0040000000000000,
972
    0x54c6000000000000,
973
    0x53ec000000000000,
974
    0xba05000000000000,
975
    0x92aa000000000000,
976
    0x0800000000000000,
977
    0x9a34000000000000,
978
    0xd107000000000000,
979
    0x4cd2000000000000,
980
    0xbe75000000000000,
981
    0x3447000000000000,
982
    0x0766000000000000,
983
    0x1c5a000000000000,
984
];
985
986
pub const KEYS_1021_FORWARD: [u64; 23] = [
987
    0x0000000000000000,
988
    0xeb23000000000000,
989
    0x10e2000000000000,
990
    0xfa0d000000000000,
991
    0x36fb000000000000,
992
    0xeb23000000000000,
993
    0xaa51000000000000,
994
    0x0000000111303471,
995
    0x0000000110210000,
996
    0xf4e7000000000000,
997
    0x4347000000000000,
998
    0x15b7000000000000,
999
    0x9e3a000000000000,
1000
    0x8420000000000000,
1001
    0x9c1a000000000000,
1002
    0x9fe5000000000000,
1003
    0x78b3000000000000,
1004
    0xb8e0000000000000,
1005
    0xbd64000000000000,
1006
    0x45b4000000000000,
1007
    0x8ddc000000000000,
1008
    0x2093000000000000,
1009
    0x3f68000000000000,
1010
];
1011
1012
pub const KEYS_6F63_FORWARD: [u64; 23] = [
1013
    0x0000000000000000,
1014
    0xe601000000000000,
1015
    0xf83f000000000000,
1016
    0x29c0000000000000,
1017
    0xfa19000000000000,
1018
    0xe601000000000000,
1019
    0x4dd4000000000000,
1020
    0x000000017d0b9ecc,
1021
    0x000000016f630000,
1022
    0x5342000000000000,
1023
    0xa2b2000000000000,
1024
    0x14e0000000000000,
1025
    0xcabd000000000000,
1026
    0x29a1000000000000,
1027
    0x5159000000000000,
1028
    0x0a70000000000000,
1029
    0xd2ef000000000000,
1030
    0xa361000000000000,
1031
    0x9f1d000000000000,
1032
    0x0538000000000000,
1033
    0xdec6000000000000,
1034
    0x42c6000000000000,
1035
    0x0867000000000000,
1036
];
1037
1038
pub const KEYS_5935_FORWARD: [u64; 23] = [
1039
    0x0000000000000000,
1040
    0x0d0e000000000000,
1041
    0x5163000000000000,
1042
    0x1286000000000000,
1043
    0x1000000000000000,
1044
    0x0d0e000000000000,
1045
    0x5866000000000000,
1046
    0x000000014ce5c8be,
1047
    0x0000000159350000,
1048
    0xfb76000000000000,
1049
    0xdbdd000000000000,
1050
    0x250c000000000000,
1051
    0x2000000000000000,
1052
    0xafd9000000000000,
1053
    0xee8f000000000000,
1054
    0x4a18000000000000,
1055
    0x4000000000000000,
1056
    0x0687000000000000,
1057
    0x842b000000000000,
1058
    0x9430000000000000,
1059
    0x8000000000000000,
1060
    0xd0d9000000000000,
1061
    0x0100000000000000,
1062
];
1063
1064
pub const KEYS_080B_REFLECTED: [u64; 23] = [
1065
    0x0000000000000000,
1066
    0x000000000001986c,
1067
    0x0000000000006b98,
1068
    0x00000000000016a8,
1069
    0x0000000000011ef6,
1070
    0x000000000001986c,
1071
    0x00000000000170fa,
1072
    0x0000000180912421,
1073
    0x000000000001a021,
1074
    0x000000000001f852,
1075
    0x000000000001b176,
1076
    0x000000000000183c,
1077
    0x0000000000016ffc,
1078
    0x00000000000015f4,
1079
    0x0000000000003308,
1080
    0x00000000000018a4,
1081
    0x000000000000cd12,
1082
    0x0000000000010052,
1083
    0x000000000001faaa,
1084
    0x0000000000013e86,
1085
    0x0000000000009bc4,
1086
    0x0000000000005f3a,
1087
    0x000000000001c124,
1088
];
1089
1090
pub const KEYS_755B_FORWARD: [u64; 23] = [
1091
    0x0000000000000000,
1092
    0x0e5f000000000000,
1093
    0x21d3000000000000,
1094
    0x16bf000000000000,
1095
    0x8e20000000000000,
1096
    0x0e5f000000000000,
1097
    0x3c73000000000000,
1098
    0x0000000167c863d9,
1099
    0x00000001755b0000,
1100
    0xa8cb000000000000,
1101
    0x7562000000000000,
1102
    0x0f7d000000000000,
1103
    0x8c80000000000000,
1104
    0x6285000000000000,
1105
    0x8c37000000000000,
1106
    0x06a7000000000000,
1107
    0x937d000000000000,
1108
    0x9aac000000000000,
1109
    0xb5b7000000000000,
1110
    0xff2f000000000000,
1111
    0xf1df000000000000,
1112
    0x407d000000000000,
1113
    0x597e000000000000,
1114
];
1115
1116
pub const KEYS_1DCF_FORWARD: [u64; 23] = [
1117
    0x0000000000000000,
1118
    0x4ee2000000000000,
1119
    0x8462000000000000,
1120
    0xfe12000000000000,
1121
    0x2690000000000000,
1122
    0x4ee2000000000000,
1123
    0x19ae000000000000,
1124
    0x000000011c842752,
1125
    0x000000011dcf0000,
1126
    0xe047000000000000,
1127
    0x0ad2000000000000,
1128
    0x4c6c000000000000,
1129
    0xe7e9000000000000,
1130
    0x1940000000000000,
1131
    0x22a2000000000000,
1132
    0xaddd000000000000,
1133
    0x5fd5000000000000,
1134
    0x28c9000000000000,
1135
    0x6186000000000000,
1136
    0xeb76000000000000,
1137
    0x1db2000000000000,
1138
    0xa36b000000000000,
1139
    0x3557000000000000,
1140
];
1141
1142
pub const KEYS_A097_FORWARD: [u64; 23] = [
1143
    0x0000000000000000,
1144
    0x4c3f000000000000,
1145
    0xc8aa000000000000,
1146
    0x6e48000000000000,
1147
    0x6c83000000000000,
1148
    0x4c3f000000000000,
1149
    0xf15f000000000000,
1150
    0x00000001d31c0419,
1151
    0x00000001a0970000,
1152
    0x8cfa000000000000,
1153
    0x3a08000000000000,
1154
    0xff4f000000000000,
1155
    0x872c000000000000,
1156
    0xe3ac000000000000,
1157
    0x38d7000000000000,
1158
    0xd7ae000000000000,
1159
    0x5be1000000000000,
1160
    0xb5e1000000000000,
1161
    0x2a65000000000000,
1162
    0x2922000000000000,
1163
    0x7d9d000000000000,
1164
    0xf735000000000000,
1165
    0xb9e2000000000000,
1166
];
1167
1168
pub const KEYS_8BB7_FORWARD: [u64; 23] = [
1169
    0x0000000000000000,
1170
    0x2d56000000000000, // 2^(32* 3) mod Q << 32
1171
    0x06df000000000000, // 2^(32* 5) mod Q << 32
1172
    0x9d9d000000000000, // 2^(32*31) mod Q << 32
1173
    0x7cf5000000000000, // 2^(32*33) mod Q << 32
1174
    0x2d56000000000000, // 2^(32* 3) mod Q << 32
1175
    0x1368000000000000, // 2^(32* 2) mod Q << 32
1176
    0x00000001f65a57f8, // floor(2^64/Q)
1177
    0x000000018bb70000, // Q
1178
    0xceae000000000000, // 2^(32*27) mod Q << 32
1179
    0xbfd6000000000000, // 2^(32*29) mod Q << 32
1180
    0x1e16000000000000, // 2^(32*23) mod Q << 32
1181
    0x713c000000000000, // 2^(32*25) mod Q << 32
1182
    0xf7f9000000000000, // 2^(32*19) mod Q << 32
1183
    0x80a6000000000000, // 2^(32*21) mod Q << 32
1184
    0x044c000000000000, // 2^(32*15) mod Q << 32
1185
    0xe658000000000000, // 2^(32*17) mod Q << 32
1186
    0xad18000000000000, // 2^(32*11) mod Q << 32
1187
    0xa497000000000000, // 2^(32*13) mod Q << 32
1188
    0x6ee3000000000000, // 2^(32* 7) mod Q << 32
1189
    0xe7b5000000000000, // 2^(32* 9) mod Q << 32
1190
    0xdccf000000000000, // 2^(32*63) mod Q << 32 (256-byte folding)
1191
    0x4b0b000000000000, // 2^(32*65) mod Q << 32 (256-byte folding)
1192
];
1193
1194
pub const KEYS_1021_REVERSE: [u64; 23] = [
1195
    0x0000000000000000,
1196
    0x00000000000189ae, // (2^(32* 3) mod P(x))' << 1
1197
    0x0000000000008e10, // (2^(32* 5) mod P(x))' << 1
1198
    0x00000000000160be, // (2^(32*31) mod P(x))' << 1
1199
    0x000000000001bed8, // (2^(32*33) mod P(x))' << 1
1200
    0x00000000000189ae, // (2^(32* 3) mod P(x))' << 1
1201
    0x00000000000114aa, // (2^(32* 2) mod P(x))' << 1
1202
    0x000000011c581911, // (floor(2^64/P(x)))'
1203
    0x0000000000010811, // (P(x))'
1204
    0x000000000001ce5e, // (2^(32*27) mod P(x))' << 1
1205
    0x000000000001c584, // (2^(32*29) mod P(x))' << 1
1206
    0x000000000001db50, // (2^(32*23) mod P(x))' << 1
1207
    0x000000000000b8f2, // (2^(32*25) mod P(x))' << 1
1208
    0x0000000000000842, // (2^(32*19) mod P(x))' << 1
1209
    0x000000000000b072, // (2^(32*21) mod P(x))' << 1
1210
    0x0000000000014ff2, // (2^(32*15) mod P(x))' << 1
1211
    0x0000000000019a3c, // (2^(32*17) mod P(x))' << 1
1212
    0x0000000000000e3a, // (2^(32*11) mod P(x))' << 1
1213
    0x0000000000004d7a, // (2^(32*13) mod P(x))' << 1
1214
    0x0000000000005b44, // (2^(32* 7) mod P(x))' << 1
1215
    0x0000000000007762, // (2^(32* 9) mod P(x))' << 1
1216
    0x0000000000019208, // (2^(32*63) mod P(x))' << 1 (256-byte folding)
1217
    0x0000000000002df8, // (2^(32*65) mod P(x))' << 1 (256-byte folding)
1218
];