fiat_crypto/
p256_64.rs

1//! Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Rust --inline p256 64 '2^256 - 2^224 + 2^192 + 2^96 - 1' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes one msat divstep divstep_precomp
2//! curve description: p256
3//! machine_wordsize = 64 (from "64")
4//! requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp
5//! m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1")
6//!
7//! NOTE: In addition to the bounds specified above each function, all
8//!   functions synthesized for this Montgomery arithmetic require the
9//!   input to be strictly less than the prime modulus (m), and also
10//!   require the input to be in the unique saturated representation.
11//!   All functions also ensure that these two properties are true of
12//!   return values.
13//!
14//! Computed values:
15//!   eval z = z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192)
16//!   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)
17//!   twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) in
18//!                            if x1 & (2^256-1) < 2^255 then x1 & (2^256-1) else (x1 & (2^256-1)) - 2^256
19
20#![allow(unused_parens)]
21#![allow(non_camel_case_types)]
22
23/** fiat_p256_u1 represents values of 1 bits, stored in one byte. */
24pub type fiat_p256_u1 = u8;
25/** fiat_p256_i1 represents values of 1 bits, stored in one byte. */
26pub type fiat_p256_i1 = i8;
27/** fiat_p256_u2 represents values of 2 bits, stored in one byte. */
28pub type fiat_p256_u2 = u8;
29/** fiat_p256_i2 represents values of 2 bits, stored in one byte. */
30pub type fiat_p256_i2 = i8;
31
32/** The type fiat_p256_montgomery_domain_field_element is a field element in the Montgomery domain. */
33/** Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] */
34#[derive(Clone, Copy)]
35pub struct fiat_p256_montgomery_domain_field_element(pub [u64; 4]);
36
37impl core::ops::Index<usize> for fiat_p256_montgomery_domain_field_element {
38    type Output = u64;
39    #[inline]
40    fn index(&self, index: usize) -> &Self::Output {
41        &self.0[index]
42    }
43}
44
45impl core::ops::IndexMut<usize> for fiat_p256_montgomery_domain_field_element {
46    #[inline]
47    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
48        &mut self.0[index]
49    }
50}
51
52/** The type fiat_p256_non_montgomery_domain_field_element is a field element NOT in the Montgomery domain. */
53/** Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] */
54#[derive(Clone, Copy)]
55pub struct fiat_p256_non_montgomery_domain_field_element(pub [u64; 4]);
56
57impl core::ops::Index<usize> for fiat_p256_non_montgomery_domain_field_element {
58    type Output = u64;
59    #[inline]
60    fn index(&self, index: usize) -> &Self::Output {
61        &self.0[index]
62    }
63}
64
65impl core::ops::IndexMut<usize> for fiat_p256_non_montgomery_domain_field_element {
66    #[inline]
67    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
68        &mut self.0[index]
69    }
70}
71
72
73/// The function fiat_p256_addcarryx_u64 is an addition with carry.
74///
75/// Postconditions:
76///   out1 = (arg1 + arg2 + arg3) mod 2^64
77///   out2 = ⌊(arg1 + arg2 + arg3) / 2^64⌋
78///
79/// Input Bounds:
80///   arg1: [0x0 ~> 0x1]
81///   arg2: [0x0 ~> 0xffffffffffffffff]
82///   arg3: [0x0 ~> 0xffffffffffffffff]
83/// Output Bounds:
84///   out1: [0x0 ~> 0xffffffffffffffff]
85///   out2: [0x0 ~> 0x1]
86#[inline]
87pub fn fiat_p256_addcarryx_u64(out1: &mut u64, out2: &mut fiat_p256_u1, arg1: fiat_p256_u1, arg2: u64, arg3: u64) {
88  let x1: u128 = (((arg1 as u128) + (arg2 as u128)) + (arg3 as u128));
89  let x2: u64 = ((x1 & (0xffffffffffffffff as u128)) as u64);
90  let x3: fiat_p256_u1 = ((x1 >> 64) as fiat_p256_u1);
91  *out1 = x2;
92  *out2 = x3;
93}
94
95/// The function fiat_p256_subborrowx_u64 is a subtraction with borrow.
96///
97/// Postconditions:
98///   out1 = (-arg1 + arg2 + -arg3) mod 2^64
99///   out2 = -⌊(-arg1 + arg2 + -arg3) / 2^64⌋
100///
101/// Input Bounds:
102///   arg1: [0x0 ~> 0x1]
103///   arg2: [0x0 ~> 0xffffffffffffffff]
104///   arg3: [0x0 ~> 0xffffffffffffffff]
105/// Output Bounds:
106///   out1: [0x0 ~> 0xffffffffffffffff]
107///   out2: [0x0 ~> 0x1]
108#[inline]
109pub fn fiat_p256_subborrowx_u64(out1: &mut u64, out2: &mut fiat_p256_u1, arg1: fiat_p256_u1, arg2: u64, arg3: u64) {
110  let x1: i128 = (((arg2 as i128) - (arg1 as i128)) - (arg3 as i128));
111  let x2: fiat_p256_i1 = ((x1 >> 64) as fiat_p256_i1);
112  let x3: u64 = ((x1 & (0xffffffffffffffff as i128)) as u64);
113  *out1 = x3;
114  *out2 = (((0x0 as fiat_p256_i2) - (x2 as fiat_p256_i2)) as fiat_p256_u1);
115}
116
117/// The function fiat_p256_mulx_u64 is a multiplication, returning the full double-width result.
118///
119/// Postconditions:
120///   out1 = (arg1 * arg2) mod 2^64
121///   out2 = ⌊arg1 * arg2 / 2^64⌋
122///
123/// Input Bounds:
124///   arg1: [0x0 ~> 0xffffffffffffffff]
125///   arg2: [0x0 ~> 0xffffffffffffffff]
126/// Output Bounds:
127///   out1: [0x0 ~> 0xffffffffffffffff]
128///   out2: [0x0 ~> 0xffffffffffffffff]
129#[inline]
130pub fn fiat_p256_mulx_u64(out1: &mut u64, out2: &mut u64, arg1: u64, arg2: u64) {
131  let x1: u128 = ((arg1 as u128) * (arg2 as u128));
132  let x2: u64 = ((x1 & (0xffffffffffffffff as u128)) as u64);
133  let x3: u64 = ((x1 >> 64) as u64);
134  *out1 = x2;
135  *out2 = x3;
136}
137
138/// The function fiat_p256_cmovznz_u64 is a single-word conditional move.
139///
140/// Postconditions:
141///   out1 = (if arg1 = 0 then arg2 else arg3)
142///
143/// Input Bounds:
144///   arg1: [0x0 ~> 0x1]
145///   arg2: [0x0 ~> 0xffffffffffffffff]
146///   arg3: [0x0 ~> 0xffffffffffffffff]
147/// Output Bounds:
148///   out1: [0x0 ~> 0xffffffffffffffff]
149#[inline]
150pub fn fiat_p256_cmovznz_u64(out1: &mut u64, arg1: fiat_p256_u1, arg2: u64, arg3: u64) {
151  let x1: fiat_p256_u1 = (!(!arg1));
152  let x2: u64 = ((((((0x0 as fiat_p256_i2) - (x1 as fiat_p256_i2)) as fiat_p256_i1) as i128) & (0xffffffffffffffff as i128)) as u64);
153  let x3: u64 = ((x2 & arg3) | ((!x2) & arg2));
154  *out1 = x3;
155}
156
157/// The function fiat_p256_mul multiplies two field elements in the Montgomery domain.
158///
159/// Preconditions:
160///   0 ≤ eval arg1 < m
161///   0 ≤ eval arg2 < m
162/// Postconditions:
163///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
164///   0 ≤ eval out1 < m
165///
166#[inline]
167pub fn fiat_p256_mul(out1: &mut fiat_p256_montgomery_domain_field_element, arg1: &fiat_p256_montgomery_domain_field_element, arg2: &fiat_p256_montgomery_domain_field_element) {
168  let x1: u64 = (arg1[1]);
169  let x2: u64 = (arg1[2]);
170  let x3: u64 = (arg1[3]);
171  let x4: u64 = (arg1[0]);
172  let mut x5: u64 = 0;
173  let mut x6: u64 = 0;
174  fiat_p256_mulx_u64(&mut x5, &mut x6, x4, (arg2[3]));
175  let mut x7: u64 = 0;
176  let mut x8: u64 = 0;
177  fiat_p256_mulx_u64(&mut x7, &mut x8, x4, (arg2[2]));
178  let mut x9: u64 = 0;
179  let mut x10: u64 = 0;
180  fiat_p256_mulx_u64(&mut x9, &mut x10, x4, (arg2[1]));
181  let mut x11: u64 = 0;
182  let mut x12: u64 = 0;
183  fiat_p256_mulx_u64(&mut x11, &mut x12, x4, (arg2[0]));
184  let mut x13: u64 = 0;
185  let mut x14: fiat_p256_u1 = 0;
186  fiat_p256_addcarryx_u64(&mut x13, &mut x14, 0x0, x12, x9);
187  let mut x15: u64 = 0;
188  let mut x16: fiat_p256_u1 = 0;
189  fiat_p256_addcarryx_u64(&mut x15, &mut x16, x14, x10, x7);
190  let mut x17: u64 = 0;
191  let mut x18: fiat_p256_u1 = 0;
192  fiat_p256_addcarryx_u64(&mut x17, &mut x18, x16, x8, x5);
193  let x19: u64 = ((x18 as u64) + x6);
194  let mut x20: u64 = 0;
195  let mut x21: u64 = 0;
196  fiat_p256_mulx_u64(&mut x20, &mut x21, x11, 0xffffffff00000001);
197  let mut x22: u64 = 0;
198  let mut x23: u64 = 0;
199  fiat_p256_mulx_u64(&mut x22, &mut x23, x11, 0xffffffff);
200  let mut x24: u64 = 0;
201  let mut x25: u64 = 0;
202  fiat_p256_mulx_u64(&mut x24, &mut x25, x11, 0xffffffffffffffff);
203  let mut x26: u64 = 0;
204  let mut x27: fiat_p256_u1 = 0;
205  fiat_p256_addcarryx_u64(&mut x26, &mut x27, 0x0, x25, x22);
206  let x28: u64 = ((x27 as u64) + x23);
207  let mut x29: u64 = 0;
208  let mut x30: fiat_p256_u1 = 0;
209  fiat_p256_addcarryx_u64(&mut x29, &mut x30, 0x0, x11, x24);
210  let mut x31: u64 = 0;
211  let mut x32: fiat_p256_u1 = 0;
212  fiat_p256_addcarryx_u64(&mut x31, &mut x32, x30, x13, x26);
213  let mut x33: u64 = 0;
214  let mut x34: fiat_p256_u1 = 0;
215  fiat_p256_addcarryx_u64(&mut x33, &mut x34, x32, x15, x28);
216  let mut x35: u64 = 0;
217  let mut x36: fiat_p256_u1 = 0;
218  fiat_p256_addcarryx_u64(&mut x35, &mut x36, x34, x17, x20);
219  let mut x37: u64 = 0;
220  let mut x38: fiat_p256_u1 = 0;
221  fiat_p256_addcarryx_u64(&mut x37, &mut x38, x36, x19, x21);
222  let mut x39: u64 = 0;
223  let mut x40: u64 = 0;
224  fiat_p256_mulx_u64(&mut x39, &mut x40, x1, (arg2[3]));
225  let mut x41: u64 = 0;
226  let mut x42: u64 = 0;
227  fiat_p256_mulx_u64(&mut x41, &mut x42, x1, (arg2[2]));
228  let mut x43: u64 = 0;
229  let mut x44: u64 = 0;
230  fiat_p256_mulx_u64(&mut x43, &mut x44, x1, (arg2[1]));
231  let mut x45: u64 = 0;
232  let mut x46: u64 = 0;
233  fiat_p256_mulx_u64(&mut x45, &mut x46, x1, (arg2[0]));
234  let mut x47: u64 = 0;
235  let mut x48: fiat_p256_u1 = 0;
236  fiat_p256_addcarryx_u64(&mut x47, &mut x48, 0x0, x46, x43);
237  let mut x49: u64 = 0;
238  let mut x50: fiat_p256_u1 = 0;
239  fiat_p256_addcarryx_u64(&mut x49, &mut x50, x48, x44, x41);
240  let mut x51: u64 = 0;
241  let mut x52: fiat_p256_u1 = 0;
242  fiat_p256_addcarryx_u64(&mut x51, &mut x52, x50, x42, x39);
243  let x53: u64 = ((x52 as u64) + x40);
244  let mut x54: u64 = 0;
245  let mut x55: fiat_p256_u1 = 0;
246  fiat_p256_addcarryx_u64(&mut x54, &mut x55, 0x0, x31, x45);
247  let mut x56: u64 = 0;
248  let mut x57: fiat_p256_u1 = 0;
249  fiat_p256_addcarryx_u64(&mut x56, &mut x57, x55, x33, x47);
250  let mut x58: u64 = 0;
251  let mut x59: fiat_p256_u1 = 0;
252  fiat_p256_addcarryx_u64(&mut x58, &mut x59, x57, x35, x49);
253  let mut x60: u64 = 0;
254  let mut x61: fiat_p256_u1 = 0;
255  fiat_p256_addcarryx_u64(&mut x60, &mut x61, x59, x37, x51);
256  let mut x62: u64 = 0;
257  let mut x63: fiat_p256_u1 = 0;
258  fiat_p256_addcarryx_u64(&mut x62, &mut x63, x61, (x38 as u64), x53);
259  let mut x64: u64 = 0;
260  let mut x65: u64 = 0;
261  fiat_p256_mulx_u64(&mut x64, &mut x65, x54, 0xffffffff00000001);
262  let mut x66: u64 = 0;
263  let mut x67: u64 = 0;
264  fiat_p256_mulx_u64(&mut x66, &mut x67, x54, 0xffffffff);
265  let mut x68: u64 = 0;
266  let mut x69: u64 = 0;
267  fiat_p256_mulx_u64(&mut x68, &mut x69, x54, 0xffffffffffffffff);
268  let mut x70: u64 = 0;
269  let mut x71: fiat_p256_u1 = 0;
270  fiat_p256_addcarryx_u64(&mut x70, &mut x71, 0x0, x69, x66);
271  let x72: u64 = ((x71 as u64) + x67);
272  let mut x73: u64 = 0;
273  let mut x74: fiat_p256_u1 = 0;
274  fiat_p256_addcarryx_u64(&mut x73, &mut x74, 0x0, x54, x68);
275  let mut x75: u64 = 0;
276  let mut x76: fiat_p256_u1 = 0;
277  fiat_p256_addcarryx_u64(&mut x75, &mut x76, x74, x56, x70);
278  let mut x77: u64 = 0;
279  let mut x78: fiat_p256_u1 = 0;
280  fiat_p256_addcarryx_u64(&mut x77, &mut x78, x76, x58, x72);
281  let mut x79: u64 = 0;
282  let mut x80: fiat_p256_u1 = 0;
283  fiat_p256_addcarryx_u64(&mut x79, &mut x80, x78, x60, x64);
284  let mut x81: u64 = 0;
285  let mut x82: fiat_p256_u1 = 0;
286  fiat_p256_addcarryx_u64(&mut x81, &mut x82, x80, x62, x65);
287  let x83: u64 = ((x82 as u64) + (x63 as u64));
288  let mut x84: u64 = 0;
289  let mut x85: u64 = 0;
290  fiat_p256_mulx_u64(&mut x84, &mut x85, x2, (arg2[3]));
291  let mut x86: u64 = 0;
292  let mut x87: u64 = 0;
293  fiat_p256_mulx_u64(&mut x86, &mut x87, x2, (arg2[2]));
294  let mut x88: u64 = 0;
295  let mut x89: u64 = 0;
296  fiat_p256_mulx_u64(&mut x88, &mut x89, x2, (arg2[1]));
297  let mut x90: u64 = 0;
298  let mut x91: u64 = 0;
299  fiat_p256_mulx_u64(&mut x90, &mut x91, x2, (arg2[0]));
300  let mut x92: u64 = 0;
301  let mut x93: fiat_p256_u1 = 0;
302  fiat_p256_addcarryx_u64(&mut x92, &mut x93, 0x0, x91, x88);
303  let mut x94: u64 = 0;
304  let mut x95: fiat_p256_u1 = 0;
305  fiat_p256_addcarryx_u64(&mut x94, &mut x95, x93, x89, x86);
306  let mut x96: u64 = 0;
307  let mut x97: fiat_p256_u1 = 0;
308  fiat_p256_addcarryx_u64(&mut x96, &mut x97, x95, x87, x84);
309  let x98: u64 = ((x97 as u64) + x85);
310  let mut x99: u64 = 0;
311  let mut x100: fiat_p256_u1 = 0;
312  fiat_p256_addcarryx_u64(&mut x99, &mut x100, 0x0, x75, x90);
313  let mut x101: u64 = 0;
314  let mut x102: fiat_p256_u1 = 0;
315  fiat_p256_addcarryx_u64(&mut x101, &mut x102, x100, x77, x92);
316  let mut x103: u64 = 0;
317  let mut x104: fiat_p256_u1 = 0;
318  fiat_p256_addcarryx_u64(&mut x103, &mut x104, x102, x79, x94);
319  let mut x105: u64 = 0;
320  let mut x106: fiat_p256_u1 = 0;
321  fiat_p256_addcarryx_u64(&mut x105, &mut x106, x104, x81, x96);
322  let mut x107: u64 = 0;
323  let mut x108: fiat_p256_u1 = 0;
324  fiat_p256_addcarryx_u64(&mut x107, &mut x108, x106, x83, x98);
325  let mut x109: u64 = 0;
326  let mut x110: u64 = 0;
327  fiat_p256_mulx_u64(&mut x109, &mut x110, x99, 0xffffffff00000001);
328  let mut x111: u64 = 0;
329  let mut x112: u64 = 0;
330  fiat_p256_mulx_u64(&mut x111, &mut x112, x99, 0xffffffff);
331  let mut x113: u64 = 0;
332  let mut x114: u64 = 0;
333  fiat_p256_mulx_u64(&mut x113, &mut x114, x99, 0xffffffffffffffff);
334  let mut x115: u64 = 0;
335  let mut x116: fiat_p256_u1 = 0;
336  fiat_p256_addcarryx_u64(&mut x115, &mut x116, 0x0, x114, x111);
337  let x117: u64 = ((x116 as u64) + x112);
338  let mut x118: u64 = 0;
339  let mut x119: fiat_p256_u1 = 0;
340  fiat_p256_addcarryx_u64(&mut x118, &mut x119, 0x0, x99, x113);
341  let mut x120: u64 = 0;
342  let mut x121: fiat_p256_u1 = 0;
343  fiat_p256_addcarryx_u64(&mut x120, &mut x121, x119, x101, x115);
344  let mut x122: u64 = 0;
345  let mut x123: fiat_p256_u1 = 0;
346  fiat_p256_addcarryx_u64(&mut x122, &mut x123, x121, x103, x117);
347  let mut x124: u64 = 0;
348  let mut x125: fiat_p256_u1 = 0;
349  fiat_p256_addcarryx_u64(&mut x124, &mut x125, x123, x105, x109);
350  let mut x126: u64 = 0;
351  let mut x127: fiat_p256_u1 = 0;
352  fiat_p256_addcarryx_u64(&mut x126, &mut x127, x125, x107, x110);
353  let x128: u64 = ((x127 as u64) + (x108 as u64));
354  let mut x129: u64 = 0;
355  let mut x130: u64 = 0;
356  fiat_p256_mulx_u64(&mut x129, &mut x130, x3, (arg2[3]));
357  let mut x131: u64 = 0;
358  let mut x132: u64 = 0;
359  fiat_p256_mulx_u64(&mut x131, &mut x132, x3, (arg2[2]));
360  let mut x133: u64 = 0;
361  let mut x134: u64 = 0;
362  fiat_p256_mulx_u64(&mut x133, &mut x134, x3, (arg2[1]));
363  let mut x135: u64 = 0;
364  let mut x136: u64 = 0;
365  fiat_p256_mulx_u64(&mut x135, &mut x136, x3, (arg2[0]));
366  let mut x137: u64 = 0;
367  let mut x138: fiat_p256_u1 = 0;
368  fiat_p256_addcarryx_u64(&mut x137, &mut x138, 0x0, x136, x133);
369  let mut x139: u64 = 0;
370  let mut x140: fiat_p256_u1 = 0;
371  fiat_p256_addcarryx_u64(&mut x139, &mut x140, x138, x134, x131);
372  let mut x141: u64 = 0;
373  let mut x142: fiat_p256_u1 = 0;
374  fiat_p256_addcarryx_u64(&mut x141, &mut x142, x140, x132, x129);
375  let x143: u64 = ((x142 as u64) + x130);
376  let mut x144: u64 = 0;
377  let mut x145: fiat_p256_u1 = 0;
378  fiat_p256_addcarryx_u64(&mut x144, &mut x145, 0x0, x120, x135);
379  let mut x146: u64 = 0;
380  let mut x147: fiat_p256_u1 = 0;
381  fiat_p256_addcarryx_u64(&mut x146, &mut x147, x145, x122, x137);
382  let mut x148: u64 = 0;
383  let mut x149: fiat_p256_u1 = 0;
384  fiat_p256_addcarryx_u64(&mut x148, &mut x149, x147, x124, x139);
385  let mut x150: u64 = 0;
386  let mut x151: fiat_p256_u1 = 0;
387  fiat_p256_addcarryx_u64(&mut x150, &mut x151, x149, x126, x141);
388  let mut x152: u64 = 0;
389  let mut x153: fiat_p256_u1 = 0;
390  fiat_p256_addcarryx_u64(&mut x152, &mut x153, x151, x128, x143);
391  let mut x154: u64 = 0;
392  let mut x155: u64 = 0;
393  fiat_p256_mulx_u64(&mut x154, &mut x155, x144, 0xffffffff00000001);
394  let mut x156: u64 = 0;
395  let mut x157: u64 = 0;
396  fiat_p256_mulx_u64(&mut x156, &mut x157, x144, 0xffffffff);
397  let mut x158: u64 = 0;
398  let mut x159: u64 = 0;
399  fiat_p256_mulx_u64(&mut x158, &mut x159, x144, 0xffffffffffffffff);
400  let mut x160: u64 = 0;
401  let mut x161: fiat_p256_u1 = 0;
402  fiat_p256_addcarryx_u64(&mut x160, &mut x161, 0x0, x159, x156);
403  let x162: u64 = ((x161 as u64) + x157);
404  let mut x163: u64 = 0;
405  let mut x164: fiat_p256_u1 = 0;
406  fiat_p256_addcarryx_u64(&mut x163, &mut x164, 0x0, x144, x158);
407  let mut x165: u64 = 0;
408  let mut x166: fiat_p256_u1 = 0;
409  fiat_p256_addcarryx_u64(&mut x165, &mut x166, x164, x146, x160);
410  let mut x167: u64 = 0;
411  let mut x168: fiat_p256_u1 = 0;
412  fiat_p256_addcarryx_u64(&mut x167, &mut x168, x166, x148, x162);
413  let mut x169: u64 = 0;
414  let mut x170: fiat_p256_u1 = 0;
415  fiat_p256_addcarryx_u64(&mut x169, &mut x170, x168, x150, x154);
416  let mut x171: u64 = 0;
417  let mut x172: fiat_p256_u1 = 0;
418  fiat_p256_addcarryx_u64(&mut x171, &mut x172, x170, x152, x155);
419  let x173: u64 = ((x172 as u64) + (x153 as u64));
420  let mut x174: u64 = 0;
421  let mut x175: fiat_p256_u1 = 0;
422  fiat_p256_subborrowx_u64(&mut x174, &mut x175, 0x0, x165, 0xffffffffffffffff);
423  let mut x176: u64 = 0;
424  let mut x177: fiat_p256_u1 = 0;
425  fiat_p256_subborrowx_u64(&mut x176, &mut x177, x175, x167, 0xffffffff);
426  let mut x178: u64 = 0;
427  let mut x179: fiat_p256_u1 = 0;
428  fiat_p256_subborrowx_u64(&mut x178, &mut x179, x177, x169, (0x0 as u64));
429  let mut x180: u64 = 0;
430  let mut x181: fiat_p256_u1 = 0;
431  fiat_p256_subborrowx_u64(&mut x180, &mut x181, x179, x171, 0xffffffff00000001);
432  let mut x182: u64 = 0;
433  let mut x183: fiat_p256_u1 = 0;
434  fiat_p256_subborrowx_u64(&mut x182, &mut x183, x181, x173, (0x0 as u64));
435  let mut x184: u64 = 0;
436  fiat_p256_cmovznz_u64(&mut x184, x183, x174, x165);
437  let mut x185: u64 = 0;
438  fiat_p256_cmovznz_u64(&mut x185, x183, x176, x167);
439  let mut x186: u64 = 0;
440  fiat_p256_cmovznz_u64(&mut x186, x183, x178, x169);
441  let mut x187: u64 = 0;
442  fiat_p256_cmovznz_u64(&mut x187, x183, x180, x171);
443  out1[0] = x184;
444  out1[1] = x185;
445  out1[2] = x186;
446  out1[3] = x187;
447}
448
449/// The function fiat_p256_square squares a field element in the Montgomery domain.
450///
451/// Preconditions:
452///   0 ≤ eval arg1 < m
453/// Postconditions:
454///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
455///   0 ≤ eval out1 < m
456///
457#[inline]
458pub fn fiat_p256_square(out1: &mut fiat_p256_montgomery_domain_field_element, arg1: &fiat_p256_montgomery_domain_field_element) {
459  let x1: u64 = (arg1[1]);
460  let x2: u64 = (arg1[2]);
461  let x3: u64 = (arg1[3]);
462  let x4: u64 = (arg1[0]);
463  let mut x5: u64 = 0;
464  let mut x6: u64 = 0;
465  fiat_p256_mulx_u64(&mut x5, &mut x6, x4, (arg1[3]));
466  let mut x7: u64 = 0;
467  let mut x8: u64 = 0;
468  fiat_p256_mulx_u64(&mut x7, &mut x8, x4, (arg1[2]));
469  let mut x9: u64 = 0;
470  let mut x10: u64 = 0;
471  fiat_p256_mulx_u64(&mut x9, &mut x10, x4, (arg1[1]));
472  let mut x11: u64 = 0;
473  let mut x12: u64 = 0;
474  fiat_p256_mulx_u64(&mut x11, &mut x12, x4, (arg1[0]));
475  let mut x13: u64 = 0;
476  let mut x14: fiat_p256_u1 = 0;
477  fiat_p256_addcarryx_u64(&mut x13, &mut x14, 0x0, x12, x9);
478  let mut x15: u64 = 0;
479  let mut x16: fiat_p256_u1 = 0;
480  fiat_p256_addcarryx_u64(&mut x15, &mut x16, x14, x10, x7);
481  let mut x17: u64 = 0;
482  let mut x18: fiat_p256_u1 = 0;
483  fiat_p256_addcarryx_u64(&mut x17, &mut x18, x16, x8, x5);
484  let x19: u64 = ((x18 as u64) + x6);
485  let mut x20: u64 = 0;
486  let mut x21: u64 = 0;
487  fiat_p256_mulx_u64(&mut x20, &mut x21, x11, 0xffffffff00000001);
488  let mut x22: u64 = 0;
489  let mut x23: u64 = 0;
490  fiat_p256_mulx_u64(&mut x22, &mut x23, x11, 0xffffffff);
491  let mut x24: u64 = 0;
492  let mut x25: u64 = 0;
493  fiat_p256_mulx_u64(&mut x24, &mut x25, x11, 0xffffffffffffffff);
494  let mut x26: u64 = 0;
495  let mut x27: fiat_p256_u1 = 0;
496  fiat_p256_addcarryx_u64(&mut x26, &mut x27, 0x0, x25, x22);
497  let x28: u64 = ((x27 as u64) + x23);
498  let mut x29: u64 = 0;
499  let mut x30: fiat_p256_u1 = 0;
500  fiat_p256_addcarryx_u64(&mut x29, &mut x30, 0x0, x11, x24);
501  let mut x31: u64 = 0;
502  let mut x32: fiat_p256_u1 = 0;
503  fiat_p256_addcarryx_u64(&mut x31, &mut x32, x30, x13, x26);
504  let mut x33: u64 = 0;
505  let mut x34: fiat_p256_u1 = 0;
506  fiat_p256_addcarryx_u64(&mut x33, &mut x34, x32, x15, x28);
507  let mut x35: u64 = 0;
508  let mut x36: fiat_p256_u1 = 0;
509  fiat_p256_addcarryx_u64(&mut x35, &mut x36, x34, x17, x20);
510  let mut x37: u64 = 0;
511  let mut x38: fiat_p256_u1 = 0;
512  fiat_p256_addcarryx_u64(&mut x37, &mut x38, x36, x19, x21);
513  let mut x39: u64 = 0;
514  let mut x40: u64 = 0;
515  fiat_p256_mulx_u64(&mut x39, &mut x40, x1, (arg1[3]));
516  let mut x41: u64 = 0;
517  let mut x42: u64 = 0;
518  fiat_p256_mulx_u64(&mut x41, &mut x42, x1, (arg1[2]));
519  let mut x43: u64 = 0;
520  let mut x44: u64 = 0;
521  fiat_p256_mulx_u64(&mut x43, &mut x44, x1, (arg1[1]));
522  let mut x45: u64 = 0;
523  let mut x46: u64 = 0;
524  fiat_p256_mulx_u64(&mut x45, &mut x46, x1, (arg1[0]));
525  let mut x47: u64 = 0;
526  let mut x48: fiat_p256_u1 = 0;
527  fiat_p256_addcarryx_u64(&mut x47, &mut x48, 0x0, x46, x43);
528  let mut x49: u64 = 0;
529  let mut x50: fiat_p256_u1 = 0;
530  fiat_p256_addcarryx_u64(&mut x49, &mut x50, x48, x44, x41);
531  let mut x51: u64 = 0;
532  let mut x52: fiat_p256_u1 = 0;
533  fiat_p256_addcarryx_u64(&mut x51, &mut x52, x50, x42, x39);
534  let x53: u64 = ((x52 as u64) + x40);
535  let mut x54: u64 = 0;
536  let mut x55: fiat_p256_u1 = 0;
537  fiat_p256_addcarryx_u64(&mut x54, &mut x55, 0x0, x31, x45);
538  let mut x56: u64 = 0;
539  let mut x57: fiat_p256_u1 = 0;
540  fiat_p256_addcarryx_u64(&mut x56, &mut x57, x55, x33, x47);
541  let mut x58: u64 = 0;
542  let mut x59: fiat_p256_u1 = 0;
543  fiat_p256_addcarryx_u64(&mut x58, &mut x59, x57, x35, x49);
544  let mut x60: u64 = 0;
545  let mut x61: fiat_p256_u1 = 0;
546  fiat_p256_addcarryx_u64(&mut x60, &mut x61, x59, x37, x51);
547  let mut x62: u64 = 0;
548  let mut x63: fiat_p256_u1 = 0;
549  fiat_p256_addcarryx_u64(&mut x62, &mut x63, x61, (x38 as u64), x53);
550  let mut x64: u64 = 0;
551  let mut x65: u64 = 0;
552  fiat_p256_mulx_u64(&mut x64, &mut x65, x54, 0xffffffff00000001);
553  let mut x66: u64 = 0;
554  let mut x67: u64 = 0;
555  fiat_p256_mulx_u64(&mut x66, &mut x67, x54, 0xffffffff);
556  let mut x68: u64 = 0;
557  let mut x69: u64 = 0;
558  fiat_p256_mulx_u64(&mut x68, &mut x69, x54, 0xffffffffffffffff);
559  let mut x70: u64 = 0;
560  let mut x71: fiat_p256_u1 = 0;
561  fiat_p256_addcarryx_u64(&mut x70, &mut x71, 0x0, x69, x66);
562  let x72: u64 = ((x71 as u64) + x67);
563  let mut x73: u64 = 0;
564  let mut x74: fiat_p256_u1 = 0;
565  fiat_p256_addcarryx_u64(&mut x73, &mut x74, 0x0, x54, x68);
566  let mut x75: u64 = 0;
567  let mut x76: fiat_p256_u1 = 0;
568  fiat_p256_addcarryx_u64(&mut x75, &mut x76, x74, x56, x70);
569  let mut x77: u64 = 0;
570  let mut x78: fiat_p256_u1 = 0;
571  fiat_p256_addcarryx_u64(&mut x77, &mut x78, x76, x58, x72);
572  let mut x79: u64 = 0;
573  let mut x80: fiat_p256_u1 = 0;
574  fiat_p256_addcarryx_u64(&mut x79, &mut x80, x78, x60, x64);
575  let mut x81: u64 = 0;
576  let mut x82: fiat_p256_u1 = 0;
577  fiat_p256_addcarryx_u64(&mut x81, &mut x82, x80, x62, x65);
578  let x83: u64 = ((x82 as u64) + (x63 as u64));
579  let mut x84: u64 = 0;
580  let mut x85: u64 = 0;
581  fiat_p256_mulx_u64(&mut x84, &mut x85, x2, (arg1[3]));
582  let mut x86: u64 = 0;
583  let mut x87: u64 = 0;
584  fiat_p256_mulx_u64(&mut x86, &mut x87, x2, (arg1[2]));
585  let mut x88: u64 = 0;
586  let mut x89: u64 = 0;
587  fiat_p256_mulx_u64(&mut x88, &mut x89, x2, (arg1[1]));
588  let mut x90: u64 = 0;
589  let mut x91: u64 = 0;
590  fiat_p256_mulx_u64(&mut x90, &mut x91, x2, (arg1[0]));
591  let mut x92: u64 = 0;
592  let mut x93: fiat_p256_u1 = 0;
593  fiat_p256_addcarryx_u64(&mut x92, &mut x93, 0x0, x91, x88);
594  let mut x94: u64 = 0;
595  let mut x95: fiat_p256_u1 = 0;
596  fiat_p256_addcarryx_u64(&mut x94, &mut x95, x93, x89, x86);
597  let mut x96: u64 = 0;
598  let mut x97: fiat_p256_u1 = 0;
599  fiat_p256_addcarryx_u64(&mut x96, &mut x97, x95, x87, x84);
600  let x98: u64 = ((x97 as u64) + x85);
601  let mut x99: u64 = 0;
602  let mut x100: fiat_p256_u1 = 0;
603  fiat_p256_addcarryx_u64(&mut x99, &mut x100, 0x0, x75, x90);
604  let mut x101: u64 = 0;
605  let mut x102: fiat_p256_u1 = 0;
606  fiat_p256_addcarryx_u64(&mut x101, &mut x102, x100, x77, x92);
607  let mut x103: u64 = 0;
608  let mut x104: fiat_p256_u1 = 0;
609  fiat_p256_addcarryx_u64(&mut x103, &mut x104, x102, x79, x94);
610  let mut x105: u64 = 0;
611  let mut x106: fiat_p256_u1 = 0;
612  fiat_p256_addcarryx_u64(&mut x105, &mut x106, x104, x81, x96);
613  let mut x107: u64 = 0;
614  let mut x108: fiat_p256_u1 = 0;
615  fiat_p256_addcarryx_u64(&mut x107, &mut x108, x106, x83, x98);
616  let mut x109: u64 = 0;
617  let mut x110: u64 = 0;
618  fiat_p256_mulx_u64(&mut x109, &mut x110, x99, 0xffffffff00000001);
619  let mut x111: u64 = 0;
620  let mut x112: u64 = 0;
621  fiat_p256_mulx_u64(&mut x111, &mut x112, x99, 0xffffffff);
622  let mut x113: u64 = 0;
623  let mut x114: u64 = 0;
624  fiat_p256_mulx_u64(&mut x113, &mut x114, x99, 0xffffffffffffffff);
625  let mut x115: u64 = 0;
626  let mut x116: fiat_p256_u1 = 0;
627  fiat_p256_addcarryx_u64(&mut x115, &mut x116, 0x0, x114, x111);
628  let x117: u64 = ((x116 as u64) + x112);
629  let mut x118: u64 = 0;
630  let mut x119: fiat_p256_u1 = 0;
631  fiat_p256_addcarryx_u64(&mut x118, &mut x119, 0x0, x99, x113);
632  let mut x120: u64 = 0;
633  let mut x121: fiat_p256_u1 = 0;
634  fiat_p256_addcarryx_u64(&mut x120, &mut x121, x119, x101, x115);
635  let mut x122: u64 = 0;
636  let mut x123: fiat_p256_u1 = 0;
637  fiat_p256_addcarryx_u64(&mut x122, &mut x123, x121, x103, x117);
638  let mut x124: u64 = 0;
639  let mut x125: fiat_p256_u1 = 0;
640  fiat_p256_addcarryx_u64(&mut x124, &mut x125, x123, x105, x109);
641  let mut x126: u64 = 0;
642  let mut x127: fiat_p256_u1 = 0;
643  fiat_p256_addcarryx_u64(&mut x126, &mut x127, x125, x107, x110);
644  let x128: u64 = ((x127 as u64) + (x108 as u64));
645  let mut x129: u64 = 0;
646  let mut x130: u64 = 0;
647  fiat_p256_mulx_u64(&mut x129, &mut x130, x3, (arg1[3]));
648  let mut x131: u64 = 0;
649  let mut x132: u64 = 0;
650  fiat_p256_mulx_u64(&mut x131, &mut x132, x3, (arg1[2]));
651  let mut x133: u64 = 0;
652  let mut x134: u64 = 0;
653  fiat_p256_mulx_u64(&mut x133, &mut x134, x3, (arg1[1]));
654  let mut x135: u64 = 0;
655  let mut x136: u64 = 0;
656  fiat_p256_mulx_u64(&mut x135, &mut x136, x3, (arg1[0]));
657  let mut x137: u64 = 0;
658  let mut x138: fiat_p256_u1 = 0;
659  fiat_p256_addcarryx_u64(&mut x137, &mut x138, 0x0, x136, x133);
660  let mut x139: u64 = 0;
661  let mut x140: fiat_p256_u1 = 0;
662  fiat_p256_addcarryx_u64(&mut x139, &mut x140, x138, x134, x131);
663  let mut x141: u64 = 0;
664  let mut x142: fiat_p256_u1 = 0;
665  fiat_p256_addcarryx_u64(&mut x141, &mut x142, x140, x132, x129);
666  let x143: u64 = ((x142 as u64) + x130);
667  let mut x144: u64 = 0;
668  let mut x145: fiat_p256_u1 = 0;
669  fiat_p256_addcarryx_u64(&mut x144, &mut x145, 0x0, x120, x135);
670  let mut x146: u64 = 0;
671  let mut x147: fiat_p256_u1 = 0;
672  fiat_p256_addcarryx_u64(&mut x146, &mut x147, x145, x122, x137);
673  let mut x148: u64 = 0;
674  let mut x149: fiat_p256_u1 = 0;
675  fiat_p256_addcarryx_u64(&mut x148, &mut x149, x147, x124, x139);
676  let mut x150: u64 = 0;
677  let mut x151: fiat_p256_u1 = 0;
678  fiat_p256_addcarryx_u64(&mut x150, &mut x151, x149, x126, x141);
679  let mut x152: u64 = 0;
680  let mut x153: fiat_p256_u1 = 0;
681  fiat_p256_addcarryx_u64(&mut x152, &mut x153, x151, x128, x143);
682  let mut x154: u64 = 0;
683  let mut x155: u64 = 0;
684  fiat_p256_mulx_u64(&mut x154, &mut x155, x144, 0xffffffff00000001);
685  let mut x156: u64 = 0;
686  let mut x157: u64 = 0;
687  fiat_p256_mulx_u64(&mut x156, &mut x157, x144, 0xffffffff);
688  let mut x158: u64 = 0;
689  let mut x159: u64 = 0;
690  fiat_p256_mulx_u64(&mut x158, &mut x159, x144, 0xffffffffffffffff);
691  let mut x160: u64 = 0;
692  let mut x161: fiat_p256_u1 = 0;
693  fiat_p256_addcarryx_u64(&mut x160, &mut x161, 0x0, x159, x156);
694  let x162: u64 = ((x161 as u64) + x157);
695  let mut x163: u64 = 0;
696  let mut x164: fiat_p256_u1 = 0;
697  fiat_p256_addcarryx_u64(&mut x163, &mut x164, 0x0, x144, x158);
698  let mut x165: u64 = 0;
699  let mut x166: fiat_p256_u1 = 0;
700  fiat_p256_addcarryx_u64(&mut x165, &mut x166, x164, x146, x160);
701  let mut x167: u64 = 0;
702  let mut x168: fiat_p256_u1 = 0;
703  fiat_p256_addcarryx_u64(&mut x167, &mut x168, x166, x148, x162);
704  let mut x169: u64 = 0;
705  let mut x170: fiat_p256_u1 = 0;
706  fiat_p256_addcarryx_u64(&mut x169, &mut x170, x168, x150, x154);
707  let mut x171: u64 = 0;
708  let mut x172: fiat_p256_u1 = 0;
709  fiat_p256_addcarryx_u64(&mut x171, &mut x172, x170, x152, x155);
710  let x173: u64 = ((x172 as u64) + (x153 as u64));
711  let mut x174: u64 = 0;
712  let mut x175: fiat_p256_u1 = 0;
713  fiat_p256_subborrowx_u64(&mut x174, &mut x175, 0x0, x165, 0xffffffffffffffff);
714  let mut x176: u64 = 0;
715  let mut x177: fiat_p256_u1 = 0;
716  fiat_p256_subborrowx_u64(&mut x176, &mut x177, x175, x167, 0xffffffff);
717  let mut x178: u64 = 0;
718  let mut x179: fiat_p256_u1 = 0;
719  fiat_p256_subborrowx_u64(&mut x178, &mut x179, x177, x169, (0x0 as u64));
720  let mut x180: u64 = 0;
721  let mut x181: fiat_p256_u1 = 0;
722  fiat_p256_subborrowx_u64(&mut x180, &mut x181, x179, x171, 0xffffffff00000001);
723  let mut x182: u64 = 0;
724  let mut x183: fiat_p256_u1 = 0;
725  fiat_p256_subborrowx_u64(&mut x182, &mut x183, x181, x173, (0x0 as u64));
726  let mut x184: u64 = 0;
727  fiat_p256_cmovznz_u64(&mut x184, x183, x174, x165);
728  let mut x185: u64 = 0;
729  fiat_p256_cmovznz_u64(&mut x185, x183, x176, x167);
730  let mut x186: u64 = 0;
731  fiat_p256_cmovznz_u64(&mut x186, x183, x178, x169);
732  let mut x187: u64 = 0;
733  fiat_p256_cmovznz_u64(&mut x187, x183, x180, x171);
734  out1[0] = x184;
735  out1[1] = x185;
736  out1[2] = x186;
737  out1[3] = x187;
738}
739
740/// The function fiat_p256_add adds two field elements in the Montgomery domain.
741///
742/// Preconditions:
743///   0 ≤ eval arg1 < m
744///   0 ≤ eval arg2 < m
745/// Postconditions:
746///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
747///   0 ≤ eval out1 < m
748///
749#[inline]
750pub fn fiat_p256_add(out1: &mut fiat_p256_montgomery_domain_field_element, arg1: &fiat_p256_montgomery_domain_field_element, arg2: &fiat_p256_montgomery_domain_field_element) {
751  let mut x1: u64 = 0;
752  let mut x2: fiat_p256_u1 = 0;
753  fiat_p256_addcarryx_u64(&mut x1, &mut x2, 0x0, (arg1[0]), (arg2[0]));
754  let mut x3: u64 = 0;
755  let mut x4: fiat_p256_u1 = 0;
756  fiat_p256_addcarryx_u64(&mut x3, &mut x4, x2, (arg1[1]), (arg2[1]));
757  let mut x5: u64 = 0;
758  let mut x6: fiat_p256_u1 = 0;
759  fiat_p256_addcarryx_u64(&mut x5, &mut x6, x4, (arg1[2]), (arg2[2]));
760  let mut x7: u64 = 0;
761  let mut x8: fiat_p256_u1 = 0;
762  fiat_p256_addcarryx_u64(&mut x7, &mut x8, x6, (arg1[3]), (arg2[3]));
763  let mut x9: u64 = 0;
764  let mut x10: fiat_p256_u1 = 0;
765  fiat_p256_subborrowx_u64(&mut x9, &mut x10, 0x0, x1, 0xffffffffffffffff);
766  let mut x11: u64 = 0;
767  let mut x12: fiat_p256_u1 = 0;
768  fiat_p256_subborrowx_u64(&mut x11, &mut x12, x10, x3, 0xffffffff);
769  let mut x13: u64 = 0;
770  let mut x14: fiat_p256_u1 = 0;
771  fiat_p256_subborrowx_u64(&mut x13, &mut x14, x12, x5, (0x0 as u64));
772  let mut x15: u64 = 0;
773  let mut x16: fiat_p256_u1 = 0;
774  fiat_p256_subborrowx_u64(&mut x15, &mut x16, x14, x7, 0xffffffff00000001);
775  let mut x17: u64 = 0;
776  let mut x18: fiat_p256_u1 = 0;
777  fiat_p256_subborrowx_u64(&mut x17, &mut x18, x16, (x8 as u64), (0x0 as u64));
778  let mut x19: u64 = 0;
779  fiat_p256_cmovznz_u64(&mut x19, x18, x9, x1);
780  let mut x20: u64 = 0;
781  fiat_p256_cmovznz_u64(&mut x20, x18, x11, x3);
782  let mut x21: u64 = 0;
783  fiat_p256_cmovznz_u64(&mut x21, x18, x13, x5);
784  let mut x22: u64 = 0;
785  fiat_p256_cmovznz_u64(&mut x22, x18, x15, x7);
786  out1[0] = x19;
787  out1[1] = x20;
788  out1[2] = x21;
789  out1[3] = x22;
790}
791
792/// The function fiat_p256_sub subtracts two field elements in the Montgomery domain.
793///
794/// Preconditions:
795///   0 ≤ eval arg1 < m
796///   0 ≤ eval arg2 < m
797/// Postconditions:
798///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
799///   0 ≤ eval out1 < m
800///
801#[inline]
802pub fn fiat_p256_sub(out1: &mut fiat_p256_montgomery_domain_field_element, arg1: &fiat_p256_montgomery_domain_field_element, arg2: &fiat_p256_montgomery_domain_field_element) {
803  let mut x1: u64 = 0;
804  let mut x2: fiat_p256_u1 = 0;
805  fiat_p256_subborrowx_u64(&mut x1, &mut x2, 0x0, (arg1[0]), (arg2[0]));
806  let mut x3: u64 = 0;
807  let mut x4: fiat_p256_u1 = 0;
808  fiat_p256_subborrowx_u64(&mut x3, &mut x4, x2, (arg1[1]), (arg2[1]));
809  let mut x5: u64 = 0;
810  let mut x6: fiat_p256_u1 = 0;
811  fiat_p256_subborrowx_u64(&mut x5, &mut x6, x4, (arg1[2]), (arg2[2]));
812  let mut x7: u64 = 0;
813  let mut x8: fiat_p256_u1 = 0;
814  fiat_p256_subborrowx_u64(&mut x7, &mut x8, x6, (arg1[3]), (arg2[3]));
815  let mut x9: u64 = 0;
816  fiat_p256_cmovznz_u64(&mut x9, x8, (0x0 as u64), 0xffffffffffffffff);
817  let mut x10: u64 = 0;
818  let mut x11: fiat_p256_u1 = 0;
819  fiat_p256_addcarryx_u64(&mut x10, &mut x11, 0x0, x1, x9);
820  let mut x12: u64 = 0;
821  let mut x13: fiat_p256_u1 = 0;
822  fiat_p256_addcarryx_u64(&mut x12, &mut x13, x11, x3, (x9 & 0xffffffff));
823  let mut x14: u64 = 0;
824  let mut x15: fiat_p256_u1 = 0;
825  fiat_p256_addcarryx_u64(&mut x14, &mut x15, x13, x5, (0x0 as u64));
826  let mut x16: u64 = 0;
827  let mut x17: fiat_p256_u1 = 0;
828  fiat_p256_addcarryx_u64(&mut x16, &mut x17, x15, x7, (x9 & 0xffffffff00000001));
829  out1[0] = x10;
830  out1[1] = x12;
831  out1[2] = x14;
832  out1[3] = x16;
833}
834
835/// The function fiat_p256_opp negates a field element in the Montgomery domain.
836///
837/// Preconditions:
838///   0 ≤ eval arg1 < m
839/// Postconditions:
840///   eval (from_montgomery out1) mod m = -eval (from_montgomery arg1) mod m
841///   0 ≤ eval out1 < m
842///
843#[inline]
844pub fn fiat_p256_opp(out1: &mut fiat_p256_montgomery_domain_field_element, arg1: &fiat_p256_montgomery_domain_field_element) {
845  let mut x1: u64 = 0;
846  let mut x2: fiat_p256_u1 = 0;
847  fiat_p256_subborrowx_u64(&mut x1, &mut x2, 0x0, (0x0 as u64), (arg1[0]));
848  let mut x3: u64 = 0;
849  let mut x4: fiat_p256_u1 = 0;
850  fiat_p256_subborrowx_u64(&mut x3, &mut x4, x2, (0x0 as u64), (arg1[1]));
851  let mut x5: u64 = 0;
852  let mut x6: fiat_p256_u1 = 0;
853  fiat_p256_subborrowx_u64(&mut x5, &mut x6, x4, (0x0 as u64), (arg1[2]));
854  let mut x7: u64 = 0;
855  let mut x8: fiat_p256_u1 = 0;
856  fiat_p256_subborrowx_u64(&mut x7, &mut x8, x6, (0x0 as u64), (arg1[3]));
857  let mut x9: u64 = 0;
858  fiat_p256_cmovznz_u64(&mut x9, x8, (0x0 as u64), 0xffffffffffffffff);
859  let mut x10: u64 = 0;
860  let mut x11: fiat_p256_u1 = 0;
861  fiat_p256_addcarryx_u64(&mut x10, &mut x11, 0x0, x1, x9);
862  let mut x12: u64 = 0;
863  let mut x13: fiat_p256_u1 = 0;
864  fiat_p256_addcarryx_u64(&mut x12, &mut x13, x11, x3, (x9 & 0xffffffff));
865  let mut x14: u64 = 0;
866  let mut x15: fiat_p256_u1 = 0;
867  fiat_p256_addcarryx_u64(&mut x14, &mut x15, x13, x5, (0x0 as u64));
868  let mut x16: u64 = 0;
869  let mut x17: fiat_p256_u1 = 0;
870  fiat_p256_addcarryx_u64(&mut x16, &mut x17, x15, x7, (x9 & 0xffffffff00000001));
871  out1[0] = x10;
872  out1[1] = x12;
873  out1[2] = x14;
874  out1[3] = x16;
875}
876
877/// The function fiat_p256_from_montgomery translates a field element out of the Montgomery domain.
878///
879/// Preconditions:
880///   0 ≤ eval arg1 < m
881/// Postconditions:
882///   eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m
883///   0 ≤ eval out1 < m
884///
885#[inline]
886pub fn fiat_p256_from_montgomery(out1: &mut fiat_p256_non_montgomery_domain_field_element, arg1: &fiat_p256_montgomery_domain_field_element) {
887  let x1: u64 = (arg1[0]);
888  let mut x2: u64 = 0;
889  let mut x3: u64 = 0;
890  fiat_p256_mulx_u64(&mut x2, &mut x3, x1, 0xffffffff00000001);
891  let mut x4: u64 = 0;
892  let mut x5: u64 = 0;
893  fiat_p256_mulx_u64(&mut x4, &mut x5, x1, 0xffffffff);
894  let mut x6: u64 = 0;
895  let mut x7: u64 = 0;
896  fiat_p256_mulx_u64(&mut x6, &mut x7, x1, 0xffffffffffffffff);
897  let mut x8: u64 = 0;
898  let mut x9: fiat_p256_u1 = 0;
899  fiat_p256_addcarryx_u64(&mut x8, &mut x9, 0x0, x7, x4);
900  let mut x10: u64 = 0;
901  let mut x11: fiat_p256_u1 = 0;
902  fiat_p256_addcarryx_u64(&mut x10, &mut x11, 0x0, x1, x6);
903  let mut x12: u64 = 0;
904  let mut x13: fiat_p256_u1 = 0;
905  fiat_p256_addcarryx_u64(&mut x12, &mut x13, x11, (0x0 as u64), x8);
906  let mut x14: u64 = 0;
907  let mut x15: fiat_p256_u1 = 0;
908  fiat_p256_addcarryx_u64(&mut x14, &mut x15, 0x0, x12, (arg1[1]));
909  let mut x16: u64 = 0;
910  let mut x17: u64 = 0;
911  fiat_p256_mulx_u64(&mut x16, &mut x17, x14, 0xffffffff00000001);
912  let mut x18: u64 = 0;
913  let mut x19: u64 = 0;
914  fiat_p256_mulx_u64(&mut x18, &mut x19, x14, 0xffffffff);
915  let mut x20: u64 = 0;
916  let mut x21: u64 = 0;
917  fiat_p256_mulx_u64(&mut x20, &mut x21, x14, 0xffffffffffffffff);
918  let mut x22: u64 = 0;
919  let mut x23: fiat_p256_u1 = 0;
920  fiat_p256_addcarryx_u64(&mut x22, &mut x23, 0x0, x21, x18);
921  let mut x24: u64 = 0;
922  let mut x25: fiat_p256_u1 = 0;
923  fiat_p256_addcarryx_u64(&mut x24, &mut x25, 0x0, x14, x20);
924  let mut x26: u64 = 0;
925  let mut x27: fiat_p256_u1 = 0;
926  fiat_p256_addcarryx_u64(&mut x26, &mut x27, x25, ((x15 as u64) + ((x13 as u64) + ((x9 as u64) + x5))), x22);
927  let mut x28: u64 = 0;
928  let mut x29: fiat_p256_u1 = 0;
929  fiat_p256_addcarryx_u64(&mut x28, &mut x29, x27, x2, ((x23 as u64) + x19));
930  let mut x30: u64 = 0;
931  let mut x31: fiat_p256_u1 = 0;
932  fiat_p256_addcarryx_u64(&mut x30, &mut x31, x29, x3, x16);
933  let mut x32: u64 = 0;
934  let mut x33: fiat_p256_u1 = 0;
935  fiat_p256_addcarryx_u64(&mut x32, &mut x33, 0x0, x26, (arg1[2]));
936  let mut x34: u64 = 0;
937  let mut x35: fiat_p256_u1 = 0;
938  fiat_p256_addcarryx_u64(&mut x34, &mut x35, x33, x28, (0x0 as u64));
939  let mut x36: u64 = 0;
940  let mut x37: fiat_p256_u1 = 0;
941  fiat_p256_addcarryx_u64(&mut x36, &mut x37, x35, x30, (0x0 as u64));
942  let mut x38: u64 = 0;
943  let mut x39: u64 = 0;
944  fiat_p256_mulx_u64(&mut x38, &mut x39, x32, 0xffffffff00000001);
945  let mut x40: u64 = 0;
946  let mut x41: u64 = 0;
947  fiat_p256_mulx_u64(&mut x40, &mut x41, x32, 0xffffffff);
948  let mut x42: u64 = 0;
949  let mut x43: u64 = 0;
950  fiat_p256_mulx_u64(&mut x42, &mut x43, x32, 0xffffffffffffffff);
951  let mut x44: u64 = 0;
952  let mut x45: fiat_p256_u1 = 0;
953  fiat_p256_addcarryx_u64(&mut x44, &mut x45, 0x0, x43, x40);
954  let mut x46: u64 = 0;
955  let mut x47: fiat_p256_u1 = 0;
956  fiat_p256_addcarryx_u64(&mut x46, &mut x47, 0x0, x32, x42);
957  let mut x48: u64 = 0;
958  let mut x49: fiat_p256_u1 = 0;
959  fiat_p256_addcarryx_u64(&mut x48, &mut x49, x47, x34, x44);
960  let mut x50: u64 = 0;
961  let mut x51: fiat_p256_u1 = 0;
962  fiat_p256_addcarryx_u64(&mut x50, &mut x51, x49, x36, ((x45 as u64) + x41));
963  let mut x52: u64 = 0;
964  let mut x53: fiat_p256_u1 = 0;
965  fiat_p256_addcarryx_u64(&mut x52, &mut x53, x51, ((x37 as u64) + ((x31 as u64) + x17)), x38);
966  let mut x54: u64 = 0;
967  let mut x55: fiat_p256_u1 = 0;
968  fiat_p256_addcarryx_u64(&mut x54, &mut x55, 0x0, x48, (arg1[3]));
969  let mut x56: u64 = 0;
970  let mut x57: fiat_p256_u1 = 0;
971  fiat_p256_addcarryx_u64(&mut x56, &mut x57, x55, x50, (0x0 as u64));
972  let mut x58: u64 = 0;
973  let mut x59: fiat_p256_u1 = 0;
974  fiat_p256_addcarryx_u64(&mut x58, &mut x59, x57, x52, (0x0 as u64));
975  let mut x60: u64 = 0;
976  let mut x61: u64 = 0;
977  fiat_p256_mulx_u64(&mut x60, &mut x61, x54, 0xffffffff00000001);
978  let mut x62: u64 = 0;
979  let mut x63: u64 = 0;
980  fiat_p256_mulx_u64(&mut x62, &mut x63, x54, 0xffffffff);
981  let mut x64: u64 = 0;
982  let mut x65: u64 = 0;
983  fiat_p256_mulx_u64(&mut x64, &mut x65, x54, 0xffffffffffffffff);
984  let mut x66: u64 = 0;
985  let mut x67: fiat_p256_u1 = 0;
986  fiat_p256_addcarryx_u64(&mut x66, &mut x67, 0x0, x65, x62);
987  let mut x68: u64 = 0;
988  let mut x69: fiat_p256_u1 = 0;
989  fiat_p256_addcarryx_u64(&mut x68, &mut x69, 0x0, x54, x64);
990  let mut x70: u64 = 0;
991  let mut x71: fiat_p256_u1 = 0;
992  fiat_p256_addcarryx_u64(&mut x70, &mut x71, x69, x56, x66);
993  let mut x72: u64 = 0;
994  let mut x73: fiat_p256_u1 = 0;
995  fiat_p256_addcarryx_u64(&mut x72, &mut x73, x71, x58, ((x67 as u64) + x63));
996  let mut x74: u64 = 0;
997  let mut x75: fiat_p256_u1 = 0;
998  fiat_p256_addcarryx_u64(&mut x74, &mut x75, x73, ((x59 as u64) + ((x53 as u64) + x39)), x60);
999  let x76: u64 = ((x75 as u64) + x61);
1000  let mut x77: u64 = 0;
1001  let mut x78: fiat_p256_u1 = 0;
1002  fiat_p256_subborrowx_u64(&mut x77, &mut x78, 0x0, x70, 0xffffffffffffffff);
1003  let mut x79: u64 = 0;
1004  let mut x80: fiat_p256_u1 = 0;
1005  fiat_p256_subborrowx_u64(&mut x79, &mut x80, x78, x72, 0xffffffff);
1006  let mut x81: u64 = 0;
1007  let mut x82: fiat_p256_u1 = 0;
1008  fiat_p256_subborrowx_u64(&mut x81, &mut x82, x80, x74, (0x0 as u64));
1009  let mut x83: u64 = 0;
1010  let mut x84: fiat_p256_u1 = 0;
1011  fiat_p256_subborrowx_u64(&mut x83, &mut x84, x82, x76, 0xffffffff00000001);
1012  let mut x85: u64 = 0;
1013  let mut x86: fiat_p256_u1 = 0;
1014  fiat_p256_subborrowx_u64(&mut x85, &mut x86, x84, (0x0 as u64), (0x0 as u64));
1015  let mut x87: u64 = 0;
1016  fiat_p256_cmovznz_u64(&mut x87, x86, x77, x70);
1017  let mut x88: u64 = 0;
1018  fiat_p256_cmovznz_u64(&mut x88, x86, x79, x72);
1019  let mut x89: u64 = 0;
1020  fiat_p256_cmovznz_u64(&mut x89, x86, x81, x74);
1021  let mut x90: u64 = 0;
1022  fiat_p256_cmovznz_u64(&mut x90, x86, x83, x76);
1023  out1[0] = x87;
1024  out1[1] = x88;
1025  out1[2] = x89;
1026  out1[3] = x90;
1027}
1028
1029/// The function fiat_p256_to_montgomery translates a field element into the Montgomery domain.
1030///
1031/// Preconditions:
1032///   0 ≤ eval arg1 < m
1033/// Postconditions:
1034///   eval (from_montgomery out1) mod m = eval arg1 mod m
1035///   0 ≤ eval out1 < m
1036///
1037#[inline]
1038pub fn fiat_p256_to_montgomery(out1: &mut fiat_p256_montgomery_domain_field_element, arg1: &fiat_p256_non_montgomery_domain_field_element) {
1039  let x1: u64 = (arg1[1]);
1040  let x2: u64 = (arg1[2]);
1041  let x3: u64 = (arg1[3]);
1042  let x4: u64 = (arg1[0]);
1043  let mut x5: u64 = 0;
1044  let mut x6: u64 = 0;
1045  fiat_p256_mulx_u64(&mut x5, &mut x6, x4, 0x4fffffffd);
1046  let mut x7: u64 = 0;
1047  let mut x8: u64 = 0;
1048  fiat_p256_mulx_u64(&mut x7, &mut x8, x4, 0xfffffffffffffffe);
1049  let mut x9: u64 = 0;
1050  let mut x10: u64 = 0;
1051  fiat_p256_mulx_u64(&mut x9, &mut x10, x4, 0xfffffffbffffffff);
1052  let mut x11: u64 = 0;
1053  let mut x12: u64 = 0;
1054  fiat_p256_mulx_u64(&mut x11, &mut x12, x4, 0x3);
1055  let mut x13: u64 = 0;
1056  let mut x14: fiat_p256_u1 = 0;
1057  fiat_p256_addcarryx_u64(&mut x13, &mut x14, 0x0, x12, x9);
1058  let mut x15: u64 = 0;
1059  let mut x16: fiat_p256_u1 = 0;
1060  fiat_p256_addcarryx_u64(&mut x15, &mut x16, x14, x10, x7);
1061  let mut x17: u64 = 0;
1062  let mut x18: fiat_p256_u1 = 0;
1063  fiat_p256_addcarryx_u64(&mut x17, &mut x18, x16, x8, x5);
1064  let mut x19: u64 = 0;
1065  let mut x20: u64 = 0;
1066  fiat_p256_mulx_u64(&mut x19, &mut x20, x11, 0xffffffff00000001);
1067  let mut x21: u64 = 0;
1068  let mut x22: u64 = 0;
1069  fiat_p256_mulx_u64(&mut x21, &mut x22, x11, 0xffffffff);
1070  let mut x23: u64 = 0;
1071  let mut x24: u64 = 0;
1072  fiat_p256_mulx_u64(&mut x23, &mut x24, x11, 0xffffffffffffffff);
1073  let mut x25: u64 = 0;
1074  let mut x26: fiat_p256_u1 = 0;
1075  fiat_p256_addcarryx_u64(&mut x25, &mut x26, 0x0, x24, x21);
1076  let mut x27: u64 = 0;
1077  let mut x28: fiat_p256_u1 = 0;
1078  fiat_p256_addcarryx_u64(&mut x27, &mut x28, 0x0, x11, x23);
1079  let mut x29: u64 = 0;
1080  let mut x30: fiat_p256_u1 = 0;
1081  fiat_p256_addcarryx_u64(&mut x29, &mut x30, x28, x13, x25);
1082  let mut x31: u64 = 0;
1083  let mut x32: fiat_p256_u1 = 0;
1084  fiat_p256_addcarryx_u64(&mut x31, &mut x32, x30, x15, ((x26 as u64) + x22));
1085  let mut x33: u64 = 0;
1086  let mut x34: fiat_p256_u1 = 0;
1087  fiat_p256_addcarryx_u64(&mut x33, &mut x34, x32, x17, x19);
1088  let mut x35: u64 = 0;
1089  let mut x36: fiat_p256_u1 = 0;
1090  fiat_p256_addcarryx_u64(&mut x35, &mut x36, x34, ((x18 as u64) + x6), x20);
1091  let mut x37: u64 = 0;
1092  let mut x38: u64 = 0;
1093  fiat_p256_mulx_u64(&mut x37, &mut x38, x1, 0x4fffffffd);
1094  let mut x39: u64 = 0;
1095  let mut x40: u64 = 0;
1096  fiat_p256_mulx_u64(&mut x39, &mut x40, x1, 0xfffffffffffffffe);
1097  let mut x41: u64 = 0;
1098  let mut x42: u64 = 0;
1099  fiat_p256_mulx_u64(&mut x41, &mut x42, x1, 0xfffffffbffffffff);
1100  let mut x43: u64 = 0;
1101  let mut x44: u64 = 0;
1102  fiat_p256_mulx_u64(&mut x43, &mut x44, x1, 0x3);
1103  let mut x45: u64 = 0;
1104  let mut x46: fiat_p256_u1 = 0;
1105  fiat_p256_addcarryx_u64(&mut x45, &mut x46, 0x0, x44, x41);
1106  let mut x47: u64 = 0;
1107  let mut x48: fiat_p256_u1 = 0;
1108  fiat_p256_addcarryx_u64(&mut x47, &mut x48, x46, x42, x39);
1109  let mut x49: u64 = 0;
1110  let mut x50: fiat_p256_u1 = 0;
1111  fiat_p256_addcarryx_u64(&mut x49, &mut x50, x48, x40, x37);
1112  let mut x51: u64 = 0;
1113  let mut x52: fiat_p256_u1 = 0;
1114  fiat_p256_addcarryx_u64(&mut x51, &mut x52, 0x0, x29, x43);
1115  let mut x53: u64 = 0;
1116  let mut x54: fiat_p256_u1 = 0;
1117  fiat_p256_addcarryx_u64(&mut x53, &mut x54, x52, x31, x45);
1118  let mut x55: u64 = 0;
1119  let mut x56: fiat_p256_u1 = 0;
1120  fiat_p256_addcarryx_u64(&mut x55, &mut x56, x54, x33, x47);
1121  let mut x57: u64 = 0;
1122  let mut x58: fiat_p256_u1 = 0;
1123  fiat_p256_addcarryx_u64(&mut x57, &mut x58, x56, x35, x49);
1124  let mut x59: u64 = 0;
1125  let mut x60: u64 = 0;
1126  fiat_p256_mulx_u64(&mut x59, &mut x60, x51, 0xffffffff00000001);
1127  let mut x61: u64 = 0;
1128  let mut x62: u64 = 0;
1129  fiat_p256_mulx_u64(&mut x61, &mut x62, x51, 0xffffffff);
1130  let mut x63: u64 = 0;
1131  let mut x64: u64 = 0;
1132  fiat_p256_mulx_u64(&mut x63, &mut x64, x51, 0xffffffffffffffff);
1133  let mut x65: u64 = 0;
1134  let mut x66: fiat_p256_u1 = 0;
1135  fiat_p256_addcarryx_u64(&mut x65, &mut x66, 0x0, x64, x61);
1136  let mut x67: u64 = 0;
1137  let mut x68: fiat_p256_u1 = 0;
1138  fiat_p256_addcarryx_u64(&mut x67, &mut x68, 0x0, x51, x63);
1139  let mut x69: u64 = 0;
1140  let mut x70: fiat_p256_u1 = 0;
1141  fiat_p256_addcarryx_u64(&mut x69, &mut x70, x68, x53, x65);
1142  let mut x71: u64 = 0;
1143  let mut x72: fiat_p256_u1 = 0;
1144  fiat_p256_addcarryx_u64(&mut x71, &mut x72, x70, x55, ((x66 as u64) + x62));
1145  let mut x73: u64 = 0;
1146  let mut x74: fiat_p256_u1 = 0;
1147  fiat_p256_addcarryx_u64(&mut x73, &mut x74, x72, x57, x59);
1148  let mut x75: u64 = 0;
1149  let mut x76: fiat_p256_u1 = 0;
1150  fiat_p256_addcarryx_u64(&mut x75, &mut x76, x74, (((x58 as u64) + (x36 as u64)) + ((x50 as u64) + x38)), x60);
1151  let mut x77: u64 = 0;
1152  let mut x78: u64 = 0;
1153  fiat_p256_mulx_u64(&mut x77, &mut x78, x2, 0x4fffffffd);
1154  let mut x79: u64 = 0;
1155  let mut x80: u64 = 0;
1156  fiat_p256_mulx_u64(&mut x79, &mut x80, x2, 0xfffffffffffffffe);
1157  let mut x81: u64 = 0;
1158  let mut x82: u64 = 0;
1159  fiat_p256_mulx_u64(&mut x81, &mut x82, x2, 0xfffffffbffffffff);
1160  let mut x83: u64 = 0;
1161  let mut x84: u64 = 0;
1162  fiat_p256_mulx_u64(&mut x83, &mut x84, x2, 0x3);
1163  let mut x85: u64 = 0;
1164  let mut x86: fiat_p256_u1 = 0;
1165  fiat_p256_addcarryx_u64(&mut x85, &mut x86, 0x0, x84, x81);
1166  let mut x87: u64 = 0;
1167  let mut x88: fiat_p256_u1 = 0;
1168  fiat_p256_addcarryx_u64(&mut x87, &mut x88, x86, x82, x79);
1169  let mut x89: u64 = 0;
1170  let mut x90: fiat_p256_u1 = 0;
1171  fiat_p256_addcarryx_u64(&mut x89, &mut x90, x88, x80, x77);
1172  let mut x91: u64 = 0;
1173  let mut x92: fiat_p256_u1 = 0;
1174  fiat_p256_addcarryx_u64(&mut x91, &mut x92, 0x0, x69, x83);
1175  let mut x93: u64 = 0;
1176  let mut x94: fiat_p256_u1 = 0;
1177  fiat_p256_addcarryx_u64(&mut x93, &mut x94, x92, x71, x85);
1178  let mut x95: u64 = 0;
1179  let mut x96: fiat_p256_u1 = 0;
1180  fiat_p256_addcarryx_u64(&mut x95, &mut x96, x94, x73, x87);
1181  let mut x97: u64 = 0;
1182  let mut x98: fiat_p256_u1 = 0;
1183  fiat_p256_addcarryx_u64(&mut x97, &mut x98, x96, x75, x89);
1184  let mut x99: u64 = 0;
1185  let mut x100: u64 = 0;
1186  fiat_p256_mulx_u64(&mut x99, &mut x100, x91, 0xffffffff00000001);
1187  let mut x101: u64 = 0;
1188  let mut x102: u64 = 0;
1189  fiat_p256_mulx_u64(&mut x101, &mut x102, x91, 0xffffffff);
1190  let mut x103: u64 = 0;
1191  let mut x104: u64 = 0;
1192  fiat_p256_mulx_u64(&mut x103, &mut x104, x91, 0xffffffffffffffff);
1193  let mut x105: u64 = 0;
1194  let mut x106: fiat_p256_u1 = 0;
1195  fiat_p256_addcarryx_u64(&mut x105, &mut x106, 0x0, x104, x101);
1196  let mut x107: u64 = 0;
1197  let mut x108: fiat_p256_u1 = 0;
1198  fiat_p256_addcarryx_u64(&mut x107, &mut x108, 0x0, x91, x103);
1199  let mut x109: u64 = 0;
1200  let mut x110: fiat_p256_u1 = 0;
1201  fiat_p256_addcarryx_u64(&mut x109, &mut x110, x108, x93, x105);
1202  let mut x111: u64 = 0;
1203  let mut x112: fiat_p256_u1 = 0;
1204  fiat_p256_addcarryx_u64(&mut x111, &mut x112, x110, x95, ((x106 as u64) + x102));
1205  let mut x113: u64 = 0;
1206  let mut x114: fiat_p256_u1 = 0;
1207  fiat_p256_addcarryx_u64(&mut x113, &mut x114, x112, x97, x99);
1208  let mut x115: u64 = 0;
1209  let mut x116: fiat_p256_u1 = 0;
1210  fiat_p256_addcarryx_u64(&mut x115, &mut x116, x114, (((x98 as u64) + (x76 as u64)) + ((x90 as u64) + x78)), x100);
1211  let mut x117: u64 = 0;
1212  let mut x118: u64 = 0;
1213  fiat_p256_mulx_u64(&mut x117, &mut x118, x3, 0x4fffffffd);
1214  let mut x119: u64 = 0;
1215  let mut x120: u64 = 0;
1216  fiat_p256_mulx_u64(&mut x119, &mut x120, x3, 0xfffffffffffffffe);
1217  let mut x121: u64 = 0;
1218  let mut x122: u64 = 0;
1219  fiat_p256_mulx_u64(&mut x121, &mut x122, x3, 0xfffffffbffffffff);
1220  let mut x123: u64 = 0;
1221  let mut x124: u64 = 0;
1222  fiat_p256_mulx_u64(&mut x123, &mut x124, x3, 0x3);
1223  let mut x125: u64 = 0;
1224  let mut x126: fiat_p256_u1 = 0;
1225  fiat_p256_addcarryx_u64(&mut x125, &mut x126, 0x0, x124, x121);
1226  let mut x127: u64 = 0;
1227  let mut x128: fiat_p256_u1 = 0;
1228  fiat_p256_addcarryx_u64(&mut x127, &mut x128, x126, x122, x119);
1229  let mut x129: u64 = 0;
1230  let mut x130: fiat_p256_u1 = 0;
1231  fiat_p256_addcarryx_u64(&mut x129, &mut x130, x128, x120, x117);
1232  let mut x131: u64 = 0;
1233  let mut x132: fiat_p256_u1 = 0;
1234  fiat_p256_addcarryx_u64(&mut x131, &mut x132, 0x0, x109, x123);
1235  let mut x133: u64 = 0;
1236  let mut x134: fiat_p256_u1 = 0;
1237  fiat_p256_addcarryx_u64(&mut x133, &mut x134, x132, x111, x125);
1238  let mut x135: u64 = 0;
1239  let mut x136: fiat_p256_u1 = 0;
1240  fiat_p256_addcarryx_u64(&mut x135, &mut x136, x134, x113, x127);
1241  let mut x137: u64 = 0;
1242  let mut x138: fiat_p256_u1 = 0;
1243  fiat_p256_addcarryx_u64(&mut x137, &mut x138, x136, x115, x129);
1244  let mut x139: u64 = 0;
1245  let mut x140: u64 = 0;
1246  fiat_p256_mulx_u64(&mut x139, &mut x140, x131, 0xffffffff00000001);
1247  let mut x141: u64 = 0;
1248  let mut x142: u64 = 0;
1249  fiat_p256_mulx_u64(&mut x141, &mut x142, x131, 0xffffffff);
1250  let mut x143: u64 = 0;
1251  let mut x144: u64 = 0;
1252  fiat_p256_mulx_u64(&mut x143, &mut x144, x131, 0xffffffffffffffff);
1253  let mut x145: u64 = 0;
1254  let mut x146: fiat_p256_u1 = 0;
1255  fiat_p256_addcarryx_u64(&mut x145, &mut x146, 0x0, x144, x141);
1256  let mut x147: u64 = 0;
1257  let mut x148: fiat_p256_u1 = 0;
1258  fiat_p256_addcarryx_u64(&mut x147, &mut x148, 0x0, x131, x143);
1259  let mut x149: u64 = 0;
1260  let mut x150: fiat_p256_u1 = 0;
1261  fiat_p256_addcarryx_u64(&mut x149, &mut x150, x148, x133, x145);
1262  let mut x151: u64 = 0;
1263  let mut x152: fiat_p256_u1 = 0;
1264  fiat_p256_addcarryx_u64(&mut x151, &mut x152, x150, x135, ((x146 as u64) + x142));
1265  let mut x153: u64 = 0;
1266  let mut x154: fiat_p256_u1 = 0;
1267  fiat_p256_addcarryx_u64(&mut x153, &mut x154, x152, x137, x139);
1268  let mut x155: u64 = 0;
1269  let mut x156: fiat_p256_u1 = 0;
1270  fiat_p256_addcarryx_u64(&mut x155, &mut x156, x154, (((x138 as u64) + (x116 as u64)) + ((x130 as u64) + x118)), x140);
1271  let mut x157: u64 = 0;
1272  let mut x158: fiat_p256_u1 = 0;
1273  fiat_p256_subborrowx_u64(&mut x157, &mut x158, 0x0, x149, 0xffffffffffffffff);
1274  let mut x159: u64 = 0;
1275  let mut x160: fiat_p256_u1 = 0;
1276  fiat_p256_subborrowx_u64(&mut x159, &mut x160, x158, x151, 0xffffffff);
1277  let mut x161: u64 = 0;
1278  let mut x162: fiat_p256_u1 = 0;
1279  fiat_p256_subborrowx_u64(&mut x161, &mut x162, x160, x153, (0x0 as u64));
1280  let mut x163: u64 = 0;
1281  let mut x164: fiat_p256_u1 = 0;
1282  fiat_p256_subborrowx_u64(&mut x163, &mut x164, x162, x155, 0xffffffff00000001);
1283  let mut x165: u64 = 0;
1284  let mut x166: fiat_p256_u1 = 0;
1285  fiat_p256_subborrowx_u64(&mut x165, &mut x166, x164, (x156 as u64), (0x0 as u64));
1286  let mut x167: u64 = 0;
1287  fiat_p256_cmovznz_u64(&mut x167, x166, x157, x149);
1288  let mut x168: u64 = 0;
1289  fiat_p256_cmovznz_u64(&mut x168, x166, x159, x151);
1290  let mut x169: u64 = 0;
1291  fiat_p256_cmovznz_u64(&mut x169, x166, x161, x153);
1292  let mut x170: u64 = 0;
1293  fiat_p256_cmovznz_u64(&mut x170, x166, x163, x155);
1294  out1[0] = x167;
1295  out1[1] = x168;
1296  out1[2] = x169;
1297  out1[3] = x170;
1298}
1299
1300/// The function fiat_p256_nonzero outputs a single non-zero word if the input is non-zero and zero otherwise.
1301///
1302/// Preconditions:
1303///   0 ≤ eval arg1 < m
1304/// Postconditions:
1305///   out1 = 0 ↔ eval (from_montgomery arg1) mod m = 0
1306///
1307/// Input Bounds:
1308///   arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1309/// Output Bounds:
1310///   out1: [0x0 ~> 0xffffffffffffffff]
1311#[inline]
1312pub fn fiat_p256_nonzero(out1: &mut u64, arg1: &[u64; 4]) {
1313  let x1: u64 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | (arg1[3]))));
1314  *out1 = x1;
1315}
1316
1317/// The function fiat_p256_selectznz is a multi-limb conditional select.
1318///
1319/// Postconditions:
1320///   out1 = (if arg1 = 0 then arg2 else arg3)
1321///
1322/// Input Bounds:
1323///   arg1: [0x0 ~> 0x1]
1324///   arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1325///   arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1326/// Output Bounds:
1327///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1328#[inline]
1329pub fn fiat_p256_selectznz(out1: &mut [u64; 4], arg1: fiat_p256_u1, arg2: &[u64; 4], arg3: &[u64; 4]) {
1330  let mut x1: u64 = 0;
1331  fiat_p256_cmovznz_u64(&mut x1, arg1, (arg2[0]), (arg3[0]));
1332  let mut x2: u64 = 0;
1333  fiat_p256_cmovznz_u64(&mut x2, arg1, (arg2[1]), (arg3[1]));
1334  let mut x3: u64 = 0;
1335  fiat_p256_cmovznz_u64(&mut x3, arg1, (arg2[2]), (arg3[2]));
1336  let mut x4: u64 = 0;
1337  fiat_p256_cmovznz_u64(&mut x4, arg1, (arg2[3]), (arg3[3]));
1338  out1[0] = x1;
1339  out1[1] = x2;
1340  out1[2] = x3;
1341  out1[3] = x4;
1342}
1343
1344/// The function fiat_p256_to_bytes serializes a field element NOT in the Montgomery domain to bytes in little-endian order.
1345///
1346/// Preconditions:
1347///   0 ≤ eval arg1 < m
1348/// Postconditions:
1349///   out1 = map (λ x, ⌊((eval arg1 mod m) mod 2^(8 * (x + 1))) / 2^(8 * x)⌋) [0..31]
1350///
1351/// Input Bounds:
1352///   arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1353/// Output Bounds:
1354///   out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]]
1355#[inline]
1356pub fn fiat_p256_to_bytes(out1: &mut [u8; 32], arg1: &[u64; 4]) {
1357  let x1: u64 = (arg1[3]);
1358  let x2: u64 = (arg1[2]);
1359  let x3: u64 = (arg1[1]);
1360  let x4: u64 = (arg1[0]);
1361  let x5: u8 = ((x4 & (0xff as u64)) as u8);
1362  let x6: u64 = (x4 >> 8);
1363  let x7: u8 = ((x6 & (0xff as u64)) as u8);
1364  let x8: u64 = (x6 >> 8);
1365  let x9: u8 = ((x8 & (0xff as u64)) as u8);
1366  let x10: u64 = (x8 >> 8);
1367  let x11: u8 = ((x10 & (0xff as u64)) as u8);
1368  let x12: u64 = (x10 >> 8);
1369  let x13: u8 = ((x12 & (0xff as u64)) as u8);
1370  let x14: u64 = (x12 >> 8);
1371  let x15: u8 = ((x14 & (0xff as u64)) as u8);
1372  let x16: u64 = (x14 >> 8);
1373  let x17: u8 = ((x16 & (0xff as u64)) as u8);
1374  let x18: u8 = ((x16 >> 8) as u8);
1375  let x19: u8 = ((x3 & (0xff as u64)) as u8);
1376  let x20: u64 = (x3 >> 8);
1377  let x21: u8 = ((x20 & (0xff as u64)) as u8);
1378  let x22: u64 = (x20 >> 8);
1379  let x23: u8 = ((x22 & (0xff as u64)) as u8);
1380  let x24: u64 = (x22 >> 8);
1381  let x25: u8 = ((x24 & (0xff as u64)) as u8);
1382  let x26: u64 = (x24 >> 8);
1383  let x27: u8 = ((x26 & (0xff as u64)) as u8);
1384  let x28: u64 = (x26 >> 8);
1385  let x29: u8 = ((x28 & (0xff as u64)) as u8);
1386  let x30: u64 = (x28 >> 8);
1387  let x31: u8 = ((x30 & (0xff as u64)) as u8);
1388  let x32: u8 = ((x30 >> 8) as u8);
1389  let x33: u8 = ((x2 & (0xff as u64)) as u8);
1390  let x34: u64 = (x2 >> 8);
1391  let x35: u8 = ((x34 & (0xff as u64)) as u8);
1392  let x36: u64 = (x34 >> 8);
1393  let x37: u8 = ((x36 & (0xff as u64)) as u8);
1394  let x38: u64 = (x36 >> 8);
1395  let x39: u8 = ((x38 & (0xff as u64)) as u8);
1396  let x40: u64 = (x38 >> 8);
1397  let x41: u8 = ((x40 & (0xff as u64)) as u8);
1398  let x42: u64 = (x40 >> 8);
1399  let x43: u8 = ((x42 & (0xff as u64)) as u8);
1400  let x44: u64 = (x42 >> 8);
1401  let x45: u8 = ((x44 & (0xff as u64)) as u8);
1402  let x46: u8 = ((x44 >> 8) as u8);
1403  let x47: u8 = ((x1 & (0xff as u64)) as u8);
1404  let x48: u64 = (x1 >> 8);
1405  let x49: u8 = ((x48 & (0xff as u64)) as u8);
1406  let x50: u64 = (x48 >> 8);
1407  let x51: u8 = ((x50 & (0xff as u64)) as u8);
1408  let x52: u64 = (x50 >> 8);
1409  let x53: u8 = ((x52 & (0xff as u64)) as u8);
1410  let x54: u64 = (x52 >> 8);
1411  let x55: u8 = ((x54 & (0xff as u64)) as u8);
1412  let x56: u64 = (x54 >> 8);
1413  let x57: u8 = ((x56 & (0xff as u64)) as u8);
1414  let x58: u64 = (x56 >> 8);
1415  let x59: u8 = ((x58 & (0xff as u64)) as u8);
1416  let x60: u8 = ((x58 >> 8) as u8);
1417  out1[0] = x5;
1418  out1[1] = x7;
1419  out1[2] = x9;
1420  out1[3] = x11;
1421  out1[4] = x13;
1422  out1[5] = x15;
1423  out1[6] = x17;
1424  out1[7] = x18;
1425  out1[8] = x19;
1426  out1[9] = x21;
1427  out1[10] = x23;
1428  out1[11] = x25;
1429  out1[12] = x27;
1430  out1[13] = x29;
1431  out1[14] = x31;
1432  out1[15] = x32;
1433  out1[16] = x33;
1434  out1[17] = x35;
1435  out1[18] = x37;
1436  out1[19] = x39;
1437  out1[20] = x41;
1438  out1[21] = x43;
1439  out1[22] = x45;
1440  out1[23] = x46;
1441  out1[24] = x47;
1442  out1[25] = x49;
1443  out1[26] = x51;
1444  out1[27] = x53;
1445  out1[28] = x55;
1446  out1[29] = x57;
1447  out1[30] = x59;
1448  out1[31] = x60;
1449}
1450
1451/// The function fiat_p256_from_bytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order.
1452///
1453/// Preconditions:
1454///   0 ≤ bytes_eval arg1 < m
1455/// Postconditions:
1456///   eval out1 mod m = bytes_eval arg1 mod m
1457///   0 ≤ eval out1 < m
1458///
1459/// Input Bounds:
1460///   arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]]
1461/// Output Bounds:
1462///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1463#[inline]
1464pub fn fiat_p256_from_bytes(out1: &mut [u64; 4], arg1: &[u8; 32]) {
1465  let x1: u64 = (((arg1[31]) as u64) << 56);
1466  let x2: u64 = (((arg1[30]) as u64) << 48);
1467  let x3: u64 = (((arg1[29]) as u64) << 40);
1468  let x4: u64 = (((arg1[28]) as u64) << 32);
1469  let x5: u64 = (((arg1[27]) as u64) << 24);
1470  let x6: u64 = (((arg1[26]) as u64) << 16);
1471  let x7: u64 = (((arg1[25]) as u64) << 8);
1472  let x8: u8 = (arg1[24]);
1473  let x9: u64 = (((arg1[23]) as u64) << 56);
1474  let x10: u64 = (((arg1[22]) as u64) << 48);
1475  let x11: u64 = (((arg1[21]) as u64) << 40);
1476  let x12: u64 = (((arg1[20]) as u64) << 32);
1477  let x13: u64 = (((arg1[19]) as u64) << 24);
1478  let x14: u64 = (((arg1[18]) as u64) << 16);
1479  let x15: u64 = (((arg1[17]) as u64) << 8);
1480  let x16: u8 = (arg1[16]);
1481  let x17: u64 = (((arg1[15]) as u64) << 56);
1482  let x18: u64 = (((arg1[14]) as u64) << 48);
1483  let x19: u64 = (((arg1[13]) as u64) << 40);
1484  let x20: u64 = (((arg1[12]) as u64) << 32);
1485  let x21: u64 = (((arg1[11]) as u64) << 24);
1486  let x22: u64 = (((arg1[10]) as u64) << 16);
1487  let x23: u64 = (((arg1[9]) as u64) << 8);
1488  let x24: u8 = (arg1[8]);
1489  let x25: u64 = (((arg1[7]) as u64) << 56);
1490  let x26: u64 = (((arg1[6]) as u64) << 48);
1491  let x27: u64 = (((arg1[5]) as u64) << 40);
1492  let x28: u64 = (((arg1[4]) as u64) << 32);
1493  let x29: u64 = (((arg1[3]) as u64) << 24);
1494  let x30: u64 = (((arg1[2]) as u64) << 16);
1495  let x31: u64 = (((arg1[1]) as u64) << 8);
1496  let x32: u8 = (arg1[0]);
1497  let x33: u64 = (x31 + (x32 as u64));
1498  let x34: u64 = (x30 + x33);
1499  let x35: u64 = (x29 + x34);
1500  let x36: u64 = (x28 + x35);
1501  let x37: u64 = (x27 + x36);
1502  let x38: u64 = (x26 + x37);
1503  let x39: u64 = (x25 + x38);
1504  let x40: u64 = (x23 + (x24 as u64));
1505  let x41: u64 = (x22 + x40);
1506  let x42: u64 = (x21 + x41);
1507  let x43: u64 = (x20 + x42);
1508  let x44: u64 = (x19 + x43);
1509  let x45: u64 = (x18 + x44);
1510  let x46: u64 = (x17 + x45);
1511  let x47: u64 = (x15 + (x16 as u64));
1512  let x48: u64 = (x14 + x47);
1513  let x49: u64 = (x13 + x48);
1514  let x50: u64 = (x12 + x49);
1515  let x51: u64 = (x11 + x50);
1516  let x52: u64 = (x10 + x51);
1517  let x53: u64 = (x9 + x52);
1518  let x54: u64 = (x7 + (x8 as u64));
1519  let x55: u64 = (x6 + x54);
1520  let x56: u64 = (x5 + x55);
1521  let x57: u64 = (x4 + x56);
1522  let x58: u64 = (x3 + x57);
1523  let x59: u64 = (x2 + x58);
1524  let x60: u64 = (x1 + x59);
1525  out1[0] = x39;
1526  out1[1] = x46;
1527  out1[2] = x53;
1528  out1[3] = x60;
1529}
1530
1531/// The function fiat_p256_set_one returns the field element one in the Montgomery domain.
1532///
1533/// Postconditions:
1534///   eval (from_montgomery out1) mod m = 1 mod m
1535///   0 ≤ eval out1 < m
1536///
1537#[inline]
1538pub fn fiat_p256_set_one(out1: &mut fiat_p256_montgomery_domain_field_element) {
1539  out1[0] = (0x1 as u64);
1540  out1[1] = 0xffffffff00000000;
1541  out1[2] = 0xffffffffffffffff;
1542  out1[3] = 0xfffffffe;
1543}
1544
1545/// The function fiat_p256_msat returns the saturated representation of the prime modulus.
1546///
1547/// Postconditions:
1548///   twos_complement_eval out1 = m
1549///   0 ≤ eval out1 < m
1550///
1551/// Output Bounds:
1552///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1553#[inline]
1554pub fn fiat_p256_msat(out1: &mut [u64; 5]) {
1555  out1[0] = 0xffffffffffffffff;
1556  out1[1] = 0xffffffff;
1557  out1[2] = (0x0 as u64);
1558  out1[3] = 0xffffffff00000001;
1559  out1[4] = (0x0 as u64);
1560}
1561
1562/// The function fiat_p256_divstep computes a divstep.
1563///
1564/// Preconditions:
1565///   0 ≤ eval arg4 < m
1566///   0 ≤ eval arg5 < m
1567/// Postconditions:
1568///   out1 = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then 1 - arg1 else 1 + arg1)
1569///   twos_complement_eval out2 = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then twos_complement_eval arg3 else twos_complement_eval arg2)
1570///   twos_complement_eval out3 = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then ⌊(twos_complement_eval arg3 - twos_complement_eval arg2) / 2⌋ else ⌊(twos_complement_eval arg3 + (twos_complement_eval arg3 mod 2) * twos_complement_eval arg2) / 2⌋)
1571///   eval (from_montgomery out4) mod m = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then (2 * eval (from_montgomery arg5)) mod m else (2 * eval (from_montgomery arg4)) mod m)
1572///   eval (from_montgomery out5) mod m = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then (eval (from_montgomery arg4) - eval (from_montgomery arg4)) mod m else (eval (from_montgomery arg5) + (twos_complement_eval arg3 mod 2) * eval (from_montgomery arg4)) mod m)
1573///   0 ≤ eval out5 < m
1574///   0 ≤ eval out5 < m
1575///   0 ≤ eval out2 < m
1576///   0 ≤ eval out3 < m
1577///
1578/// Input Bounds:
1579///   arg1: [0x0 ~> 0xffffffffffffffff]
1580///   arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1581///   arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1582///   arg4: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1583///   arg5: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1584/// Output Bounds:
1585///   out1: [0x0 ~> 0xffffffffffffffff]
1586///   out2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1587///   out3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1588///   out4: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1589///   out5: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1590#[inline]
1591pub fn fiat_p256_divstep(out1: &mut u64, out2: &mut [u64; 5], out3: &mut [u64; 5], out4: &mut [u64; 4], out5: &mut [u64; 4], arg1: u64, arg2: &[u64; 5], arg3: &[u64; 5], arg4: &[u64; 4], arg5: &[u64; 4]) {
1592  let mut x1: u64 = 0;
1593  let mut x2: fiat_p256_u1 = 0;
1594  fiat_p256_addcarryx_u64(&mut x1, &mut x2, 0x0, (!arg1), (0x1 as u64));
1595  let x3: fiat_p256_u1 = (((x1 >> 63) as fiat_p256_u1) & (((arg3[0]) & (0x1 as u64)) as fiat_p256_u1));
1596  let mut x4: u64 = 0;
1597  let mut x5: fiat_p256_u1 = 0;
1598  fiat_p256_addcarryx_u64(&mut x4, &mut x5, 0x0, (!arg1), (0x1 as u64));
1599  let mut x6: u64 = 0;
1600  fiat_p256_cmovznz_u64(&mut x6, x3, arg1, x4);
1601  let mut x7: u64 = 0;
1602  fiat_p256_cmovznz_u64(&mut x7, x3, (arg2[0]), (arg3[0]));
1603  let mut x8: u64 = 0;
1604  fiat_p256_cmovznz_u64(&mut x8, x3, (arg2[1]), (arg3[1]));
1605  let mut x9: u64 = 0;
1606  fiat_p256_cmovznz_u64(&mut x9, x3, (arg2[2]), (arg3[2]));
1607  let mut x10: u64 = 0;
1608  fiat_p256_cmovznz_u64(&mut x10, x3, (arg2[3]), (arg3[3]));
1609  let mut x11: u64 = 0;
1610  fiat_p256_cmovznz_u64(&mut x11, x3, (arg2[4]), (arg3[4]));
1611  let mut x12: u64 = 0;
1612  let mut x13: fiat_p256_u1 = 0;
1613  fiat_p256_addcarryx_u64(&mut x12, &mut x13, 0x0, (0x1 as u64), (!(arg2[0])));
1614  let mut x14: u64 = 0;
1615  let mut x15: fiat_p256_u1 = 0;
1616  fiat_p256_addcarryx_u64(&mut x14, &mut x15, x13, (0x0 as u64), (!(arg2[1])));
1617  let mut x16: u64 = 0;
1618  let mut x17: fiat_p256_u1 = 0;
1619  fiat_p256_addcarryx_u64(&mut x16, &mut x17, x15, (0x0 as u64), (!(arg2[2])));
1620  let mut x18: u64 = 0;
1621  let mut x19: fiat_p256_u1 = 0;
1622  fiat_p256_addcarryx_u64(&mut x18, &mut x19, x17, (0x0 as u64), (!(arg2[3])));
1623  let mut x20: u64 = 0;
1624  let mut x21: fiat_p256_u1 = 0;
1625  fiat_p256_addcarryx_u64(&mut x20, &mut x21, x19, (0x0 as u64), (!(arg2[4])));
1626  let mut x22: u64 = 0;
1627  fiat_p256_cmovznz_u64(&mut x22, x3, (arg3[0]), x12);
1628  let mut x23: u64 = 0;
1629  fiat_p256_cmovznz_u64(&mut x23, x3, (arg3[1]), x14);
1630  let mut x24: u64 = 0;
1631  fiat_p256_cmovznz_u64(&mut x24, x3, (arg3[2]), x16);
1632  let mut x25: u64 = 0;
1633  fiat_p256_cmovznz_u64(&mut x25, x3, (arg3[3]), x18);
1634  let mut x26: u64 = 0;
1635  fiat_p256_cmovznz_u64(&mut x26, x3, (arg3[4]), x20);
1636  let mut x27: u64 = 0;
1637  fiat_p256_cmovznz_u64(&mut x27, x3, (arg4[0]), (arg5[0]));
1638  let mut x28: u64 = 0;
1639  fiat_p256_cmovznz_u64(&mut x28, x3, (arg4[1]), (arg5[1]));
1640  let mut x29: u64 = 0;
1641  fiat_p256_cmovznz_u64(&mut x29, x3, (arg4[2]), (arg5[2]));
1642  let mut x30: u64 = 0;
1643  fiat_p256_cmovznz_u64(&mut x30, x3, (arg4[3]), (arg5[3]));
1644  let mut x31: u64 = 0;
1645  let mut x32: fiat_p256_u1 = 0;
1646  fiat_p256_addcarryx_u64(&mut x31, &mut x32, 0x0, x27, x27);
1647  let mut x33: u64 = 0;
1648  let mut x34: fiat_p256_u1 = 0;
1649  fiat_p256_addcarryx_u64(&mut x33, &mut x34, x32, x28, x28);
1650  let mut x35: u64 = 0;
1651  let mut x36: fiat_p256_u1 = 0;
1652  fiat_p256_addcarryx_u64(&mut x35, &mut x36, x34, x29, x29);
1653  let mut x37: u64 = 0;
1654  let mut x38: fiat_p256_u1 = 0;
1655  fiat_p256_addcarryx_u64(&mut x37, &mut x38, x36, x30, x30);
1656  let mut x39: u64 = 0;
1657  let mut x40: fiat_p256_u1 = 0;
1658  fiat_p256_subborrowx_u64(&mut x39, &mut x40, 0x0, x31, 0xffffffffffffffff);
1659  let mut x41: u64 = 0;
1660  let mut x42: fiat_p256_u1 = 0;
1661  fiat_p256_subborrowx_u64(&mut x41, &mut x42, x40, x33, 0xffffffff);
1662  let mut x43: u64 = 0;
1663  let mut x44: fiat_p256_u1 = 0;
1664  fiat_p256_subborrowx_u64(&mut x43, &mut x44, x42, x35, (0x0 as u64));
1665  let mut x45: u64 = 0;
1666  let mut x46: fiat_p256_u1 = 0;
1667  fiat_p256_subborrowx_u64(&mut x45, &mut x46, x44, x37, 0xffffffff00000001);
1668  let mut x47: u64 = 0;
1669  let mut x48: fiat_p256_u1 = 0;
1670  fiat_p256_subborrowx_u64(&mut x47, &mut x48, x46, (x38 as u64), (0x0 as u64));
1671  let x49: u64 = (arg4[3]);
1672  let x50: u64 = (arg4[2]);
1673  let x51: u64 = (arg4[1]);
1674  let x52: u64 = (arg4[0]);
1675  let mut x53: u64 = 0;
1676  let mut x54: fiat_p256_u1 = 0;
1677  fiat_p256_subborrowx_u64(&mut x53, &mut x54, 0x0, (0x0 as u64), x52);
1678  let mut x55: u64 = 0;
1679  let mut x56: fiat_p256_u1 = 0;
1680  fiat_p256_subborrowx_u64(&mut x55, &mut x56, x54, (0x0 as u64), x51);
1681  let mut x57: u64 = 0;
1682  let mut x58: fiat_p256_u1 = 0;
1683  fiat_p256_subborrowx_u64(&mut x57, &mut x58, x56, (0x0 as u64), x50);
1684  let mut x59: u64 = 0;
1685  let mut x60: fiat_p256_u1 = 0;
1686  fiat_p256_subborrowx_u64(&mut x59, &mut x60, x58, (0x0 as u64), x49);
1687  let mut x61: u64 = 0;
1688  fiat_p256_cmovznz_u64(&mut x61, x60, (0x0 as u64), 0xffffffffffffffff);
1689  let mut x62: u64 = 0;
1690  let mut x63: fiat_p256_u1 = 0;
1691  fiat_p256_addcarryx_u64(&mut x62, &mut x63, 0x0, x53, x61);
1692  let mut x64: u64 = 0;
1693  let mut x65: fiat_p256_u1 = 0;
1694  fiat_p256_addcarryx_u64(&mut x64, &mut x65, x63, x55, (x61 & 0xffffffff));
1695  let mut x66: u64 = 0;
1696  let mut x67: fiat_p256_u1 = 0;
1697  fiat_p256_addcarryx_u64(&mut x66, &mut x67, x65, x57, (0x0 as u64));
1698  let mut x68: u64 = 0;
1699  let mut x69: fiat_p256_u1 = 0;
1700  fiat_p256_addcarryx_u64(&mut x68, &mut x69, x67, x59, (x61 & 0xffffffff00000001));
1701  let mut x70: u64 = 0;
1702  fiat_p256_cmovznz_u64(&mut x70, x3, (arg5[0]), x62);
1703  let mut x71: u64 = 0;
1704  fiat_p256_cmovznz_u64(&mut x71, x3, (arg5[1]), x64);
1705  let mut x72: u64 = 0;
1706  fiat_p256_cmovznz_u64(&mut x72, x3, (arg5[2]), x66);
1707  let mut x73: u64 = 0;
1708  fiat_p256_cmovznz_u64(&mut x73, x3, (arg5[3]), x68);
1709  let x74: fiat_p256_u1 = ((x22 & (0x1 as u64)) as fiat_p256_u1);
1710  let mut x75: u64 = 0;
1711  fiat_p256_cmovznz_u64(&mut x75, x74, (0x0 as u64), x7);
1712  let mut x76: u64 = 0;
1713  fiat_p256_cmovznz_u64(&mut x76, x74, (0x0 as u64), x8);
1714  let mut x77: u64 = 0;
1715  fiat_p256_cmovznz_u64(&mut x77, x74, (0x0 as u64), x9);
1716  let mut x78: u64 = 0;
1717  fiat_p256_cmovznz_u64(&mut x78, x74, (0x0 as u64), x10);
1718  let mut x79: u64 = 0;
1719  fiat_p256_cmovznz_u64(&mut x79, x74, (0x0 as u64), x11);
1720  let mut x80: u64 = 0;
1721  let mut x81: fiat_p256_u1 = 0;
1722  fiat_p256_addcarryx_u64(&mut x80, &mut x81, 0x0, x22, x75);
1723  let mut x82: u64 = 0;
1724  let mut x83: fiat_p256_u1 = 0;
1725  fiat_p256_addcarryx_u64(&mut x82, &mut x83, x81, x23, x76);
1726  let mut x84: u64 = 0;
1727  let mut x85: fiat_p256_u1 = 0;
1728  fiat_p256_addcarryx_u64(&mut x84, &mut x85, x83, x24, x77);
1729  let mut x86: u64 = 0;
1730  let mut x87: fiat_p256_u1 = 0;
1731  fiat_p256_addcarryx_u64(&mut x86, &mut x87, x85, x25, x78);
1732  let mut x88: u64 = 0;
1733  let mut x89: fiat_p256_u1 = 0;
1734  fiat_p256_addcarryx_u64(&mut x88, &mut x89, x87, x26, x79);
1735  let mut x90: u64 = 0;
1736  fiat_p256_cmovznz_u64(&mut x90, x74, (0x0 as u64), x27);
1737  let mut x91: u64 = 0;
1738  fiat_p256_cmovznz_u64(&mut x91, x74, (0x0 as u64), x28);
1739  let mut x92: u64 = 0;
1740  fiat_p256_cmovznz_u64(&mut x92, x74, (0x0 as u64), x29);
1741  let mut x93: u64 = 0;
1742  fiat_p256_cmovznz_u64(&mut x93, x74, (0x0 as u64), x30);
1743  let mut x94: u64 = 0;
1744  let mut x95: fiat_p256_u1 = 0;
1745  fiat_p256_addcarryx_u64(&mut x94, &mut x95, 0x0, x70, x90);
1746  let mut x96: u64 = 0;
1747  let mut x97: fiat_p256_u1 = 0;
1748  fiat_p256_addcarryx_u64(&mut x96, &mut x97, x95, x71, x91);
1749  let mut x98: u64 = 0;
1750  let mut x99: fiat_p256_u1 = 0;
1751  fiat_p256_addcarryx_u64(&mut x98, &mut x99, x97, x72, x92);
1752  let mut x100: u64 = 0;
1753  let mut x101: fiat_p256_u1 = 0;
1754  fiat_p256_addcarryx_u64(&mut x100, &mut x101, x99, x73, x93);
1755  let mut x102: u64 = 0;
1756  let mut x103: fiat_p256_u1 = 0;
1757  fiat_p256_subborrowx_u64(&mut x102, &mut x103, 0x0, x94, 0xffffffffffffffff);
1758  let mut x104: u64 = 0;
1759  let mut x105: fiat_p256_u1 = 0;
1760  fiat_p256_subborrowx_u64(&mut x104, &mut x105, x103, x96, 0xffffffff);
1761  let mut x106: u64 = 0;
1762  let mut x107: fiat_p256_u1 = 0;
1763  fiat_p256_subborrowx_u64(&mut x106, &mut x107, x105, x98, (0x0 as u64));
1764  let mut x108: u64 = 0;
1765  let mut x109: fiat_p256_u1 = 0;
1766  fiat_p256_subborrowx_u64(&mut x108, &mut x109, x107, x100, 0xffffffff00000001);
1767  let mut x110: u64 = 0;
1768  let mut x111: fiat_p256_u1 = 0;
1769  fiat_p256_subborrowx_u64(&mut x110, &mut x111, x109, (x101 as u64), (0x0 as u64));
1770  let mut x112: u64 = 0;
1771  let mut x113: fiat_p256_u1 = 0;
1772  fiat_p256_addcarryx_u64(&mut x112, &mut x113, 0x0, x6, (0x1 as u64));
1773  let x114: u64 = ((x80 >> 1) | ((x82 << 63) & 0xffffffffffffffff));
1774  let x115: u64 = ((x82 >> 1) | ((x84 << 63) & 0xffffffffffffffff));
1775  let x116: u64 = ((x84 >> 1) | ((x86 << 63) & 0xffffffffffffffff));
1776  let x117: u64 = ((x86 >> 1) | ((x88 << 63) & 0xffffffffffffffff));
1777  let x118: u64 = ((x88 & 0x8000000000000000) | (x88 >> 1));
1778  let mut x119: u64 = 0;
1779  fiat_p256_cmovznz_u64(&mut x119, x48, x39, x31);
1780  let mut x120: u64 = 0;
1781  fiat_p256_cmovznz_u64(&mut x120, x48, x41, x33);
1782  let mut x121: u64 = 0;
1783  fiat_p256_cmovznz_u64(&mut x121, x48, x43, x35);
1784  let mut x122: u64 = 0;
1785  fiat_p256_cmovznz_u64(&mut x122, x48, x45, x37);
1786  let mut x123: u64 = 0;
1787  fiat_p256_cmovznz_u64(&mut x123, x111, x102, x94);
1788  let mut x124: u64 = 0;
1789  fiat_p256_cmovznz_u64(&mut x124, x111, x104, x96);
1790  let mut x125: u64 = 0;
1791  fiat_p256_cmovznz_u64(&mut x125, x111, x106, x98);
1792  let mut x126: u64 = 0;
1793  fiat_p256_cmovznz_u64(&mut x126, x111, x108, x100);
1794  *out1 = x112;
1795  out2[0] = x7;
1796  out2[1] = x8;
1797  out2[2] = x9;
1798  out2[3] = x10;
1799  out2[4] = x11;
1800  out3[0] = x114;
1801  out3[1] = x115;
1802  out3[2] = x116;
1803  out3[3] = x117;
1804  out3[4] = x118;
1805  out4[0] = x119;
1806  out4[1] = x120;
1807  out4[2] = x121;
1808  out4[3] = x122;
1809  out5[0] = x123;
1810  out5[1] = x124;
1811  out5[2] = x125;
1812  out5[3] = x126;
1813}
1814
1815/// The function fiat_p256_divstep_precomp returns the precomputed value for Bernstein-Yang-inversion (in montgomery form).
1816///
1817/// Postconditions:
1818///   eval (from_montgomery out1) = ⌊(m - 1) / 2⌋^(if ⌊log2 m⌋ + 1 < 46 then ⌊(49 * (⌊log2 m⌋ + 1) + 80) / 17⌋ else ⌊(49 * (⌊log2 m⌋ + 1) + 57) / 17⌋)
1819///   0 ≤ eval out1 < m
1820///
1821/// Output Bounds:
1822///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
1823#[inline]
1824pub fn fiat_p256_divstep_precomp(out1: &mut [u64; 4]) {
1825  out1[0] = 0x67ffffffb8000000;
1826  out1[1] = 0xc000000038000000;
1827  out1[2] = 0xd80000007fffffff;
1828  out1[3] = 0x2fffffffffffffff;
1829}