-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcheck_implementations.sage
10936 lines (10862 loc) · 207 KB
/
check_implementations.sage
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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
load("code.sage")
def check_slp_program(m, program, offset=0):
"""
Return whether the encoded program implements the multiplication by m
"""
if m[0][0].parent() != GF(2):
m = ff_matrix2bin(m)
# define program
n_variables = m.nrows()
inputs = ["x%d" % (i + offset) for i in range(n_variables)]
inputs2gf2 = ["%s = GF(2)(%s)" % (i, i) for i in inputs]
outputs = ["y%d" % (i + offset) for i in range(n_variables)]
function = """def prog(x):
# parse input to variables
%s = x
# convert variables to GF(2) objects
%s
# compute given program
%s
return vector(GF(2), [%s])
""" % (", ".join(inputs),
"\n ".join(inputs2gf2),
"\n ".join(program.splitlines()),
", ".join(outputs))
exec(function)
test_m = [prog(Integer(1<<i).digits(base=2, padto=n_variables))
for i in range(n_variables)
]
test_m = matrix(GF(2), test_m).transpose()
return m == test_m
def run_tests():
"""
Runs 'check_slp_program' on all test cases given in the global tests list.
As the variable numbering differs between paar and bp heuristic outputs,
we use a small hack to try both variable numberings.
The function returns two lists, the index of all successful tests and the
index of all failed tests
"""
success = []
fail = []
for i, (m, p) in enumerate(tests):
try:
if check_slp_program(m, p):
success.append(i)
else:
fail.append(i)
except NameError as e:
try:
if check_slp_program(m, p, 1):
success.append(i)
else:
fail.append(i)
except NameError as e:
fail.append(i)
print(i, "Error while checking SLP")
return success, fail
###############################################################################
#### SLP Implementations form subdir ##########################################
###############################################################################
tests = [
(ACISP_SarSye17_8x8_4, """
# Generated with LinOpt, seed 13357, XOR Count 204
BFP0 = x4 + x12
BFP1 = x8 + x16
BFP2 = x11 + x26
BFP3 = x2 + x18
BFP4 = x3 + x19
BFP5 = x20 + x28
BFP6 = x24 + x32
BFP7 = x22 + BFP0
BFP8 = x7 + x23
BFP9 = x10 + x25
BFP10 = x6 + x21
BFP11 = x5 + x29
BFP12 = x1 + x31
BFP13 = x9 + x13
BFP14 = x14 + x27
BFP15 = BFP1 + BFP2
BFP16 = x15 + x30
BFP17 = x2 + x17
BFP18 = x6 + x9
BFP19 = x28 + BFP4
BFP20 = x4 + x14
BFP21 = x32 + BFP8
BFP22 = x1 + BFP9
BFP23 = BFP5 + BFP16
BFP24 = BFP6 + BFP10
BFP25 = x17 + BFP3
BFP26 = x7 + BFP7
BFP27 = x10 + x13
BFP28 = x19 + BFP11
BFP29 = BFP4 + BFP15
BFP30 = BFP11 + BFP20
BFP31 = x17 + BFP12
BFP32 = x3 + x31
BFP33 = x20 + x27
BFP34 = x5 + x24
BFP35 = x31 + BFP5
BFP36 = x29 + BFP6
BFP37 = x6 + x22
BFP38 = x15 + x18
BFP39 = BFP3 + BFP24
BFP40 = x8 + BFP38
BFP41 = BFP22 + BFP40
BFP42 = x23 + BFP32
BFP43 = x21 + x32
BFP44 = x26 + BFP17
BFP45 = x12 + x30
BFP46 = x28 + BFP9
BFP47 = BFP14 + BFP27
BFP48 = BFP31 + BFP46
BFP49 = x27 + BFP45
BFP50 = x24 + BFP15
BFP51 = BFP18 + BFP23
BFP52 = BFP7 + BFP28
BFP53 = x5 + BFP0
BFP54 = BFP1 + BFP43
BFP55 = BFP14 + BFP18
BFP56 = BFP13 + BFP19
BFP57 = x20 + x25
BFP58 = x13 + BFP33
BFP59 = x11 + BFP14
BFP60 = BFP13 + BFP21
BFP61 = x23 + x30
BFP62 = x25 + BFP13
BFP63 = x3 + x9
BFP64 = BFP5 + BFP10
BFP65 = x11 + BFP24
BFP66 = x15 + BFP7
BFP67 = BFP3 + BFP42
BFP68 = BFP2 + BFP25
BFP69 = x8 + BFP51
BFP70 = x16 + BFP12
BFP71 = BFP6 + BFP41
BFP72 = BFP66 + BFP70
BFP73 = x3 + BFP64
BFP74 = BFP22 + BFP44
BFP75 = BFP10 + BFP27
BFP76 = x12 + BFP29
BFP77 = x11 + x25
BFP78 = BFP52 + BFP62
BFP79 = BFP3 + BFP30
BFP80 = BFP25 + BFP26
BFP81 = BFP8 + BFP59
BFP82 = x32 + BFP48
BFP83 = BFP1 + BFP20
BFP84 = BFP36 + BFP44
BFP85 = BFP55 + BFP57
BFP86 = x15 + BFP15
BFP87 = x27 + BFP56
BFP88 = x4 + BFP33
BFP89 = x8 + BFP0
BFP90 = x21 + BFP63
BFP91 = BFP32 + BFP50
BFP92 = BFP49 + BFP73
BFP93 = BFP37 + BFP68
BFP94 = BFP29 + BFP34
BFP95 = BFP75 + BFP91
BFP96 = BFP11 + BFP54
BFP97 = x14 + BFP11
BFP98 = BFP16 + BFP26
BFP99 = x16 + BFP6
BFP100 = x10 + BFP35
BFP101 = BFP87 + BFP99
BFP102 = x2 + BFP88
BFP103 = BFP62 + BFP84
BFP104 = BFP7 + BFP9
BFP105 = x11 + BFP30
BFP106 = x9 + x27
BFP107 = BFP56 + BFP79
BFP108 = BFP47 + BFP96
BFP109 = x26 + BFP41
BFP110 = x30 + BFP39
BFP111 = BFP36 + BFP37
BFP112 = x10 + BFP8
BFP113 = BFP35 + BFP83
BFP114 = BFP9 + BFP24
BFP115 = BFP16 + BFP65
BFP116 = x15 + BFP68
BFP117 = BFP54 + BFP77
BFP118 = BFP29 + BFP30
BFP119 = BFP23 + BFP90
BFP120 = x1 + BFP25
BFP121 = BFP3 + BFP8
BFP122 = BFP20 + BFP115
BFP123 = BFP49 + BFP117
BFP124 = x1 + BFP102
BFP125 = x13 + BFP92
BFP126 = x22 + BFP122
BFP127 = BFP104 + BFP121
BFP128 = BFP26 + BFP74
BFP129 = BFP19 + BFP109
BFP130 = BFP58 + BFP65
BFP131 = x21 + BFP78
BFP132 = BFP17 + BFP70
BFP133 = BFP58 + BFP98
BFP134 = BFP26 + BFP107
BFP135 = BFP63 + BFP97
BFP136 = x7 + BFP100
BFP137 = BFP22 + BFP105
BFP138 = BFP4 + BFP12
BFP139 = BFP1 + BFP10
BFP140 = BFP86 + BFP106
BFP141 = BFP69 + BFP127
BFP142 = BFP57 + BFP72
BFP143 = x22 + x29
BFP144 = BFP12 + BFP69
BFP145 = BFP1 + BFP103
BFP146 = BFP55 + BFP82
BFP147 = x12 + BFP144
BFP148 = BFP52 + BFP59
BFP149 = BFP67 + BFP108
BFP150 = BFP64 + BFP137
BFP151 = BFP17 + BFP125
BFP152 = x31 + BFP80
BFP153 = BFP8 + BFP142
BFP154 = BFP0 + BFP146
BFP155 = BFP114 + BFP132
BFP156 = x30 + BFP148
BFP157 = BFP23 + BFP128
BFP158 = x26 + BFP131
BFP159 = x23 + BFP34
BFP160 = x2 + BFP76
BFP161 = BFP19 + BFP126
BFP162 = BFP28 + BFP50
BFP163 = BFP36 + BFP116
BFP164 = BFP21 + BFP156
BFP165 = x16 + BFP93
BFP166 = BFP53 + BFP101
BFP167 = BFP53 + BFP119
BFP168 = BFP60 + BFP165
BFP169 = x18 + BFP143
BFP170 = x6 + BFP133
BFP171 = BFP66 + BFP139
BFP172 = BFP110 + BFP118
BFP173 = BFP67 + BFP140
BFP174 = BFP31 + BFP112
BFP175 = x29 + BFP153
BFP176 = BFP17 + BFP113
BFP177 = BFP81 + BFP167
BFP178 = BFP47 + BFP111
BFP179 = BFP61 + BFP145
BFP180 = BFP147 + BFP159
BFP181 = BFP120 + BFP130
BFP182 = BFP21 + BFP129
BFP183 = BFP160 + BFP178
BFP184 = x14 + BFP157
BFP185 = x7 + BFP155
BFP186 = BFP60 + BFP176
BFP187 = BFP85 + BFP152
BFP188 = BFP35 + BFP158
BFP189 = x19 + BFP61
BFP190 = x18 + BFP4
BFP191 = BFP124 + BFP162
BFP192 = BFP123 + BFP190
BFP193 = BFP71 + BFP135
BFP194 = BFP34 + BFP171
BFP195 = BFP89 + BFP181
BFP196 = BFP154 + BFP189
BFP197 = BFP95 + BFP169
BFP198 = x10 + BFP166
BFP199 = x29 + BFP151
BFP200 = BFP94 + BFP174
BFP201 = BFP138 + BFP170
BFP202 = BFP136 + BFP163
BFP203 = BFP48 + BFP194
y1 = BFP188
y2 = BFP196
y3 = BFP202
y4 = BFP192
y5 = BFP179
y6 = BFP149
y7 = BFP161
y8 = BFP175
y9 = BFP199
y10 = BFP187
y11 = BFP182
y12 = BFP191
y13 = BFP185
y14 = BFP197
y15 = BFP164
y16 = BFP180
y17 = BFP150
y18 = BFP184
y19 = BFP173
y20 = BFP198
y21 = BFP193
y22 = BFP172
y23 = BFP201
y24 = BFP186
y25 = BFP134
y26 = BFP141
y27 = BFP200
y28 = BFP195
y29 = BFP168
y30 = BFP183
y31 = BFP177
y32 = BFP203
"""),
(ACISP_SarSye17_8x8_8, """
# Generated with LinOpt, seed 27896, XOR Count 438
BFP0 = x7 + x31
BFP1 = x32 + x56
BFP2 = x0 + x24
BFP3 = x16 + x40
BFP4 = x8 + x49
BFP5 = x23 + x63
BFP6 = x39 + x41
BFP7 = x25 + x48
BFP8 = x17 + x57
BFP9 = x8 + x33
BFP10 = x1 + x57
BFP11 = x6 + x46
BFP12 = x30 + x55
BFP13 = x33 + x58
BFP14 = x22 + x47
BFP15 = x15 + x23
BFP16 = x54 + BFP0
BFP17 = x20 + x49
BFP18 = x41 + x50
BFP19 = x7 + x36
BFP20 = x14 + x43
BFP21 = x15 + x38
BFP22 = x3 + x39
BFP23 = x48 + x57
BFP24 = x8 + BFP8
BFP25 = x24 + BFP9
BFP26 = x25 + x61
BFP27 = x16 + x52
BFP28 = x9 + x50
BFP29 = BFP1 + BFP4
BFP30 = x4 + x45
BFP31 = x0 + BFP19
BFP32 = x48 + BFP2
BFP33 = x14 + x37
BFP34 = x0 + x9
BFP35 = BFP6 + BFP10
BFP36 = x32 + x38
BFP37 = x36 + x60
BFP38 = x5 + x45
BFP39 = x46 + BFP12
BFP40 = x10 + x34
BFP41 = x62 + BFP15
BFP42 = x15 + x44
BFP43 = x41 + BFP0
BFP44 = x14 + BFP3
BFP45 = x55 + x56
BFP46 = x5 + x29
BFP47 = x3 + x27
BFP48 = x12 + x53
BFP49 = x1 + x42
BFP50 = x2 + x26
BFP51 = x56 + x62
BFP52 = x49 + BFP13
BFP53 = x39 + x47
BFP54 = x35 + x59
BFP55 = x17 + x26
BFP56 = x24 + x49
BFP57 = x11 + BFP14
BFP58 = x31 + x34
BFP59 = x0 + x40
BFP60 = x28 + BFP22
BFP61 = x18 + x54
BFP62 = x1 + x19
BFP63 = x41 + x51
BFP64 = x13 + x54
BFP65 = x48 + BFP61
BFP66 = x55 + BFP2
BFP67 = x11 + x21
BFP68 = x57 + BFP3
BFP69 = x51 + BFP47
BFP70 = x17 + x42
BFP71 = x40 + BFP18
BFP72 = x10 + x52
BFP73 = x23 + x34
BFP74 = x55 + BFP42
BFP75 = x45 + BFP17
BFP76 = x51 + BFP40
BFP77 = x19 + x61
BFP78 = BFP26 + BFP31
BFP79 = x51 + BFP2
BFP80 = x5 + x47
BFP81 = x19 + x42
BFP82 = x7 + x9
BFP83 = BFP1 + BFP82
BFP84 = x44 + x53
BFP85 = x23 + BFP68
BFP86 = x6 + x32
BFP87 = x21 + BFP34
BFP88 = x27 + BFP5
BFP89 = BFP20 + BFP22
BFP90 = x40 + x50
BFP91 = x15 + x25
BFP92 = x16 + x22
BFP93 = x12 + x59
BFP94 = x21 + BFP30
BFP95 = x63 + BFP21
BFP96 = x13 + x60
BFP97 = x38 + x62
BFP98 = BFP6 + BFP41
BFP99 = x14 + BFP46
BFP100 = x13 + x53
BFP101 = x2 + BFP36
BFP102 = x29 + x43
BFP103 = x11 + BFP51
BFP104 = x6 + x35
BFP105 = x11 + x58
BFP106 = x18 + BFP49
BFP107 = x21 + BFP26
BFP108 = x2 + x58
BFP109 = x16 + BFP53
BFP110 = x28 + BFP24
BFP111 = x13 + BFP45
BFP112 = x46 + BFP5
BFP113 = x18 + x27
BFP114 = x28 + BFP63
BFP115 = x6 + x29
BFP116 = x43 + BFP50
BFP117 = BFP12 + BFP43
BFP118 = x10 + BFP32
BFP119 = x19 + BFP37
BFP120 = x35 + BFP11
BFP121 = x20 + x61
BFP122 = BFP11 + BFP25
BFP123 = x12 + BFP35
BFP124 = x6 + BFP13
BFP125 = x0 + x25
BFP126 = x7 + BFP7
BFP127 = BFP20 + BFP66
BFP128 = BFP88 + BFP110
BFP129 = x12 + BFP23
BFP130 = x35 + BFP7
BFP131 = x45 + BFP54
BFP132 = x22 + BFP33
BFP133 = BFP106 + BFP114
BFP134 = x28 + BFP8
BFP135 = x7 + BFP75
BFP136 = x47 + BFP105
BFP137 = x59 + BFP29
BFP138 = x2 + BFP85
BFP139 = BFP79 + BFP104
BFP140 = x19 + x59
BFP141 = x14 + BFP107
BFP142 = BFP71 + BFP79
BFP143 = x12 + BFP27
BFP144 = x17 + x32
BFP145 = x20 + BFP129
BFP146 = x37 + BFP80
BFP147 = x4 + x26
BFP148 = x53 + BFP21
BFP149 = x13 + BFP51
BFP150 = x38 + BFP59
BFP151 = x10 + x37
BFP152 = x5 + x52
BFP153 = x42 + BFP32
BFP154 = BFP33 + BFP91
BFP155 = BFP10 + BFP88
BFP156 = x54 + BFP101
BFP157 = BFP16 + BFP48
BFP158 = x4 + BFP102
BFP159 = BFP17 + BFP58
BFP160 = x5 + x8
BFP161 = BFP44 + BFP100
BFP162 = BFP28 + BFP29
BFP163 = x36 + BFP92
BFP164 = x60 + BFP151
BFP165 = BFP84 + BFP121
BFP166 = x59 + BFP144
BFP167 = x17 + BFP71
BFP168 = x34 + BFP152
BFP169 = x34 + BFP16
BFP170 = x41 + BFP143
BFP171 = BFP98 + BFP99
BFP172 = x31 + x45
BFP173 = x62 + BFP154
BFP174 = BFP94 + BFP122
BFP175 = x36 + BFP75
BFP176 = BFP30 + BFP33
BFP177 = BFP87 + BFP135
BFP178 = BFP14 + BFP162
BFP179 = BFP73 + BFP170
BFP180 = x50 + BFP124
BFP181 = x48 + BFP87
BFP182 = x37 + BFP64
BFP183 = x21 + BFP164
BFP184 = BFP3 + BFP180
BFP185 = BFP39 + BFP110
BFP186 = BFP1 + BFP80
BFP187 = x59 + BFP50
BFP188 = x58 + BFP74
BFP189 = BFP59 + BFP72
BFP190 = BFP65 + BFP131
BFP191 = BFP70 + BFP100
BFP192 = x4 + x40
BFP193 = BFP157 + BFP171
BFP194 = x9 + BFP76
BFP195 = x44 + BFP67
BFP196 = BFP103 + BFP120
BFP197 = x22 + BFP52
BFP198 = BFP21 + BFP78
BFP199 = x20 + BFP76
BFP200 = BFP17 + BFP115
BFP201 = x4 + BFP36
BFP202 = x33 + BFP57
BFP203 = x11 + BFP159
BFP204 = BFP136 + BFP167
BFP205 = x30 + BFP15
BFP206 = BFP37 + BFP125
BFP207 = x41 + x47
BFP208 = BFP118 + BFP140
BFP209 = BFP48 + BFP104
BFP210 = x50 + BFP107
BFP211 = BFP66 + BFP109
BFP212 = x2 + BFP113
BFP213 = BFP12 + BFP24
BFP214 = BFP27 + BFP155
BFP215 = BFP64 + BFP123
BFP216 = x25 + x51
BFP217 = x1 + BFP7
BFP218 = x6 + BFP18
BFP219 = BFP3 + BFP95
BFP220 = BFP78 + BFP106
BFP221 = BFP101 + BFP102
BFP222 = BFP172 + BFP209
BFP223 = x27 + BFP204
BFP224 = BFP5 + BFP14
BFP225 = BFP24 + BFP115
BFP226 = BFP93 + BFP119
BFP227 = x30 + BFP168
BFP228 = x52 + BFP128
BFP229 = BFP182 + BFP198
BFP230 = BFP28 + BFP60
BFP231 = x33 + x56
BFP232 = BFP44 + BFP70
BFP233 = x30 + BFP165
BFP234 = BFP56 + BFP90
BFP235 = BFP56 + BFP192
BFP236 = x47 + BFP85
BFP237 = BFP18 + BFP96
BFP238 = BFP23 + BFP137
BFP239 = x30 + BFP97
BFP240 = x32 + BFP230
BFP241 = BFP121 + BFP146
BFP242 = BFP4 + BFP188
BFP243 = BFP19 + BFP48
BFP244 = BFP130 + BFP242
BFP245 = BFP20 + BFP160
BFP246 = BFP94 + BFP111
BFP247 = BFP5 + BFP97
BFP248 = BFP34 + BFP74
BFP249 = BFP84 + BFP134
BFP250 = x37 + BFP62
BFP251 = x63 + BFP173
BFP252 = x24 + BFP49
BFP253 = BFP42 + BFP147
BFP254 = x28 + BFP196
BFP255 = BFP116 + BFP250
BFP256 = x4 + BFP113
BFP257 = BFP69 + BFP183
BFP258 = x4 + BFP197
BFP259 = x31 + BFP111
BFP260 = BFP57 + BFP114
BFP261 = x58 + BFP83
BFP262 = x25 + BFP203
BFP263 = BFP55 + BFP219
BFP264 = BFP117 + BFP161
BFP265 = BFP16 + BFP109
BFP266 = BFP6 + BFP95
BFP267 = x35 + BFP210
BFP268 = BFP7 + BFP122
BFP269 = x27 + BFP77
BFP270 = BFP200 + BFP248
BFP271 = x63 + BFP10
BFP272 = x17 + BFP43
BFP273 = x18 + x60
BFP274 = x31 + BFP99
BFP275 = x15 + BFP232
BFP276 = BFP150 + BFP259
BFP277 = x26 + BFP7
BFP278 = x63 + BFP264
BFP279 = x60 + BFP252
BFP280 = BFP53 + BFP112
BFP281 = BFP39 + BFP235
BFP282 = x30 + BFP215
BFP283 = BFP9 + BFP253
BFP284 = BFP195 + BFP227
BFP285 = x20 + BFP254
BFP286 = x33 + x41
BFP287 = x22 + BFP234
BFP288 = x58 + BFP179
BFP289 = x26 + x49
BFP290 = BFP77 + BFP270
BFP291 = BFP27 + BFP193
BFP292 = BFP38 + BFP224
BFP293 = x63 + BFP156
BFP294 = BFP29 + BFP266
BFP295 = BFP89 + BFP233
BFP296 = x7 + BFP46
BFP297 = BFP7 + BFP241
BFP298 = x42 + BFP142
BFP299 = BFP3 + BFP261
BFP300 = BFP5 + BFP298
BFP301 = BFP16 + BFP41
BFP302 = BFP58 + BFP238
BFP303 = BFP177 + BFP239
BFP304 = BFP25 + BFP292
BFP305 = BFP174 + BFP301
BFP306 = x29 + BFP243
BFP307 = x33 + BFP81
BFP308 = x10 + BFP289
BFP309 = BFP236 + BFP308
BFP310 = x26 + BFP163
BFP311 = x9 + BFP214
BFP312 = BFP0 + BFP186
BFP313 = x18 + BFP299
BFP314 = x18 + BFP127
BFP315 = x61 + BFP27
BFP316 = x43 + BFP231
BFP317 = BFP83 + BFP268
BFP318 = BFP184 + BFP302
BFP319 = BFP89 + BFP91
BFP320 = x12 + BFP116
BFP321 = BFP262 + BFP279
BFP322 = x46 + BFP257
BFP323 = BFP271 + BFP306
BFP324 = BFP73 + BFP317
BFP325 = x52 + BFP221
BFP326 = BFP47 + BFP145
BFP327 = x1 + BFP178
BFP328 = x29 + BFP190
BFP329 = BFP62 + BFP244
BFP330 = BFP1 + BFP286
BFP331 = x60 + BFP272
BFP332 = BFP132 + BFP282
BFP333 = BFP258 + BFP274
BFP334 = BFP148 + BFP185
BFP335 = BFP277 + BFP300
BFP336 = BFP201 + BFP260
BFP337 = x56 + BFP44
BFP338 = BFP207 + BFP323
BFP339 = BFP293 + BFP326
BFP340 = x37 + BFP133
BFP341 = BFP35 + BFP153
BFP342 = x31 + BFP237
BFP343 = x3 + BFP105
BFP344 = x31 + BFP280
BFP345 = x24 + BFP54
BFP346 = x16 + BFP229
BFP347 = BFP296 + BFP334
BFP348 = BFP205 + BFP312
BFP349 = BFP45 + BFP225
BFP350 = BFP98 + BFP126
BFP351 = BFP202 + BFP216
BFP352 = BFP315 + BFP336
BFP353 = x3 + BFP55
BFP354 = BFP206 + BFP222
BFP355 = BFP11 + BFP333
BFP356 = x37 + BFP290
BFP357 = BFP81 + BFP96
BFP358 = x33 + BFP208
BFP359 = BFP139 + BFP331
BFP360 = BFP297 + BFP342
BFP361 = BFP65 + BFP245
BFP362 = BFP2 + BFP217
BFP363 = BFP23 + BFP348
BFP364 = BFP212 + BFP294
BFP365 = BFP194 + BFP269
BFP366 = BFP15 + BFP276
BFP367 = BFP175 + BFP187
BFP368 = BFP29 + BFP335
BFP369 = BFP263 + BFP362
BFP370 = BFP108 + BFP341
BFP371 = BFP284 + BFP345
BFP372 = x44 + BFP339
BFP373 = BFP25 + BFP295
BFP374 = BFP52 + BFP60
BFP375 = BFP120 + BFP309
BFP376 = BFP16 + BFP275
BFP377 = BFP240 + BFP307
BFP378 = x44 + BFP305
BFP379 = BFP4 + BFP319
BFP380 = BFP31 + BFP223
BFP381 = BFP69 + BFP149
BFP382 = x53 + BFP103
BFP383 = BFP138 + BFP351
BFP384 = BFP28 + BFP367
BFP385 = BFP4 + BFP344
BFP386 = BFP265 + BFP349
BFP387 = BFP288 + BFP353
BFP388 = BFP112 + BFP346
BFP389 = BFP38 + BFP365
BFP390 = BFP117 + BFP358
BFP391 = BFP23 + BFP314
BFP392 = BFP40 + BFP108
BFP393 = BFP13 + BFP199
BFP394 = BFP141 + BFP218
BFP395 = BFP86 + BFP278
BFP396 = BFP189 + BFP285
BFP397 = BFP310 + BFP381
BFP398 = BFP54 + BFP191
BFP399 = BFP249 + BFP392
BFP400 = BFP181 + BFP385
BFP401 = BFP169 + BFP391
BFP402 = BFP118 + BFP327
BFP403 = BFP93 + BFP340
BFP404 = BFP273 + BFP283
BFP405 = BFP86 + BFP304
BFP406 = BFP328 + BFP343
BFP407 = BFP90 + BFP322
BFP408 = BFP119 + BFP361
BFP409 = BFP325 + BFP357
BFP410 = x55 + BFP405
BFP411 = BFP28 + BFP404
BFP412 = BFP176 + BFP228
BFP413 = BFP211 + BFP251
BFP414 = BFP35 + BFP366
BFP415 = BFP255 + BFP382
BFP416 = BFP311 + BFP316
BFP417 = BFP72 + BFP220
BFP418 = BFP246 + BFP374
BFP419 = BFP256 + BFP398
BFP420 = BFP337 + BFP370
BFP421 = x28 + BFP408
BFP422 = BFP92 + BFP354
BFP423 = BFP158 + BFP393
BFP424 = x32 + BFP291
BFP425 = x57 + BFP377
BFP426 = BFP287 + BFP350
BFP427 = BFP166 + BFP379
BFP428 = BFP267 + BFP320
BFP429 = x44 + BFP397
BFP430 = BFP213 + BFP313
BFP431 = BFP14 + BFP303
BFP432 = BFP330 + BFP376
BFP433 = BFP52 + BFP363
BFP434 = BFP247 + BFP394
BFP435 = BFP67 + BFP338
BFP436 = BFP226 + BFP281
BFP437 = x9 + BFP359
y0 = BFP368
y1 = BFP416
y2 = BFP399
y3 = BFP406
y4 = BFP436
y5 = BFP360
y6 = BFP434
y7 = BFP426
y8 = BFP318
y9 = BFP437
y10 = BFP417
y11 = BFP415
y12 = BFP372
y13 = BFP418
y14 = BFP355
y15 = BFP433
y16 = BFP420
y17 = BFP427
y18 = BFP411
y19 = BFP389
y20 = BFP396
y21 = BFP435
y22 = BFP332
y23 = BFP414
y24 = BFP402
y25 = BFP383
y26 = BFP387
y27 = BFP419
y28 = BFP421
y29 = BFP356
y30 = BFP431
y31 = BFP400
y32 = BFP430
y33 = BFP390
y34 = BFP321
y35 = BFP428
y36 = BFP429
y37 = BFP412
y38 = BFP347
y39 = BFP386
y40 = BFP369
y41 = BFP364
y42 = BFP425
y43 = BFP423
y44 = BFP371
y45 = BFP422
y46 = BFP388
y47 = BFP413
y48 = BFP324
y49 = BFP375
y50 = BFP380
y51 = BFP403
y52 = BFP409
y53 = BFP373
y54 = BFP378
y55 = BFP410
y56 = BFP432
y57 = BFP401
y58 = BFP329
y59 = BFP384
y60 = BFP407
y61 = BFP352
y62 = BFP424
y63 = BFP395
"""),
(AES, """
# Generated with slp_heuristic, XOR Count 97
t0 = x7 + x15
t1 = x23 + x31
t2 = x7 + x31
t3 = x15 + x23
t4 = x0 + x8
t5 = x6 + x14
t6 = x5 + x29
t7 = x16 + x24
t8 = x22 + x30
t9 = x13 + x21
t10 = x1 + x9
t11 = x10 + x18
t12 = x2 + x26
t13 = x17 + x25
t14 = x4 + x12
t15 = x3 + x27
t16 = x20 + x28
t17 = x11 + x19
t18 = x0 + t3
y8 = t7 + t18
t20 = x16 + t4
y24 = t2 + t20
t22 = t1 + t7
y16 = t20 + t22
t24 = x8 + t7
y0 = t0 + t24
t26 = x6 + t8
y14 = t9 + t26
t28 = x7 + x22
t29 = x21 + t5
t30 = x5 + y14
y6 = t29 + t30
t32 = x10 + t12
y18 = t13 + t32
t34 = x25 + t11
t35 = x1 + x2
y26 = t34 + t35
t37 = x9 + y18
y10 = t34 + t37
t39 = t0 + t32
t40 = x13 + t6
y21 = t16 + t40
t42 = x28 + t9
t43 = x4 + x5
y29 = t42 + t43
t45 = x12 + y21
y13 = t42 + t45
t47 = x14 + t1
y15 = t28 + t47
t49 = x6 + x15
y7 = t47 + t49
t51 = x15 + t2
y23 = t8 + t51
t53 = x22 + t5
y30 = t6 + t53
t55 = x25 + t10
y17 = t22 + t55
t57 = x26 + t10
y2 = t11 + t57
t59 = x29 + x30
y22 = t29 + t59
t61 = x29 + t9
y5 = t14 + t61
t63 = t3 + t26
y31 = t28 + t63
t65 = t4 + t37
y1 = t39 + t65
t67 = x1 + t13
t68 = t18 + t20
y9 = t67 + t68
t70 = x3 + t2
t71 = x27 + t14
t72 = x20 + t70
y28 = t71 + t72
t74 = t12 + t17
y27 = t70 + t74
t76 = x2 + x27
t77 = t39 + t74
y3 = t76 + t77
t79 = t3 + t11
t80 = x19 + t15
y11 = t79 + t80
t82 = x4 + t3
t83 = t16 + t17
y12 = t82 + t83
t85 = x19 + t1
t86 = x28 + t71
y20 = t85 + t86
t88 = x9 + y17
t89 = y1 + t68
y25 = t88 + t89
t91 = x11 + y27
t92 = y3 + t79
y19 = t91 + t92
t94 = t14 + t70
t95 = y12 + t85
y4 = t94 + t95
"""),
(Anubis, """
# Generated with slp_heuristic, XOR Count 113
t0 = x6 + x14
t1 = x22 + x30
t2 = x0 + x15
t3 = x7 + x8
t4 = x16 + x31
t5 = x23 + x24
t6 = x3 + x15
t7 = x7 + x11
t8 = x19 + x31
t9 = x23 + x27
t10 = x2 + t0
t11 = x18 + t1
t12 = x1 + x17
t13 = t2 + t3
t14 = x9 + x25
t15 = t4 + t5
t16 = x4 + x12
t17 = x5 + x21
t18 = x13 + x22
t19 = x23 + t1
y8 = t3 + t19
t21 = x5 + t18
t22 = x20 + x28
t23 = x6 + x29
t24 = x7 + t0
y24 = t5 + t24
t26 = x21 + t23
t27 = x4 + x20
t28 = t6 + t7
t29 = x12 + x28
t30 = t8 + t9
t31 = x8 + x24
t32 = x15 + t0
y16 = t4 + t32
t34 = t1 + t2
y0 = x31 + t34
t36 = x15 + t19
t37 = x9 + t24
t38 = x2 + x18
t39 = x17 + x31
t40 = x10 + x26
t41 = x10 + t10
t42 = x26 + t11
t43 = x1 + t31
y1 = t36 + t43
t45 = x2 + t14
y2 = t15 + t45
t47 = x5 + t29
y5 = t30 + t47
t49 = x6 + x31
y31 = t21 + t49
t51 = x10 + t12
y10 = t15 + t51
t53 = x13 + t22
y6 = t23 + t53
t55 = x13 + t27
y13 = t30 + t55
t57 = x14 + t17
y14 = t22 + t57
t59 = x14 + t19
y23 = t21 + t59
t61 = x15 + x22
y15 = t26 + t61
t63 = x18 + t13
y18 = t14 + t63
t65 = x21 + t28
y21 = t29 + t65
t67 = x26 + t12
y26 = t13 + t67
t69 = x29 + t16
y22 = t18 + t69
t71 = x29 + t27
y29 = t28 + t71
t73 = x30 + t16
y30 = t17 + t73
t75 = x30 + t24
y7 = t26 + t75
t77 = t24 + t31
y17 = t39 + t77
t79 = y16 + t34