forked from mit-plv/fiat-crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
p256_scalar_32.c
5558 lines (5533 loc) · 195 KB
/
p256_scalar_32.c
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
/* Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --inline --static --use-value-barrier p256_scalar 32 '2^256 - 2^224 + 2^192 - 89188191075325690597107910205041859247' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes one msat divstep divstep_precomp */
/* curve description: p256_scalar */
/* machine_wordsize = 32 (from "32") */
/* requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp */
/* m = 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551 (from "2^256 - 2^224 + 2^192 - 89188191075325690597107910205041859247") */
/* */
/* NOTE: In addition to the bounds specified above each function, all */
/* functions synthesized for this Montgomery arithmetic require the */
/* input to be strictly less than the prime modulus (m), and also */
/* require the input to be in the unique saturated representation. */
/* All functions also ensure that these two properties are true of */
/* return values. */
/* */
/* Computed values: */
/* eval z = z[0] + (z[1] << 32) + (z[2] << 64) + (z[3] << 96) + (z[4] << 128) + (z[5] << 160) + (z[6] << 192) + (z[7] << 224) */
/* bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) */
/* twos_complement_eval z = let x1 := z[0] + (z[1] << 32) + (z[2] << 64) + (z[3] << 96) + (z[4] << 128) + (z[5] << 160) + (z[6] << 192) + (z[7] << 224) in */
/* if x1 & (2^256-1) < 2^255 then x1 & (2^256-1) else (x1 & (2^256-1)) - 2^256 */
#include <stdint.h>
typedef unsigned char fiat_p256_scalar_uint1;
typedef signed char fiat_p256_scalar_int1;
#if defined(__GNUC__) || defined(__clang__)
# define FIAT_P256_SCALAR_FIAT_INLINE __inline__
#else
# define FIAT_P256_SCALAR_FIAT_INLINE
#endif
/* The type fiat_p256_scalar_montgomery_domain_field_element is a field element in the Montgomery domain. */
/* Bounds: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */
typedef uint32_t fiat_p256_scalar_montgomery_domain_field_element[8];
/* The type fiat_p256_scalar_non_montgomery_domain_field_element is a field element NOT in the Montgomery domain. */
/* Bounds: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */
typedef uint32_t fiat_p256_scalar_non_montgomery_domain_field_element[8];
#if (-1 & 3) != 3
#error "This code only works on a two's complement system"
#endif
#if !defined(FIAT_P256_SCALAR_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
static __inline__ uint32_t fiat_p256_scalar_value_barrier_u32(uint32_t a) {
__asm__("" : "+r"(a) : /* no inputs */);
return a;
}
#else
# define fiat_p256_scalar_value_barrier_u32(x) (x)
#endif
/*
* The function fiat_p256_scalar_addcarryx_u32 is an addition with carry.
*
* Postconditions:
* out1 = (arg1 + arg2 + arg3) mod 2^32
* out2 = ⌊(arg1 + arg2 + arg3) / 2^32⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffff]
* arg3: [0x0 ~> 0xffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffff]
* out2: [0x0 ~> 0x1]
*/
static FIAT_P256_SCALAR_FIAT_INLINE void fiat_p256_scalar_addcarryx_u32(uint32_t* out1, fiat_p256_scalar_uint1* out2, fiat_p256_scalar_uint1 arg1, uint32_t arg2, uint32_t arg3) {
uint64_t x1;
uint32_t x2;
fiat_p256_scalar_uint1 x3;
x1 = ((arg1 + (uint64_t)arg2) + arg3);
x2 = (uint32_t)(x1 & UINT32_C(0xffffffff));
x3 = (fiat_p256_scalar_uint1)(x1 >> 32);
*out1 = x2;
*out2 = x3;
}
/*
* The function fiat_p256_scalar_subborrowx_u32 is a subtraction with borrow.
*
* Postconditions:
* out1 = (-arg1 + arg2 + -arg3) mod 2^32
* out2 = -⌊(-arg1 + arg2 + -arg3) / 2^32⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffff]
* arg3: [0x0 ~> 0xffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffff]
* out2: [0x0 ~> 0x1]
*/
static FIAT_P256_SCALAR_FIAT_INLINE void fiat_p256_scalar_subborrowx_u32(uint32_t* out1, fiat_p256_scalar_uint1* out2, fiat_p256_scalar_uint1 arg1, uint32_t arg2, uint32_t arg3) {
int64_t x1;
fiat_p256_scalar_int1 x2;
uint32_t x3;
x1 = ((arg2 - (int64_t)arg1) - arg3);
x2 = (fiat_p256_scalar_int1)(x1 >> 32);
x3 = (uint32_t)(x1 & UINT32_C(0xffffffff));
*out1 = x3;
*out2 = (fiat_p256_scalar_uint1)(0x0 - x2);
}
/*
* The function fiat_p256_scalar_mulx_u32 is a multiplication, returning the full double-width result.
*
* Postconditions:
* out1 = (arg1 * arg2) mod 2^32
* out2 = ⌊arg1 * arg2 / 2^32⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0xffffffff]
* arg2: [0x0 ~> 0xffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffff]
* out2: [0x0 ~> 0xffffffff]
*/
static FIAT_P256_SCALAR_FIAT_INLINE void fiat_p256_scalar_mulx_u32(uint32_t* out1, uint32_t* out2, uint32_t arg1, uint32_t arg2) {
uint64_t x1;
uint32_t x2;
uint32_t x3;
x1 = ((uint64_t)arg1 * arg2);
x2 = (uint32_t)(x1 & UINT32_C(0xffffffff));
x3 = (uint32_t)(x1 >> 32);
*out1 = x2;
*out2 = x3;
}
/*
* The function fiat_p256_scalar_cmovznz_u32 is a single-word conditional move.
*
* Postconditions:
* out1 = (if arg1 = 0 then arg2 else arg3)
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffff]
* arg3: [0x0 ~> 0xffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffff]
*/
static FIAT_P256_SCALAR_FIAT_INLINE void fiat_p256_scalar_cmovznz_u32(uint32_t* out1, fiat_p256_scalar_uint1 arg1, uint32_t arg2, uint32_t arg3) {
fiat_p256_scalar_uint1 x1;
uint32_t x2;
uint32_t x3;
x1 = (!(!arg1));
x2 = ((fiat_p256_scalar_int1)(0x0 - x1) & UINT32_C(0xffffffff));
x3 = ((fiat_p256_scalar_value_barrier_u32(x2) & arg3) | (fiat_p256_scalar_value_barrier_u32((~x2)) & arg2));
*out1 = x3;
}
/*
* The function fiat_p256_scalar_mul multiplies two field elements in the Montgomery domain.
*
* Preconditions:
* 0 ≤ eval arg1 < m
* 0 ≤ eval arg2 < m
* Postconditions:
* eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
* 0 ≤ eval out1 < m
*
*/
static FIAT_P256_SCALAR_FIAT_INLINE void fiat_p256_scalar_mul(fiat_p256_scalar_montgomery_domain_field_element out1, const fiat_p256_scalar_montgomery_domain_field_element arg1, const fiat_p256_scalar_montgomery_domain_field_element arg2) {
uint32_t x1;
uint32_t x2;
uint32_t x3;
uint32_t x4;
uint32_t x5;
uint32_t x6;
uint32_t x7;
uint32_t x8;
uint32_t x9;
uint32_t x10;
uint32_t x11;
uint32_t x12;
uint32_t x13;
uint32_t x14;
uint32_t x15;
uint32_t x16;
uint32_t x17;
uint32_t x18;
uint32_t x19;
uint32_t x20;
uint32_t x21;
uint32_t x22;
uint32_t x23;
uint32_t x24;
uint32_t x25;
fiat_p256_scalar_uint1 x26;
uint32_t x27;
fiat_p256_scalar_uint1 x28;
uint32_t x29;
fiat_p256_scalar_uint1 x30;
uint32_t x31;
fiat_p256_scalar_uint1 x32;
uint32_t x33;
fiat_p256_scalar_uint1 x34;
uint32_t x35;
fiat_p256_scalar_uint1 x36;
uint32_t x37;
fiat_p256_scalar_uint1 x38;
uint32_t x39;
uint32_t x40;
uint32_t x41;
uint32_t x42;
uint32_t x43;
uint32_t x44;
uint32_t x45;
uint32_t x46;
uint32_t x47;
uint32_t x48;
uint32_t x49;
uint32_t x50;
uint32_t x51;
uint32_t x52;
uint32_t x53;
uint32_t x54;
uint32_t x55;
uint32_t x56;
fiat_p256_scalar_uint1 x57;
uint32_t x58;
fiat_p256_scalar_uint1 x59;
uint32_t x60;
fiat_p256_scalar_uint1 x61;
uint32_t x62;
fiat_p256_scalar_uint1 x63;
uint32_t x64;
fiat_p256_scalar_uint1 x65;
uint32_t x66;
uint32_t x67;
fiat_p256_scalar_uint1 x68;
uint32_t x69;
fiat_p256_scalar_uint1 x70;
uint32_t x71;
fiat_p256_scalar_uint1 x72;
uint32_t x73;
fiat_p256_scalar_uint1 x74;
uint32_t x75;
fiat_p256_scalar_uint1 x76;
uint32_t x77;
fiat_p256_scalar_uint1 x78;
uint32_t x79;
fiat_p256_scalar_uint1 x80;
uint32_t x81;
fiat_p256_scalar_uint1 x82;
uint32_t x83;
fiat_p256_scalar_uint1 x84;
uint32_t x85;
uint32_t x86;
uint32_t x87;
uint32_t x88;
uint32_t x89;
uint32_t x90;
uint32_t x91;
uint32_t x92;
uint32_t x93;
uint32_t x94;
uint32_t x95;
uint32_t x96;
uint32_t x97;
uint32_t x98;
uint32_t x99;
uint32_t x100;
uint32_t x101;
fiat_p256_scalar_uint1 x102;
uint32_t x103;
fiat_p256_scalar_uint1 x104;
uint32_t x105;
fiat_p256_scalar_uint1 x106;
uint32_t x107;
fiat_p256_scalar_uint1 x108;
uint32_t x109;
fiat_p256_scalar_uint1 x110;
uint32_t x111;
fiat_p256_scalar_uint1 x112;
uint32_t x113;
fiat_p256_scalar_uint1 x114;
uint32_t x115;
uint32_t x116;
fiat_p256_scalar_uint1 x117;
uint32_t x118;
fiat_p256_scalar_uint1 x119;
uint32_t x120;
fiat_p256_scalar_uint1 x121;
uint32_t x122;
fiat_p256_scalar_uint1 x123;
uint32_t x124;
fiat_p256_scalar_uint1 x125;
uint32_t x126;
fiat_p256_scalar_uint1 x127;
uint32_t x128;
fiat_p256_scalar_uint1 x129;
uint32_t x130;
fiat_p256_scalar_uint1 x131;
uint32_t x132;
fiat_p256_scalar_uint1 x133;
uint32_t x134;
uint32_t x135;
uint32_t x136;
uint32_t x137;
uint32_t x138;
uint32_t x139;
uint32_t x140;
uint32_t x141;
uint32_t x142;
uint32_t x143;
uint32_t x144;
uint32_t x145;
uint32_t x146;
uint32_t x147;
uint32_t x148;
uint32_t x149;
uint32_t x150;
fiat_p256_scalar_uint1 x151;
uint32_t x152;
fiat_p256_scalar_uint1 x153;
uint32_t x154;
fiat_p256_scalar_uint1 x155;
uint32_t x156;
fiat_p256_scalar_uint1 x157;
uint32_t x158;
fiat_p256_scalar_uint1 x159;
uint32_t x160;
uint32_t x161;
fiat_p256_scalar_uint1 x162;
uint32_t x163;
fiat_p256_scalar_uint1 x164;
uint32_t x165;
fiat_p256_scalar_uint1 x166;
uint32_t x167;
fiat_p256_scalar_uint1 x168;
uint32_t x169;
fiat_p256_scalar_uint1 x170;
uint32_t x171;
fiat_p256_scalar_uint1 x172;
uint32_t x173;
fiat_p256_scalar_uint1 x174;
uint32_t x175;
fiat_p256_scalar_uint1 x176;
uint32_t x177;
fiat_p256_scalar_uint1 x178;
uint32_t x179;
uint32_t x180;
uint32_t x181;
uint32_t x182;
uint32_t x183;
uint32_t x184;
uint32_t x185;
uint32_t x186;
uint32_t x187;
uint32_t x188;
uint32_t x189;
uint32_t x190;
uint32_t x191;
uint32_t x192;
uint32_t x193;
uint32_t x194;
uint32_t x195;
uint32_t x196;
fiat_p256_scalar_uint1 x197;
uint32_t x198;
fiat_p256_scalar_uint1 x199;
uint32_t x200;
fiat_p256_scalar_uint1 x201;
uint32_t x202;
fiat_p256_scalar_uint1 x203;
uint32_t x204;
fiat_p256_scalar_uint1 x205;
uint32_t x206;
fiat_p256_scalar_uint1 x207;
uint32_t x208;
fiat_p256_scalar_uint1 x209;
uint32_t x210;
uint32_t x211;
fiat_p256_scalar_uint1 x212;
uint32_t x213;
fiat_p256_scalar_uint1 x214;
uint32_t x215;
fiat_p256_scalar_uint1 x216;
uint32_t x217;
fiat_p256_scalar_uint1 x218;
uint32_t x219;
fiat_p256_scalar_uint1 x220;
uint32_t x221;
fiat_p256_scalar_uint1 x222;
uint32_t x223;
fiat_p256_scalar_uint1 x224;
uint32_t x225;
fiat_p256_scalar_uint1 x226;
uint32_t x227;
fiat_p256_scalar_uint1 x228;
uint32_t x229;
uint32_t x230;
uint32_t x231;
uint32_t x232;
uint32_t x233;
uint32_t x234;
uint32_t x235;
uint32_t x236;
uint32_t x237;
uint32_t x238;
uint32_t x239;
uint32_t x240;
uint32_t x241;
uint32_t x242;
uint32_t x243;
uint32_t x244;
uint32_t x245;
fiat_p256_scalar_uint1 x246;
uint32_t x247;
fiat_p256_scalar_uint1 x248;
uint32_t x249;
fiat_p256_scalar_uint1 x250;
uint32_t x251;
fiat_p256_scalar_uint1 x252;
uint32_t x253;
fiat_p256_scalar_uint1 x254;
uint32_t x255;
uint32_t x256;
fiat_p256_scalar_uint1 x257;
uint32_t x258;
fiat_p256_scalar_uint1 x259;
uint32_t x260;
fiat_p256_scalar_uint1 x261;
uint32_t x262;
fiat_p256_scalar_uint1 x263;
uint32_t x264;
fiat_p256_scalar_uint1 x265;
uint32_t x266;
fiat_p256_scalar_uint1 x267;
uint32_t x268;
fiat_p256_scalar_uint1 x269;
uint32_t x270;
fiat_p256_scalar_uint1 x271;
uint32_t x272;
fiat_p256_scalar_uint1 x273;
uint32_t x274;
uint32_t x275;
uint32_t x276;
uint32_t x277;
uint32_t x278;
uint32_t x279;
uint32_t x280;
uint32_t x281;
uint32_t x282;
uint32_t x283;
uint32_t x284;
uint32_t x285;
uint32_t x286;
uint32_t x287;
uint32_t x288;
uint32_t x289;
uint32_t x290;
uint32_t x291;
fiat_p256_scalar_uint1 x292;
uint32_t x293;
fiat_p256_scalar_uint1 x294;
uint32_t x295;
fiat_p256_scalar_uint1 x296;
uint32_t x297;
fiat_p256_scalar_uint1 x298;
uint32_t x299;
fiat_p256_scalar_uint1 x300;
uint32_t x301;
fiat_p256_scalar_uint1 x302;
uint32_t x303;
fiat_p256_scalar_uint1 x304;
uint32_t x305;
uint32_t x306;
fiat_p256_scalar_uint1 x307;
uint32_t x308;
fiat_p256_scalar_uint1 x309;
uint32_t x310;
fiat_p256_scalar_uint1 x311;
uint32_t x312;
fiat_p256_scalar_uint1 x313;
uint32_t x314;
fiat_p256_scalar_uint1 x315;
uint32_t x316;
fiat_p256_scalar_uint1 x317;
uint32_t x318;
fiat_p256_scalar_uint1 x319;
uint32_t x320;
fiat_p256_scalar_uint1 x321;
uint32_t x322;
fiat_p256_scalar_uint1 x323;
uint32_t x324;
uint32_t x325;
uint32_t x326;
uint32_t x327;
uint32_t x328;
uint32_t x329;
uint32_t x330;
uint32_t x331;
uint32_t x332;
uint32_t x333;
uint32_t x334;
uint32_t x335;
uint32_t x336;
uint32_t x337;
uint32_t x338;
uint32_t x339;
uint32_t x340;
fiat_p256_scalar_uint1 x341;
uint32_t x342;
fiat_p256_scalar_uint1 x343;
uint32_t x344;
fiat_p256_scalar_uint1 x345;
uint32_t x346;
fiat_p256_scalar_uint1 x347;
uint32_t x348;
fiat_p256_scalar_uint1 x349;
uint32_t x350;
uint32_t x351;
fiat_p256_scalar_uint1 x352;
uint32_t x353;
fiat_p256_scalar_uint1 x354;
uint32_t x355;
fiat_p256_scalar_uint1 x356;
uint32_t x357;
fiat_p256_scalar_uint1 x358;
uint32_t x359;
fiat_p256_scalar_uint1 x360;
uint32_t x361;
fiat_p256_scalar_uint1 x362;
uint32_t x363;
fiat_p256_scalar_uint1 x364;
uint32_t x365;
fiat_p256_scalar_uint1 x366;
uint32_t x367;
fiat_p256_scalar_uint1 x368;
uint32_t x369;
uint32_t x370;
uint32_t x371;
uint32_t x372;
uint32_t x373;
uint32_t x374;
uint32_t x375;
uint32_t x376;
uint32_t x377;
uint32_t x378;
uint32_t x379;
uint32_t x380;
uint32_t x381;
uint32_t x382;
uint32_t x383;
uint32_t x384;
uint32_t x385;
uint32_t x386;
fiat_p256_scalar_uint1 x387;
uint32_t x388;
fiat_p256_scalar_uint1 x389;
uint32_t x390;
fiat_p256_scalar_uint1 x391;
uint32_t x392;
fiat_p256_scalar_uint1 x393;
uint32_t x394;
fiat_p256_scalar_uint1 x395;
uint32_t x396;
fiat_p256_scalar_uint1 x397;
uint32_t x398;
fiat_p256_scalar_uint1 x399;
uint32_t x400;
uint32_t x401;
fiat_p256_scalar_uint1 x402;
uint32_t x403;
fiat_p256_scalar_uint1 x404;
uint32_t x405;
fiat_p256_scalar_uint1 x406;
uint32_t x407;
fiat_p256_scalar_uint1 x408;
uint32_t x409;
fiat_p256_scalar_uint1 x410;
uint32_t x411;
fiat_p256_scalar_uint1 x412;
uint32_t x413;
fiat_p256_scalar_uint1 x414;
uint32_t x415;
fiat_p256_scalar_uint1 x416;
uint32_t x417;
fiat_p256_scalar_uint1 x418;
uint32_t x419;
uint32_t x420;
uint32_t x421;
uint32_t x422;
uint32_t x423;
uint32_t x424;
uint32_t x425;
uint32_t x426;
uint32_t x427;
uint32_t x428;
uint32_t x429;
uint32_t x430;
uint32_t x431;
uint32_t x432;
uint32_t x433;
uint32_t x434;
uint32_t x435;
fiat_p256_scalar_uint1 x436;
uint32_t x437;
fiat_p256_scalar_uint1 x438;
uint32_t x439;
fiat_p256_scalar_uint1 x440;
uint32_t x441;
fiat_p256_scalar_uint1 x442;
uint32_t x443;
fiat_p256_scalar_uint1 x444;
uint32_t x445;
uint32_t x446;
fiat_p256_scalar_uint1 x447;
uint32_t x448;
fiat_p256_scalar_uint1 x449;
uint32_t x450;
fiat_p256_scalar_uint1 x451;
uint32_t x452;
fiat_p256_scalar_uint1 x453;
uint32_t x454;
fiat_p256_scalar_uint1 x455;
uint32_t x456;
fiat_p256_scalar_uint1 x457;
uint32_t x458;
fiat_p256_scalar_uint1 x459;
uint32_t x460;
fiat_p256_scalar_uint1 x461;
uint32_t x462;
fiat_p256_scalar_uint1 x463;
uint32_t x464;
uint32_t x465;
uint32_t x466;
uint32_t x467;
uint32_t x468;
uint32_t x469;
uint32_t x470;
uint32_t x471;
uint32_t x472;
uint32_t x473;
uint32_t x474;
uint32_t x475;
uint32_t x476;
uint32_t x477;
uint32_t x478;
uint32_t x479;
uint32_t x480;
uint32_t x481;
fiat_p256_scalar_uint1 x482;
uint32_t x483;
fiat_p256_scalar_uint1 x484;
uint32_t x485;
fiat_p256_scalar_uint1 x486;
uint32_t x487;
fiat_p256_scalar_uint1 x488;
uint32_t x489;
fiat_p256_scalar_uint1 x490;
uint32_t x491;
fiat_p256_scalar_uint1 x492;
uint32_t x493;
fiat_p256_scalar_uint1 x494;
uint32_t x495;
uint32_t x496;
fiat_p256_scalar_uint1 x497;
uint32_t x498;
fiat_p256_scalar_uint1 x499;
uint32_t x500;
fiat_p256_scalar_uint1 x501;
uint32_t x502;
fiat_p256_scalar_uint1 x503;
uint32_t x504;
fiat_p256_scalar_uint1 x505;
uint32_t x506;
fiat_p256_scalar_uint1 x507;
uint32_t x508;
fiat_p256_scalar_uint1 x509;
uint32_t x510;
fiat_p256_scalar_uint1 x511;
uint32_t x512;
fiat_p256_scalar_uint1 x513;
uint32_t x514;
uint32_t x515;
uint32_t x516;
uint32_t x517;
uint32_t x518;
uint32_t x519;
uint32_t x520;
uint32_t x521;
uint32_t x522;
uint32_t x523;
uint32_t x524;
uint32_t x525;
uint32_t x526;
uint32_t x527;
uint32_t x528;
uint32_t x529;
uint32_t x530;
fiat_p256_scalar_uint1 x531;
uint32_t x532;
fiat_p256_scalar_uint1 x533;
uint32_t x534;
fiat_p256_scalar_uint1 x535;
uint32_t x536;
fiat_p256_scalar_uint1 x537;
uint32_t x538;
fiat_p256_scalar_uint1 x539;
uint32_t x540;
uint32_t x541;
fiat_p256_scalar_uint1 x542;
uint32_t x543;
fiat_p256_scalar_uint1 x544;
uint32_t x545;
fiat_p256_scalar_uint1 x546;
uint32_t x547;
fiat_p256_scalar_uint1 x548;
uint32_t x549;
fiat_p256_scalar_uint1 x550;
uint32_t x551;
fiat_p256_scalar_uint1 x552;
uint32_t x553;
fiat_p256_scalar_uint1 x554;
uint32_t x555;
fiat_p256_scalar_uint1 x556;
uint32_t x557;
fiat_p256_scalar_uint1 x558;
uint32_t x559;
uint32_t x560;
uint32_t x561;
uint32_t x562;
uint32_t x563;
uint32_t x564;
uint32_t x565;
uint32_t x566;
uint32_t x567;
uint32_t x568;
uint32_t x569;
uint32_t x570;
uint32_t x571;
uint32_t x572;
uint32_t x573;
uint32_t x574;
uint32_t x575;
uint32_t x576;
fiat_p256_scalar_uint1 x577;
uint32_t x578;
fiat_p256_scalar_uint1 x579;
uint32_t x580;
fiat_p256_scalar_uint1 x581;
uint32_t x582;
fiat_p256_scalar_uint1 x583;
uint32_t x584;
fiat_p256_scalar_uint1 x585;
uint32_t x586;
fiat_p256_scalar_uint1 x587;
uint32_t x588;
fiat_p256_scalar_uint1 x589;
uint32_t x590;
uint32_t x591;
fiat_p256_scalar_uint1 x592;
uint32_t x593;
fiat_p256_scalar_uint1 x594;
uint32_t x595;
fiat_p256_scalar_uint1 x596;
uint32_t x597;
fiat_p256_scalar_uint1 x598;
uint32_t x599;
fiat_p256_scalar_uint1 x600;
uint32_t x601;
fiat_p256_scalar_uint1 x602;
uint32_t x603;
fiat_p256_scalar_uint1 x604;
uint32_t x605;
fiat_p256_scalar_uint1 x606;
uint32_t x607;
fiat_p256_scalar_uint1 x608;
uint32_t x609;
uint32_t x610;
uint32_t x611;
uint32_t x612;
uint32_t x613;
uint32_t x614;
uint32_t x615;
uint32_t x616;
uint32_t x617;
uint32_t x618;
uint32_t x619;
uint32_t x620;
uint32_t x621;
uint32_t x622;
uint32_t x623;
uint32_t x624;
uint32_t x625;
fiat_p256_scalar_uint1 x626;
uint32_t x627;
fiat_p256_scalar_uint1 x628;
uint32_t x629;
fiat_p256_scalar_uint1 x630;
uint32_t x631;
fiat_p256_scalar_uint1 x632;
uint32_t x633;
fiat_p256_scalar_uint1 x634;
uint32_t x635;
uint32_t x636;
fiat_p256_scalar_uint1 x637;
uint32_t x638;
fiat_p256_scalar_uint1 x639;
uint32_t x640;
fiat_p256_scalar_uint1 x641;
uint32_t x642;
fiat_p256_scalar_uint1 x643;
uint32_t x644;
fiat_p256_scalar_uint1 x645;
uint32_t x646;
fiat_p256_scalar_uint1 x647;
uint32_t x648;
fiat_p256_scalar_uint1 x649;
uint32_t x650;
fiat_p256_scalar_uint1 x651;
uint32_t x652;
fiat_p256_scalar_uint1 x653;
uint32_t x654;
uint32_t x655;
uint32_t x656;
uint32_t x657;
uint32_t x658;
uint32_t x659;
uint32_t x660;
uint32_t x661;
uint32_t x662;
uint32_t x663;
uint32_t x664;
uint32_t x665;
uint32_t x666;
uint32_t x667;
uint32_t x668;
uint32_t x669;
uint32_t x670;
uint32_t x671;
fiat_p256_scalar_uint1 x672;
uint32_t x673;
fiat_p256_scalar_uint1 x674;
uint32_t x675;
fiat_p256_scalar_uint1 x676;
uint32_t x677;
fiat_p256_scalar_uint1 x678;
uint32_t x679;
fiat_p256_scalar_uint1 x680;
uint32_t x681;
fiat_p256_scalar_uint1 x682;
uint32_t x683;
fiat_p256_scalar_uint1 x684;
uint32_t x685;
uint32_t x686;
fiat_p256_scalar_uint1 x687;
uint32_t x688;
fiat_p256_scalar_uint1 x689;
uint32_t x690;
fiat_p256_scalar_uint1 x691;
uint32_t x692;
fiat_p256_scalar_uint1 x693;
uint32_t x694;
fiat_p256_scalar_uint1 x695;
uint32_t x696;
fiat_p256_scalar_uint1 x697;
uint32_t x698;
fiat_p256_scalar_uint1 x699;
uint32_t x700;
fiat_p256_scalar_uint1 x701;
uint32_t x702;
fiat_p256_scalar_uint1 x703;
uint32_t x704;
uint32_t x705;
uint32_t x706;
uint32_t x707;
uint32_t x708;
uint32_t x709;
uint32_t x710;
uint32_t x711;
uint32_t x712;
uint32_t x713;
uint32_t x714;
uint32_t x715;
uint32_t x716;
uint32_t x717;
uint32_t x718;
uint32_t x719;
uint32_t x720;
fiat_p256_scalar_uint1 x721;
uint32_t x722;
fiat_p256_scalar_uint1 x723;
uint32_t x724;
fiat_p256_scalar_uint1 x725;
uint32_t x726;
fiat_p256_scalar_uint1 x727;
uint32_t x728;
fiat_p256_scalar_uint1 x729;
uint32_t x730;
uint32_t x731;
fiat_p256_scalar_uint1 x732;
uint32_t x733;
fiat_p256_scalar_uint1 x734;
uint32_t x735;
fiat_p256_scalar_uint1 x736;
uint32_t x737;
fiat_p256_scalar_uint1 x738;
uint32_t x739;
fiat_p256_scalar_uint1 x740;
uint32_t x741;
fiat_p256_scalar_uint1 x742;
uint32_t x743;
fiat_p256_scalar_uint1 x744;
uint32_t x745;
fiat_p256_scalar_uint1 x746;
uint32_t x747;
fiat_p256_scalar_uint1 x748;
uint32_t x749;
uint32_t x750;
fiat_p256_scalar_uint1 x751;
uint32_t x752;
fiat_p256_scalar_uint1 x753;
uint32_t x754;
fiat_p256_scalar_uint1 x755;
uint32_t x756;
fiat_p256_scalar_uint1 x757;
uint32_t x758;
fiat_p256_scalar_uint1 x759;
uint32_t x760;
fiat_p256_scalar_uint1 x761;
uint32_t x762;
fiat_p256_scalar_uint1 x763;
uint32_t x764;
fiat_p256_scalar_uint1 x765;
uint32_t x766;
fiat_p256_scalar_uint1 x767;
uint32_t x768;
uint32_t x769;
uint32_t x770;
uint32_t x771;
uint32_t x772;
uint32_t x773;
uint32_t x774;
uint32_t x775;
x1 = (arg1[1]);
x2 = (arg1[2]);
x3 = (arg1[3]);
x4 = (arg1[4]);
x5 = (arg1[5]);
x6 = (arg1[6]);
x7 = (arg1[7]);
x8 = (arg1[0]);
fiat_p256_scalar_mulx_u32(&x9, &x10, x8, (arg2[7]));
fiat_p256_scalar_mulx_u32(&x11, &x12, x8, (arg2[6]));
fiat_p256_scalar_mulx_u32(&x13, &x14, x8, (arg2[5]));
fiat_p256_scalar_mulx_u32(&x15, &x16, x8, (arg2[4]));
fiat_p256_scalar_mulx_u32(&x17, &x18, x8, (arg2[3]));
fiat_p256_scalar_mulx_u32(&x19, &x20, x8, (arg2[2]));
fiat_p256_scalar_mulx_u32(&x21, &x22, x8, (arg2[1]));
fiat_p256_scalar_mulx_u32(&x23, &x24, x8, (arg2[0]));
fiat_p256_scalar_addcarryx_u32(&x25, &x26, 0x0, x24, x21);
fiat_p256_scalar_addcarryx_u32(&x27, &x28, x26, x22, x19);
fiat_p256_scalar_addcarryx_u32(&x29, &x30, x28, x20, x17);
fiat_p256_scalar_addcarryx_u32(&x31, &x32, x30, x18, x15);
fiat_p256_scalar_addcarryx_u32(&x33, &x34, x32, x16, x13);
fiat_p256_scalar_addcarryx_u32(&x35, &x36, x34, x14, x11);
fiat_p256_scalar_addcarryx_u32(&x37, &x38, x36, x12, x9);
x39 = (x38 + x10);
fiat_p256_scalar_mulx_u32(&x40, &x41, x23, UINT32_C(0xee00bc4f));
fiat_p256_scalar_mulx_u32(&x42, &x43, x40, UINT32_C(0xffffffff));
fiat_p256_scalar_mulx_u32(&x44, &x45, x40, UINT32_C(0xffffffff));
fiat_p256_scalar_mulx_u32(&x46, &x47, x40, UINT32_C(0xffffffff));
fiat_p256_scalar_mulx_u32(&x48, &x49, x40, UINT32_C(0xbce6faad));
fiat_p256_scalar_mulx_u32(&x50, &x51, x40, UINT32_C(0xa7179e84));
fiat_p256_scalar_mulx_u32(&x52, &x53, x40, UINT32_C(0xf3b9cac2));
fiat_p256_scalar_mulx_u32(&x54, &x55, x40, UINT32_C(0xfc632551));
fiat_p256_scalar_addcarryx_u32(&x56, &x57, 0x0, x55, x52);
fiat_p256_scalar_addcarryx_u32(&x58, &x59, x57, x53, x50);
fiat_p256_scalar_addcarryx_u32(&x60, &x61, x59, x51, x48);
fiat_p256_scalar_addcarryx_u32(&x62, &x63, x61, x49, x46);
fiat_p256_scalar_addcarryx_u32(&x64, &x65, x63, x47, x44);
x66 = (x65 + x45);
fiat_p256_scalar_addcarryx_u32(&x67, &x68, 0x0, x23, x54);
fiat_p256_scalar_addcarryx_u32(&x69, &x70, x68, x25, x56);
fiat_p256_scalar_addcarryx_u32(&x71, &x72, x70, x27, x58);
fiat_p256_scalar_addcarryx_u32(&x73, &x74, x72, x29, x60);
fiat_p256_scalar_addcarryx_u32(&x75, &x76, x74, x31, x62);
fiat_p256_scalar_addcarryx_u32(&x77, &x78, x76, x33, x64);
fiat_p256_scalar_addcarryx_u32(&x79, &x80, x78, x35, x66);
fiat_p256_scalar_addcarryx_u32(&x81, &x82, x80, x37, x42);
fiat_p256_scalar_addcarryx_u32(&x83, &x84, x82, x39, x43);
fiat_p256_scalar_mulx_u32(&x85, &x86, x1, (arg2[7]));
fiat_p256_scalar_mulx_u32(&x87, &x88, x1, (arg2[6]));
fiat_p256_scalar_mulx_u32(&x89, &x90, x1, (arg2[5]));
fiat_p256_scalar_mulx_u32(&x91, &x92, x1, (arg2[4]));
fiat_p256_scalar_mulx_u32(&x93, &x94, x1, (arg2[3]));
fiat_p256_scalar_mulx_u32(&x95, &x96, x1, (arg2[2]));
fiat_p256_scalar_mulx_u32(&x97, &x98, x1, (arg2[1]));
fiat_p256_scalar_mulx_u32(&x99, &x100, x1, (arg2[0]));
fiat_p256_scalar_addcarryx_u32(&x101, &x102, 0x0, x100, x97);
fiat_p256_scalar_addcarryx_u32(&x103, &x104, x102, x98, x95);
fiat_p256_scalar_addcarryx_u32(&x105, &x106, x104, x96, x93);
fiat_p256_scalar_addcarryx_u32(&x107, &x108, x106, x94, x91);
fiat_p256_scalar_addcarryx_u32(&x109, &x110, x108, x92, x89);
fiat_p256_scalar_addcarryx_u32(&x111, &x112, x110, x90, x87);
fiat_p256_scalar_addcarryx_u32(&x113, &x114, x112, x88, x85);
x115 = (x114 + x86);