-
Notifications
You must be signed in to change notification settings - Fork 3
/
Operations.cs
590 lines (572 loc) · 53.2 KB
/
Operations.cs
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSA.Operations
{
public static class Operations
{
// byte array extention method for converting to UInt64
public static UInt64 ToUInt64(this byte[] bytea)
{
return BitConverter.ToUInt64(bytea, 0);
}
public static UInt64 CSAKeyPermuteBlock(UInt64 k)
{
#region kperm
UInt64[,] _kperm =
{
{
0x0000000000000000, 0x0000000000080000, 0x0000000008000000, 0x0000000008080000,
0x0080000000000000, 0x0080000000080000, 0x0080000008000000, 0x0080000008080000,
0x0000400000000000, 0x0000400000080000, 0x0000400008000000, 0x0000400008080000,
0x0080400000000000, 0x0080400000080000, 0x0080400008000000, 0x0080400008080000,
0x0000000000000002, 0x0000000000080002, 0x0000000008000002, 0x0000000008080002,
0x0080000000000002, 0x0080000000080002, 0x0080000008000002, 0x0080000008080002,
0x0000400000000002, 0x0000400000080002, 0x0000400008000002, 0x0000400008080002,
0x0080400000000002, 0x0080400000080002, 0x0080400008000002, 0x0080400008080002,
0x0000000000008000, 0x0000000000088000, 0x0000000008008000, 0x0000000008088000,
0x0080000000008000, 0x0080000000088000, 0x0080000008008000, 0x0080000008088000,
0x0000400000008000, 0x0000400000088000, 0x0000400008008000, 0x0000400008088000,
0x0080400000008000, 0x0080400000088000, 0x0080400008008000, 0x0080400008088000,
0x0000000000008002, 0x0000000000088002, 0x0000000008008002, 0x0000000008088002,
0x0080000000008002, 0x0080000000088002, 0x0080000008008002, 0x0080000008088002,
0x0000400000008002, 0x0000400000088002, 0x0000400008008002, 0x0000400008088002,
0x0080400000008002, 0x0080400000088002, 0x0080400008008002, 0x0080400008088002,
0x0000001000000000, 0x0000001000080000, 0x0000001008000000, 0x0000001008080000,
0x0080001000000000, 0x0080001000080000, 0x0080001008000000, 0x0080001008080000,
0x0000401000000000, 0x0000401000080000, 0x0000401008000000, 0x0000401008080000,
0x0080401000000000, 0x0080401000080000, 0x0080401008000000, 0x0080401008080000,
0x0000001000000002, 0x0000001000080002, 0x0000001008000002, 0x0000001008080002,
0x0080001000000002, 0x0080001000080002, 0x0080001008000002, 0x0080001008080002,
0x0000401000000002, 0x0000401000080002, 0x0000401008000002, 0x0000401008080002,
0x0080401000000002, 0x0080401000080002, 0x0080401008000002, 0x0080401008080002,
0x0000001000008000, 0x0000001000088000, 0x0000001008008000, 0x0000001008088000,
0x0080001000008000, 0x0080001000088000, 0x0080001008008000, 0x0080001008088000,
0x0000401000008000, 0x0000401000088000, 0x0000401008008000, 0x0000401008088000,
0x0080401000008000, 0x0080401000088000, 0x0080401008008000, 0x0080401008088000,
0x0000001000008002, 0x0000001000088002, 0x0000001008008002, 0x0000001008088002,
0x0080001000008002, 0x0080001000088002, 0x0080001008008002, 0x0080001008088002,
0x0000401000008002, 0x0000401000088002, 0x0000401008008002, 0x0000401008088002,
0x0080401000008002, 0x0080401000088002, 0x0080401008008002, 0x0080401008088002,
0x0000000000400000, 0x0000000000480000, 0x0000000008400000, 0x0000000008480000,
0x0080000000400000, 0x0080000000480000, 0x0080000008400000, 0x0080000008480000,
0x0000400000400000, 0x0000400000480000, 0x0000400008400000, 0x0000400008480000,
0x0080400000400000, 0x0080400000480000, 0x0080400008400000, 0x0080400008480000,
0x0000000000400002, 0x0000000000480002, 0x0000000008400002, 0x0000000008480002,
0x0080000000400002, 0x0080000000480002, 0x0080000008400002, 0x0080000008480002,
0x0000400000400002, 0x0000400000480002, 0x0000400008400002, 0x0000400008480002,
0x0080400000400002, 0x0080400000480002, 0x0080400008400002, 0x0080400008480002,
0x0000000000408000, 0x0000000000488000, 0x0000000008408000, 0x0000000008488000,
0x0080000000408000, 0x0080000000488000, 0x0080000008408000, 0x0080000008488000,
0x0000400000408000, 0x0000400000488000, 0x0000400008408000, 0x0000400008488000,
0x0080400000408000, 0x0080400000488000, 0x0080400008408000, 0x0080400008488000,
0x0000000000408002, 0x0000000000488002, 0x0000000008408002, 0x0000000008488002,
0x0080000000408002, 0x0080000000488002, 0x0080000008408002, 0x0080000008488002,
0x0000400000408002, 0x0000400000488002, 0x0000400008408002, 0x0000400008488002,
0x0080400000408002, 0x0080400000488002, 0x0080400008408002, 0x0080400008488002,
0x0000001000400000, 0x0000001000480000, 0x0000001008400000, 0x0000001008480000,
0x0080001000400000, 0x0080001000480000, 0x0080001008400000, 0x0080001008480000,
0x0000401000400000, 0x0000401000480000, 0x0000401008400000, 0x0000401008480000,
0x0080401000400000, 0x0080401000480000, 0x0080401008400000, 0x0080401008480000,
0x0000001000400002, 0x0000001000480002, 0x0000001008400002, 0x0000001008480002,
0x0080001000400002, 0x0080001000480002, 0x0080001008400002, 0x0080001008480002,
0x0000401000400002, 0x0000401000480002, 0x0000401008400002, 0x0000401008480002,
0x0080401000400002, 0x0080401000480002, 0x0080401008400002, 0x0080401008480002,
0x0000001000408000, 0x0000001000488000, 0x0000001008408000, 0x0000001008488000,
0x0080001000408000, 0x0080001000488000, 0x0080001008408000, 0x0080001008488000,
0x0000401000408000, 0x0000401000488000, 0x0000401008408000, 0x0000401008488000,
0x0080401000408000, 0x0080401000488000, 0x0080401008408000, 0x0080401008488000,
0x0000001000408002, 0x0000001000488002, 0x0000001008408002, 0x0000001008488002,
0x0080001000408002, 0x0080001000488002, 0x0080001008408002, 0x0080001008488002,
0x0000401000408002, 0x0000401000488002, 0x0000401008408002, 0x0000401008488002,
0x0080401000408002, 0x0080401000488002, 0x0080401008408002, 0x0080401008488002,
},
{
0x0000000000000000, 0x0100000000000000, 0x2000000000000000, 0x2100000000000000,
0x0000008000000000, 0x0100008000000000, 0x2000008000000000, 0x2100008000000000,
0x0000000000200000, 0x0100000000200000, 0x2000000000200000, 0x2100000000200000,
0x0000008000200000, 0x0100008000200000, 0x2000008000200000, 0x2100008000200000,
0x0040000000000000, 0x0140000000000000, 0x2040000000000000, 0x2140000000000000,
0x0040008000000000, 0x0140008000000000, 0x2040008000000000, 0x2140008000000000,
0x0040000000200000, 0x0140000000200000, 0x2040000000200000, 0x2140000000200000,
0x0040008000200000, 0x0140008000200000, 0x2040008000200000, 0x2140008000200000,
0x0400000000000000, 0x0500000000000000, 0x2400000000000000, 0x2500000000000000,
0x0400008000000000, 0x0500008000000000, 0x2400008000000000, 0x2500008000000000,
0x0400000000200000, 0x0500000000200000, 0x2400000000200000, 0x2500000000200000,
0x0400008000200000, 0x0500008000200000, 0x2400008000200000, 0x2500008000200000,
0x0440000000000000, 0x0540000000000000, 0x2440000000000000, 0x2540000000000000,
0x0440008000000000, 0x0540008000000000, 0x2440008000000000, 0x2540008000000000,
0x0440000000200000, 0x0540000000200000, 0x2440000000200000, 0x2540000000200000,
0x0440008000200000, 0x0540008000200000, 0x2440008000200000, 0x2540008000200000,
0x0004000000000000, 0x0104000000000000, 0x2004000000000000, 0x2104000000000000,
0x0004008000000000, 0x0104008000000000, 0x2004008000000000, 0x2104008000000000,
0x0004000000200000, 0x0104000000200000, 0x2004000000200000, 0x2104000000200000,
0x0004008000200000, 0x0104008000200000, 0x2004008000200000, 0x2104008000200000,
0x0044000000000000, 0x0144000000000000, 0x2044000000000000, 0x2144000000000000,
0x0044008000000000, 0x0144008000000000, 0x2044008000000000, 0x2144008000000000,
0x0044000000200000, 0x0144000000200000, 0x2044000000200000, 0x2144000000200000,
0x0044008000200000, 0x0144008000200000, 0x2044008000200000, 0x2144008000200000,
0x0404000000000000, 0x0504000000000000, 0x2404000000000000, 0x2504000000000000,
0x0404008000000000, 0x0504008000000000, 0x2404008000000000, 0x2504008000000000,
0x0404000000200000, 0x0504000000200000, 0x2404000000200000, 0x2504000000200000,
0x0404008000200000, 0x0504008000200000, 0x2404008000200000, 0x2504008000200000,
0x0444000000000000, 0x0544000000000000, 0x2444000000000000, 0x2544000000000000,
0x0444008000000000, 0x0544008000000000, 0x2444008000000000, 0x2544008000000000,
0x0444000000200000, 0x0544000000200000, 0x2444000000200000, 0x2544000000200000,
0x0444008000200000, 0x0544008000200000, 0x2444008000200000, 0x2544008000200000,
0x0000000010000000, 0x0100000010000000, 0x2000000010000000, 0x2100000010000000,
0x0000008010000000, 0x0100008010000000, 0x2000008010000000, 0x2100008010000000,
0x0000000010200000, 0x0100000010200000, 0x2000000010200000, 0x2100000010200000,
0x0000008010200000, 0x0100008010200000, 0x2000008010200000, 0x2100008010200000,
0x0040000010000000, 0x0140000010000000, 0x2040000010000000, 0x2140000010000000,
0x0040008010000000, 0x0140008010000000, 0x2040008010000000, 0x2140008010000000,
0x0040000010200000, 0x0140000010200000, 0x2040000010200000, 0x2140000010200000,
0x0040008010200000, 0x0140008010200000, 0x2040008010200000, 0x2140008010200000,
0x0400000010000000, 0x0500000010000000, 0x2400000010000000, 0x2500000010000000,
0x0400008010000000, 0x0500008010000000, 0x2400008010000000, 0x2500008010000000,
0x0400000010200000, 0x0500000010200000, 0x2400000010200000, 0x2500000010200000,
0x0400008010200000, 0x0500008010200000, 0x2400008010200000, 0x2500008010200000,
0x0440000010000000, 0x0540000010000000, 0x2440000010000000, 0x2540000010000000,
0x0440008010000000, 0x0540008010000000, 0x2440008010000000, 0x2540008010000000,
0x0440000010200000, 0x0540000010200000, 0x2440000010200000, 0x2540000010200000,
0x0440008010200000, 0x0540008010200000, 0x2440008010200000, 0x2540008010200000,
0x0004000010000000, 0x0104000010000000, 0x2004000010000000, 0x2104000010000000,
0x0004008010000000, 0x0104008010000000, 0x2004008010000000, 0x2104008010000000,
0x0004000010200000, 0x0104000010200000, 0x2004000010200000, 0x2104000010200000,
0x0004008010200000, 0x0104008010200000, 0x2004008010200000, 0x2104008010200000,
0x0044000010000000, 0x0144000010000000, 0x2044000010000000, 0x2144000010000000,
0x0044008010000000, 0x0144008010000000, 0x2044008010000000, 0x2144008010000000,
0x0044000010200000, 0x0144000010200000, 0x2044000010200000, 0x2144000010200000,
0x0044008010200000, 0x0144008010200000, 0x2044008010200000, 0x2144008010200000,
0x0404000010000000, 0x0504000010000000, 0x2404000010000000, 0x2504000010000000,
0x0404008010000000, 0x0504008010000000, 0x2404008010000000, 0x2504008010000000,
0x0404000010200000, 0x0504000010200000, 0x2404000010200000, 0x2504000010200000,
0x0404008010200000, 0x0504008010200000, 0x2404008010200000, 0x2504008010200000,
0x0444000010000000, 0x0544000010000000, 0x2444000010000000, 0x2544000010000000,
0x0444008010000000, 0x0544008010000000, 0x2444008010000000, 0x2544008010000000,
0x0444000010200000, 0x0544000010200000, 0x2444000010200000, 0x2544000010200000,
0x0444008010200000, 0x0544008010200000, 0x2444008010200000, 0x2544008010200000,
},
{
0x0000000000000000, 0x0000000000000080, 0x0000000020000000, 0x0000000020000080,
0x0008000000000000, 0x0008000000000080, 0x0008000020000000, 0x0008000020000080,
0x0000000000000040, 0x00000000000000c0, 0x0000000020000040, 0x00000000200000c0,
0x0008000000000040, 0x00080000000000c0, 0x0008000020000040, 0x00080000200000c0,
0x0000000200000000, 0x0000000200000080, 0x0000000220000000, 0x0000000220000080,
0x0008000200000000, 0x0008000200000080, 0x0008000220000000, 0x0008000220000080,
0x0000000200000040, 0x00000002000000c0, 0x0000000220000040, 0x00000002200000c0,
0x0008000200000040, 0x00080002000000c0, 0x0008000220000040, 0x00080002200000c0,
0x0000000800000000, 0x0000000800000080, 0x0000000820000000, 0x0000000820000080,
0x0008000800000000, 0x0008000800000080, 0x0008000820000000, 0x0008000820000080,
0x0000000800000040, 0x00000008000000c0, 0x0000000820000040, 0x00000008200000c0,
0x0008000800000040, 0x00080008000000c0, 0x0008000820000040, 0x00080008200000c0,
0x0000000a00000000, 0x0000000a00000080, 0x0000000a20000000, 0x0000000a20000080,
0x0008000a00000000, 0x0008000a00000080, 0x0008000a20000000, 0x0008000a20000080,
0x0000000a00000040, 0x0000000a000000c0, 0x0000000a20000040, 0x0000000a200000c0,
0x0008000a00000040, 0x0008000a000000c0, 0x0008000a20000040, 0x0008000a200000c0,
0x0000000000100000, 0x0000000000100080, 0x0000000020100000, 0x0000000020100080,
0x0008000000100000, 0x0008000000100080, 0x0008000020100000, 0x0008000020100080,
0x0000000000100040, 0x00000000001000c0, 0x0000000020100040, 0x00000000201000c0,
0x0008000000100040, 0x00080000001000c0, 0x0008000020100040, 0x00080000201000c0,
0x0000000200100000, 0x0000000200100080, 0x0000000220100000, 0x0000000220100080,
0x0008000200100000, 0x0008000200100080, 0x0008000220100000, 0x0008000220100080,
0x0000000200100040, 0x00000002001000c0, 0x0000000220100040, 0x00000002201000c0,
0x0008000200100040, 0x00080002001000c0, 0x0008000220100040, 0x00080002201000c0,
0x0000000800100000, 0x0000000800100080, 0x0000000820100000, 0x0000000820100080,
0x0008000800100000, 0x0008000800100080, 0x0008000820100000, 0x0008000820100080,
0x0000000800100040, 0x00000008001000c0, 0x0000000820100040, 0x00000008201000c0,
0x0008000800100040, 0x00080008001000c0, 0x0008000820100040, 0x00080008201000c0,
0x0000000a00100000, 0x0000000a00100080, 0x0000000a20100000, 0x0000000a20100080,
0x0008000a00100000, 0x0008000a00100080, 0x0008000a20100000, 0x0008000a20100080,
0x0000000a00100040, 0x0000000a001000c0, 0x0000000a20100040, 0x0000000a201000c0,
0x0008000a00100040, 0x0008000a001000c0, 0x0008000a20100040, 0x0008000a201000c0,
0x0000000000010000, 0x0000000000010080, 0x0000000020010000, 0x0000000020010080,
0x0008000000010000, 0x0008000000010080, 0x0008000020010000, 0x0008000020010080,
0x0000000000010040, 0x00000000000100c0, 0x0000000020010040, 0x00000000200100c0,
0x0008000000010040, 0x00080000000100c0, 0x0008000020010040, 0x00080000200100c0,
0x0000000200010000, 0x0000000200010080, 0x0000000220010000, 0x0000000220010080,
0x0008000200010000, 0x0008000200010080, 0x0008000220010000, 0x0008000220010080,
0x0000000200010040, 0x00000002000100c0, 0x0000000220010040, 0x00000002200100c0,
0x0008000200010040, 0x00080002000100c0, 0x0008000220010040, 0x00080002200100c0,
0x0000000800010000, 0x0000000800010080, 0x0000000820010000, 0x0000000820010080,
0x0008000800010000, 0x0008000800010080, 0x0008000820010000, 0x0008000820010080,
0x0000000800010040, 0x00000008000100c0, 0x0000000820010040, 0x00000008200100c0,
0x0008000800010040, 0x00080008000100c0, 0x0008000820010040, 0x00080008200100c0,
0x0000000a00010000, 0x0000000a00010080, 0x0000000a20010000, 0x0000000a20010080,
0x0008000a00010000, 0x0008000a00010080, 0x0008000a20010000, 0x0008000a20010080,
0x0000000a00010040, 0x0000000a000100c0, 0x0000000a20010040, 0x0000000a200100c0,
0x0008000a00010040, 0x0008000a000100c0, 0x0008000a20010040, 0x0008000a200100c0,
0x0000000000110000, 0x0000000000110080, 0x0000000020110000, 0x0000000020110080,
0x0008000000110000, 0x0008000000110080, 0x0008000020110000, 0x0008000020110080,
0x0000000000110040, 0x00000000001100c0, 0x0000000020110040, 0x00000000201100c0,
0x0008000000110040, 0x00080000001100c0, 0x0008000020110040, 0x00080000201100c0,
0x0000000200110000, 0x0000000200110080, 0x0000000220110000, 0x0000000220110080,
0x0008000200110000, 0x0008000200110080, 0x0008000220110000, 0x0008000220110080,
0x0000000200110040, 0x00000002001100c0, 0x0000000220110040, 0x00000002201100c0,
0x0008000200110040, 0x00080002001100c0, 0x0008000220110040, 0x00080002201100c0,
0x0000000800110000, 0x0000000800110080, 0x0000000820110000, 0x0000000820110080,
0x0008000800110000, 0x0008000800110080, 0x0008000820110000, 0x0008000820110080,
0x0000000800110040, 0x00000008001100c0, 0x0000000820110040, 0x00000008201100c0,
0x0008000800110040, 0x00080008001100c0, 0x0008000820110040, 0x00080008201100c0,
0x0000000a00110000, 0x0000000a00110080, 0x0000000a20110000, 0x0000000a20110080,
0x0008000a00110000, 0x0008000a00110080, 0x0008000a20110000, 0x0008000a20110080,
0x0000000a00110040, 0x0000000a001100c0, 0x0000000a20110040, 0x0000000a201100c0,
0x0008000a00110040, 0x0008000a001100c0, 0x0008000a20110040, 0x0008000a201100c0,
},
{
0x0000000000000000, 0x0000800000000000, 0x0000000040000000, 0x0000800040000000,
0x0000000100000000, 0x0000800100000000, 0x0000000140000000, 0x0000800140000000,
0x8000000000000000, 0x8000800000000000, 0x8000000040000000, 0x8000800040000000,
0x8000000100000000, 0x8000800100000000, 0x8000000140000000, 0x8000800140000000,
0x0000000000000400, 0x0000800000000400, 0x0000000040000400, 0x0000800040000400,
0x0000000100000400, 0x0000800100000400, 0x0000000140000400, 0x0000800140000400,
0x8000000000000400, 0x8000800000000400, 0x8000000040000400, 0x8000800040000400,
0x8000000100000400, 0x8000800100000400, 0x8000000140000400, 0x8000800140000400,
0x0000000000000800, 0x0000800000000800, 0x0000000040000800, 0x0000800040000800,
0x0000000100000800, 0x0000800100000800, 0x0000000140000800, 0x0000800140000800,
0x8000000000000800, 0x8000800000000800, 0x8000000040000800, 0x8000800040000800,
0x8000000100000800, 0x8000800100000800, 0x8000000140000800, 0x8000800140000800,
0x0000000000000c00, 0x0000800000000c00, 0x0000000040000c00, 0x0000800040000c00,
0x0000000100000c00, 0x0000800100000c00, 0x0000000140000c00, 0x0000800140000c00,
0x8000000000000c00, 0x8000800000000c00, 0x8000000040000c00, 0x8000800040000c00,
0x8000000100000c00, 0x8000800100000c00, 0x8000000140000c00, 0x8000800140000c00,
0x0000000000000010, 0x0000800000000010, 0x0000000040000010, 0x0000800040000010,
0x0000000100000010, 0x0000800100000010, 0x0000000140000010, 0x0000800140000010,
0x8000000000000010, 0x8000800000000010, 0x8000000040000010, 0x8000800040000010,
0x8000000100000010, 0x8000800100000010, 0x8000000140000010, 0x8000800140000010,
0x0000000000000410, 0x0000800000000410, 0x0000000040000410, 0x0000800040000410,
0x0000000100000410, 0x0000800100000410, 0x0000000140000410, 0x0000800140000410,
0x8000000000000410, 0x8000800000000410, 0x8000000040000410, 0x8000800040000410,
0x8000000100000410, 0x8000800100000410, 0x8000000140000410, 0x8000800140000410,
0x0000000000000810, 0x0000800000000810, 0x0000000040000810, 0x0000800040000810,
0x0000000100000810, 0x0000800100000810, 0x0000000140000810, 0x0000800140000810,
0x8000000000000810, 0x8000800000000810, 0x8000000040000810, 0x8000800040000810,
0x8000000100000810, 0x8000800100000810, 0x8000000140000810, 0x8000800140000810,
0x0000000000000c10, 0x0000800000000c10, 0x0000000040000c10, 0x0000800040000c10,
0x0000000100000c10, 0x0000800100000c10, 0x0000000140000c10, 0x0000800140000c10,
0x8000000000000c10, 0x8000800000000c10, 0x8000000040000c10, 0x8000800040000c10,
0x8000000100000c10, 0x8000800100000c10, 0x8000000140000c10, 0x8000800140000c10,
0x0000004000000000, 0x0000804000000000, 0x0000004040000000, 0x0000804040000000,
0x0000004100000000, 0x0000804100000000, 0x0000004140000000, 0x0000804140000000,
0x8000004000000000, 0x8000804000000000, 0x8000004040000000, 0x8000804040000000,
0x8000004100000000, 0x8000804100000000, 0x8000004140000000, 0x8000804140000000,
0x0000004000000400, 0x0000804000000400, 0x0000004040000400, 0x0000804040000400,
0x0000004100000400, 0x0000804100000400, 0x0000004140000400, 0x0000804140000400,
0x8000004000000400, 0x8000804000000400, 0x8000004040000400, 0x8000804040000400,
0x8000004100000400, 0x8000804100000400, 0x8000004140000400, 0x8000804140000400,
0x0000004000000800, 0x0000804000000800, 0x0000004040000800, 0x0000804040000800,
0x0000004100000800, 0x0000804100000800, 0x0000004140000800, 0x0000804140000800,
0x8000004000000800, 0x8000804000000800, 0x8000004040000800, 0x8000804040000800,
0x8000004100000800, 0x8000804100000800, 0x8000004140000800, 0x8000804140000800,
0x0000004000000c00, 0x0000804000000c00, 0x0000004040000c00, 0x0000804040000c00,
0x0000004100000c00, 0x0000804100000c00, 0x0000004140000c00, 0x0000804140000c00,
0x8000004000000c00, 0x8000804000000c00, 0x8000004040000c00, 0x8000804040000c00,
0x8000004100000c00, 0x8000804100000c00, 0x8000004140000c00, 0x8000804140000c00,
0x0000004000000010, 0x0000804000000010, 0x0000004040000010, 0x0000804040000010,
0x0000004100000010, 0x0000804100000010, 0x0000004140000010, 0x0000804140000010,
0x8000004000000010, 0x8000804000000010, 0x8000004040000010, 0x8000804040000010,
0x8000004100000010, 0x8000804100000010, 0x8000004140000010, 0x8000804140000010,
0x0000004000000410, 0x0000804000000410, 0x0000004040000410, 0x0000804040000410,
0x0000004100000410, 0x0000804100000410, 0x0000004140000410, 0x0000804140000410,
0x8000004000000410, 0x8000804000000410, 0x8000004040000410, 0x8000804040000410,
0x8000004100000410, 0x8000804100000410, 0x8000004140000410, 0x8000804140000410,
0x0000004000000810, 0x0000804000000810, 0x0000004040000810, 0x0000804040000810,
0x0000004100000810, 0x0000804100000810, 0x0000004140000810, 0x0000804140000810,
0x8000004000000810, 0x8000804000000810, 0x8000004040000810, 0x8000804040000810,
0x8000004100000810, 0x8000804100000810, 0x8000004140000810, 0x8000804140000810,
0x0000004000000c10, 0x0000804000000c10, 0x0000004040000c10, 0x0000804040000c10,
0x0000004100000c10, 0x0000804100000c10, 0x0000004140000c10, 0x0000804140000c10,
0x8000004000000c10, 0x8000804000000c10, 0x8000004040000c10, 0x8000804040000c10,
0x8000004100000c10, 0x8000804100000c10, 0x8000004140000c10, 0x8000804140000c10,
},
{
0x0000000000000000, 0x4000000000000000, 0x0000000004000000, 0x4000000004000000,
0x0000010000000000, 0x4000010000000000, 0x0000010004000000, 0x4000010004000000,
0x0000000000040000, 0x4000000000040000, 0x0000000004040000, 0x4000000004040000,
0x0000010000040000, 0x4000010000040000, 0x0000010004040000, 0x4000010004040000,
0x0000000000001000, 0x4000000000001000, 0x0000000004001000, 0x4000000004001000,
0x0000010000001000, 0x4000010000001000, 0x0000010004001000, 0x4000010004001000,
0x0000000000041000, 0x4000000000041000, 0x0000000004041000, 0x4000000004041000,
0x0000010000041000, 0x4000010000041000, 0x0000010004041000, 0x4000010004041000,
0x0010000000000000, 0x4010000000000000, 0x0010000004000000, 0x4010000004000000,
0x0010010000000000, 0x4010010000000000, 0x0010010004000000, 0x4010010004000000,
0x0010000000040000, 0x4010000000040000, 0x0010000004040000, 0x4010000004040000,
0x0010010000040000, 0x4010010000040000, 0x0010010004040000, 0x4010010004040000,
0x0010000000001000, 0x4010000000001000, 0x0010000004001000, 0x4010000004001000,
0x0010010000001000, 0x4010010000001000, 0x0010010004001000, 0x4010010004001000,
0x0010000000041000, 0x4010000000041000, 0x0010000004041000, 0x4010000004041000,
0x0010010000041000, 0x4010010000041000, 0x0010010004041000, 0x4010010004041000,
0x0000002000000000, 0x4000002000000000, 0x0000002004000000, 0x4000002004000000,
0x0000012000000000, 0x4000012000000000, 0x0000012004000000, 0x4000012004000000,
0x0000002000040000, 0x4000002000040000, 0x0000002004040000, 0x4000002004040000,
0x0000012000040000, 0x4000012000040000, 0x0000012004040000, 0x4000012004040000,
0x0000002000001000, 0x4000002000001000, 0x0000002004001000, 0x4000002004001000,
0x0000012000001000, 0x4000012000001000, 0x0000012004001000, 0x4000012004001000,
0x0000002000041000, 0x4000002000041000, 0x0000002004041000, 0x4000002004041000,
0x0000012000041000, 0x4000012000041000, 0x0000012004041000, 0x4000012004041000,
0x0010002000000000, 0x4010002000000000, 0x0010002004000000, 0x4010002004000000,
0x0010012000000000, 0x4010012000000000, 0x0010012004000000, 0x4010012004000000,
0x0010002000040000, 0x4010002000040000, 0x0010002004040000, 0x4010002004040000,
0x0010012000040000, 0x4010012000040000, 0x0010012004040000, 0x4010012004040000,
0x0010002000001000, 0x4010002000001000, 0x0010002004001000, 0x4010002004001000,
0x0010012000001000, 0x4010012000001000, 0x0010012004001000, 0x4010012004001000,
0x0010002000041000, 0x4010002000041000, 0x0010002004041000, 0x4010002004041000,
0x0010012000041000, 0x4010012000041000, 0x0010012004041000, 0x4010012004041000,
0x0020000000000000, 0x4020000000000000, 0x0020000004000000, 0x4020000004000000,
0x0020010000000000, 0x4020010000000000, 0x0020010004000000, 0x4020010004000000,
0x0020000000040000, 0x4020000000040000, 0x0020000004040000, 0x4020000004040000,
0x0020010000040000, 0x4020010000040000, 0x0020010004040000, 0x4020010004040000,
0x0020000000001000, 0x4020000000001000, 0x0020000004001000, 0x4020000004001000,
0x0020010000001000, 0x4020010000001000, 0x0020010004001000, 0x4020010004001000,
0x0020000000041000, 0x4020000000041000, 0x0020000004041000, 0x4020000004041000,
0x0020010000041000, 0x4020010000041000, 0x0020010004041000, 0x4020010004041000,
0x0030000000000000, 0x4030000000000000, 0x0030000004000000, 0x4030000004000000,
0x0030010000000000, 0x4030010000000000, 0x0030010004000000, 0x4030010004000000,
0x0030000000040000, 0x4030000000040000, 0x0030000004040000, 0x4030000004040000,
0x0030010000040000, 0x4030010000040000, 0x0030010004040000, 0x4030010004040000,
0x0030000000001000, 0x4030000000001000, 0x0030000004001000, 0x4030000004001000,
0x0030010000001000, 0x4030010000001000, 0x0030010004001000, 0x4030010004001000,
0x0030000000041000, 0x4030000000041000, 0x0030000004041000, 0x4030000004041000,
0x0030010000041000, 0x4030010000041000, 0x0030010004041000, 0x4030010004041000,
0x0020002000000000, 0x4020002000000000, 0x0020002004000000, 0x4020002004000000,
0x0020012000000000, 0x4020012000000000, 0x0020012004000000, 0x4020012004000000,
0x0020002000040000, 0x4020002000040000, 0x0020002004040000, 0x4020002004040000,
0x0020012000040000, 0x4020012000040000, 0x0020012004040000, 0x4020012004040000,
0x0020002000001000, 0x4020002000001000, 0x0020002004001000, 0x4020002004001000,
0x0020012000001000, 0x4020012000001000, 0x0020012004001000, 0x4020012004001000,
0x0020002000041000, 0x4020002000041000, 0x0020002004041000, 0x4020002004041000,
0x0020012000041000, 0x4020012000041000, 0x0020012004041000, 0x4020012004041000,
0x0030002000000000, 0x4030002000000000, 0x0030002004000000, 0x4030002004000000,
0x0030012000000000, 0x4030012000000000, 0x0030012004000000, 0x4030012004000000,
0x0030002000040000, 0x4030002000040000, 0x0030002004040000, 0x4030002004040000,
0x0030012000040000, 0x4030012000040000, 0x0030012004040000, 0x4030012004040000,
0x0030002000001000, 0x4030002000001000, 0x0030002004001000, 0x4030002004001000,
0x0030012000001000, 0x4030012000001000, 0x0030012004001000, 0x4030012004001000,
0x0030002000041000, 0x4030002000041000, 0x0030002004041000, 0x4030002004041000,
0x0030012000041000, 0x4030012000041000, 0x0030012004041000, 0x4030012004041000,
},
{
0x0000000000000000, 0x0000000000800000, 0x0800000000000000, 0x0800000000800000,
0x0000020000000000, 0x0000020000800000, 0x0800020000000000, 0x0800020000800000,
0x0000000000020000, 0x0000000000820000, 0x0800000000020000, 0x0800000000820000,
0x0000020000020000, 0x0000020000820000, 0x0800020000020000, 0x0800020000820000,
0x0000000080000000, 0x0000000080800000, 0x0800000080000000, 0x0800000080800000,
0x0000020080000000, 0x0000020080800000, 0x0800020080000000, 0x0800020080800000,
0x0000000080020000, 0x0000000080820000, 0x0800000080020000, 0x0800000080820000,
0x0000020080020000, 0x0000020080820000, 0x0800020080020000, 0x0800020080820000,
0x0000000000000001, 0x0000000000800001, 0x0800000000000001, 0x0800000000800001,
0x0000020000000001, 0x0000020000800001, 0x0800020000000001, 0x0800020000800001,
0x0000000000020001, 0x0000000000820001, 0x0800000000020001, 0x0800000000820001,
0x0000020000020001, 0x0000020000820001, 0x0800020000020001, 0x0800020000820001,
0x0000000080000001, 0x0000000080800001, 0x0800000080000001, 0x0800000080800001,
0x0000020080000001, 0x0000020080800001, 0x0800020080000001, 0x0800020080800001,
0x0000000080020001, 0x0000000080820001, 0x0800000080020001, 0x0800000080820001,
0x0000020080020001, 0x0000020080820001, 0x0800020080020001, 0x0800020080820001,
0x0000000002000000, 0x0000000002800000, 0x0800000002000000, 0x0800000002800000,
0x0000020002000000, 0x0000020002800000, 0x0800020002000000, 0x0800020002800000,
0x0000000002020000, 0x0000000002820000, 0x0800000002020000, 0x0800000002820000,
0x0000020002020000, 0x0000020002820000, 0x0800020002020000, 0x0800020002820000,
0x0000000082000000, 0x0000000082800000, 0x0800000082000000, 0x0800000082800000,
0x0000020082000000, 0x0000020082800000, 0x0800020082000000, 0x0800020082800000,
0x0000000082020000, 0x0000000082820000, 0x0800000082020000, 0x0800000082820000,
0x0000020082020000, 0x0000020082820000, 0x0800020082020000, 0x0800020082820000,
0x0000000002000001, 0x0000000002800001, 0x0800000002000001, 0x0800000002800001,
0x0000020002000001, 0x0000020002800001, 0x0800020002000001, 0x0800020002800001,
0x0000000002020001, 0x0000000002820001, 0x0800000002020001, 0x0800000002820001,
0x0000020002020001, 0x0000020002820001, 0x0800020002020001, 0x0800020002820001,
0x0000000082000001, 0x0000000082800001, 0x0800000082000001, 0x0800000082800001,
0x0000020082000001, 0x0000020082800001, 0x0800020082000001, 0x0800020082800001,
0x0000000082020001, 0x0000000082820001, 0x0800000082020001, 0x0800000082820001,
0x0000020082020001, 0x0000020082820001, 0x0800020082020001, 0x0800020082820001,
0x0000080000000000, 0x0000080000800000, 0x0800080000000000, 0x0800080000800000,
0x00000a0000000000, 0x00000a0000800000, 0x08000a0000000000, 0x08000a0000800000,
0x0000080000020000, 0x0000080000820000, 0x0800080000020000, 0x0800080000820000,
0x00000a0000020000, 0x00000a0000820000, 0x08000a0000020000, 0x08000a0000820000,
0x0000080080000000, 0x0000080080800000, 0x0800080080000000, 0x0800080080800000,
0x00000a0080000000, 0x00000a0080800000, 0x08000a0080000000, 0x08000a0080800000,
0x0000080080020000, 0x0000080080820000, 0x0800080080020000, 0x0800080080820000,
0x00000a0080020000, 0x00000a0080820000, 0x08000a0080020000, 0x08000a0080820000,
0x0000080000000001, 0x0000080000800001, 0x0800080000000001, 0x0800080000800001,
0x00000a0000000001, 0x00000a0000800001, 0x08000a0000000001, 0x08000a0000800001,
0x0000080000020001, 0x0000080000820001, 0x0800080000020001, 0x0800080000820001,
0x00000a0000020001, 0x00000a0000820001, 0x08000a0000020001, 0x08000a0000820001,
0x0000080080000001, 0x0000080080800001, 0x0800080080000001, 0x0800080080800001,
0x00000a0080000001, 0x00000a0080800001, 0x08000a0080000001, 0x08000a0080800001,
0x0000080080020001, 0x0000080080820001, 0x0800080080020001, 0x0800080080820001,
0x00000a0080020001, 0x00000a0080820001, 0x08000a0080020001, 0x08000a0080820001,
0x0000080002000000, 0x0000080002800000, 0x0800080002000000, 0x0800080002800000,
0x00000a0002000000, 0x00000a0002800000, 0x08000a0002000000, 0x08000a0002800000,
0x0000080002020000, 0x0000080002820000, 0x0800080002020000, 0x0800080002820000,
0x00000a0002020000, 0x00000a0002820000, 0x08000a0002020000, 0x08000a0002820000,
0x0000080082000000, 0x0000080082800000, 0x0800080082000000, 0x0800080082800000,
0x00000a0082000000, 0x00000a0082800000, 0x08000a0082000000, 0x08000a0082800000,
0x0000080082020000, 0x0000080082820000, 0x0800080082020000, 0x0800080082820000,
0x00000a0082020000, 0x00000a0082820000, 0x08000a0082020000, 0x08000a0082820000,
0x0000080002000001, 0x0000080002800001, 0x0800080002000001, 0x0800080002800001,
0x00000a0002000001, 0x00000a0002800001, 0x08000a0002000001, 0x08000a0002800001,
0x0000080002020001, 0x0000080002820001, 0x0800080002020001, 0x0800080002820001,
0x00000a0002020001, 0x00000a0002820001, 0x08000a0002020001, 0x08000a0002820001,
0x0000080082000001, 0x0000080082800001, 0x0800080082000001, 0x0800080082800001,
0x00000a0082000001, 0x00000a0082800001, 0x08000a0082000001, 0x08000a0082800001,
0x0000080082020001, 0x0000080082820001, 0x0800080082020001, 0x0800080082820001,
0x00000a0082020001, 0x00000a0082820001, 0x08000a0082020001, 0x08000a0082820001,
},
{
0x0000000000000000, 0x0000100000000000, 0x0000000000004000, 0x0000100000004000,
0x0000000000000004, 0x0000100000000004, 0x0000000000004004, 0x0000100000004004,
0x0000000000002000, 0x0000100000002000, 0x0000000000006000, 0x0000100000006000,
0x0000000000002004, 0x0000100000002004, 0x0000000000006004, 0x0000100000006004,
0x0000200000000000, 0x0000300000000000, 0x0000200000004000, 0x0000300000004000,
0x0000200000000004, 0x0000300000000004, 0x0000200000004004, 0x0000300000004004,
0x0000200000002000, 0x0000300000002000, 0x0000200000006000, 0x0000300000006000,
0x0000200000002004, 0x0000300000002004, 0x0000200000006004, 0x0000300000006004,
0x0001000000000000, 0x0001100000000000, 0x0001000000004000, 0x0001100000004000,
0x0001000000000004, 0x0001100000000004, 0x0001000000004004, 0x0001100000004004,
0x0001000000002000, 0x0001100000002000, 0x0001000000006000, 0x0001100000006000,
0x0001000000002004, 0x0001100000002004, 0x0001000000006004, 0x0001100000006004,
0x0001200000000000, 0x0001300000000000, 0x0001200000004000, 0x0001300000004000,
0x0001200000000004, 0x0001300000000004, 0x0001200000004004, 0x0001300000004004,
0x0001200000002000, 0x0001300000002000, 0x0001200000006000, 0x0001300000006000,
0x0001200000002004, 0x0001300000002004, 0x0001200000006004, 0x0001300000006004,
0x0000000000000008, 0x0000100000000008, 0x0000000000004008, 0x0000100000004008,
0x000000000000000c, 0x000010000000000c, 0x000000000000400c, 0x000010000000400c,
0x0000000000002008, 0x0000100000002008, 0x0000000000006008, 0x0000100000006008,
0x000000000000200c, 0x000010000000200c, 0x000000000000600c, 0x000010000000600c,
0x0000200000000008, 0x0000300000000008, 0x0000200000004008, 0x0000300000004008,
0x000020000000000c, 0x000030000000000c, 0x000020000000400c, 0x000030000000400c,
0x0000200000002008, 0x0000300000002008, 0x0000200000006008, 0x0000300000006008,
0x000020000000200c, 0x000030000000200c, 0x000020000000600c, 0x000030000000600c,
0x0001000000000008, 0x0001100000000008, 0x0001000000004008, 0x0001100000004008,
0x000100000000000c, 0x000110000000000c, 0x000100000000400c, 0x000110000000400c,
0x0001000000002008, 0x0001100000002008, 0x0001000000006008, 0x0001100000006008,
0x000100000000200c, 0x000110000000200c, 0x000100000000600c, 0x000110000000600c,
0x0001200000000008, 0x0001300000000008, 0x0001200000004008, 0x0001300000004008,
0x000120000000000c, 0x000130000000000c, 0x000120000000400c, 0x000130000000400c,
0x0001200000002008, 0x0001300000002008, 0x0001200000006008, 0x0001300000006008,
0x000120000000200c, 0x000130000000200c, 0x000120000000600c, 0x000130000000600c,
0x1000000000000000, 0x1000100000000000, 0x1000000000004000, 0x1000100000004000,
0x1000000000000004, 0x1000100000000004, 0x1000000000004004, 0x1000100000004004,
0x1000000000002000, 0x1000100000002000, 0x1000000000006000, 0x1000100000006000,
0x1000000000002004, 0x1000100000002004, 0x1000000000006004, 0x1000100000006004,
0x1000200000000000, 0x1000300000000000, 0x1000200000004000, 0x1000300000004000,
0x1000200000000004, 0x1000300000000004, 0x1000200000004004, 0x1000300000004004,
0x1000200000002000, 0x1000300000002000, 0x1000200000006000, 0x1000300000006000,
0x1000200000002004, 0x1000300000002004, 0x1000200000006004, 0x1000300000006004,
0x1001000000000000, 0x1001100000000000, 0x1001000000004000, 0x1001100000004000,
0x1001000000000004, 0x1001100000000004, 0x1001000000004004, 0x1001100000004004,
0x1001000000002000, 0x1001100000002000, 0x1001000000006000, 0x1001100000006000,
0x1001000000002004, 0x1001100000002004, 0x1001000000006004, 0x1001100000006004,
0x1001200000000000, 0x1001300000000000, 0x1001200000004000, 0x1001300000004000,
0x1001200000000004, 0x1001300000000004, 0x1001200000004004, 0x1001300000004004,
0x1001200000002000, 0x1001300000002000, 0x1001200000006000, 0x1001300000006000,
0x1001200000002004, 0x1001300000002004, 0x1001200000006004, 0x1001300000006004,
0x1000000000000008, 0x1000100000000008, 0x1000000000004008, 0x1000100000004008,
0x100000000000000c, 0x100010000000000c, 0x100000000000400c, 0x100010000000400c,
0x1000000000002008, 0x1000100000002008, 0x1000000000006008, 0x1000100000006008,
0x100000000000200c, 0x100010000000200c, 0x100000000000600c, 0x100010000000600c,
0x1000200000000008, 0x1000300000000008, 0x1000200000004008, 0x1000300000004008,
0x100020000000000c, 0x100030000000000c, 0x100020000000400c, 0x100030000000400c,
0x1000200000002008, 0x1000300000002008, 0x1000200000006008, 0x1000300000006008,
0x100020000000200c, 0x100030000000200c, 0x100020000000600c, 0x100030000000600c,
0x1001000000000008, 0x1001100000000008, 0x1001000000004008, 0x1001100000004008,
0x100100000000000c, 0x100110000000000c, 0x100100000000400c, 0x100110000000400c,
0x1001000000002008, 0x1001100000002008, 0x1001000000006008, 0x1001100000006008,
0x100100000000200c, 0x100110000000200c, 0x100100000000600c, 0x100110000000600c,
0x1001200000000008, 0x1001300000000008, 0x1001200000004008, 0x1001300000004008,
0x100120000000000c, 0x100130000000000c, 0x100120000000400c, 0x100130000000400c,
0x1001200000002008, 0x1001300000002008, 0x1001200000006008, 0x1001300000006008,
0x100120000000200c, 0x100130000000200c, 0x100120000000600c, 0x100130000000600c,
},
{
0x0000000000000000, 0x0002000000000000, 0x0000000000000100, 0x0002000000000100,
0x0000000400000000, 0x0002000400000000, 0x0000000400000100, 0x0002000400000100,
0x0000000000000020, 0x0002000000000020, 0x0000000000000120, 0x0002000000000120,
0x0000000400000020, 0x0002000400000020, 0x0000000400000120, 0x0002000400000120,
0x0000000000000200, 0x0002000000000200, 0x0000000000000300, 0x0002000000000300,
0x0000000400000200, 0x0002000400000200, 0x0000000400000300, 0x0002000400000300,
0x0000000000000220, 0x0002000000000220, 0x0000000000000320, 0x0002000000000320,
0x0000000400000220, 0x0002000400000220, 0x0000000400000320, 0x0002000400000320,
0x0000040000000000, 0x0002040000000000, 0x0000040000000100, 0x0002040000000100,
0x0000040400000000, 0x0002040400000000, 0x0000040400000100, 0x0002040400000100,
0x0000040000000020, 0x0002040000000020, 0x0000040000000120, 0x0002040000000120,
0x0000040400000020, 0x0002040400000020, 0x0000040400000120, 0x0002040400000120,
0x0000040000000200, 0x0002040000000200, 0x0000040000000300, 0x0002040000000300,
0x0000040400000200, 0x0002040400000200, 0x0000040400000300, 0x0002040400000300,
0x0000040000000220, 0x0002040000000220, 0x0000040000000320, 0x0002040000000320,
0x0000040400000220, 0x0002040400000220, 0x0000040400000320, 0x0002040400000320,
0x0200000000000000, 0x0202000000000000, 0x0200000000000100, 0x0202000000000100,
0x0200000400000000, 0x0202000400000000, 0x0200000400000100, 0x0202000400000100,
0x0200000000000020, 0x0202000000000020, 0x0200000000000120, 0x0202000000000120,
0x0200000400000020, 0x0202000400000020, 0x0200000400000120, 0x0202000400000120,
0x0200000000000200, 0x0202000000000200, 0x0200000000000300, 0x0202000000000300,
0x0200000400000200, 0x0202000400000200, 0x0200000400000300, 0x0202000400000300,
0x0200000000000220, 0x0202000000000220, 0x0200000000000320, 0x0202000000000320,
0x0200000400000220, 0x0202000400000220, 0x0200000400000320, 0x0202000400000320,
0x0200040000000000, 0x0202040000000000, 0x0200040000000100, 0x0202040000000100,
0x0200040400000000, 0x0202040400000000, 0x0200040400000100, 0x0202040400000100,
0x0200040000000020, 0x0202040000000020, 0x0200040000000120, 0x0202040000000120,
0x0200040400000020, 0x0202040400000020, 0x0200040400000120, 0x0202040400000120,
0x0200040000000200, 0x0202040000000200, 0x0200040000000300, 0x0202040000000300,
0x0200040400000200, 0x0202040400000200, 0x0200040400000300, 0x0202040400000300,
0x0200040000000220, 0x0202040000000220, 0x0200040000000320, 0x0202040000000320,
0x0200040400000220, 0x0202040400000220, 0x0200040400000320, 0x0202040400000320,
0x0000000001000000, 0x0002000001000000, 0x0000000001000100, 0x0002000001000100,
0x0000000401000000, 0x0002000401000000, 0x0000000401000100, 0x0002000401000100,
0x0000000001000020, 0x0002000001000020, 0x0000000001000120, 0x0002000001000120,
0x0000000401000020, 0x0002000401000020, 0x0000000401000120, 0x0002000401000120,
0x0000000001000200, 0x0002000001000200, 0x0000000001000300, 0x0002000001000300,
0x0000000401000200, 0x0002000401000200, 0x0000000401000300, 0x0002000401000300,
0x0000000001000220, 0x0002000001000220, 0x0000000001000320, 0x0002000001000320,
0x0000000401000220, 0x0002000401000220, 0x0000000401000320, 0x0002000401000320,
0x0000040001000000, 0x0002040001000000, 0x0000040001000100, 0x0002040001000100,
0x0000040401000000, 0x0002040401000000, 0x0000040401000100, 0x0002040401000100,
0x0000040001000020, 0x0002040001000020, 0x0000040001000120, 0x0002040001000120,
0x0000040401000020, 0x0002040401000020, 0x0000040401000120, 0x0002040401000120,
0x0000040001000200, 0x0002040001000200, 0x0000040001000300, 0x0002040001000300,
0x0000040401000200, 0x0002040401000200, 0x0000040401000300, 0x0002040401000300,
0x0000040001000220, 0x0002040001000220, 0x0000040001000320, 0x0002040001000320,
0x0000040401000220, 0x0002040401000220, 0x0000040401000320, 0x0002040401000320,
0x0200000001000000, 0x0202000001000000, 0x0200000001000100, 0x0202000001000100,
0x0200000401000000, 0x0202000401000000, 0x0200000401000100, 0x0202000401000100,
0x0200000001000020, 0x0202000001000020, 0x0200000001000120, 0x0202000001000120,
0x0200000401000020, 0x0202000401000020, 0x0200000401000120, 0x0202000401000120,
0x0200000001000200, 0x0202000001000200, 0x0200000001000300, 0x0202000001000300,
0x0200000401000200, 0x0202000401000200, 0x0200000401000300, 0x0202000401000300,
0x0200000001000220, 0x0202000001000220, 0x0200000001000320, 0x0202000001000320,
0x0200000401000220, 0x0202000401000220, 0x0200000401000320, 0x0202000401000320,
0x0200040001000000, 0x0202040001000000, 0x0200040001000100, 0x0202040001000100,
0x0200040401000000, 0x0202040401000000, 0x0200040401000100, 0x0202040401000100,
0x0200040001000020, 0x0202040001000020, 0x0200040001000120, 0x0202040001000120,
0x0200040401000020, 0x0202040401000020, 0x0200040401000120, 0x0202040401000120,
0x0200040001000200, 0x0202040001000200, 0x0200040001000300, 0x0202040001000300,
0x0200040401000200, 0x0202040401000200, 0x0200040401000300, 0x0202040401000300,
0x0200040001000220, 0x0202040001000220, 0x0200040001000320, 0x0202040001000320,
0x0200040401000220, 0x0202040401000220, 0x0200040401000320, 0x0202040401000320,
},
};
#endregion
UInt64 n = 0;
int i;
for (i = 0; i < 8; i++)
{
n |= _kperm[i,(uint)(k & 0xff)];
k >>= 8;
}
return n;
}
public static byte[] CSAKeyScheduleBlock(byte[] cw)
{
UInt64[] k = new UInt64[7];
byte[] kk = new byte[56]; // is this key buff length
int i, j;
k[6] = cw.ToUInt64();
for (i = 6; i > 0; i--)
k[i - 1] = CSAKeyPermuteBlock(k[i]);
for (i = 0; i < 7; i++)
for (j = 0; j < 8; j++)
kk[i*8+j] = (byte)((k[i]>>(j*8)) ^ (byte)i);
return kk;
}
}
}