-
Notifications
You must be signed in to change notification settings - Fork 147
/
p224_64.c
2073 lines (2047 loc) · 66.2 KB
/
p224_64.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 p224 64 '2^224 - 2^96 + 1' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes one msat divstep divstep_precomp */
/* curve description: p224 */
/* machine_wordsize = 64 (from "64") */
/* requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp */
/* m = 0xffffffffffffffffffffffffffffffff000000000000000000000001 (from "2^224 - 2^96 + 1") */
/* */
/* 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] << 64) + (z[2] << 128) + (z[3] << 192) */
/* 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) */
/* twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) 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_p224_uint1;
typedef signed char fiat_p224_int1;
#if defined(__GNUC__) || defined(__clang__)
# define FIAT_P224_FIAT_EXTENSION __extension__
# define FIAT_P224_FIAT_INLINE __inline__
#else
# define FIAT_P224_FIAT_EXTENSION
# define FIAT_P224_FIAT_INLINE
#endif
FIAT_P224_FIAT_EXTENSION typedef signed __int128 fiat_p224_int128;
FIAT_P224_FIAT_EXTENSION typedef unsigned __int128 fiat_p224_uint128;
/* The type fiat_p224_montgomery_domain_field_element is a field element in the Montgomery domain. */
/* Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] */
typedef uint64_t fiat_p224_montgomery_domain_field_element[4];
/* The type fiat_p224_non_montgomery_domain_field_element is a field element NOT in the Montgomery domain. */
/* Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] */
typedef uint64_t fiat_p224_non_montgomery_domain_field_element[4];
#if (-1 & 3) != 3
#error "This code only works on a two's complement system"
#endif
#if !defined(FIAT_P224_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
static __inline__ uint64_t fiat_p224_value_barrier_u64(uint64_t a) {
__asm__("" : "+r"(a) : /* no inputs */);
return a;
}
#else
# define fiat_p224_value_barrier_u64(x) (x)
#endif
/*
* The function fiat_p224_addcarryx_u64 is an addition with carry.
*
* Postconditions:
* out1 = (arg1 + arg2 + arg3) mod 2^64
* out2 = ⌊(arg1 + arg2 + arg3) / 2^64⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffffffffffff]
* arg3: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
* out2: [0x0 ~> 0x1]
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_addcarryx_u64(uint64_t* out1, fiat_p224_uint1* out2, fiat_p224_uint1 arg1, uint64_t arg2, uint64_t arg3) {
fiat_p224_uint128 x1;
uint64_t x2;
fiat_p224_uint1 x3;
x1 = ((arg1 + (fiat_p224_uint128)arg2) + arg3);
x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff));
x3 = (fiat_p224_uint1)(x1 >> 64);
*out1 = x2;
*out2 = x3;
}
/*
* The function fiat_p224_subborrowx_u64 is a subtraction with borrow.
*
* Postconditions:
* out1 = (-arg1 + arg2 + -arg3) mod 2^64
* out2 = -⌊(-arg1 + arg2 + -arg3) / 2^64⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffffffffffff]
* arg3: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
* out2: [0x0 ~> 0x1]
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_subborrowx_u64(uint64_t* out1, fiat_p224_uint1* out2, fiat_p224_uint1 arg1, uint64_t arg2, uint64_t arg3) {
fiat_p224_int128 x1;
fiat_p224_int1 x2;
uint64_t x3;
x1 = ((arg2 - (fiat_p224_int128)arg1) - arg3);
x2 = (fiat_p224_int1)(x1 >> 64);
x3 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff));
*out1 = x3;
*out2 = (fiat_p224_uint1)(0x0 - x2);
}
/*
* The function fiat_p224_mulx_u64 is a multiplication, returning the full double-width result.
*
* Postconditions:
* out1 = (arg1 * arg2) mod 2^64
* out2 = ⌊arg1 * arg2 / 2^64⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0xffffffffffffffff]
* arg2: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
* out2: [0x0 ~> 0xffffffffffffffff]
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_mulx_u64(uint64_t* out1, uint64_t* out2, uint64_t arg1, uint64_t arg2) {
fiat_p224_uint128 x1;
uint64_t x2;
uint64_t x3;
x1 = ((fiat_p224_uint128)arg1 * arg2);
x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff));
x3 = (uint64_t)(x1 >> 64);
*out1 = x2;
*out2 = x3;
}
/*
* The function fiat_p224_cmovznz_u64 is a single-word conditional move.
*
* Postconditions:
* out1 = (if arg1 = 0 then arg2 else arg3)
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffffffffffff]
* arg3: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_cmovznz_u64(uint64_t* out1, fiat_p224_uint1 arg1, uint64_t arg2, uint64_t arg3) {
fiat_p224_uint1 x1;
uint64_t x2;
uint64_t x3;
x1 = (!(!arg1));
x2 = ((fiat_p224_int1)(0x0 - x1) & UINT64_C(0xffffffffffffffff));
x3 = ((fiat_p224_value_barrier_u64(x2) & arg3) | (fiat_p224_value_barrier_u64((~x2)) & arg2));
*out1 = x3;
}
/*
* The function fiat_p224_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_P224_FIAT_INLINE void fiat_p224_mul(fiat_p224_montgomery_domain_field_element out1, const fiat_p224_montgomery_domain_field_element arg1, const fiat_p224_montgomery_domain_field_element arg2) {
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
uint64_t x6;
uint64_t x7;
uint64_t x8;
uint64_t x9;
uint64_t x10;
uint64_t x11;
uint64_t x12;
uint64_t x13;
fiat_p224_uint1 x14;
uint64_t x15;
fiat_p224_uint1 x16;
uint64_t x17;
fiat_p224_uint1 x18;
uint64_t x19;
uint64_t x20;
uint64_t x21;
uint64_t x22;
uint64_t x23;
uint64_t x24;
uint64_t x25;
uint64_t x26;
uint64_t x27;
uint64_t x28;
fiat_p224_uint1 x29;
uint64_t x30;
fiat_p224_uint1 x31;
uint64_t x32;
uint64_t x33;
fiat_p224_uint1 x34;
uint64_t x35;
fiat_p224_uint1 x36;
uint64_t x37;
fiat_p224_uint1 x38;
uint64_t x39;
fiat_p224_uint1 x40;
uint64_t x41;
fiat_p224_uint1 x42;
uint64_t x43;
uint64_t x44;
uint64_t x45;
uint64_t x46;
uint64_t x47;
uint64_t x48;
uint64_t x49;
uint64_t x50;
uint64_t x51;
fiat_p224_uint1 x52;
uint64_t x53;
fiat_p224_uint1 x54;
uint64_t x55;
fiat_p224_uint1 x56;
uint64_t x57;
uint64_t x58;
fiat_p224_uint1 x59;
uint64_t x60;
fiat_p224_uint1 x61;
uint64_t x62;
fiat_p224_uint1 x63;
uint64_t x64;
fiat_p224_uint1 x65;
uint64_t x66;
fiat_p224_uint1 x67;
uint64_t x68;
uint64_t x69;
uint64_t x70;
uint64_t x71;
uint64_t x72;
uint64_t x73;
uint64_t x74;
uint64_t x75;
uint64_t x76;
fiat_p224_uint1 x77;
uint64_t x78;
fiat_p224_uint1 x79;
uint64_t x80;
uint64_t x81;
fiat_p224_uint1 x82;
uint64_t x83;
fiat_p224_uint1 x84;
uint64_t x85;
fiat_p224_uint1 x86;
uint64_t x87;
fiat_p224_uint1 x88;
uint64_t x89;
fiat_p224_uint1 x90;
uint64_t x91;
uint64_t x92;
uint64_t x93;
uint64_t x94;
uint64_t x95;
uint64_t x96;
uint64_t x97;
uint64_t x98;
uint64_t x99;
uint64_t x100;
fiat_p224_uint1 x101;
uint64_t x102;
fiat_p224_uint1 x103;
uint64_t x104;
fiat_p224_uint1 x105;
uint64_t x106;
uint64_t x107;
fiat_p224_uint1 x108;
uint64_t x109;
fiat_p224_uint1 x110;
uint64_t x111;
fiat_p224_uint1 x112;
uint64_t x113;
fiat_p224_uint1 x114;
uint64_t x115;
fiat_p224_uint1 x116;
uint64_t x117;
uint64_t x118;
uint64_t x119;
uint64_t x120;
uint64_t x121;
uint64_t x122;
uint64_t x123;
uint64_t x124;
uint64_t x125;
fiat_p224_uint1 x126;
uint64_t x127;
fiat_p224_uint1 x128;
uint64_t x129;
uint64_t x130;
fiat_p224_uint1 x131;
uint64_t x132;
fiat_p224_uint1 x133;
uint64_t x134;
fiat_p224_uint1 x135;
uint64_t x136;
fiat_p224_uint1 x137;
uint64_t x138;
fiat_p224_uint1 x139;
uint64_t x140;
uint64_t x141;
uint64_t x142;
uint64_t x143;
uint64_t x144;
uint64_t x145;
uint64_t x146;
uint64_t x147;
uint64_t x148;
uint64_t x149;
fiat_p224_uint1 x150;
uint64_t x151;
fiat_p224_uint1 x152;
uint64_t x153;
fiat_p224_uint1 x154;
uint64_t x155;
uint64_t x156;
fiat_p224_uint1 x157;
uint64_t x158;
fiat_p224_uint1 x159;
uint64_t x160;
fiat_p224_uint1 x161;
uint64_t x162;
fiat_p224_uint1 x163;
uint64_t x164;
fiat_p224_uint1 x165;
uint64_t x166;
uint64_t x167;
uint64_t x168;
uint64_t x169;
uint64_t x170;
uint64_t x171;
uint64_t x172;
uint64_t x173;
uint64_t x174;
fiat_p224_uint1 x175;
uint64_t x176;
fiat_p224_uint1 x177;
uint64_t x178;
uint64_t x179;
fiat_p224_uint1 x180;
uint64_t x181;
fiat_p224_uint1 x182;
uint64_t x183;
fiat_p224_uint1 x184;
uint64_t x185;
fiat_p224_uint1 x186;
uint64_t x187;
fiat_p224_uint1 x188;
uint64_t x189;
uint64_t x190;
fiat_p224_uint1 x191;
uint64_t x192;
fiat_p224_uint1 x193;
uint64_t x194;
fiat_p224_uint1 x195;
uint64_t x196;
fiat_p224_uint1 x197;
uint64_t x198;
fiat_p224_uint1 x199;
uint64_t x200;
uint64_t x201;
uint64_t x202;
uint64_t x203;
x1 = (arg1[1]);
x2 = (arg1[2]);
x3 = (arg1[3]);
x4 = (arg1[0]);
fiat_p224_mulx_u64(&x5, &x6, x4, (arg2[3]));
fiat_p224_mulx_u64(&x7, &x8, x4, (arg2[2]));
fiat_p224_mulx_u64(&x9, &x10, x4, (arg2[1]));
fiat_p224_mulx_u64(&x11, &x12, x4, (arg2[0]));
fiat_p224_addcarryx_u64(&x13, &x14, 0x0, x12, x9);
fiat_p224_addcarryx_u64(&x15, &x16, x14, x10, x7);
fiat_p224_addcarryx_u64(&x17, &x18, x16, x8, x5);
x19 = (x18 + x6);
fiat_p224_mulx_u64(&x20, &x21, x11, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x22, &x23, x20, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x24, &x25, x20, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x26, &x27, x20, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x28, &x29, 0x0, x27, x24);
fiat_p224_addcarryx_u64(&x30, &x31, x29, x25, x22);
x32 = (x31 + x23);
fiat_p224_addcarryx_u64(&x33, &x34, 0x0, x11, x20);
fiat_p224_addcarryx_u64(&x35, &x36, x34, x13, x26);
fiat_p224_addcarryx_u64(&x37, &x38, x36, x15, x28);
fiat_p224_addcarryx_u64(&x39, &x40, x38, x17, x30);
fiat_p224_addcarryx_u64(&x41, &x42, x40, x19, x32);
fiat_p224_mulx_u64(&x43, &x44, x1, (arg2[3]));
fiat_p224_mulx_u64(&x45, &x46, x1, (arg2[2]));
fiat_p224_mulx_u64(&x47, &x48, x1, (arg2[1]));
fiat_p224_mulx_u64(&x49, &x50, x1, (arg2[0]));
fiat_p224_addcarryx_u64(&x51, &x52, 0x0, x50, x47);
fiat_p224_addcarryx_u64(&x53, &x54, x52, x48, x45);
fiat_p224_addcarryx_u64(&x55, &x56, x54, x46, x43);
x57 = (x56 + x44);
fiat_p224_addcarryx_u64(&x58, &x59, 0x0, x35, x49);
fiat_p224_addcarryx_u64(&x60, &x61, x59, x37, x51);
fiat_p224_addcarryx_u64(&x62, &x63, x61, x39, x53);
fiat_p224_addcarryx_u64(&x64, &x65, x63, x41, x55);
fiat_p224_addcarryx_u64(&x66, &x67, x65, x42, x57);
fiat_p224_mulx_u64(&x68, &x69, x58, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x70, &x71, x68, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x72, &x73, x68, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x74, &x75, x68, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x76, &x77, 0x0, x75, x72);
fiat_p224_addcarryx_u64(&x78, &x79, x77, x73, x70);
x80 = (x79 + x71);
fiat_p224_addcarryx_u64(&x81, &x82, 0x0, x58, x68);
fiat_p224_addcarryx_u64(&x83, &x84, x82, x60, x74);
fiat_p224_addcarryx_u64(&x85, &x86, x84, x62, x76);
fiat_p224_addcarryx_u64(&x87, &x88, x86, x64, x78);
fiat_p224_addcarryx_u64(&x89, &x90, x88, x66, x80);
x91 = ((uint64_t)x90 + x67);
fiat_p224_mulx_u64(&x92, &x93, x2, (arg2[3]));
fiat_p224_mulx_u64(&x94, &x95, x2, (arg2[2]));
fiat_p224_mulx_u64(&x96, &x97, x2, (arg2[1]));
fiat_p224_mulx_u64(&x98, &x99, x2, (arg2[0]));
fiat_p224_addcarryx_u64(&x100, &x101, 0x0, x99, x96);
fiat_p224_addcarryx_u64(&x102, &x103, x101, x97, x94);
fiat_p224_addcarryx_u64(&x104, &x105, x103, x95, x92);
x106 = (x105 + x93);
fiat_p224_addcarryx_u64(&x107, &x108, 0x0, x83, x98);
fiat_p224_addcarryx_u64(&x109, &x110, x108, x85, x100);
fiat_p224_addcarryx_u64(&x111, &x112, x110, x87, x102);
fiat_p224_addcarryx_u64(&x113, &x114, x112, x89, x104);
fiat_p224_addcarryx_u64(&x115, &x116, x114, x91, x106);
fiat_p224_mulx_u64(&x117, &x118, x107, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x119, &x120, x117, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x121, &x122, x117, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x123, &x124, x117, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x125, &x126, 0x0, x124, x121);
fiat_p224_addcarryx_u64(&x127, &x128, x126, x122, x119);
x129 = (x128 + x120);
fiat_p224_addcarryx_u64(&x130, &x131, 0x0, x107, x117);
fiat_p224_addcarryx_u64(&x132, &x133, x131, x109, x123);
fiat_p224_addcarryx_u64(&x134, &x135, x133, x111, x125);
fiat_p224_addcarryx_u64(&x136, &x137, x135, x113, x127);
fiat_p224_addcarryx_u64(&x138, &x139, x137, x115, x129);
x140 = ((uint64_t)x139 + x116);
fiat_p224_mulx_u64(&x141, &x142, x3, (arg2[3]));
fiat_p224_mulx_u64(&x143, &x144, x3, (arg2[2]));
fiat_p224_mulx_u64(&x145, &x146, x3, (arg2[1]));
fiat_p224_mulx_u64(&x147, &x148, x3, (arg2[0]));
fiat_p224_addcarryx_u64(&x149, &x150, 0x0, x148, x145);
fiat_p224_addcarryx_u64(&x151, &x152, x150, x146, x143);
fiat_p224_addcarryx_u64(&x153, &x154, x152, x144, x141);
x155 = (x154 + x142);
fiat_p224_addcarryx_u64(&x156, &x157, 0x0, x132, x147);
fiat_p224_addcarryx_u64(&x158, &x159, x157, x134, x149);
fiat_p224_addcarryx_u64(&x160, &x161, x159, x136, x151);
fiat_p224_addcarryx_u64(&x162, &x163, x161, x138, x153);
fiat_p224_addcarryx_u64(&x164, &x165, x163, x140, x155);
fiat_p224_mulx_u64(&x166, &x167, x156, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x168, &x169, x166, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x170, &x171, x166, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x172, &x173, x166, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x174, &x175, 0x0, x173, x170);
fiat_p224_addcarryx_u64(&x176, &x177, x175, x171, x168);
x178 = (x177 + x169);
fiat_p224_addcarryx_u64(&x179, &x180, 0x0, x156, x166);
fiat_p224_addcarryx_u64(&x181, &x182, x180, x158, x172);
fiat_p224_addcarryx_u64(&x183, &x184, x182, x160, x174);
fiat_p224_addcarryx_u64(&x185, &x186, x184, x162, x176);
fiat_p224_addcarryx_u64(&x187, &x188, x186, x164, x178);
x189 = ((uint64_t)x188 + x165);
fiat_p224_subborrowx_u64(&x190, &x191, 0x0, x181, 0x1);
fiat_p224_subborrowx_u64(&x192, &x193, x191, x183, UINT64_C(0xffffffff00000000));
fiat_p224_subborrowx_u64(&x194, &x195, x193, x185, UINT64_C(0xffffffffffffffff));
fiat_p224_subborrowx_u64(&x196, &x197, x195, x187, UINT32_C(0xffffffff));
fiat_p224_subborrowx_u64(&x198, &x199, x197, x189, 0x0);
fiat_p224_cmovznz_u64(&x200, x199, x190, x181);
fiat_p224_cmovznz_u64(&x201, x199, x192, x183);
fiat_p224_cmovznz_u64(&x202, x199, x194, x185);
fiat_p224_cmovznz_u64(&x203, x199, x196, x187);
out1[0] = x200;
out1[1] = x201;
out1[2] = x202;
out1[3] = x203;
}
/*
* The function fiat_p224_square squares a field element in the Montgomery domain.
*
* Preconditions:
* 0 ≤ eval arg1 < m
* Postconditions:
* eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
* 0 ≤ eval out1 < m
*
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_square(fiat_p224_montgomery_domain_field_element out1, const fiat_p224_montgomery_domain_field_element arg1) {
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
uint64_t x6;
uint64_t x7;
uint64_t x8;
uint64_t x9;
uint64_t x10;
uint64_t x11;
uint64_t x12;
uint64_t x13;
fiat_p224_uint1 x14;
uint64_t x15;
fiat_p224_uint1 x16;
uint64_t x17;
fiat_p224_uint1 x18;
uint64_t x19;
uint64_t x20;
uint64_t x21;
uint64_t x22;
uint64_t x23;
uint64_t x24;
uint64_t x25;
uint64_t x26;
uint64_t x27;
uint64_t x28;
fiat_p224_uint1 x29;
uint64_t x30;
fiat_p224_uint1 x31;
uint64_t x32;
uint64_t x33;
fiat_p224_uint1 x34;
uint64_t x35;
fiat_p224_uint1 x36;
uint64_t x37;
fiat_p224_uint1 x38;
uint64_t x39;
fiat_p224_uint1 x40;
uint64_t x41;
fiat_p224_uint1 x42;
uint64_t x43;
uint64_t x44;
uint64_t x45;
uint64_t x46;
uint64_t x47;
uint64_t x48;
uint64_t x49;
uint64_t x50;
uint64_t x51;
fiat_p224_uint1 x52;
uint64_t x53;
fiat_p224_uint1 x54;
uint64_t x55;
fiat_p224_uint1 x56;
uint64_t x57;
uint64_t x58;
fiat_p224_uint1 x59;
uint64_t x60;
fiat_p224_uint1 x61;
uint64_t x62;
fiat_p224_uint1 x63;
uint64_t x64;
fiat_p224_uint1 x65;
uint64_t x66;
fiat_p224_uint1 x67;
uint64_t x68;
uint64_t x69;
uint64_t x70;
uint64_t x71;
uint64_t x72;
uint64_t x73;
uint64_t x74;
uint64_t x75;
uint64_t x76;
fiat_p224_uint1 x77;
uint64_t x78;
fiat_p224_uint1 x79;
uint64_t x80;
uint64_t x81;
fiat_p224_uint1 x82;
uint64_t x83;
fiat_p224_uint1 x84;
uint64_t x85;
fiat_p224_uint1 x86;
uint64_t x87;
fiat_p224_uint1 x88;
uint64_t x89;
fiat_p224_uint1 x90;
uint64_t x91;
uint64_t x92;
uint64_t x93;
uint64_t x94;
uint64_t x95;
uint64_t x96;
uint64_t x97;
uint64_t x98;
uint64_t x99;
uint64_t x100;
fiat_p224_uint1 x101;
uint64_t x102;
fiat_p224_uint1 x103;
uint64_t x104;
fiat_p224_uint1 x105;
uint64_t x106;
uint64_t x107;
fiat_p224_uint1 x108;
uint64_t x109;
fiat_p224_uint1 x110;
uint64_t x111;
fiat_p224_uint1 x112;
uint64_t x113;
fiat_p224_uint1 x114;
uint64_t x115;
fiat_p224_uint1 x116;
uint64_t x117;
uint64_t x118;
uint64_t x119;
uint64_t x120;
uint64_t x121;
uint64_t x122;
uint64_t x123;
uint64_t x124;
uint64_t x125;
fiat_p224_uint1 x126;
uint64_t x127;
fiat_p224_uint1 x128;
uint64_t x129;
uint64_t x130;
fiat_p224_uint1 x131;
uint64_t x132;
fiat_p224_uint1 x133;
uint64_t x134;
fiat_p224_uint1 x135;
uint64_t x136;
fiat_p224_uint1 x137;
uint64_t x138;
fiat_p224_uint1 x139;
uint64_t x140;
uint64_t x141;
uint64_t x142;
uint64_t x143;
uint64_t x144;
uint64_t x145;
uint64_t x146;
uint64_t x147;
uint64_t x148;
uint64_t x149;
fiat_p224_uint1 x150;
uint64_t x151;
fiat_p224_uint1 x152;
uint64_t x153;
fiat_p224_uint1 x154;
uint64_t x155;
uint64_t x156;
fiat_p224_uint1 x157;
uint64_t x158;
fiat_p224_uint1 x159;
uint64_t x160;
fiat_p224_uint1 x161;
uint64_t x162;
fiat_p224_uint1 x163;
uint64_t x164;
fiat_p224_uint1 x165;
uint64_t x166;
uint64_t x167;
uint64_t x168;
uint64_t x169;
uint64_t x170;
uint64_t x171;
uint64_t x172;
uint64_t x173;
uint64_t x174;
fiat_p224_uint1 x175;
uint64_t x176;
fiat_p224_uint1 x177;
uint64_t x178;
uint64_t x179;
fiat_p224_uint1 x180;
uint64_t x181;
fiat_p224_uint1 x182;
uint64_t x183;
fiat_p224_uint1 x184;
uint64_t x185;
fiat_p224_uint1 x186;
uint64_t x187;
fiat_p224_uint1 x188;
uint64_t x189;
uint64_t x190;
fiat_p224_uint1 x191;
uint64_t x192;
fiat_p224_uint1 x193;
uint64_t x194;
fiat_p224_uint1 x195;
uint64_t x196;
fiat_p224_uint1 x197;
uint64_t x198;
fiat_p224_uint1 x199;
uint64_t x200;
uint64_t x201;
uint64_t x202;
uint64_t x203;
x1 = (arg1[1]);
x2 = (arg1[2]);
x3 = (arg1[3]);
x4 = (arg1[0]);
fiat_p224_mulx_u64(&x5, &x6, x4, (arg1[3]));
fiat_p224_mulx_u64(&x7, &x8, x4, (arg1[2]));
fiat_p224_mulx_u64(&x9, &x10, x4, (arg1[1]));
fiat_p224_mulx_u64(&x11, &x12, x4, (arg1[0]));
fiat_p224_addcarryx_u64(&x13, &x14, 0x0, x12, x9);
fiat_p224_addcarryx_u64(&x15, &x16, x14, x10, x7);
fiat_p224_addcarryx_u64(&x17, &x18, x16, x8, x5);
x19 = (x18 + x6);
fiat_p224_mulx_u64(&x20, &x21, x11, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x22, &x23, x20, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x24, &x25, x20, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x26, &x27, x20, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x28, &x29, 0x0, x27, x24);
fiat_p224_addcarryx_u64(&x30, &x31, x29, x25, x22);
x32 = (x31 + x23);
fiat_p224_addcarryx_u64(&x33, &x34, 0x0, x11, x20);
fiat_p224_addcarryx_u64(&x35, &x36, x34, x13, x26);
fiat_p224_addcarryx_u64(&x37, &x38, x36, x15, x28);
fiat_p224_addcarryx_u64(&x39, &x40, x38, x17, x30);
fiat_p224_addcarryx_u64(&x41, &x42, x40, x19, x32);
fiat_p224_mulx_u64(&x43, &x44, x1, (arg1[3]));
fiat_p224_mulx_u64(&x45, &x46, x1, (arg1[2]));
fiat_p224_mulx_u64(&x47, &x48, x1, (arg1[1]));
fiat_p224_mulx_u64(&x49, &x50, x1, (arg1[0]));
fiat_p224_addcarryx_u64(&x51, &x52, 0x0, x50, x47);
fiat_p224_addcarryx_u64(&x53, &x54, x52, x48, x45);
fiat_p224_addcarryx_u64(&x55, &x56, x54, x46, x43);
x57 = (x56 + x44);
fiat_p224_addcarryx_u64(&x58, &x59, 0x0, x35, x49);
fiat_p224_addcarryx_u64(&x60, &x61, x59, x37, x51);
fiat_p224_addcarryx_u64(&x62, &x63, x61, x39, x53);
fiat_p224_addcarryx_u64(&x64, &x65, x63, x41, x55);
fiat_p224_addcarryx_u64(&x66, &x67, x65, x42, x57);
fiat_p224_mulx_u64(&x68, &x69, x58, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x70, &x71, x68, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x72, &x73, x68, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x74, &x75, x68, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x76, &x77, 0x0, x75, x72);
fiat_p224_addcarryx_u64(&x78, &x79, x77, x73, x70);
x80 = (x79 + x71);
fiat_p224_addcarryx_u64(&x81, &x82, 0x0, x58, x68);
fiat_p224_addcarryx_u64(&x83, &x84, x82, x60, x74);
fiat_p224_addcarryx_u64(&x85, &x86, x84, x62, x76);
fiat_p224_addcarryx_u64(&x87, &x88, x86, x64, x78);
fiat_p224_addcarryx_u64(&x89, &x90, x88, x66, x80);
x91 = ((uint64_t)x90 + x67);
fiat_p224_mulx_u64(&x92, &x93, x2, (arg1[3]));
fiat_p224_mulx_u64(&x94, &x95, x2, (arg1[2]));
fiat_p224_mulx_u64(&x96, &x97, x2, (arg1[1]));
fiat_p224_mulx_u64(&x98, &x99, x2, (arg1[0]));
fiat_p224_addcarryx_u64(&x100, &x101, 0x0, x99, x96);
fiat_p224_addcarryx_u64(&x102, &x103, x101, x97, x94);
fiat_p224_addcarryx_u64(&x104, &x105, x103, x95, x92);
x106 = (x105 + x93);
fiat_p224_addcarryx_u64(&x107, &x108, 0x0, x83, x98);
fiat_p224_addcarryx_u64(&x109, &x110, x108, x85, x100);
fiat_p224_addcarryx_u64(&x111, &x112, x110, x87, x102);
fiat_p224_addcarryx_u64(&x113, &x114, x112, x89, x104);
fiat_p224_addcarryx_u64(&x115, &x116, x114, x91, x106);
fiat_p224_mulx_u64(&x117, &x118, x107, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x119, &x120, x117, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x121, &x122, x117, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x123, &x124, x117, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x125, &x126, 0x0, x124, x121);
fiat_p224_addcarryx_u64(&x127, &x128, x126, x122, x119);
x129 = (x128 + x120);
fiat_p224_addcarryx_u64(&x130, &x131, 0x0, x107, x117);
fiat_p224_addcarryx_u64(&x132, &x133, x131, x109, x123);
fiat_p224_addcarryx_u64(&x134, &x135, x133, x111, x125);
fiat_p224_addcarryx_u64(&x136, &x137, x135, x113, x127);
fiat_p224_addcarryx_u64(&x138, &x139, x137, x115, x129);
x140 = ((uint64_t)x139 + x116);
fiat_p224_mulx_u64(&x141, &x142, x3, (arg1[3]));
fiat_p224_mulx_u64(&x143, &x144, x3, (arg1[2]));
fiat_p224_mulx_u64(&x145, &x146, x3, (arg1[1]));
fiat_p224_mulx_u64(&x147, &x148, x3, (arg1[0]));
fiat_p224_addcarryx_u64(&x149, &x150, 0x0, x148, x145);
fiat_p224_addcarryx_u64(&x151, &x152, x150, x146, x143);
fiat_p224_addcarryx_u64(&x153, &x154, x152, x144, x141);
x155 = (x154 + x142);
fiat_p224_addcarryx_u64(&x156, &x157, 0x0, x132, x147);
fiat_p224_addcarryx_u64(&x158, &x159, x157, x134, x149);
fiat_p224_addcarryx_u64(&x160, &x161, x159, x136, x151);
fiat_p224_addcarryx_u64(&x162, &x163, x161, x138, x153);
fiat_p224_addcarryx_u64(&x164, &x165, x163, x140, x155);
fiat_p224_mulx_u64(&x166, &x167, x156, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x168, &x169, x166, UINT32_C(0xffffffff));
fiat_p224_mulx_u64(&x170, &x171, x166, UINT64_C(0xffffffffffffffff));
fiat_p224_mulx_u64(&x172, &x173, x166, UINT64_C(0xffffffff00000000));
fiat_p224_addcarryx_u64(&x174, &x175, 0x0, x173, x170);
fiat_p224_addcarryx_u64(&x176, &x177, x175, x171, x168);
x178 = (x177 + x169);
fiat_p224_addcarryx_u64(&x179, &x180, 0x0, x156, x166);
fiat_p224_addcarryx_u64(&x181, &x182, x180, x158, x172);
fiat_p224_addcarryx_u64(&x183, &x184, x182, x160, x174);
fiat_p224_addcarryx_u64(&x185, &x186, x184, x162, x176);
fiat_p224_addcarryx_u64(&x187, &x188, x186, x164, x178);
x189 = ((uint64_t)x188 + x165);
fiat_p224_subborrowx_u64(&x190, &x191, 0x0, x181, 0x1);
fiat_p224_subborrowx_u64(&x192, &x193, x191, x183, UINT64_C(0xffffffff00000000));
fiat_p224_subborrowx_u64(&x194, &x195, x193, x185, UINT64_C(0xffffffffffffffff));
fiat_p224_subborrowx_u64(&x196, &x197, x195, x187, UINT32_C(0xffffffff));
fiat_p224_subborrowx_u64(&x198, &x199, x197, x189, 0x0);
fiat_p224_cmovznz_u64(&x200, x199, x190, x181);
fiat_p224_cmovznz_u64(&x201, x199, x192, x183);
fiat_p224_cmovznz_u64(&x202, x199, x194, x185);
fiat_p224_cmovznz_u64(&x203, x199, x196, x187);
out1[0] = x200;
out1[1] = x201;
out1[2] = x202;
out1[3] = x203;
}
/*
* The function fiat_p224_add adds 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_P224_FIAT_INLINE void fiat_p224_add(fiat_p224_montgomery_domain_field_element out1, const fiat_p224_montgomery_domain_field_element arg1, const fiat_p224_montgomery_domain_field_element arg2) {
uint64_t x1;
fiat_p224_uint1 x2;
uint64_t x3;
fiat_p224_uint1 x4;
uint64_t x5;
fiat_p224_uint1 x6;
uint64_t x7;
fiat_p224_uint1 x8;
uint64_t x9;
fiat_p224_uint1 x10;
uint64_t x11;
fiat_p224_uint1 x12;
uint64_t x13;
fiat_p224_uint1 x14;
uint64_t x15;
fiat_p224_uint1 x16;
uint64_t x17;
fiat_p224_uint1 x18;
uint64_t x19;
uint64_t x20;
uint64_t x21;
uint64_t x22;
fiat_p224_addcarryx_u64(&x1, &x2, 0x0, (arg1[0]), (arg2[0]));
fiat_p224_addcarryx_u64(&x3, &x4, x2, (arg1[1]), (arg2[1]));
fiat_p224_addcarryx_u64(&x5, &x6, x4, (arg1[2]), (arg2[2]));
fiat_p224_addcarryx_u64(&x7, &x8, x6, (arg1[3]), (arg2[3]));
fiat_p224_subborrowx_u64(&x9, &x10, 0x0, x1, 0x1);
fiat_p224_subborrowx_u64(&x11, &x12, x10, x3, UINT64_C(0xffffffff00000000));
fiat_p224_subborrowx_u64(&x13, &x14, x12, x5, UINT64_C(0xffffffffffffffff));
fiat_p224_subborrowx_u64(&x15, &x16, x14, x7, UINT32_C(0xffffffff));
fiat_p224_subborrowx_u64(&x17, &x18, x16, x8, 0x0);
fiat_p224_cmovznz_u64(&x19, x18, x9, x1);
fiat_p224_cmovznz_u64(&x20, x18, x11, x3);
fiat_p224_cmovznz_u64(&x21, x18, x13, x5);
fiat_p224_cmovznz_u64(&x22, x18, x15, x7);
out1[0] = x19;
out1[1] = x20;
out1[2] = x21;
out1[3] = x22;
}
/*
* The function fiat_p224_sub subtracts 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_P224_FIAT_INLINE void fiat_p224_sub(fiat_p224_montgomery_domain_field_element out1, const fiat_p224_montgomery_domain_field_element arg1, const fiat_p224_montgomery_domain_field_element arg2) {
uint64_t x1;
fiat_p224_uint1 x2;
uint64_t x3;
fiat_p224_uint1 x4;
uint64_t x5;
fiat_p224_uint1 x6;
uint64_t x7;
fiat_p224_uint1 x8;
uint64_t x9;
uint64_t x10;
fiat_p224_uint1 x11;
uint64_t x12;
fiat_p224_uint1 x13;
uint64_t x14;
fiat_p224_uint1 x15;
uint64_t x16;
fiat_p224_uint1 x17;
fiat_p224_subborrowx_u64(&x1, &x2, 0x0, (arg1[0]), (arg2[0]));
fiat_p224_subborrowx_u64(&x3, &x4, x2, (arg1[1]), (arg2[1]));
fiat_p224_subborrowx_u64(&x5, &x6, x4, (arg1[2]), (arg2[2]));
fiat_p224_subborrowx_u64(&x7, &x8, x6, (arg1[3]), (arg2[3]));
fiat_p224_cmovznz_u64(&x9, x8, 0x0, UINT64_C(0xffffffffffffffff));
fiat_p224_addcarryx_u64(&x10, &x11, 0x0, x1, (fiat_p224_uint1)(x9 & 0x1));
fiat_p224_addcarryx_u64(&x12, &x13, x11, x3, (x9 & UINT64_C(0xffffffff00000000)));
fiat_p224_addcarryx_u64(&x14, &x15, x13, x5, x9);
fiat_p224_addcarryx_u64(&x16, &x17, x15, x7, (x9 & UINT32_C(0xffffffff)));
out1[0] = x10;
out1[1] = x12;
out1[2] = x14;
out1[3] = x16;
}
/*
* The function fiat_p224_opp negates a field element in the Montgomery domain.
*
* Preconditions:
* 0 ≤ eval arg1 < m
* Postconditions:
* eval (from_montgomery out1) mod m = -eval (from_montgomery arg1) mod m
* 0 ≤ eval out1 < m
*
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_opp(fiat_p224_montgomery_domain_field_element out1, const fiat_p224_montgomery_domain_field_element arg1) {
uint64_t x1;
fiat_p224_uint1 x2;
uint64_t x3;
fiat_p224_uint1 x4;
uint64_t x5;
fiat_p224_uint1 x6;
uint64_t x7;
fiat_p224_uint1 x8;
uint64_t x9;
uint64_t x10;
fiat_p224_uint1 x11;
uint64_t x12;
fiat_p224_uint1 x13;
uint64_t x14;
fiat_p224_uint1 x15;
uint64_t x16;
fiat_p224_uint1 x17;
fiat_p224_subborrowx_u64(&x1, &x2, 0x0, 0x0, (arg1[0]));
fiat_p224_subborrowx_u64(&x3, &x4, x2, 0x0, (arg1[1]));
fiat_p224_subborrowx_u64(&x5, &x6, x4, 0x0, (arg1[2]));
fiat_p224_subborrowx_u64(&x7, &x8, x6, 0x0, (arg1[3]));
fiat_p224_cmovznz_u64(&x9, x8, 0x0, UINT64_C(0xffffffffffffffff));
fiat_p224_addcarryx_u64(&x10, &x11, 0x0, x1, (fiat_p224_uint1)(x9 & 0x1));
fiat_p224_addcarryx_u64(&x12, &x13, x11, x3, (x9 & UINT64_C(0xffffffff00000000)));
fiat_p224_addcarryx_u64(&x14, &x15, x13, x5, x9);
fiat_p224_addcarryx_u64(&x16, &x17, x15, x7, (x9 & UINT32_C(0xffffffff)));
out1[0] = x10;
out1[1] = x12;
out1[2] = x14;
out1[3] = x16;
}
/*
* The function fiat_p224_from_montgomery translates a field element out of the Montgomery domain.
*
* Preconditions:
* 0 ≤ eval arg1 < m
* Postconditions:
* eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m
* 0 ≤ eval out1 < m
*
*/
static FIAT_P224_FIAT_INLINE void fiat_p224_from_montgomery(fiat_p224_non_montgomery_domain_field_element out1, const fiat_p224_montgomery_domain_field_element arg1) {
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
uint64_t x6;
uint64_t x7;
uint64_t x8;
uint64_t x9;
uint64_t x10;
fiat_p224_uint1 x11;
uint64_t x12;
fiat_p224_uint1 x13;
uint64_t x14;
fiat_p224_uint1 x15;
uint64_t x16;
fiat_p224_uint1 x17;
uint64_t x18;
fiat_p224_uint1 x19;
uint64_t x20;
fiat_p224_uint1 x21;
uint64_t x22;
fiat_p224_uint1 x23;
uint64_t x24;
fiat_p224_uint1 x25;
uint64_t x26;
fiat_p224_uint1 x27;
uint64_t x28;
uint64_t x29;
uint64_t x30;
uint64_t x31;