From ce753f0a82f931bc16e626e5588b7f708673cb64 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 11 Feb 2024 01:24:11 +0800 Subject: [PATCH] codegen is working now --- compile_commands.json | 12 + crypto/curve25519/curve25519.rs | 5899 ------------------------ crypto/fipsmodule/aes/aes_nohw.rs | 1109 ----- crypto/fipsmodule/bn/montgomery.rs | 158 - crypto/fipsmodule/bn/montgomery_inv.rs | 26 - crypto/fipsmodule/ec/ecp_nistz.rs | 102 - crypto/fipsmodule/ec/gfp_p256.rs | 61 - crypto/fipsmodule/ec/gfp_p384.rs | 1094 ----- ring-transpile-c2rust.py | 1 + src/c2rust/gfp_p384.rs | 2 +- src/c2rust/montgomery.rs | 36 - 11 files changed, 14 insertions(+), 8486 deletions(-) delete mode 100644 crypto/curve25519/curve25519.rs delete mode 100644 crypto/fipsmodule/aes/aes_nohw.rs delete mode 100644 crypto/fipsmodule/bn/montgomery.rs delete mode 100644 crypto/fipsmodule/bn/montgomery_inv.rs delete mode 100644 crypto/fipsmodule/ec/ecp_nistz.rs delete mode 100644 crypto/fipsmodule/ec/gfp_p256.rs delete mode 100644 crypto/fipsmodule/ec/gfp_p384.rs diff --git a/compile_commands.json b/compile_commands.json index 2999ff041e..3f8dca3f52 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -7,6 +7,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -25,6 +26,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -43,6 +45,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -61,6 +64,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -79,6 +83,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -97,6 +102,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -115,6 +121,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -133,6 +140,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -151,6 +159,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -169,6 +178,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -187,6 +197,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", @@ -205,6 +216,7 @@ "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", diff --git a/crypto/curve25519/curve25519.rs b/crypto/curve25519/curve25519.rs deleted file mode 100644 index 575672afa8..0000000000 --- a/crypto/curve25519/curve25519.rs +++ /dev/null @@ -1,5899 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(asm, register_tool)] -use std::arch::asm; -extern "C" { - fn CRYPTO_memcmp( - a: *const libc::c_void, - b: *const libc::c_void, - len: size_t, - ) -> libc::c_int; - fn memcpy( - _: *mut libc::c_void, - _: *const libc::c_void, - _: libc::c_uint, - ) -> *mut libc::c_void; - fn memset( - _: *mut libc::c_void, - _: libc::c_int, - _: libc::c_uint, - ) -> *mut libc::c_void; -} -pub type size_t = libc::c_uint; -pub type __uint8_t = libc::c_uchar; -pub type __int32_t = libc::c_int; -pub type __uint32_t = libc::c_uint; -pub type __int64_t = libc::c_longlong; -pub type __uint64_t = libc::c_ulonglong; -pub type int32_t = __int32_t; -pub type int64_t = __int64_t; -pub type uint8_t = __uint8_t; -pub type uint32_t = __uint32_t; -pub type uint64_t = __uint64_t; -pub type crypto_word_t = uint32_t; -pub type fe_limb_t = uint32_t; -#[derive(Copy, Clone)] -#[repr(C)] -pub struct fe { - pub v: [fe_limb_t; 10], -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct fe_loose { - pub v: [fe_limb_t; 10], -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct ge_p2 { - pub X: fe, - pub Y: fe, - pub Z: fe, -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct ge_p3 { - pub X: fe, - pub Y: fe, - pub Z: fe, - pub T: fe, -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct ge_p1p1 { - pub X: fe_loose, - pub Y: fe_loose, - pub Z: fe_loose, - pub T: fe_loose, -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct ge_precomp { - pub yplusx: fe_loose, - pub yminusx: fe_loose, - pub xy2d: fe_loose, -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct ge_cached { - pub YplusX: fe_loose, - pub YminusX: fe_loose, - pub Z: fe_loose, - pub T2d: fe_loose, -} -pub type fiat_25519_uint1 = libc::c_uchar; -pub type fiat_25519_int1 = libc::c_schar; -#[inline] -unsafe extern "C" fn constant_time_eq_w( - mut a: crypto_word_t, - mut b: crypto_word_t, -) -> crypto_word_t { - return constant_time_is_zero_w(a ^ b); -} -#[inline] -unsafe extern "C" fn constant_time_is_zero_w(mut a: crypto_word_t) -> crypto_word_t { - return constant_time_msb_w(!a & a.wrapping_sub(1 as libc::c_int as libc::c_uint)); -} -#[inline] -unsafe extern "C" fn constant_time_msb_w(mut a: crypto_word_t) -> crypto_word_t { - return (0 as libc::c_uint) - .wrapping_sub( - a - >> (::std::mem::size_of::() as libc::c_ulong) - .wrapping_mul(8 as libc::c_int as libc::c_uint) - .wrapping_sub(1 as libc::c_int as libc::c_uint), - ); -} -#[inline] -unsafe extern "C" fn OPENSSL_memcpy( - mut dst: *mut libc::c_void, - mut src: *const libc::c_void, - mut n: size_t, -) -> *mut libc::c_void { - if n == 0 as libc::c_int as libc::c_uint { - return dst; - } - return memcpy(dst, src, n); -} -#[inline] -unsafe extern "C" fn OPENSSL_memset( - mut dst: *mut libc::c_void, - mut c: libc::c_int, - mut n: size_t, -) -> *mut libc::c_void { - if n == 0 as libc::c_int as libc::c_uint { - return dst; - } - return memset(dst, c, n); -} -#[inline] -unsafe extern "C" fn fe_limbs_copy(mut r: *mut fe_limb_t, mut a: *const fe_limb_t) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < 10 as libc::c_int as libc::c_uint { - *r.offset(i as isize) = *a.offset(i as isize); - i = i.wrapping_add(1); - } -} -static mut d: fe = { - let mut init = fe { - v: [ - 56195235 as libc::c_int as fe_limb_t, - 13857412 as libc::c_int as fe_limb_t, - 51736253 as libc::c_int as fe_limb_t, - 6949390 as libc::c_int as fe_limb_t, - 114729 as libc::c_int as fe_limb_t, - 24766616 as libc::c_int as fe_limb_t, - 60832955 as libc::c_int as fe_limb_t, - 30306712 as libc::c_int as fe_limb_t, - 48412415 as libc::c_int as fe_limb_t, - 21499315 as libc::c_int as fe_limb_t, - ], - }; - init -}; -static mut sqrtm1: fe = { - let mut init = fe { - v: [ - 34513072 as libc::c_int as fe_limb_t, - 25610706 as libc::c_int as fe_limb_t, - 9377949 as libc::c_int as fe_limb_t, - 3500415 as libc::c_int as fe_limb_t, - 12389472 as libc::c_int as fe_limb_t, - 33281959 as libc::c_int as fe_limb_t, - 41962654 as libc::c_int as fe_limb_t, - 31548777 as libc::c_int as fe_limb_t, - 326685 as libc::c_int as fe_limb_t, - 11406482 as libc::c_int as fe_limb_t, - ], - }; - init -}; -static mut d2: fe = { - let mut init = fe { - v: [ - 45281625 as libc::c_int as fe_limb_t, - 27714825 as libc::c_int as fe_limb_t, - 36363642 as libc::c_int as fe_limb_t, - 13898781 as libc::c_int as fe_limb_t, - 229458 as libc::c_int as fe_limb_t, - 15978800 as libc::c_int as fe_limb_t, - 54557047 as libc::c_int as fe_limb_t, - 27058993 as libc::c_int as fe_limb_t, - 29715967 as libc::c_int as fe_limb_t, - 9444199 as libc::c_int as fe_limb_t, - ], - }; - init -}; -static mut k25519SmallPrecomp: [uint8_t; 960] = [ - 0x1a as libc::c_int as uint8_t, - 0xd5 as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0x56 as libc::c_int as uint8_t, - 0xc9 as libc::c_int as uint8_t, - 0xb2 as libc::c_int as uint8_t, - 0xa7 as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, - 0x95 as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0xc7 as libc::c_int as uint8_t, - 0x2c as libc::c_int as uint8_t, - 0x69 as libc::c_int as uint8_t, - 0x5c as libc::c_int as uint8_t, - 0xdc as libc::c_int as uint8_t, - 0xd6 as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0x31 as libc::c_int as uint8_t, - 0xe2 as libc::c_int as uint8_t, - 0xa4 as libc::c_int as uint8_t, - 0xc0 as libc::c_int as uint8_t, - 0xfe as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0x6e as libc::c_int as uint8_t, - 0xcd as libc::c_int as uint8_t, - 0xd3 as libc::c_int as uint8_t, - 0x36 as libc::c_int as uint8_t, - 0x69 as libc::c_int as uint8_t, - 0x21 as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x2 as libc::c_int as uint8_t, - 0xa2 as libc::c_int as uint8_t, - 0xed as libc::c_int as uint8_t, - 0xf4 as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0x6b as libc::c_int as uint8_t, - 0xb as libc::c_int as uint8_t, - 0x3e as libc::c_int as uint8_t, - 0xeb as libc::c_int as uint8_t, - 0x35 as libc::c_int as uint8_t, - 0x1a as libc::c_int as uint8_t, - 0xd5 as libc::c_int as uint8_t, - 0x7e as libc::c_int as uint8_t, - 0xdb as libc::c_int as uint8_t, - 0x78 as libc::c_int as uint8_t, - 0 as libc::c_int as uint8_t, - 0x96 as libc::c_int as uint8_t, - 0x8a as libc::c_int as uint8_t, - 0xa0 as libc::c_int as uint8_t, - 0xb4 as libc::c_int as uint8_t, - 0xcf as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0x4b as libc::c_int as uint8_t, - 0xd4 as libc::c_int as uint8_t, - 0xd5 as libc::c_int as uint8_t, - 0xf9 as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0xbf as libc::c_int as uint8_t, - 0x88 as libc::c_int as uint8_t, - 0xbd as libc::c_int as uint8_t, - 0x22 as libc::c_int as uint8_t, - 0x62 as libc::c_int as uint8_t, - 0x13 as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0xe4 as libc::c_int as uint8_t, - 0x82 as libc::c_int as uint8_t, - 0x57 as libc::c_int as uint8_t, - 0xfa as libc::c_int as uint8_t, - 0x1e as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0x6 as libc::c_int as uint8_t, - 0x2b as libc::c_int as uint8_t, - 0x90 as libc::c_int as uint8_t, - 0xba as libc::c_int as uint8_t, - 0x8 as libc::c_int as uint8_t, - 0xb6 as libc::c_int as uint8_t, - 0x10 as libc::c_int as uint8_t, - 0x54 as libc::c_int as uint8_t, - 0x4f as libc::c_int as uint8_t, - 0x7c as libc::c_int as uint8_t, - 0x1b as libc::c_int as uint8_t, - 0x26 as libc::c_int as uint8_t, - 0xed as libc::c_int as uint8_t, - 0xda as libc::c_int as uint8_t, - 0x6b as libc::c_int as uint8_t, - 0xdd as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, - 0xd0 as libc::c_int as uint8_t, - 0x4e as libc::c_int as uint8_t, - 0xea as libc::c_int as uint8_t, - 0x42 as libc::c_int as uint8_t, - 0xbb as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, - 0x3 as libc::c_int as uint8_t, - 0xa2 as libc::c_int as uint8_t, - 0xfb as libc::c_int as uint8_t, - 0xcc as libc::c_int as uint8_t, - 0x61 as libc::c_int as uint8_t, - 0x67 as libc::c_int as uint8_t, - 0x6 as libc::c_int as uint8_t, - 0x70 as libc::c_int as uint8_t, - 0x1a as libc::c_int as uint8_t, - 0xc4 as libc::c_int as uint8_t, - 0x78 as libc::c_int as uint8_t, - 0x3a as libc::c_int as uint8_t, - 0xff as libc::c_int as uint8_t, - 0x32 as libc::c_int as uint8_t, - 0x62 as libc::c_int as uint8_t, - 0xdd as libc::c_int as uint8_t, - 0x2c as libc::c_int as uint8_t, - 0xab as libc::c_int as uint8_t, - 0x50 as libc::c_int as uint8_t, - 0x19 as libc::c_int as uint8_t, - 0x3b as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0x9b as libc::c_int as uint8_t, - 0x7d as libc::c_int as uint8_t, - 0xb8 as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0x4f as libc::c_int as uint8_t, - 0x29 as libc::c_int as uint8_t, - 0x9c as libc::c_int as uint8_t, - 0xa7 as libc::c_int as uint8_t, - 0x91 as libc::c_int as uint8_t, - 0xba as libc::c_int as uint8_t, - 0xe as libc::c_int as uint8_t, - 0x46 as libc::c_int as uint8_t, - 0x5e as libc::c_int as uint8_t, - 0x51 as libc::c_int as uint8_t, - 0xfe as libc::c_int as uint8_t, - 0x1d as libc::c_int as uint8_t, - 0xbf as libc::c_int as uint8_t, - 0xe5 as libc::c_int as uint8_t, - 0xe5 as libc::c_int as uint8_t, - 0x9b as libc::c_int as uint8_t, - 0x95 as libc::c_int as uint8_t, - 0xd as libc::c_int as uint8_t, - 0x67 as libc::c_int as uint8_t, - 0xf8 as libc::c_int as uint8_t, - 0xd1 as libc::c_int as uint8_t, - 0xb5 as libc::c_int as uint8_t, - 0x5a as libc::c_int as uint8_t, - 0xa1 as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0x2c as libc::c_int as uint8_t, - 0xc3 as libc::c_int as uint8_t, - 0xde as libc::c_int as uint8_t, - 0xe as libc::c_int as uint8_t, - 0x97 as libc::c_int as uint8_t, - 0x85 as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0x7f as libc::c_int as uint8_t, - 0xea as libc::c_int as uint8_t, - 0xab as libc::c_int as uint8_t, - 0x3e as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0x30 as libc::c_int as uint8_t, - 0x18 as libc::c_int as uint8_t, - 0x24 as libc::c_int as uint8_t, - 0xe8 as libc::c_int as uint8_t, - 0xb7 as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0xae as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0x80 as libc::c_int as uint8_t, - 0xfc as libc::c_int as uint8_t, - 0xe5 as libc::c_int as uint8_t, - 0x23 as libc::c_int as uint8_t, - 0xe7 as libc::c_int as uint8_t, - 0xc2 as libc::c_int as uint8_t, - 0xc9 as libc::c_int as uint8_t, - 0x85 as libc::c_int as uint8_t, - 0xe6 as libc::c_int as uint8_t, - 0x98 as libc::c_int as uint8_t, - 0xa0 as libc::c_int as uint8_t, - 0x29 as libc::c_int as uint8_t, - 0x4e as libc::c_int as uint8_t, - 0xe1 as libc::c_int as uint8_t, - 0x84 as libc::c_int as uint8_t, - 0x39 as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0x95 as libc::c_int as uint8_t, - 0x2c as libc::c_int as uint8_t, - 0xf3 as libc::c_int as uint8_t, - 0x45 as libc::c_int as uint8_t, - 0x3c as libc::c_int as uint8_t, - 0xff as libc::c_int as uint8_t, - 0xaf as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0x4c as libc::c_int as uint8_t, - 0x6b as libc::c_int as uint8_t, - 0xa6 as libc::c_int as uint8_t, - 0xf5 as libc::c_int as uint8_t, - 0x4b as libc::c_int as uint8_t, - 0x11 as libc::c_int as uint8_t, - 0xbd as libc::c_int as uint8_t, - 0xba as libc::c_int as uint8_t, - 0x5b as libc::c_int as uint8_t, - 0x9e as libc::c_int as uint8_t, - 0xc4 as libc::c_int as uint8_t, - 0xa4 as libc::c_int as uint8_t, - 0x51 as libc::c_int as uint8_t, - 0x1e as libc::c_int as uint8_t, - 0xbe as libc::c_int as uint8_t, - 0xd0 as libc::c_int as uint8_t, - 0x90 as libc::c_int as uint8_t, - 0x3a as libc::c_int as uint8_t, - 0x9c as libc::c_int as uint8_t, - 0xc2 as libc::c_int as uint8_t, - 0x26 as libc::c_int as uint8_t, - 0xb6 as libc::c_int as uint8_t, - 0x1e as libc::c_int as uint8_t, - 0xf1 as libc::c_int as uint8_t, - 0x95 as libc::c_int as uint8_t, - 0x7d as libc::c_int as uint8_t, - 0xc8 as libc::c_int as uint8_t, - 0x6d as libc::c_int as uint8_t, - 0x52 as libc::c_int as uint8_t, - 0xe6 as libc::c_int as uint8_t, - 0x99 as libc::c_int as uint8_t, - 0x2c as libc::c_int as uint8_t, - 0x5f as libc::c_int as uint8_t, - 0x9a as libc::c_int as uint8_t, - 0x96 as libc::c_int as uint8_t, - 0xc as libc::c_int as uint8_t, - 0x68 as libc::c_int as uint8_t, - 0x29 as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0xe2 as libc::c_int as uint8_t, - 0xfb as libc::c_int as uint8_t, - 0xe6 as libc::c_int as uint8_t, - 0xbc as libc::c_int as uint8_t, - 0xec as libc::c_int as uint8_t, - 0x31 as libc::c_int as uint8_t, - 0x8 as libc::c_int as uint8_t, - 0xec as libc::c_int as uint8_t, - 0xe6 as libc::c_int as uint8_t, - 0xb0 as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0xc3 as libc::c_int as uint8_t, - 0x8c as libc::c_int as uint8_t, - 0xbe as libc::c_int as uint8_t, - 0xc1 as libc::c_int as uint8_t, - 0xb3 as libc::c_int as uint8_t, - 0x8a as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0xe4 as libc::c_int as uint8_t, - 0x88 as libc::c_int as uint8_t, - 0x2b as libc::c_int as uint8_t, - 0x55 as libc::c_int as uint8_t, - 0xe5 as libc::c_int as uint8_t, - 0x64 as libc::c_int as uint8_t, - 0x6e as libc::c_int as uint8_t, - 0x9b as libc::c_int as uint8_t, - 0xd0 as libc::c_int as uint8_t, - 0xaf as libc::c_int as uint8_t, - 0x7b as libc::c_int as uint8_t, - 0x64 as libc::c_int as uint8_t, - 0x2a as libc::c_int as uint8_t, - 0x35 as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, - 0x10 as libc::c_int as uint8_t, - 0x52 as libc::c_int as uint8_t, - 0xc5 as libc::c_int as uint8_t, - 0x9e as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x11 as libc::c_int as uint8_t, - 0x39 as libc::c_int as uint8_t, - 0x36 as libc::c_int as uint8_t, - 0x45 as libc::c_int as uint8_t, - 0x51 as libc::c_int as uint8_t, - 0xb8 as libc::c_int as uint8_t, - 0x39 as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0xfc as libc::c_int as uint8_t, - 0x9d as libc::c_int as uint8_t, - 0x6a as libc::c_int as uint8_t, - 0xbe as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0xcb as libc::c_int as uint8_t, - 0xa4 as libc::c_int as uint8_t, - 0xf as libc::c_int as uint8_t, - 0x51 as libc::c_int as uint8_t, - 0x3c as libc::c_int as uint8_t, - 0x38 as libc::c_int as uint8_t, - 0x5 as libc::c_int as uint8_t, - 0xca as libc::c_int as uint8_t, - 0xab as libc::c_int as uint8_t, - 0x43 as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0xe as libc::c_int as uint8_t, - 0xf3 as libc::c_int as uint8_t, - 0x8b as libc::c_int as uint8_t, - 0x41 as libc::c_int as uint8_t, - 0xa6 as libc::c_int as uint8_t, - 0xf8 as libc::c_int as uint8_t, - 0x9b as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0x70 as libc::c_int as uint8_t, - 0x80 as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0x86 as libc::c_int as uint8_t, - 0x5e as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0xe3 as libc::c_int as uint8_t, - 0xc3 as libc::c_int as uint8_t, - 0xd as libc::c_int as uint8_t, - 0x18 as libc::c_int as uint8_t, - 0xc8 as libc::c_int as uint8_t, - 0x4b as libc::c_int as uint8_t, - 0x34 as libc::c_int as uint8_t, - 0x1f as libc::c_int as uint8_t, - 0xd8 as libc::c_int as uint8_t, - 0x1d as libc::c_int as uint8_t, - 0xbc as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0x6d as libc::c_int as uint8_t, - 0x34 as libc::c_int as uint8_t, - 0x3a as libc::c_int as uint8_t, - 0xbe as libc::c_int as uint8_t, - 0xdf as libc::c_int as uint8_t, - 0xd9 as libc::c_int as uint8_t, - 0xf6 as libc::c_int as uint8_t, - 0xf3 as libc::c_int as uint8_t, - 0x89 as libc::c_int as uint8_t, - 0xa1 as libc::c_int as uint8_t, - 0xe1 as libc::c_int as uint8_t, - 0x94 as libc::c_int as uint8_t, - 0x9f as libc::c_int as uint8_t, - 0x5d as libc::c_int as uint8_t, - 0x4c as libc::c_int as uint8_t, - 0x5d as libc::c_int as uint8_t, - 0xe9 as libc::c_int as uint8_t, - 0xa1 as libc::c_int as uint8_t, - 0x49 as libc::c_int as uint8_t, - 0x92 as libc::c_int as uint8_t, - 0xef as libc::c_int as uint8_t, - 0xe as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0x81 as libc::c_int as uint8_t, - 0x89 as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x87 as libc::c_int as uint8_t, - 0xa6 as libc::c_int as uint8_t, - 0x37 as libc::c_int as uint8_t, - 0xf1 as libc::c_int as uint8_t, - 0xdd as libc::c_int as uint8_t, - 0x62 as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0x5a as libc::c_int as uint8_t, - 0x9d as libc::c_int as uint8_t, - 0x1b as libc::c_int as uint8_t, - 0x8c as libc::c_int as uint8_t, - 0xc6 as libc::c_int as uint8_t, - 0x7d as libc::c_int as uint8_t, - 0x52 as libc::c_int as uint8_t, - 0xea as libc::c_int as uint8_t, - 0x70 as libc::c_int as uint8_t, - 0x9 as libc::c_int as uint8_t, - 0x6a as libc::c_int as uint8_t, - 0xe1 as libc::c_int as uint8_t, - 0x32 as libc::c_int as uint8_t, - 0xf3 as libc::c_int as uint8_t, - 0x73 as libc::c_int as uint8_t, - 0x21 as libc::c_int as uint8_t, - 0x1f as libc::c_int as uint8_t, - 0x7 as libc::c_int as uint8_t, - 0x7b as libc::c_int as uint8_t, - 0x7c as libc::c_int as uint8_t, - 0x9b as libc::c_int as uint8_t, - 0x49 as libc::c_int as uint8_t, - 0xd8 as libc::c_int as uint8_t, - 0xc0 as libc::c_int as uint8_t, - 0xf3 as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, - 0x72 as libc::c_int as uint8_t, - 0x6f as libc::c_int as uint8_t, - 0x9d as libc::c_int as uint8_t, - 0xed as libc::c_int as uint8_t, - 0x31 as libc::c_int as uint8_t, - 0x67 as libc::c_int as uint8_t, - 0x36 as libc::c_int as uint8_t, - 0x36 as libc::c_int as uint8_t, - 0x54 as libc::c_int as uint8_t, - 0x40 as libc::c_int as uint8_t, - 0x92 as libc::c_int as uint8_t, - 0x71 as libc::c_int as uint8_t, - 0xe6 as libc::c_int as uint8_t, - 0x11 as libc::c_int as uint8_t, - 0x28 as libc::c_int as uint8_t, - 0x11 as libc::c_int as uint8_t, - 0xad as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0x32 as libc::c_int as uint8_t, - 0x85 as libc::c_int as uint8_t, - 0x7b as libc::c_int as uint8_t, - 0x3e as libc::c_int as uint8_t, - 0xb7 as libc::c_int as uint8_t, - 0x3b as libc::c_int as uint8_t, - 0x49 as libc::c_int as uint8_t, - 0x13 as libc::c_int as uint8_t, - 0x1c as libc::c_int as uint8_t, - 0x7 as libc::c_int as uint8_t, - 0xb0 as libc::c_int as uint8_t, - 0x2e as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0xaa as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0x28 as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0x3d as libc::c_int as uint8_t, - 0x8d as libc::c_int as uint8_t, - 0xd2 as libc::c_int as uint8_t, - 0xda as libc::c_int as uint8_t, - 0xc7 as libc::c_int as uint8_t, - 0x44 as libc::c_int as uint8_t, - 0xd6 as libc::c_int as uint8_t, - 0x7a as libc::c_int as uint8_t, - 0xdb as libc::c_int as uint8_t, - 0x26 as libc::c_int as uint8_t, - 0x7d as libc::c_int as uint8_t, - 0x1d as libc::c_int as uint8_t, - 0xb8 as libc::c_int as uint8_t, - 0xe1 as libc::c_int as uint8_t, - 0xde as libc::c_int as uint8_t, - 0x9d as libc::c_int as uint8_t, - 0x7a as libc::c_int as uint8_t, - 0x7d as libc::c_int as uint8_t, - 0x17 as libc::c_int as uint8_t, - 0x7e as libc::c_int as uint8_t, - 0x1c as libc::c_int as uint8_t, - 0x37 as libc::c_int as uint8_t, - 0x4 as libc::c_int as uint8_t, - 0x8d as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0x7c as libc::c_int as uint8_t, - 0x5e as libc::c_int as uint8_t, - 0x18 as libc::c_int as uint8_t, - 0x38 as libc::c_int as uint8_t, - 0x1e as libc::c_int as uint8_t, - 0xaf as libc::c_int as uint8_t, - 0xc7 as libc::c_int as uint8_t, - 0x1b as libc::c_int as uint8_t, - 0x33 as libc::c_int as uint8_t, - 0x48 as libc::c_int as uint8_t, - 0x31 as libc::c_int as uint8_t, - 0 as libc::c_int as uint8_t, - 0x59 as libc::c_int as uint8_t, - 0xf6 as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0xca as libc::c_int as uint8_t, - 0xf as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0x1b as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0x12 as libc::c_int as uint8_t, - 0x7e as libc::c_int as uint8_t, - 0x2 as libc::c_int as uint8_t, - 0x1d as libc::c_int as uint8_t, - 0x49 as libc::c_int as uint8_t, - 0xc0 as libc::c_int as uint8_t, - 0x5d as libc::c_int as uint8_t, - 0x79 as libc::c_int as uint8_t, - 0x87 as libc::c_int as uint8_t, - 0xef as libc::c_int as uint8_t, - 0x5e as libc::c_int as uint8_t, - 0x7a as libc::c_int as uint8_t, - 0x2f as libc::c_int as uint8_t, - 0x1f as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x55 as libc::c_int as uint8_t, - 0xd8 as libc::c_int as uint8_t, - 0x9 as libc::c_int as uint8_t, - 0xd9 as libc::c_int as uint8_t, - 0x61 as libc::c_int as uint8_t, - 0x38 as libc::c_int as uint8_t, - 0x68 as libc::c_int as uint8_t, - 0xb0 as libc::c_int as uint8_t, - 0x7 as libc::c_int as uint8_t, - 0xa3 as libc::c_int as uint8_t, - 0xfc as libc::c_int as uint8_t, - 0xcc as libc::c_int as uint8_t, - 0x85 as libc::c_int as uint8_t, - 0x10 as libc::c_int as uint8_t, - 0x7f as libc::c_int as uint8_t, - 0x4c as libc::c_int as uint8_t, - 0x65 as libc::c_int as uint8_t, - 0x65 as libc::c_int as uint8_t, - 0xb3 as libc::c_int as uint8_t, - 0xfa as libc::c_int as uint8_t, - 0xfa as libc::c_int as uint8_t, - 0xa5 as libc::c_int as uint8_t, - 0x53 as libc::c_int as uint8_t, - 0x6f as libc::c_int as uint8_t, - 0xdb as libc::c_int as uint8_t, - 0x74 as libc::c_int as uint8_t, - 0x4c as libc::c_int as uint8_t, - 0x56 as libc::c_int as uint8_t, - 0x46 as libc::c_int as uint8_t, - 0x3 as libc::c_int as uint8_t, - 0xe2 as libc::c_int as uint8_t, - 0xd5 as libc::c_int as uint8_t, - 0x7a as libc::c_int as uint8_t, - 0x29 as libc::c_int as uint8_t, - 0x1c as libc::c_int as uint8_t, - 0xc6 as libc::c_int as uint8_t, - 0x2 as libc::c_int as uint8_t, - 0xbc as libc::c_int as uint8_t, - 0x59 as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0x4 as libc::c_int as uint8_t, - 0x75 as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0xc0 as libc::c_int as uint8_t, - 0x84 as libc::c_int as uint8_t, - 0x2f as libc::c_int as uint8_t, - 0x60 as libc::c_int as uint8_t, - 0x1c as libc::c_int as uint8_t, - 0x67 as libc::c_int as uint8_t, - 0x76 as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0x86 as libc::c_int as uint8_t, - 0xf3 as libc::c_int as uint8_t, - 0xfa as libc::c_int as uint8_t, - 0xbf as libc::c_int as uint8_t, - 0xdc as libc::c_int as uint8_t, - 0xd2 as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0x90 as libc::c_int as uint8_t, - 0x91 as libc::c_int as uint8_t, - 0xbd as libc::c_int as uint8_t, - 0x33 as libc::c_int as uint8_t, - 0xa9 as libc::c_int as uint8_t, - 0xe5 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0xc as libc::c_int as uint8_t, - 0xda as libc::c_int as uint8_t, - 0x42 as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0xca as libc::c_int as uint8_t, - 0xf4 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0xc2 as libc::c_int as uint8_t, - 0xec as libc::c_int as uint8_t, - 0x92 as libc::c_int as uint8_t, - 0x14 as libc::c_int as uint8_t, - 0x57 as libc::c_int as uint8_t, - 0x6 as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0xd0 as libc::c_int as uint8_t, - 0x4d as libc::c_int as uint8_t, - 0x15 as libc::c_int as uint8_t, - 0x6 as libc::c_int as uint8_t, - 0xeb as libc::c_int as uint8_t, - 0x69 as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x4f as libc::c_int as uint8_t, - 0x77 as libc::c_int as uint8_t, - 0xc5 as libc::c_int as uint8_t, - 0x8b as libc::c_int as uint8_t, - 0xc7 as libc::c_int as uint8_t, - 0xf0 as libc::c_int as uint8_t, - 0x8e as libc::c_int as uint8_t, - 0xed as libc::c_int as uint8_t, - 0x64 as libc::c_int as uint8_t, - 0xa0 as libc::c_int as uint8_t, - 0xb3 as libc::c_int as uint8_t, - 0x3c as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0x71 as libc::c_int as uint8_t, - 0xc6 as libc::c_int as uint8_t, - 0x2d as libc::c_int as uint8_t, - 0xda as libc::c_int as uint8_t, - 0xa as libc::c_int as uint8_t, - 0xd as libc::c_int as uint8_t, - 0xfe as libc::c_int as uint8_t, - 0x70 as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0x64 as libc::c_int as uint8_t, - 0xf8 as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0xfa as libc::c_int as uint8_t, - 0xf6 as libc::c_int as uint8_t, - 0x5f as libc::c_int as uint8_t, - 0x30 as libc::c_int as uint8_t, - 0xa5 as libc::c_int as uint8_t, - 0xd as libc::c_int as uint8_t, - 0x6c as libc::c_int as uint8_t, - 0xda as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0x62 as libc::c_int as uint8_t, - 0x5e as libc::c_int as uint8_t, - 0x78 as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0xd3 as libc::c_int as uint8_t, - 0x66 as libc::c_int as uint8_t, - 0 as libc::c_int as uint8_t, - 0x1c as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0x56 as libc::c_int as uint8_t, - 0x1f as libc::c_int as uint8_t, - 0x5d as libc::c_int as uint8_t, - 0x3f as libc::c_int as uint8_t, - 0x6f as libc::c_int as uint8_t, - 0xf4 as libc::c_int as uint8_t, - 0x4c as libc::c_int as uint8_t, - 0xd8 as libc::c_int as uint8_t, - 0xfd as libc::c_int as uint8_t, - 0xe as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0xc9 as libc::c_int as uint8_t, - 0x5c as libc::c_int as uint8_t, - 0x2b as libc::c_int as uint8_t, - 0xbc as libc::c_int as uint8_t, - 0xc0 as libc::c_int as uint8_t, - 0xa4 as libc::c_int as uint8_t, - 0xe7 as libc::c_int as uint8_t, - 0x23 as libc::c_int as uint8_t, - 0x29 as libc::c_int as uint8_t, - 0x2 as libc::c_int as uint8_t, - 0x9f as libc::c_int as uint8_t, - 0x31 as libc::c_int as uint8_t, - 0xd6 as libc::c_int as uint8_t, - 0xe9 as libc::c_int as uint8_t, - 0xd7 as libc::c_int as uint8_t, - 0x96 as libc::c_int as uint8_t, - 0xf4 as libc::c_int as uint8_t, - 0xe0 as libc::c_int as uint8_t, - 0x5e as libc::c_int as uint8_t, - 0xb as libc::c_int as uint8_t, - 0xe as libc::c_int as uint8_t, - 0x13 as libc::c_int as uint8_t, - 0xee as libc::c_int as uint8_t, - 0x3c as libc::c_int as uint8_t, - 0x9 as libc::c_int as uint8_t, - 0xed as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0x3d as libc::c_int as uint8_t, - 0x76 as libc::c_int as uint8_t, - 0x91 as libc::c_int as uint8_t, - 0xc3 as libc::c_int as uint8_t, - 0xa4 as libc::c_int as uint8_t, - 0x97 as libc::c_int as uint8_t, - 0xae as libc::c_int as uint8_t, - 0xd4 as libc::c_int as uint8_t, - 0x87 as libc::c_int as uint8_t, - 0xd0 as libc::c_int as uint8_t, - 0x5d as libc::c_int as uint8_t, - 0xf6 as libc::c_int as uint8_t, - 0x18 as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0x1f as libc::c_int as uint8_t, - 0x1d as libc::c_int as uint8_t, - 0x67 as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0xcf as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0xa0 as libc::c_int as uint8_t, - 0x91 as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0xf8 as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0x45 as libc::c_int as uint8_t, - 0x75 as libc::c_int as uint8_t, - 0x23 as libc::c_int as uint8_t, - 0x3f as libc::c_int as uint8_t, - 0xd1 as libc::c_int as uint8_t, - 0xf1 as libc::c_int as uint8_t, - 0xad as libc::c_int as uint8_t, - 0x23 as libc::c_int as uint8_t, - 0xdd as libc::c_int as uint8_t, - 0x64 as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0x96 as libc::c_int as uint8_t, - 0x41 as libc::c_int as uint8_t, - 0x70 as libc::c_int as uint8_t, - 0x7f as libc::c_int as uint8_t, - 0xf7 as libc::c_int as uint8_t, - 0xf5 as libc::c_int as uint8_t, - 0xa9 as libc::c_int as uint8_t, - 0x89 as libc::c_int as uint8_t, - 0xa2 as libc::c_int as uint8_t, - 0x34 as libc::c_int as uint8_t, - 0xb0 as libc::c_int as uint8_t, - 0x8d as libc::c_int as uint8_t, - 0x1b as libc::c_int as uint8_t, - 0xae as libc::c_int as uint8_t, - 0x19 as libc::c_int as uint8_t, - 0x15 as libc::c_int as uint8_t, - 0x49 as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x23 as libc::c_int as uint8_t, - 0x6d as libc::c_int as uint8_t, - 0x87 as libc::c_int as uint8_t, - 0x15 as libc::c_int as uint8_t, - 0x4f as libc::c_int as uint8_t, - 0x81 as libc::c_int as uint8_t, - 0x76 as libc::c_int as uint8_t, - 0xfb as libc::c_int as uint8_t, - 0x23 as libc::c_int as uint8_t, - 0xb5 as libc::c_int as uint8_t, - 0xea as libc::c_int as uint8_t, - 0xcf as libc::c_int as uint8_t, - 0xac as libc::c_int as uint8_t, - 0x54 as libc::c_int as uint8_t, - 0x8d as libc::c_int as uint8_t, - 0x4e as libc::c_int as uint8_t, - 0x42 as libc::c_int as uint8_t, - 0x2f as libc::c_int as uint8_t, - 0xeb as libc::c_int as uint8_t, - 0xf as libc::c_int as uint8_t, - 0x63 as libc::c_int as uint8_t, - 0xdb as libc::c_int as uint8_t, - 0x68 as libc::c_int as uint8_t, - 0x37 as libc::c_int as uint8_t, - 0xa8 as libc::c_int as uint8_t, - 0xcf as libc::c_int as uint8_t, - 0x8b as libc::c_int as uint8_t, - 0xab as libc::c_int as uint8_t, - 0xf5 as libc::c_int as uint8_t, - 0xa4 as libc::c_int as uint8_t, - 0x6e as libc::c_int as uint8_t, - 0x96 as libc::c_int as uint8_t, - 0x2a as libc::c_int as uint8_t, - 0xb2 as libc::c_int as uint8_t, - 0xd6 as libc::c_int as uint8_t, - 0xbe as libc::c_int as uint8_t, - 0x9e as libc::c_int as uint8_t, - 0xbd as libc::c_int as uint8_t, - 0xd as libc::c_int as uint8_t, - 0xb4 as libc::c_int as uint8_t, - 0x42 as libc::c_int as uint8_t, - 0xa9 as libc::c_int as uint8_t, - 0xcf as libc::c_int as uint8_t, - 0x1 as libc::c_int as uint8_t, - 0x83 as libc::c_int as uint8_t, - 0x8a as libc::c_int as uint8_t, - 0x17 as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0x76 as libc::c_int as uint8_t, - 0xc4 as libc::c_int as uint8_t, - 0xc6 as libc::c_int as uint8_t, - 0x83 as libc::c_int as uint8_t, - 0x4 as libc::c_int as uint8_t, - 0x95 as libc::c_int as uint8_t, - 0xb as libc::c_int as uint8_t, - 0xfc as libc::c_int as uint8_t, - 0x11 as libc::c_int as uint8_t, - 0xc9 as libc::c_int as uint8_t, - 0x62 as libc::c_int as uint8_t, - 0xb8 as libc::c_int as uint8_t, - 0xc as libc::c_int as uint8_t, - 0x76 as libc::c_int as uint8_t, - 0x84 as libc::c_int as uint8_t, - 0xd9 as libc::c_int as uint8_t, - 0xb9 as libc::c_int as uint8_t, - 0x37 as libc::c_int as uint8_t, - 0xfa as libc::c_int as uint8_t, - 0xfc as libc::c_int as uint8_t, - 0x7c as libc::c_int as uint8_t, - 0xc2 as libc::c_int as uint8_t, - 0x6d as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x3e as libc::c_int as uint8_t, - 0xb3 as libc::c_int as uint8_t, - 0x4 as libc::c_int as uint8_t, - 0xbb as libc::c_int as uint8_t, - 0x8c as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0x48 as libc::c_int as uint8_t, - 0xbc as libc::c_int as uint8_t, - 0x91 as libc::c_int as uint8_t, - 0x27 as libc::c_int as uint8_t, - 0xcc as libc::c_int as uint8_t, - 0xf9 as libc::c_int as uint8_t, - 0xb7 as libc::c_int as uint8_t, - 0x22 as libc::c_int as uint8_t, - 0x19 as libc::c_int as uint8_t, - 0x83 as libc::c_int as uint8_t, - 0x2e as libc::c_int as uint8_t, - 0x9 as libc::c_int as uint8_t, - 0xb5 as libc::c_int as uint8_t, - 0x72 as libc::c_int as uint8_t, - 0xd9 as libc::c_int as uint8_t, - 0x54 as libc::c_int as uint8_t, - 0x1c as libc::c_int as uint8_t, - 0x4d as libc::c_int as uint8_t, - 0xa1 as libc::c_int as uint8_t, - 0xea as libc::c_int as uint8_t, - 0xb as libc::c_int as uint8_t, - 0xf1 as libc::c_int as uint8_t, - 0xc6 as libc::c_int as uint8_t, - 0x8 as libc::c_int as uint8_t, - 0x72 as libc::c_int as uint8_t, - 0x46 as libc::c_int as uint8_t, - 0x87 as libc::c_int as uint8_t, - 0x7a as libc::c_int as uint8_t, - 0x6e as libc::c_int as uint8_t, - 0x80 as libc::c_int as uint8_t, - 0x56 as libc::c_int as uint8_t, - 0xa as libc::c_int as uint8_t, - 0x8a as libc::c_int as uint8_t, - 0xc0 as libc::c_int as uint8_t, - 0xdd as libc::c_int as uint8_t, - 0x11 as libc::c_int as uint8_t, - 0x6b as libc::c_int as uint8_t, - 0xd6 as libc::c_int as uint8_t, - 0xdd as libc::c_int as uint8_t, - 0x47 as libc::c_int as uint8_t, - 0xdf as libc::c_int as uint8_t, - 0x10 as libc::c_int as uint8_t, - 0xd9 as libc::c_int as uint8_t, - 0xd8 as libc::c_int as uint8_t, - 0xea as libc::c_int as uint8_t, - 0x7c as libc::c_int as uint8_t, - 0xb0 as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0x3 as libc::c_int as uint8_t, - 0 as libc::c_int as uint8_t, - 0x2e as libc::c_int as uint8_t, - 0xc1 as libc::c_int as uint8_t, - 0x8f as libc::c_int as uint8_t, - 0x44 as libc::c_int as uint8_t, - 0xa8 as libc::c_int as uint8_t, - 0xd3 as libc::c_int as uint8_t, - 0x30 as libc::c_int as uint8_t, - 0x6 as libc::c_int as uint8_t, - 0x89 as libc::c_int as uint8_t, - 0xa2 as libc::c_int as uint8_t, - 0xf9 as libc::c_int as uint8_t, - 0x34 as libc::c_int as uint8_t, - 0xad as libc::c_int as uint8_t, - 0xdc as libc::c_int as uint8_t, - 0x3 as libc::c_int as uint8_t, - 0x85 as libc::c_int as uint8_t, - 0xed as libc::c_int as uint8_t, - 0x51 as libc::c_int as uint8_t, - 0xa7 as libc::c_int as uint8_t, - 0x82 as libc::c_int as uint8_t, - 0x9c as libc::c_int as uint8_t, - 0xe7 as libc::c_int as uint8_t, - 0x5d as libc::c_int as uint8_t, - 0x52 as libc::c_int as uint8_t, - 0x93 as libc::c_int as uint8_t, - 0xc as libc::c_int as uint8_t, - 0x32 as libc::c_int as uint8_t, - 0x9a as libc::c_int as uint8_t, - 0x5b as libc::c_int as uint8_t, - 0xe1 as libc::c_int as uint8_t, - 0xaa as libc::c_int as uint8_t, - 0xca as libc::c_int as uint8_t, - 0xb8 as libc::c_int as uint8_t, - 0x2 as libc::c_int as uint8_t, - 0x6d as libc::c_int as uint8_t, - 0x3a as libc::c_int as uint8_t, - 0xd4 as libc::c_int as uint8_t, - 0xb1 as libc::c_int as uint8_t, - 0x3a as libc::c_int as uint8_t, - 0xf0 as libc::c_int as uint8_t, - 0x5f as libc::c_int as uint8_t, - 0xbe as libc::c_int as uint8_t, - 0xb5 as libc::c_int as uint8_t, - 0xd as libc::c_int as uint8_t, - 0x10 as libc::c_int as uint8_t, - 0x6b as libc::c_int as uint8_t, - 0x38 as libc::c_int as uint8_t, - 0x32 as libc::c_int as uint8_t, - 0xac as libc::c_int as uint8_t, - 0x76 as libc::c_int as uint8_t, - 0x80 as libc::c_int as uint8_t, - 0xbd as libc::c_int as uint8_t, - 0xca as libc::c_int as uint8_t, - 0x94 as libc::c_int as uint8_t, - 0x71 as libc::c_int as uint8_t, - 0x7a as libc::c_int as uint8_t, - 0xf2 as libc::c_int as uint8_t, - 0xc9 as libc::c_int as uint8_t, - 0x35 as libc::c_int as uint8_t, - 0x2a as libc::c_int as uint8_t, - 0xde as libc::c_int as uint8_t, - 0x9f as libc::c_int as uint8_t, - 0x42 as libc::c_int as uint8_t, - 0x49 as libc::c_int as uint8_t, - 0x18 as libc::c_int as uint8_t, - 0x1 as libc::c_int as uint8_t, - 0xab as libc::c_int as uint8_t, - 0xbc as libc::c_int as uint8_t, - 0xef as libc::c_int as uint8_t, - 0x7c as libc::c_int as uint8_t, - 0x64 as libc::c_int as uint8_t, - 0x3f as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x3d as libc::c_int as uint8_t, - 0x92 as libc::c_int as uint8_t, - 0x59 as libc::c_int as uint8_t, - 0xdb as libc::c_int as uint8_t, - 0x13 as libc::c_int as uint8_t, - 0xdb as libc::c_int as uint8_t, - 0x58 as libc::c_int as uint8_t, - 0x6e as libc::c_int as uint8_t, - 0xa as libc::c_int as uint8_t, - 0xe0 as libc::c_int as uint8_t, - 0xb7 as libc::c_int as uint8_t, - 0x91 as libc::c_int as uint8_t, - 0x4a as libc::c_int as uint8_t, - 0x8 as libc::c_int as uint8_t, - 0x20 as libc::c_int as uint8_t, - 0xd6 as libc::c_int as uint8_t, - 0x2e as libc::c_int as uint8_t, - 0x3c as libc::c_int as uint8_t, - 0x45 as libc::c_int as uint8_t, - 0xc9 as libc::c_int as uint8_t, - 0x8b as libc::c_int as uint8_t, - 0x17 as libc::c_int as uint8_t, - 0x79 as libc::c_int as uint8_t, - 0xe7 as libc::c_int as uint8_t, - 0xc7 as libc::c_int as uint8_t, - 0x90 as libc::c_int as uint8_t, - 0x99 as libc::c_int as uint8_t, - 0x3a as libc::c_int as uint8_t, - 0x18 as libc::c_int as uint8_t, - 0x25 as libc::c_int as uint8_t, -]; -static mut Bi: [ge_precomp; 8] = [ - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 25967493 as libc::c_int as fe_limb_t, - 19198397 as libc::c_int as fe_limb_t, - 29566455 as libc::c_int as fe_limb_t, - 3660896 as libc::c_int as fe_limb_t, - 54414519 as libc::c_int as fe_limb_t, - 4014786 as libc::c_int as fe_limb_t, - 27544626 as libc::c_int as fe_limb_t, - 21800161 as libc::c_int as fe_limb_t, - 61029707 as libc::c_int as fe_limb_t, - 2047604 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 54563134 as libc::c_int as fe_limb_t, - 934261 as libc::c_int as fe_limb_t, - 64385954 as libc::c_int as fe_limb_t, - 3049989 as libc::c_int as fe_limb_t, - 66381436 as libc::c_int as fe_limb_t, - 9406985 as libc::c_int as fe_limb_t, - 12720692 as libc::c_int as fe_limb_t, - 5043384 as libc::c_int as fe_limb_t, - 19500929 as libc::c_int as fe_limb_t, - 18085054 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 58370664 as libc::c_int as fe_limb_t, - 4489569 as libc::c_int as fe_limb_t, - 9688441 as libc::c_int as fe_limb_t, - 18769238 as libc::c_int as fe_limb_t, - 10184608 as libc::c_int as fe_limb_t, - 21191052 as libc::c_int as fe_limb_t, - 29287918 as libc::c_int as fe_limb_t, - 11864899 as libc::c_int as fe_limb_t, - 42594502 as libc::c_int as fe_limb_t, - 29115885 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 15636272 as libc::c_int as fe_limb_t, - 23865875 as libc::c_int as fe_limb_t, - 24204772 as libc::c_int as fe_limb_t, - 25642034 as libc::c_int as fe_limb_t, - 616976 as libc::c_int as fe_limb_t, - 16869170 as libc::c_int as fe_limb_t, - 27787599 as libc::c_int as fe_limb_t, - 18782243 as libc::c_int as fe_limb_t, - 28944399 as libc::c_int as fe_limb_t, - 32004408 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 16568933 as libc::c_int as fe_limb_t, - 4717097 as libc::c_int as fe_limb_t, - 55552716 as libc::c_int as fe_limb_t, - 32452109 as libc::c_int as fe_limb_t, - 15682895 as libc::c_int as fe_limb_t, - 21747389 as libc::c_int as fe_limb_t, - 16354576 as libc::c_int as fe_limb_t, - 21778470 as libc::c_int as fe_limb_t, - 7689661 as libc::c_int as fe_limb_t, - 11199574 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 30464137 as libc::c_int as fe_limb_t, - 27578307 as libc::c_int as fe_limb_t, - 55329429 as libc::c_int as fe_limb_t, - 17883566 as libc::c_int as fe_limb_t, - 23220364 as libc::c_int as fe_limb_t, - 15915852 as libc::c_int as fe_limb_t, - 7512774 as libc::c_int as fe_limb_t, - 10017326 as libc::c_int as fe_limb_t, - 49359771 as libc::c_int as fe_limb_t, - 23634074 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 10861363 as libc::c_int as fe_limb_t, - 11473154 as libc::c_int as fe_limb_t, - 27284546 as libc::c_int as fe_limb_t, - 1981175 as libc::c_int as fe_limb_t, - 37044515 as libc::c_int as fe_limb_t, - 12577860 as libc::c_int as fe_limb_t, - 32867885 as libc::c_int as fe_limb_t, - 14515107 as libc::c_int as fe_limb_t, - 51670560 as libc::c_int as fe_limb_t, - 10819379 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 4708026 as libc::c_int as fe_limb_t, - 6336745 as libc::c_int as fe_limb_t, - 20377586 as libc::c_int as fe_limb_t, - 9066809 as libc::c_int as fe_limb_t, - 55836755 as libc::c_int as fe_limb_t, - 6594695 as libc::c_int as fe_limb_t, - 41455196 as libc::c_int as fe_limb_t, - 12483687 as libc::c_int as fe_limb_t, - 54440373 as libc::c_int as fe_limb_t, - 5581305 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 19563141 as libc::c_int as fe_limb_t, - 16186464 as libc::c_int as fe_limb_t, - 37722007 as libc::c_int as fe_limb_t, - 4097518 as libc::c_int as fe_limb_t, - 10237984 as libc::c_int as fe_limb_t, - 29206317 as libc::c_int as fe_limb_t, - 28542349 as libc::c_int as fe_limb_t, - 13850243 as libc::c_int as fe_limb_t, - 43430843 as libc::c_int as fe_limb_t, - 17738489 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 5153727 as libc::c_int as fe_limb_t, - 9909285 as libc::c_int as fe_limb_t, - 1723747 as libc::c_int as fe_limb_t, - 30776558 as libc::c_int as fe_limb_t, - 30523604 as libc::c_int as fe_limb_t, - 5516873 as libc::c_int as fe_limb_t, - 19480852 as libc::c_int as fe_limb_t, - 5230134 as libc::c_int as fe_limb_t, - 43156425 as libc::c_int as fe_limb_t, - 18378665 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 36839857 as libc::c_int as fe_limb_t, - 30090922 as libc::c_int as fe_limb_t, - 7665485 as libc::c_int as fe_limb_t, - 10083793 as libc::c_int as fe_limb_t, - 28475525 as libc::c_int as fe_limb_t, - 1649722 as libc::c_int as fe_limb_t, - 20654025 as libc::c_int as fe_limb_t, - 16520125 as libc::c_int as fe_limb_t, - 30598449 as libc::c_int as fe_limb_t, - 7715701 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 28881826 as libc::c_int as fe_limb_t, - 14381568 as libc::c_int as fe_limb_t, - 9657904 as libc::c_int as fe_limb_t, - 3680757 as libc::c_int as fe_limb_t, - 46927229 as libc::c_int as fe_limb_t, - 7843315 as libc::c_int as fe_limb_t, - 35708204 as libc::c_int as fe_limb_t, - 1370707 as libc::c_int as fe_limb_t, - 29794553 as libc::c_int as fe_limb_t, - 32145132 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 44589871 as libc::c_int as fe_limb_t, - 26862249 as libc::c_int as fe_limb_t, - 14201701 as libc::c_int as fe_limb_t, - 24808930 as libc::c_int as fe_limb_t, - 43598457 as libc::c_int as fe_limb_t, - 8844725 as libc::c_int as fe_limb_t, - 18474211 as libc::c_int as fe_limb_t, - 32192982 as libc::c_int as fe_limb_t, - 54046167 as libc::c_int as fe_limb_t, - 13821876 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 60653668 as libc::c_int as fe_limb_t, - 25714560 as libc::c_int as fe_limb_t, - 3374701 as libc::c_int as fe_limb_t, - 28813570 as libc::c_int as fe_limb_t, - 40010246 as libc::c_int as fe_limb_t, - 22982724 as libc::c_int as fe_limb_t, - 31655027 as libc::c_int as fe_limb_t, - 26342105 as libc::c_int as fe_limb_t, - 18853321 as libc::c_int as fe_limb_t, - 19333481 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 4566811 as libc::c_int as fe_limb_t, - 20590564 as libc::c_int as fe_limb_t, - 38133974 as libc::c_int as fe_limb_t, - 21313742 as libc::c_int as fe_limb_t, - 59506191 as libc::c_int as fe_limb_t, - 30723862 as libc::c_int as fe_limb_t, - 58594505 as libc::c_int as fe_limb_t, - 23123294 as libc::c_int as fe_limb_t, - 2207752 as libc::c_int as fe_limb_t, - 30344648 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 41954014 as libc::c_int as fe_limb_t, - 29368610 as libc::c_int as fe_limb_t, - 29681143 as libc::c_int as fe_limb_t, - 7868801 as libc::c_int as fe_limb_t, - 60254203 as libc::c_int as fe_limb_t, - 24130566 as libc::c_int as fe_limb_t, - 54671499 as libc::c_int as fe_limb_t, - 32891431 as libc::c_int as fe_limb_t, - 35997400 as libc::c_int as fe_limb_t, - 17421995 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 25576264 as libc::c_int as fe_limb_t, - 30851218 as libc::c_int as fe_limb_t, - 7349803 as libc::c_int as fe_limb_t, - 21739588 as libc::c_int as fe_limb_t, - 16472781 as libc::c_int as fe_limb_t, - 9300885 as libc::c_int as fe_limb_t, - 3844789 as libc::c_int as fe_limb_t, - 15725684 as libc::c_int as fe_limb_t, - 171356 as libc::c_int as fe_limb_t, - 6466918 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 23103977 as libc::c_int as fe_limb_t, - 13316479 as libc::c_int as fe_limb_t, - 9739013 as libc::c_int as fe_limb_t, - 17404951 as libc::c_int as fe_limb_t, - 817874 as libc::c_int as fe_limb_t, - 18515490 as libc::c_int as fe_limb_t, - 8965338 as libc::c_int as fe_limb_t, - 19466374 as libc::c_int as fe_limb_t, - 36393951 as libc::c_int as fe_limb_t, - 16193876 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 33587053 as libc::c_int as fe_limb_t, - 3180712 as libc::c_int as fe_limb_t, - 64714734 as libc::c_int as fe_limb_t, - 14003686 as libc::c_int as fe_limb_t, - 50205390 as libc::c_int as fe_limb_t, - 17283591 as libc::c_int as fe_limb_t, - 17238397 as libc::c_int as fe_limb_t, - 4729455 as libc::c_int as fe_limb_t, - 49034351 as libc::c_int as fe_limb_t, - 9256799 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 41926547 as libc::c_int as fe_limb_t, - 29380300 as libc::c_int as fe_limb_t, - 32336397 as libc::c_int as fe_limb_t, - 5036987 as libc::c_int as fe_limb_t, - 45872047 as libc::c_int as fe_limb_t, - 11360616 as libc::c_int as fe_limb_t, - 22616405 as libc::c_int as fe_limb_t, - 9761698 as libc::c_int as fe_limb_t, - 47281666 as libc::c_int as fe_limb_t, - 630304 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 53388152 as libc::c_int as fe_limb_t, - 2639452 as libc::c_int as fe_limb_t, - 42871404 as libc::c_int as fe_limb_t, - 26147950 as libc::c_int as fe_limb_t, - 9494426 as libc::c_int as fe_limb_t, - 27780403 as libc::c_int as fe_limb_t, - 60554312 as libc::c_int as fe_limb_t, - 17593437 as libc::c_int as fe_limb_t, - 64659607 as libc::c_int as fe_limb_t, - 19263131 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, - { - let mut init = ge_precomp { - yplusx: { - let mut init = fe_loose { - v: [ - 63957664 as libc::c_int as fe_limb_t, - 28508356 as libc::c_int as fe_limb_t, - 9282713 as libc::c_int as fe_limb_t, - 6866145 as libc::c_int as fe_limb_t, - 35201802 as libc::c_int as fe_limb_t, - 32691408 as libc::c_int as fe_limb_t, - 48168288 as libc::c_int as fe_limb_t, - 15033783 as libc::c_int as fe_limb_t, - 25105118 as libc::c_int as fe_limb_t, - 25659556 as libc::c_int as fe_limb_t, - ], - }; - init - }, - yminusx: { - let mut init = fe_loose { - v: [ - 42782475 as libc::c_int as fe_limb_t, - 15950225 as libc::c_int as fe_limb_t, - 35307649 as libc::c_int as fe_limb_t, - 18961608 as libc::c_int as fe_limb_t, - 55446126 as libc::c_int as fe_limb_t, - 28463506 as libc::c_int as fe_limb_t, - 1573891 as libc::c_int as fe_limb_t, - 30928545 as libc::c_int as fe_limb_t, - 2198789 as libc::c_int as fe_limb_t, - 17749813 as libc::c_int as fe_limb_t, - ], - }; - init - }, - xy2d: { - let mut init = fe_loose { - v: [ - 64009494 as libc::c_int as fe_limb_t, - 10324966 as libc::c_int as fe_limb_t, - 64867251 as libc::c_int as fe_limb_t, - 7453182 as libc::c_int as fe_limb_t, - 61661885 as libc::c_int as fe_limb_t, - 30818928 as libc::c_int as fe_limb_t, - 53296841 as libc::c_int as fe_limb_t, - 17317989 as libc::c_int as fe_limb_t, - 34647629 as libc::c_int as fe_limb_t, - 21263748 as libc::c_int as fe_limb_t, - ], - }; - init - }, - }; - init - }, -]; -#[inline] -unsafe extern "C" fn fiat_25519_value_barrier_u32(mut a: uint32_t) -> uint32_t { - asm!("", inlateout(reg) a, options(preserves_flags, pure, readonly)); - return a; -} -#[inline] -unsafe extern "C" fn fiat_25519_addcarryx_u26( - mut out1: *mut uint32_t, - mut out2: *mut fiat_25519_uint1, - mut arg1: fiat_25519_uint1, - mut arg2: uint32_t, - mut arg3: uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: fiat_25519_uint1 = 0; - x1 = (arg1 as libc::c_uint).wrapping_add(arg2).wrapping_add(arg3); - x2 = x1 & 0x3ffffff as libc::c_uint; - x3 = (x1 >> 26 as libc::c_int) as fiat_25519_uint1; - *out1 = x2; - *out2 = x3; -} -#[inline] -unsafe extern "C" fn fiat_25519_subborrowx_u26( - mut out1: *mut uint32_t, - mut out2: *mut fiat_25519_uint1, - mut arg1: fiat_25519_uint1, - mut arg2: uint32_t, - mut arg3: uint32_t, -) { - let mut x1: int32_t = 0; - let mut x2: fiat_25519_int1 = 0; - let mut x3: uint32_t = 0; - x1 = arg2.wrapping_sub(arg1 as libc::c_uint) as int32_t - arg3 as int32_t; - x2 = (x1 >> 26 as libc::c_int) as fiat_25519_int1; - x3 = x1 as libc::c_uint & 0x3ffffff as libc::c_uint; - *out1 = x3; - *out2 = (0 as libc::c_int - x2 as libc::c_int) as fiat_25519_uint1; -} -#[inline] -unsafe extern "C" fn fiat_25519_addcarryx_u25( - mut out1: *mut uint32_t, - mut out2: *mut fiat_25519_uint1, - mut arg1: fiat_25519_uint1, - mut arg2: uint32_t, - mut arg3: uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: fiat_25519_uint1 = 0; - x1 = (arg1 as libc::c_uint).wrapping_add(arg2).wrapping_add(arg3); - x2 = x1 & 0x1ffffff as libc::c_uint; - x3 = (x1 >> 25 as libc::c_int) as fiat_25519_uint1; - *out1 = x2; - *out2 = x3; -} -#[inline] -unsafe extern "C" fn fiat_25519_subborrowx_u25( - mut out1: *mut uint32_t, - mut out2: *mut fiat_25519_uint1, - mut arg1: fiat_25519_uint1, - mut arg2: uint32_t, - mut arg3: uint32_t, -) { - let mut x1: int32_t = 0; - let mut x2: fiat_25519_int1 = 0; - let mut x3: uint32_t = 0; - x1 = arg2.wrapping_sub(arg1 as libc::c_uint) as int32_t - arg3 as int32_t; - x2 = (x1 >> 25 as libc::c_int) as fiat_25519_int1; - x3 = x1 as libc::c_uint & 0x1ffffff as libc::c_uint; - *out1 = x3; - *out2 = (0 as libc::c_int - x2 as libc::c_int) as fiat_25519_uint1; -} -#[inline] -unsafe extern "C" fn fiat_25519_cmovznz_u32( - mut out1: *mut uint32_t, - mut arg1: fiat_25519_uint1, - mut arg2: uint32_t, - mut arg3: uint32_t, -) { - let mut x1: fiat_25519_uint1 = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - x1 = (arg1 != 0) as libc::c_int as fiat_25519_uint1; - x2 = (0 as libc::c_int - x1 as libc::c_int) as fiat_25519_int1 as libc::c_uint - & 0xffffffff as libc::c_uint; - x3 = fiat_25519_value_barrier_u32(x2) & arg3 - | fiat_25519_value_barrier_u32(!x2) & arg2; - *out1 = x3; -} -#[inline] -unsafe extern "C" fn fiat_25519_carry_mul( - mut out1: *mut uint32_t, - mut arg1: *const uint32_t, - mut arg2: *const uint32_t, -) { - let mut x1: uint64_t = 0; - let mut x2: uint64_t = 0; - let mut x3: uint64_t = 0; - let mut x4: uint64_t = 0; - let mut x5: uint64_t = 0; - let mut x6: uint64_t = 0; - let mut x7: uint64_t = 0; - let mut x8: uint64_t = 0; - let mut x9: uint64_t = 0; - let mut x10: uint64_t = 0; - let mut x11: uint64_t = 0; - let mut x12: uint64_t = 0; - let mut x13: uint64_t = 0; - let mut x14: uint64_t = 0; - let mut x15: uint64_t = 0; - let mut x16: uint64_t = 0; - let mut x17: uint64_t = 0; - let mut x18: uint64_t = 0; - let mut x19: uint64_t = 0; - let mut x20: uint64_t = 0; - let mut x21: uint64_t = 0; - let mut x22: uint64_t = 0; - let mut x23: uint64_t = 0; - let mut x24: uint64_t = 0; - let mut x25: uint64_t = 0; - let mut x26: uint64_t = 0; - let mut x27: uint64_t = 0; - let mut x28: uint64_t = 0; - let mut x29: uint64_t = 0; - let mut x30: uint64_t = 0; - let mut x31: uint64_t = 0; - let mut x32: uint64_t = 0; - let mut x33: uint64_t = 0; - let mut x34: uint64_t = 0; - let mut x35: uint64_t = 0; - let mut x36: uint64_t = 0; - let mut x37: uint64_t = 0; - let mut x38: uint64_t = 0; - let mut x39: uint64_t = 0; - let mut x40: uint64_t = 0; - let mut x41: uint64_t = 0; - let mut x42: uint64_t = 0; - let mut x43: uint64_t = 0; - let mut x44: uint64_t = 0; - let mut x45: uint64_t = 0; - let mut x46: uint64_t = 0; - let mut x47: uint64_t = 0; - let mut x48: uint64_t = 0; - let mut x49: uint64_t = 0; - let mut x50: uint64_t = 0; - let mut x51: uint64_t = 0; - let mut x52: uint64_t = 0; - let mut x53: uint64_t = 0; - let mut x54: uint64_t = 0; - let mut x55: uint64_t = 0; - let mut x56: uint64_t = 0; - let mut x57: uint64_t = 0; - let mut x58: uint64_t = 0; - let mut x59: uint64_t = 0; - let mut x60: uint64_t = 0; - let mut x61: uint64_t = 0; - let mut x62: uint64_t = 0; - let mut x63: uint64_t = 0; - let mut x64: uint64_t = 0; - let mut x65: uint64_t = 0; - let mut x66: uint64_t = 0; - let mut x67: uint64_t = 0; - let mut x68: uint64_t = 0; - let mut x69: uint64_t = 0; - let mut x70: uint64_t = 0; - let mut x71: uint64_t = 0; - let mut x72: uint64_t = 0; - let mut x73: uint64_t = 0; - let mut x74: uint64_t = 0; - let mut x75: uint64_t = 0; - let mut x76: uint64_t = 0; - let mut x77: uint64_t = 0; - let mut x78: uint64_t = 0; - let mut x79: uint64_t = 0; - let mut x80: uint64_t = 0; - let mut x81: uint64_t = 0; - let mut x82: uint64_t = 0; - let mut x83: uint64_t = 0; - let mut x84: uint64_t = 0; - let mut x85: uint64_t = 0; - let mut x86: uint64_t = 0; - let mut x87: uint64_t = 0; - let mut x88: uint64_t = 0; - let mut x89: uint64_t = 0; - let mut x90: uint64_t = 0; - let mut x91: uint64_t = 0; - let mut x92: uint64_t = 0; - let mut x93: uint64_t = 0; - let mut x94: uint64_t = 0; - let mut x95: uint64_t = 0; - let mut x96: uint64_t = 0; - let mut x97: uint64_t = 0; - let mut x98: uint64_t = 0; - let mut x99: uint64_t = 0; - let mut x100: uint64_t = 0; - let mut x101: uint64_t = 0; - let mut x102: uint64_t = 0; - let mut x103: uint32_t = 0; - let mut x104: uint64_t = 0; - let mut x105: uint64_t = 0; - let mut x106: uint64_t = 0; - let mut x107: uint64_t = 0; - let mut x108: uint64_t = 0; - let mut x109: uint64_t = 0; - let mut x110: uint64_t = 0; - let mut x111: uint64_t = 0; - let mut x112: uint64_t = 0; - let mut x113: uint64_t = 0; - let mut x114: uint64_t = 0; - let mut x115: uint32_t = 0; - let mut x116: uint64_t = 0; - let mut x117: uint64_t = 0; - let mut x118: uint32_t = 0; - let mut x119: uint64_t = 0; - let mut x120: uint64_t = 0; - let mut x121: uint32_t = 0; - let mut x122: uint64_t = 0; - let mut x123: uint64_t = 0; - let mut x124: uint32_t = 0; - let mut x125: uint64_t = 0; - let mut x126: uint64_t = 0; - let mut x127: uint32_t = 0; - let mut x128: uint64_t = 0; - let mut x129: uint64_t = 0; - let mut x130: uint32_t = 0; - let mut x131: uint64_t = 0; - let mut x132: uint64_t = 0; - let mut x133: uint32_t = 0; - let mut x134: uint64_t = 0; - let mut x135: uint64_t = 0; - let mut x136: uint32_t = 0; - let mut x137: uint64_t = 0; - let mut x138: uint64_t = 0; - let mut x139: uint32_t = 0; - let mut x140: uint64_t = 0; - let mut x141: uint64_t = 0; - let mut x142: uint32_t = 0; - let mut x143: uint32_t = 0; - let mut x144: uint32_t = 0; - let mut x145: fiat_25519_uint1 = 0; - let mut x146: uint32_t = 0; - let mut x147: uint32_t = 0; - x1 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x2 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x3 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x4 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x5 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x6 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(4 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x7 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x8 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(2 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x9 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x10 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x11 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x12 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x13 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x14 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x15 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(4 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x16 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x17 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(2 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x18 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x19 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x20 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x21 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x22 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x23 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(4 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x24 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x25 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x26 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x27 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x28 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x29 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x30 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(4 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x31 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x32 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x33 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x34 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x35 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x36 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x37 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x38 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x39 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x40 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x41 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x42 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x43 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x44 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x45 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x26 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x46 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x47 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(1 as libc::c_int as isize) as libc::c_ulonglong); - x48 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x49 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x50 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x51 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x52 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(3 as libc::c_int as isize) as libc::c_ulonglong); - x53 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x54 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(1 as libc::c_int as isize) as libc::c_ulonglong); - x55 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x56 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x57 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x58 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x59 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x60 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x61 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(5 as libc::c_int as isize) as libc::c_ulonglong); - x62 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x63 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(3 as libc::c_int as isize) as libc::c_ulonglong); - x64 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x65 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(1 as libc::c_int as isize) as libc::c_ulonglong); - x66 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x67 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(6 as libc::c_int as isize) as libc::c_ulonglong); - x68 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x69 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x70 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x71 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x72 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x73 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x74 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(7 as libc::c_int as isize) as libc::c_ulonglong); - x75 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(6 as libc::c_int as isize) as libc::c_ulonglong); - x76 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(5 as libc::c_int as isize) as libc::c_ulonglong); - x77 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x78 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(3 as libc::c_int as isize) as libc::c_ulonglong); - x79 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x80 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(1 as libc::c_int as isize) as libc::c_ulonglong); - x81 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x82 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(8 as libc::c_int as isize) as libc::c_ulonglong); - x83 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x84 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(6 as libc::c_int as isize) as libc::c_ulonglong); - x85 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x86 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x87 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x88 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x89 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg2.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x90 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x91 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(9 as libc::c_int as isize) as libc::c_ulonglong); - x92 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(8 as libc::c_int as isize) as libc::c_ulonglong); - x93 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(7 as libc::c_int as isize) as libc::c_ulonglong); - x94 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(6 as libc::c_int as isize) as libc::c_ulonglong); - x95 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(5 as libc::c_int as isize) as libc::c_ulonglong); - x96 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x97 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(3 as libc::c_int as isize) as libc::c_ulonglong); - x98 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x99 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(1 as libc::c_int as isize) as libc::c_ulonglong); - x100 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg2.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x101 = x100 - .wrapping_add( - x45 - .wrapping_add( - x44 - .wrapping_add( - x42 - .wrapping_add( - x39 - .wrapping_add( - x35 - .wrapping_add( - x30.wrapping_add(x24.wrapping_add(x17.wrapping_add(x9))), - ), - ), - ), - ), - ), - ); - x102 = x101 >> 26 as libc::c_int; - x103 = (x101 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x104 = x91 - .wrapping_add( - x82 - .wrapping_add( - x74 - .wrapping_add( - x67 - .wrapping_add( - x61 - .wrapping_add( - x56 - .wrapping_add( - x52.wrapping_add(x49.wrapping_add(x47.wrapping_add(x46))), - ), - ), - ), - ), - ), - ); - x105 = x92 - .wrapping_add( - x83 - .wrapping_add( - x75 - .wrapping_add( - x68 - .wrapping_add( - x62 - .wrapping_add( - x57 - .wrapping_add( - x53.wrapping_add(x50.wrapping_add(x48.wrapping_add(x1))), - ), - ), - ), - ), - ), - ); - x106 = x93 - .wrapping_add( - x84 - .wrapping_add( - x76 - .wrapping_add( - x69 - .wrapping_add( - x63 - .wrapping_add( - x58 - .wrapping_add( - x54.wrapping_add(x51.wrapping_add(x10.wrapping_add(x2))), - ), - ), - ), - ), - ), - ); - x107 = x94 - .wrapping_add( - x85 - .wrapping_add( - x77 - .wrapping_add( - x70 - .wrapping_add( - x64 - .wrapping_add( - x59 - .wrapping_add( - x55.wrapping_add(x18.wrapping_add(x11.wrapping_add(x3))), - ), - ), - ), - ), - ), - ); - x108 = x95 - .wrapping_add( - x86 - .wrapping_add( - x78 - .wrapping_add( - x71 - .wrapping_add( - x65 - .wrapping_add( - x60 - .wrapping_add( - x25.wrapping_add(x19.wrapping_add(x12.wrapping_add(x4))), - ), - ), - ), - ), - ), - ); - x109 = x96 - .wrapping_add( - x87 - .wrapping_add( - x79 - .wrapping_add( - x72 - .wrapping_add( - x66 - .wrapping_add( - x31 - .wrapping_add( - x26.wrapping_add(x20.wrapping_add(x13.wrapping_add(x5))), - ), - ), - ), - ), - ), - ); - x110 = x97 - .wrapping_add( - x88 - .wrapping_add( - x80 - .wrapping_add( - x73 - .wrapping_add( - x36 - .wrapping_add( - x32 - .wrapping_add( - x27.wrapping_add(x21.wrapping_add(x14.wrapping_add(x6))), - ), - ), - ), - ), - ), - ); - x111 = x98 - .wrapping_add( - x89 - .wrapping_add( - x81 - .wrapping_add( - x40 - .wrapping_add( - x37 - .wrapping_add( - x33 - .wrapping_add( - x28.wrapping_add(x22.wrapping_add(x15.wrapping_add(x7))), - ), - ), - ), - ), - ), - ); - x112 = x99 - .wrapping_add( - x90 - .wrapping_add( - x43 - .wrapping_add( - x41 - .wrapping_add( - x38 - .wrapping_add( - x34 - .wrapping_add( - x29.wrapping_add(x23.wrapping_add(x16.wrapping_add(x8))), - ), - ), - ), - ), - ), - ); - x113 = x102.wrapping_add(x112); - x114 = x113 >> 25 as libc::c_int; - x115 = (x113 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x116 = x114.wrapping_add(x111); - x117 = x116 >> 26 as libc::c_int; - x118 = (x116 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x119 = x117.wrapping_add(x110); - x120 = x119 >> 25 as libc::c_int; - x121 = (x119 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x122 = x120.wrapping_add(x109); - x123 = x122 >> 26 as libc::c_int; - x124 = (x122 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x125 = x123.wrapping_add(x108); - x126 = x125 >> 25 as libc::c_int; - x127 = (x125 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x128 = x126.wrapping_add(x107); - x129 = x128 >> 26 as libc::c_int; - x130 = (x128 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x131 = x129.wrapping_add(x106); - x132 = x131 >> 25 as libc::c_int; - x133 = (x131 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x134 = x132.wrapping_add(x105); - x135 = x134 >> 26 as libc::c_int; - x136 = (x134 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x137 = x135.wrapping_add(x104); - x138 = x137 >> 25 as libc::c_int; - x139 = (x137 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x140 = x138.wrapping_mul(0x13 as libc::c_int as libc::c_ulonglong); - x141 = (x103 as libc::c_ulonglong).wrapping_add(x140); - x142 = (x141 >> 26 as libc::c_int) as uint32_t; - x143 = (x141 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x144 = x142.wrapping_add(x115); - x145 = (x144 >> 25 as libc::c_int) as fiat_25519_uint1; - x146 = x144 & 0x1ffffff as libc::c_uint; - x147 = (x145 as libc::c_uint).wrapping_add(x118); - *out1.offset(0 as libc::c_int as isize) = x143; - *out1.offset(1 as libc::c_int as isize) = x146; - *out1.offset(2 as libc::c_int as isize) = x147; - *out1.offset(3 as libc::c_int as isize) = x121; - *out1.offset(4 as libc::c_int as isize) = x124; - *out1.offset(5 as libc::c_int as isize) = x127; - *out1.offset(6 as libc::c_int as isize) = x130; - *out1.offset(7 as libc::c_int as isize) = x133; - *out1.offset(8 as libc::c_int as isize) = x136; - *out1.offset(9 as libc::c_int as isize) = x139; -} -#[inline] -unsafe extern "C" fn fiat_25519_carry_square( - mut out1: *mut uint32_t, - mut arg1: *const uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint64_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - let mut x11: uint64_t = 0; - let mut x12: uint32_t = 0; - let mut x13: uint32_t = 0; - let mut x14: uint32_t = 0; - let mut x15: uint32_t = 0; - let mut x16: uint32_t = 0; - let mut x17: uint32_t = 0; - let mut x18: uint32_t = 0; - let mut x19: uint64_t = 0; - let mut x20: uint64_t = 0; - let mut x21: uint64_t = 0; - let mut x22: uint64_t = 0; - let mut x23: uint64_t = 0; - let mut x24: uint64_t = 0; - let mut x25: uint64_t = 0; - let mut x26: uint64_t = 0; - let mut x27: uint64_t = 0; - let mut x28: uint64_t = 0; - let mut x29: uint64_t = 0; - let mut x30: uint64_t = 0; - let mut x31: uint64_t = 0; - let mut x32: uint64_t = 0; - let mut x33: uint64_t = 0; - let mut x34: uint64_t = 0; - let mut x35: uint64_t = 0; - let mut x36: uint64_t = 0; - let mut x37: uint64_t = 0; - let mut x38: uint64_t = 0; - let mut x39: uint64_t = 0; - let mut x40: uint64_t = 0; - let mut x41: uint64_t = 0; - let mut x42: uint64_t = 0; - let mut x43: uint64_t = 0; - let mut x44: uint64_t = 0; - let mut x45: uint64_t = 0; - let mut x46: uint64_t = 0; - let mut x47: uint64_t = 0; - let mut x48: uint64_t = 0; - let mut x49: uint64_t = 0; - let mut x50: uint64_t = 0; - let mut x51: uint64_t = 0; - let mut x52: uint64_t = 0; - let mut x53: uint64_t = 0; - let mut x54: uint64_t = 0; - let mut x55: uint64_t = 0; - let mut x56: uint64_t = 0; - let mut x57: uint64_t = 0; - let mut x58: uint64_t = 0; - let mut x59: uint64_t = 0; - let mut x60: uint64_t = 0; - let mut x61: uint64_t = 0; - let mut x62: uint64_t = 0; - let mut x63: uint64_t = 0; - let mut x64: uint64_t = 0; - let mut x65: uint64_t = 0; - let mut x66: uint64_t = 0; - let mut x67: uint64_t = 0; - let mut x68: uint64_t = 0; - let mut x69: uint64_t = 0; - let mut x70: uint64_t = 0; - let mut x71: uint64_t = 0; - let mut x72: uint64_t = 0; - let mut x73: uint64_t = 0; - let mut x74: uint64_t = 0; - let mut x75: uint64_t = 0; - let mut x76: uint32_t = 0; - let mut x77: uint64_t = 0; - let mut x78: uint64_t = 0; - let mut x79: uint64_t = 0; - let mut x80: uint64_t = 0; - let mut x81: uint64_t = 0; - let mut x82: uint64_t = 0; - let mut x83: uint64_t = 0; - let mut x84: uint64_t = 0; - let mut x85: uint64_t = 0; - let mut x86: uint64_t = 0; - let mut x87: uint64_t = 0; - let mut x88: uint32_t = 0; - let mut x89: uint64_t = 0; - let mut x90: uint64_t = 0; - let mut x91: uint32_t = 0; - let mut x92: uint64_t = 0; - let mut x93: uint64_t = 0; - let mut x94: uint32_t = 0; - let mut x95: uint64_t = 0; - let mut x96: uint64_t = 0; - let mut x97: uint32_t = 0; - let mut x98: uint64_t = 0; - let mut x99: uint64_t = 0; - let mut x100: uint32_t = 0; - let mut x101: uint64_t = 0; - let mut x102: uint64_t = 0; - let mut x103: uint32_t = 0; - let mut x104: uint64_t = 0; - let mut x105: uint64_t = 0; - let mut x106: uint32_t = 0; - let mut x107: uint64_t = 0; - let mut x108: uint64_t = 0; - let mut x109: uint32_t = 0; - let mut x110: uint64_t = 0; - let mut x111: uint64_t = 0; - let mut x112: uint32_t = 0; - let mut x113: uint64_t = 0; - let mut x114: uint64_t = 0; - let mut x115: uint32_t = 0; - let mut x116: uint32_t = 0; - let mut x117: uint32_t = 0; - let mut x118: fiat_25519_uint1 = 0; - let mut x119: uint32_t = 0; - let mut x120: uint32_t = 0; - x1 = (*arg1.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint); - x2 = x1.wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x3 = (*arg1.offset(9 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x4 = (*arg1.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint); - x5 = (x4 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong); - x6 = (*arg1.offset(8 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x7 = (*arg1.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint); - x8 = x7.wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x9 = (*arg1.offset(7 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x10 = (*arg1.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint); - x11 = (x10 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong); - x12 = (*arg1.offset(6 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x13 = (*arg1.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x13 as libc::c_int as libc::c_uint); - x14 = (*arg1.offset(5 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x15 = (*arg1.offset(4 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x16 = (*arg1.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x17 = (*arg1.offset(2 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x18 = (*arg1.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint); - x19 = (*arg1.offset(9 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x1.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x20 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x2 as libc::c_ulonglong); - x21 = (*arg1.offset(8 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x4 as libc::c_ulonglong); - x22 = (*arg1.offset(7 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul( - (x2 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong), - ); - x23 = (*arg1.offset(7 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x5); - x24 = (*arg1.offset(7 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x7.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x25 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x2 as libc::c_ulonglong); - x26 = (*arg1.offset(6 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x5); - x27 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x8 as libc::c_ulonglong); - x28 = (*arg1.offset(6 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x10 as libc::c_ulonglong); - x29 = (*arg1.offset(5 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul( - (x2 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong), - ); - x30 = (*arg1.offset(5 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x5); - x31 = (*arg1.offset(5 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul( - (x8 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong), - ); - x32 = (*arg1.offset(5 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x11); - x33 = (*arg1.offset(5 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x13.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x34 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x2 as libc::c_ulonglong); - x35 = (*arg1.offset(4 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x5); - x36 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x8 as libc::c_ulonglong); - x37 = (*arg1.offset(4 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x11); - x38 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x14 as libc::c_ulonglong); - x39 = (*arg1.offset(4 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg1.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x40 = (*arg1.offset(3 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul( - (x2 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong), - ); - x41 = (*arg1.offset(3 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x5); - x42 = (*arg1.offset(3 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul( - (x8 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong), - ); - x43 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x12 as libc::c_ulonglong); - x44 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x14.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x45 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x15 as libc::c_ulonglong); - x46 = (*arg1.offset(3 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg1.offset(3 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x47 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x2 as libc::c_ulonglong); - x48 = (*arg1.offset(2 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul(x5); - x49 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x9 as libc::c_ulonglong); - x50 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x12 as libc::c_ulonglong); - x51 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x14 as libc::c_ulonglong); - x52 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x15 as libc::c_ulonglong); - x53 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x16 as libc::c_ulonglong); - x54 = (*arg1.offset(2 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg1.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x55 = (*arg1.offset(1 as libc::c_int as isize) as libc::c_ulonglong) - .wrapping_mul( - (x2 as uint64_t).wrapping_mul(0x2 as libc::c_int as libc::c_ulonglong), - ); - x56 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x6 as libc::c_ulonglong); - x57 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x9.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x58 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x12 as libc::c_ulonglong); - x59 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x14.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x60 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x15 as libc::c_ulonglong); - x61 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - x16.wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x62 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x17 as libc::c_ulonglong); - x63 = (*arg1.offset(1 as libc::c_int as isize) as uint64_t) - .wrapping_mul( - (*arg1.offset(1 as libc::c_int as isize)) - .wrapping_mul(0x2 as libc::c_int as libc::c_uint) as libc::c_ulonglong, - ); - x64 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x3 as libc::c_ulonglong); - x65 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x6 as libc::c_ulonglong); - x66 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x9 as libc::c_ulonglong); - x67 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x12 as libc::c_ulonglong); - x68 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x14 as libc::c_ulonglong); - x69 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x15 as libc::c_ulonglong); - x70 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x16 as libc::c_ulonglong); - x71 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x17 as libc::c_ulonglong); - x72 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(x18 as libc::c_ulonglong); - x73 = (*arg1.offset(0 as libc::c_int as isize) as uint64_t) - .wrapping_mul(*arg1.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x74 = x73 - .wrapping_add( - x55.wrapping_add(x48.wrapping_add(x42.wrapping_add(x37.wrapping_add(x33)))), - ); - x75 = x74 >> 26 as libc::c_int; - x76 = (x74 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x77 = x64.wrapping_add(x56.wrapping_add(x49.wrapping_add(x43.wrapping_add(x38)))); - x78 = x65 - .wrapping_add( - x57.wrapping_add(x50.wrapping_add(x44.wrapping_add(x39.wrapping_add(x19)))), - ); - x79 = x66.wrapping_add(x58.wrapping_add(x51.wrapping_add(x45.wrapping_add(x20)))); - x80 = x67 - .wrapping_add( - x59.wrapping_add(x52.wrapping_add(x46.wrapping_add(x22.wrapping_add(x21)))), - ); - x81 = x68.wrapping_add(x60.wrapping_add(x53.wrapping_add(x25.wrapping_add(x23)))); - x82 = x69 - .wrapping_add( - x61.wrapping_add(x54.wrapping_add(x29.wrapping_add(x26.wrapping_add(x24)))), - ); - x83 = x70.wrapping_add(x62.wrapping_add(x34.wrapping_add(x30.wrapping_add(x27)))); - x84 = x71 - .wrapping_add( - x63.wrapping_add(x40.wrapping_add(x35.wrapping_add(x31.wrapping_add(x28)))), - ); - x85 = x72.wrapping_add(x47.wrapping_add(x41.wrapping_add(x36.wrapping_add(x32)))); - x86 = x75.wrapping_add(x85); - x87 = x86 >> 25 as libc::c_int; - x88 = (x86 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x89 = x87.wrapping_add(x84); - x90 = x89 >> 26 as libc::c_int; - x91 = (x89 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x92 = x90.wrapping_add(x83); - x93 = x92 >> 25 as libc::c_int; - x94 = (x92 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x95 = x93.wrapping_add(x82); - x96 = x95 >> 26 as libc::c_int; - x97 = (x95 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x98 = x96.wrapping_add(x81); - x99 = x98 >> 25 as libc::c_int; - x100 = (x98 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x101 = x99.wrapping_add(x80); - x102 = x101 >> 26 as libc::c_int; - x103 = (x101 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x104 = x102.wrapping_add(x79); - x105 = x104 >> 25 as libc::c_int; - x106 = (x104 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x107 = x105.wrapping_add(x78); - x108 = x107 >> 26 as libc::c_int; - x109 = (x107 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x110 = x108.wrapping_add(x77); - x111 = x110 >> 25 as libc::c_int; - x112 = (x110 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x113 = x111.wrapping_mul(0x13 as libc::c_int as libc::c_ulonglong); - x114 = (x76 as libc::c_ulonglong).wrapping_add(x113); - x115 = (x114 >> 26 as libc::c_int) as uint32_t; - x116 = (x114 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x117 = x115.wrapping_add(x88); - x118 = (x117 >> 25 as libc::c_int) as fiat_25519_uint1; - x119 = x117 & 0x1ffffff as libc::c_uint; - x120 = (x118 as libc::c_uint).wrapping_add(x91); - *out1.offset(0 as libc::c_int as isize) = x116; - *out1.offset(1 as libc::c_int as isize) = x119; - *out1.offset(2 as libc::c_int as isize) = x120; - *out1.offset(3 as libc::c_int as isize) = x94; - *out1.offset(4 as libc::c_int as isize) = x97; - *out1.offset(5 as libc::c_int as isize) = x100; - *out1.offset(6 as libc::c_int as isize) = x103; - *out1.offset(7 as libc::c_int as isize) = x106; - *out1.offset(8 as libc::c_int as isize) = x109; - *out1.offset(9 as libc::c_int as isize) = x112; -} -#[inline] -unsafe extern "C" fn fiat_25519_carry( - mut out1: *mut uint32_t, - mut arg1: *const uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint32_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - let mut x11: uint32_t = 0; - let mut x12: uint32_t = 0; - let mut x13: uint32_t = 0; - let mut x14: uint32_t = 0; - let mut x15: uint32_t = 0; - let mut x16: uint32_t = 0; - let mut x17: uint32_t = 0; - let mut x18: uint32_t = 0; - let mut x19: uint32_t = 0; - let mut x20: uint32_t = 0; - let mut x21: uint32_t = 0; - let mut x22: uint32_t = 0; - x1 = *arg1.offset(0 as libc::c_int as isize); - x2 = (x1 >> 26 as libc::c_int).wrapping_add(*arg1.offset(1 as libc::c_int as isize)); - x3 = (x2 >> 25 as libc::c_int).wrapping_add(*arg1.offset(2 as libc::c_int as isize)); - x4 = (x3 >> 26 as libc::c_int).wrapping_add(*arg1.offset(3 as libc::c_int as isize)); - x5 = (x4 >> 25 as libc::c_int).wrapping_add(*arg1.offset(4 as libc::c_int as isize)); - x6 = (x5 >> 26 as libc::c_int).wrapping_add(*arg1.offset(5 as libc::c_int as isize)); - x7 = (x6 >> 25 as libc::c_int).wrapping_add(*arg1.offset(6 as libc::c_int as isize)); - x8 = (x7 >> 26 as libc::c_int).wrapping_add(*arg1.offset(7 as libc::c_int as isize)); - x9 = (x8 >> 25 as libc::c_int).wrapping_add(*arg1.offset(8 as libc::c_int as isize)); - x10 = (x9 >> 26 as libc::c_int) - .wrapping_add(*arg1.offset(9 as libc::c_int as isize)); - x11 = (x1 & 0x3ffffff as libc::c_uint) - .wrapping_add( - (x10 >> 25 as libc::c_int).wrapping_mul(0x13 as libc::c_int as libc::c_uint), - ); - x12 = ((x11 >> 26 as libc::c_int) as fiat_25519_uint1 as libc::c_uint) - .wrapping_add(x2 & 0x1ffffff as libc::c_uint); - x13 = x11 & 0x3ffffff as libc::c_uint; - x14 = x12 & 0x1ffffff as libc::c_uint; - x15 = ((x12 >> 25 as libc::c_int) as fiat_25519_uint1 as libc::c_uint) - .wrapping_add(x3 & 0x3ffffff as libc::c_uint); - x16 = x4 & 0x1ffffff as libc::c_uint; - x17 = x5 & 0x3ffffff as libc::c_uint; - x18 = x6 & 0x1ffffff as libc::c_uint; - x19 = x7 & 0x3ffffff as libc::c_uint; - x20 = x8 & 0x1ffffff as libc::c_uint; - x21 = x9 & 0x3ffffff as libc::c_uint; - x22 = x10 & 0x1ffffff as libc::c_uint; - *out1.offset(0 as libc::c_int as isize) = x13; - *out1.offset(1 as libc::c_int as isize) = x14; - *out1.offset(2 as libc::c_int as isize) = x15; - *out1.offset(3 as libc::c_int as isize) = x16; - *out1.offset(4 as libc::c_int as isize) = x17; - *out1.offset(5 as libc::c_int as isize) = x18; - *out1.offset(6 as libc::c_int as isize) = x19; - *out1.offset(7 as libc::c_int as isize) = x20; - *out1.offset(8 as libc::c_int as isize) = x21; - *out1.offset(9 as libc::c_int as isize) = x22; -} -#[inline] -unsafe extern "C" fn fiat_25519_add( - mut out1: *mut uint32_t, - mut arg1: *const uint32_t, - mut arg2: *const uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint32_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - x1 = (*arg1.offset(0 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(0 as libc::c_int as isize)); - x2 = (*arg1.offset(1 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(1 as libc::c_int as isize)); - x3 = (*arg1.offset(2 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(2 as libc::c_int as isize)); - x4 = (*arg1.offset(3 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(3 as libc::c_int as isize)); - x5 = (*arg1.offset(4 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(4 as libc::c_int as isize)); - x6 = (*arg1.offset(5 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(5 as libc::c_int as isize)); - x7 = (*arg1.offset(6 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(6 as libc::c_int as isize)); - x8 = (*arg1.offset(7 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(7 as libc::c_int as isize)); - x9 = (*arg1.offset(8 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(8 as libc::c_int as isize)); - x10 = (*arg1.offset(9 as libc::c_int as isize)) - .wrapping_add(*arg2.offset(9 as libc::c_int as isize)); - *out1.offset(0 as libc::c_int as isize) = x1; - *out1.offset(1 as libc::c_int as isize) = x2; - *out1.offset(2 as libc::c_int as isize) = x3; - *out1.offset(3 as libc::c_int as isize) = x4; - *out1.offset(4 as libc::c_int as isize) = x5; - *out1.offset(5 as libc::c_int as isize) = x6; - *out1.offset(6 as libc::c_int as isize) = x7; - *out1.offset(7 as libc::c_int as isize) = x8; - *out1.offset(8 as libc::c_int as isize) = x9; - *out1.offset(9 as libc::c_int as isize) = x10; -} -#[inline] -unsafe extern "C" fn fiat_25519_sub( - mut out1: *mut uint32_t, - mut arg1: *const uint32_t, - mut arg2: *const uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint32_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - x1 = (0x7ffffda as libc::c_uint) - .wrapping_add(*arg1.offset(0 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(0 as libc::c_int as isize)); - x2 = (0x3fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(1 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(1 as libc::c_int as isize)); - x3 = (0x7fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(2 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(2 as libc::c_int as isize)); - x4 = (0x3fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(3 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(3 as libc::c_int as isize)); - x5 = (0x7fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(4 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(4 as libc::c_int as isize)); - x6 = (0x3fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(5 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(5 as libc::c_int as isize)); - x7 = (0x7fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(6 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(6 as libc::c_int as isize)); - x8 = (0x3fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(7 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(7 as libc::c_int as isize)); - x9 = (0x7fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(8 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(8 as libc::c_int as isize)); - x10 = (0x3fffffe as libc::c_uint) - .wrapping_add(*arg1.offset(9 as libc::c_int as isize)) - .wrapping_sub(*arg2.offset(9 as libc::c_int as isize)); - *out1.offset(0 as libc::c_int as isize) = x1; - *out1.offset(1 as libc::c_int as isize) = x2; - *out1.offset(2 as libc::c_int as isize) = x3; - *out1.offset(3 as libc::c_int as isize) = x4; - *out1.offset(4 as libc::c_int as isize) = x5; - *out1.offset(5 as libc::c_int as isize) = x6; - *out1.offset(6 as libc::c_int as isize) = x7; - *out1.offset(7 as libc::c_int as isize) = x8; - *out1.offset(8 as libc::c_int as isize) = x9; - *out1.offset(9 as libc::c_int as isize) = x10; -} -#[inline] -unsafe extern "C" fn fiat_25519_opp(mut out1: *mut uint32_t, mut arg1: *const uint32_t) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint32_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - x1 = (0x7ffffda as libc::c_uint) - .wrapping_sub(*arg1.offset(0 as libc::c_int as isize)); - x2 = (0x3fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(1 as libc::c_int as isize)); - x3 = (0x7fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(2 as libc::c_int as isize)); - x4 = (0x3fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(3 as libc::c_int as isize)); - x5 = (0x7fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(4 as libc::c_int as isize)); - x6 = (0x3fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(5 as libc::c_int as isize)); - x7 = (0x7fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(6 as libc::c_int as isize)); - x8 = (0x3fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(7 as libc::c_int as isize)); - x9 = (0x7fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(8 as libc::c_int as isize)); - x10 = (0x3fffffe as libc::c_uint) - .wrapping_sub(*arg1.offset(9 as libc::c_int as isize)); - *out1.offset(0 as libc::c_int as isize) = x1; - *out1.offset(1 as libc::c_int as isize) = x2; - *out1.offset(2 as libc::c_int as isize) = x3; - *out1.offset(3 as libc::c_int as isize) = x4; - *out1.offset(4 as libc::c_int as isize) = x5; - *out1.offset(5 as libc::c_int as isize) = x6; - *out1.offset(6 as libc::c_int as isize) = x7; - *out1.offset(7 as libc::c_int as isize) = x8; - *out1.offset(8 as libc::c_int as isize) = x9; - *out1.offset(9 as libc::c_int as isize) = x10; -} -#[inline] -unsafe extern "C" fn fiat_25519_selectznz( - mut out1: *mut uint32_t, - mut arg1: fiat_25519_uint1, - mut arg2: *const uint32_t, - mut arg3: *const uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint32_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - fiat_25519_cmovznz_u32( - &mut x1, - arg1, - *arg2.offset(0 as libc::c_int as isize), - *arg3.offset(0 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x2, - arg1, - *arg2.offset(1 as libc::c_int as isize), - *arg3.offset(1 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x3, - arg1, - *arg2.offset(2 as libc::c_int as isize), - *arg3.offset(2 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x4, - arg1, - *arg2.offset(3 as libc::c_int as isize), - *arg3.offset(3 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x5, - arg1, - *arg2.offset(4 as libc::c_int as isize), - *arg3.offset(4 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x6, - arg1, - *arg2.offset(5 as libc::c_int as isize), - *arg3.offset(5 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x7, - arg1, - *arg2.offset(6 as libc::c_int as isize), - *arg3.offset(6 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x8, - arg1, - *arg2.offset(7 as libc::c_int as isize), - *arg3.offset(7 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x9, - arg1, - *arg2.offset(8 as libc::c_int as isize), - *arg3.offset(8 as libc::c_int as isize), - ); - fiat_25519_cmovznz_u32( - &mut x10, - arg1, - *arg2.offset(9 as libc::c_int as isize), - *arg3.offset(9 as libc::c_int as isize), - ); - *out1.offset(0 as libc::c_int as isize) = x1; - *out1.offset(1 as libc::c_int as isize) = x2; - *out1.offset(2 as libc::c_int as isize) = x3; - *out1.offset(3 as libc::c_int as isize) = x4; - *out1.offset(4 as libc::c_int as isize) = x5; - *out1.offset(5 as libc::c_int as isize) = x6; - *out1.offset(6 as libc::c_int as isize) = x7; - *out1.offset(7 as libc::c_int as isize) = x8; - *out1.offset(8 as libc::c_int as isize) = x9; - *out1.offset(9 as libc::c_int as isize) = x10; -} -#[inline] -unsafe extern "C" fn fiat_25519_to_bytes( - mut out1: *mut uint8_t, - mut arg1: *const uint32_t, -) { - let mut x1: uint32_t = 0; - let mut x2: fiat_25519_uint1 = 0; - let mut x3: uint32_t = 0; - let mut x4: fiat_25519_uint1 = 0; - let mut x5: uint32_t = 0; - let mut x6: fiat_25519_uint1 = 0; - let mut x7: uint32_t = 0; - let mut x8: fiat_25519_uint1 = 0; - let mut x9: uint32_t = 0; - let mut x10: fiat_25519_uint1 = 0; - let mut x11: uint32_t = 0; - let mut x12: fiat_25519_uint1 = 0; - let mut x13: uint32_t = 0; - let mut x14: fiat_25519_uint1 = 0; - let mut x15: uint32_t = 0; - let mut x16: fiat_25519_uint1 = 0; - let mut x17: uint32_t = 0; - let mut x18: fiat_25519_uint1 = 0; - let mut x19: uint32_t = 0; - let mut x20: fiat_25519_uint1 = 0; - let mut x21: uint32_t = 0; - let mut x22: uint32_t = 0; - let mut x23: fiat_25519_uint1 = 0; - let mut x24: uint32_t = 0; - let mut x25: fiat_25519_uint1 = 0; - let mut x26: uint32_t = 0; - let mut x27: fiat_25519_uint1 = 0; - let mut x28: uint32_t = 0; - let mut x29: fiat_25519_uint1 = 0; - let mut x30: uint32_t = 0; - let mut x31: fiat_25519_uint1 = 0; - let mut x32: uint32_t = 0; - let mut x33: fiat_25519_uint1 = 0; - let mut x34: uint32_t = 0; - let mut x35: fiat_25519_uint1 = 0; - let mut x36: uint32_t = 0; - let mut x37: fiat_25519_uint1 = 0; - let mut x38: uint32_t = 0; - let mut x39: fiat_25519_uint1 = 0; - let mut x40: uint32_t = 0; - let mut x41: fiat_25519_uint1 = 0; - let mut x42: uint32_t = 0; - let mut x43: uint32_t = 0; - let mut x44: uint32_t = 0; - let mut x45: uint32_t = 0; - let mut x46: uint32_t = 0; - let mut x47: uint32_t = 0; - let mut x48: uint32_t = 0; - let mut x49: uint32_t = 0; - let mut x50: uint8_t = 0; - let mut x51: uint32_t = 0; - let mut x52: uint8_t = 0; - let mut x53: uint32_t = 0; - let mut x54: uint8_t = 0; - let mut x55: uint8_t = 0; - let mut x56: uint32_t = 0; - let mut x57: uint8_t = 0; - let mut x58: uint32_t = 0; - let mut x59: uint8_t = 0; - let mut x60: uint32_t = 0; - let mut x61: uint8_t = 0; - let mut x62: uint8_t = 0; - let mut x63: uint32_t = 0; - let mut x64: uint8_t = 0; - let mut x65: uint32_t = 0; - let mut x66: uint8_t = 0; - let mut x67: uint32_t = 0; - let mut x68: uint8_t = 0; - let mut x69: uint8_t = 0; - let mut x70: uint32_t = 0; - let mut x71: uint8_t = 0; - let mut x72: uint32_t = 0; - let mut x73: uint8_t = 0; - let mut x74: uint32_t = 0; - let mut x75: uint8_t = 0; - let mut x76: uint8_t = 0; - let mut x77: uint32_t = 0; - let mut x78: uint8_t = 0; - let mut x79: uint32_t = 0; - let mut x80: uint8_t = 0; - let mut x81: uint32_t = 0; - let mut x82: uint8_t = 0; - let mut x83: uint8_t = 0; - let mut x84: uint8_t = 0; - let mut x85: uint32_t = 0; - let mut x86: uint8_t = 0; - let mut x87: uint32_t = 0; - let mut x88: uint8_t = 0; - let mut x89: fiat_25519_uint1 = 0; - let mut x90: uint32_t = 0; - let mut x91: uint8_t = 0; - let mut x92: uint32_t = 0; - let mut x93: uint8_t = 0; - let mut x94: uint32_t = 0; - let mut x95: uint8_t = 0; - let mut x96: uint8_t = 0; - let mut x97: uint32_t = 0; - let mut x98: uint8_t = 0; - let mut x99: uint32_t = 0; - let mut x100: uint8_t = 0; - let mut x101: uint32_t = 0; - let mut x102: uint8_t = 0; - let mut x103: uint8_t = 0; - let mut x104: uint32_t = 0; - let mut x105: uint8_t = 0; - let mut x106: uint32_t = 0; - let mut x107: uint8_t = 0; - let mut x108: uint32_t = 0; - let mut x109: uint8_t = 0; - let mut x110: uint8_t = 0; - let mut x111: uint32_t = 0; - let mut x112: uint8_t = 0; - let mut x113: uint32_t = 0; - let mut x114: uint8_t = 0; - let mut x115: uint32_t = 0; - let mut x116: uint8_t = 0; - let mut x117: uint8_t = 0; - fiat_25519_subborrowx_u26( - &mut x1, - &mut x2, - 0 as libc::c_int as fiat_25519_uint1, - *arg1.offset(0 as libc::c_int as isize), - 0x3ffffed as libc::c_uint, - ); - fiat_25519_subborrowx_u25( - &mut x3, - &mut x4, - x2, - *arg1.offset(1 as libc::c_int as isize), - 0x1ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u26( - &mut x5, - &mut x6, - x4, - *arg1.offset(2 as libc::c_int as isize), - 0x3ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u25( - &mut x7, - &mut x8, - x6, - *arg1.offset(3 as libc::c_int as isize), - 0x1ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u26( - &mut x9, - &mut x10, - x8, - *arg1.offset(4 as libc::c_int as isize), - 0x3ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u25( - &mut x11, - &mut x12, - x10, - *arg1.offset(5 as libc::c_int as isize), - 0x1ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u26( - &mut x13, - &mut x14, - x12, - *arg1.offset(6 as libc::c_int as isize), - 0x3ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u25( - &mut x15, - &mut x16, - x14, - *arg1.offset(7 as libc::c_int as isize), - 0x1ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u26( - &mut x17, - &mut x18, - x16, - *arg1.offset(8 as libc::c_int as isize), - 0x3ffffff as libc::c_uint, - ); - fiat_25519_subborrowx_u25( - &mut x19, - &mut x20, - x18, - *arg1.offset(9 as libc::c_int as isize), - 0x1ffffff as libc::c_uint, - ); - fiat_25519_cmovznz_u32( - &mut x21, - x20, - 0 as libc::c_int as uint32_t, - 0xffffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u26( - &mut x22, - &mut x23, - 0 as libc::c_int as fiat_25519_uint1, - x1, - x21 & 0x3ffffed as libc::c_uint, - ); - fiat_25519_addcarryx_u25( - &mut x24, - &mut x25, - x23, - x3, - x21 & 0x1ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u26( - &mut x26, - &mut x27, - x25, - x5, - x21 & 0x3ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u25( - &mut x28, - &mut x29, - x27, - x7, - x21 & 0x1ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u26( - &mut x30, - &mut x31, - x29, - x9, - x21 & 0x3ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u25( - &mut x32, - &mut x33, - x31, - x11, - x21 & 0x1ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u26( - &mut x34, - &mut x35, - x33, - x13, - x21 & 0x3ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u25( - &mut x36, - &mut x37, - x35, - x15, - x21 & 0x1ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u26( - &mut x38, - &mut x39, - x37, - x17, - x21 & 0x3ffffff as libc::c_uint, - ); - fiat_25519_addcarryx_u25( - &mut x40, - &mut x41, - x39, - x19, - x21 & 0x1ffffff as libc::c_uint, - ); - x42 = x40 << 6 as libc::c_int; - x43 = x38 << 4 as libc::c_int; - x44 = x36 << 3 as libc::c_int; - x45 = x34.wrapping_mul(0x2 as libc::c_int as uint32_t); - x46 = x30 << 6 as libc::c_int; - x47 = x28 << 5 as libc::c_int; - x48 = x26 << 3 as libc::c_int; - x49 = x24 << 2 as libc::c_int; - x50 = (x22 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x51 = x22 >> 8 as libc::c_int; - x52 = (x51 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x53 = x51 >> 8 as libc::c_int; - x54 = (x53 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x55 = (x53 >> 8 as libc::c_int) as uint8_t; - x56 = x49.wrapping_add(x55 as uint32_t); - x57 = (x56 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x58 = x56 >> 8 as libc::c_int; - x59 = (x58 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x60 = x58 >> 8 as libc::c_int; - x61 = (x60 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x62 = (x60 >> 8 as libc::c_int) as uint8_t; - x63 = x48.wrapping_add(x62 as uint32_t); - x64 = (x63 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x65 = x63 >> 8 as libc::c_int; - x66 = (x65 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x67 = x65 >> 8 as libc::c_int; - x68 = (x67 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x69 = (x67 >> 8 as libc::c_int) as uint8_t; - x70 = x47.wrapping_add(x69 as uint32_t); - x71 = (x70 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x72 = x70 >> 8 as libc::c_int; - x73 = (x72 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x74 = x72 >> 8 as libc::c_int; - x75 = (x74 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x76 = (x74 >> 8 as libc::c_int) as uint8_t; - x77 = x46.wrapping_add(x76 as uint32_t); - x78 = (x77 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x79 = x77 >> 8 as libc::c_int; - x80 = (x79 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x81 = x79 >> 8 as libc::c_int; - x82 = (x81 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x83 = (x81 >> 8 as libc::c_int) as uint8_t; - x84 = (x32 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x85 = x32 >> 8 as libc::c_int; - x86 = (x85 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x87 = x85 >> 8 as libc::c_int; - x88 = (x87 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x89 = (x87 >> 8 as libc::c_int) as fiat_25519_uint1; - x90 = x45.wrapping_add(x89 as uint32_t); - x91 = (x90 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x92 = x90 >> 8 as libc::c_int; - x93 = (x92 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x94 = x92 >> 8 as libc::c_int; - x95 = (x94 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x96 = (x94 >> 8 as libc::c_int) as uint8_t; - x97 = x44.wrapping_add(x96 as uint32_t); - x98 = (x97 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x99 = x97 >> 8 as libc::c_int; - x100 = (x99 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x101 = x99 >> 8 as libc::c_int; - x102 = (x101 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x103 = (x101 >> 8 as libc::c_int) as uint8_t; - x104 = x43.wrapping_add(x103 as uint32_t); - x105 = (x104 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x106 = x104 >> 8 as libc::c_int; - x107 = (x106 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x108 = x106 >> 8 as libc::c_int; - x109 = (x108 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x110 = (x108 >> 8 as libc::c_int) as uint8_t; - x111 = x42.wrapping_add(x110 as uint32_t); - x112 = (x111 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x113 = x111 >> 8 as libc::c_int; - x114 = (x113 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x115 = x113 >> 8 as libc::c_int; - x116 = (x115 & 0xff as libc::c_int as libc::c_uint) as uint8_t; - x117 = (x115 >> 8 as libc::c_int) as uint8_t; - *out1.offset(0 as libc::c_int as isize) = x50; - *out1.offset(1 as libc::c_int as isize) = x52; - *out1.offset(2 as libc::c_int as isize) = x54; - *out1.offset(3 as libc::c_int as isize) = x57; - *out1.offset(4 as libc::c_int as isize) = x59; - *out1.offset(5 as libc::c_int as isize) = x61; - *out1.offset(6 as libc::c_int as isize) = x64; - *out1.offset(7 as libc::c_int as isize) = x66; - *out1.offset(8 as libc::c_int as isize) = x68; - *out1.offset(9 as libc::c_int as isize) = x71; - *out1.offset(10 as libc::c_int as isize) = x73; - *out1.offset(11 as libc::c_int as isize) = x75; - *out1.offset(12 as libc::c_int as isize) = x78; - *out1.offset(13 as libc::c_int as isize) = x80; - *out1.offset(14 as libc::c_int as isize) = x82; - *out1.offset(15 as libc::c_int as isize) = x83; - *out1.offset(16 as libc::c_int as isize) = x84; - *out1.offset(17 as libc::c_int as isize) = x86; - *out1.offset(18 as libc::c_int as isize) = x88; - *out1.offset(19 as libc::c_int as isize) = x91; - *out1.offset(20 as libc::c_int as isize) = x93; - *out1.offset(21 as libc::c_int as isize) = x95; - *out1.offset(22 as libc::c_int as isize) = x98; - *out1.offset(23 as libc::c_int as isize) = x100; - *out1.offset(24 as libc::c_int as isize) = x102; - *out1.offset(25 as libc::c_int as isize) = x105; - *out1.offset(26 as libc::c_int as isize) = x107; - *out1.offset(27 as libc::c_int as isize) = x109; - *out1.offset(28 as libc::c_int as isize) = x112; - *out1.offset(29 as libc::c_int as isize) = x114; - *out1.offset(30 as libc::c_int as isize) = x116; - *out1.offset(31 as libc::c_int as isize) = x117; -} -#[inline] -unsafe extern "C" fn fiat_25519_from_bytes( - mut out1: *mut uint32_t, - mut arg1: *const uint8_t, -) { - let mut x1: uint32_t = 0; - let mut x2: uint32_t = 0; - let mut x3: uint32_t = 0; - let mut x4: uint32_t = 0; - let mut x5: uint32_t = 0; - let mut x6: uint32_t = 0; - let mut x7: uint32_t = 0; - let mut x8: uint32_t = 0; - let mut x9: uint32_t = 0; - let mut x10: uint32_t = 0; - let mut x11: uint32_t = 0; - let mut x12: uint32_t = 0; - let mut x13: uint32_t = 0; - let mut x14: uint32_t = 0; - let mut x15: uint32_t = 0; - let mut x16: uint8_t = 0; - let mut x17: uint32_t = 0; - let mut x18: uint32_t = 0; - let mut x19: uint32_t = 0; - let mut x20: uint32_t = 0; - let mut x21: uint32_t = 0; - let mut x22: uint32_t = 0; - let mut x23: uint32_t = 0; - let mut x24: uint32_t = 0; - let mut x25: uint32_t = 0; - let mut x26: uint32_t = 0; - let mut x27: uint32_t = 0; - let mut x28: uint32_t = 0; - let mut x29: uint32_t = 0; - let mut x30: uint32_t = 0; - let mut x31: uint32_t = 0; - let mut x32: uint8_t = 0; - let mut x33: uint32_t = 0; - let mut x34: uint32_t = 0; - let mut x35: uint32_t = 0; - let mut x36: uint32_t = 0; - let mut x37: uint8_t = 0; - let mut x38: uint32_t = 0; - let mut x39: uint32_t = 0; - let mut x40: uint32_t = 0; - let mut x41: uint32_t = 0; - let mut x42: uint8_t = 0; - let mut x43: uint32_t = 0; - let mut x44: uint32_t = 0; - let mut x45: uint32_t = 0; - let mut x46: uint32_t = 0; - let mut x47: uint8_t = 0; - let mut x48: uint32_t = 0; - let mut x49: uint32_t = 0; - let mut x50: uint32_t = 0; - let mut x51: uint32_t = 0; - let mut x52: uint8_t = 0; - let mut x53: uint32_t = 0; - let mut x54: uint32_t = 0; - let mut x55: uint32_t = 0; - let mut x56: uint32_t = 0; - let mut x57: uint32_t = 0; - let mut x58: uint32_t = 0; - let mut x59: uint32_t = 0; - let mut x60: uint8_t = 0; - let mut x61: uint32_t = 0; - let mut x62: uint32_t = 0; - let mut x63: uint32_t = 0; - let mut x64: uint32_t = 0; - let mut x65: uint8_t = 0; - let mut x66: uint32_t = 0; - let mut x67: uint32_t = 0; - let mut x68: uint32_t = 0; - let mut x69: uint32_t = 0; - let mut x70: uint8_t = 0; - let mut x71: uint32_t = 0; - let mut x72: uint32_t = 0; - let mut x73: uint32_t = 0; - let mut x74: uint32_t = 0; - let mut x75: uint8_t = 0; - let mut x76: uint32_t = 0; - let mut x77: uint32_t = 0; - let mut x78: uint32_t = 0; - x1 = (*arg1.offset(31 as libc::c_int as isize) as uint32_t) << 18 as libc::c_int; - x2 = (*arg1.offset(30 as libc::c_int as isize) as uint32_t) << 10 as libc::c_int; - x3 = (*arg1.offset(29 as libc::c_int as isize) as uint32_t) << 2 as libc::c_int; - x4 = (*arg1.offset(28 as libc::c_int as isize) as uint32_t) << 20 as libc::c_int; - x5 = (*arg1.offset(27 as libc::c_int as isize) as uint32_t) << 12 as libc::c_int; - x6 = (*arg1.offset(26 as libc::c_int as isize) as uint32_t) << 4 as libc::c_int; - x7 = (*arg1.offset(25 as libc::c_int as isize) as uint32_t) << 21 as libc::c_int; - x8 = (*arg1.offset(24 as libc::c_int as isize) as uint32_t) << 13 as libc::c_int; - x9 = (*arg1.offset(23 as libc::c_int as isize) as uint32_t) << 5 as libc::c_int; - x10 = (*arg1.offset(22 as libc::c_int as isize) as uint32_t) << 23 as libc::c_int; - x11 = (*arg1.offset(21 as libc::c_int as isize) as uint32_t) << 15 as libc::c_int; - x12 = (*arg1.offset(20 as libc::c_int as isize) as uint32_t) << 7 as libc::c_int; - x13 = (*arg1.offset(19 as libc::c_int as isize) as uint32_t) << 24 as libc::c_int; - x14 = (*arg1.offset(18 as libc::c_int as isize) as uint32_t) << 16 as libc::c_int; - x15 = (*arg1.offset(17 as libc::c_int as isize) as uint32_t) << 8 as libc::c_int; - x16 = *arg1.offset(16 as libc::c_int as isize); - x17 = (*arg1.offset(15 as libc::c_int as isize) as uint32_t) << 18 as libc::c_int; - x18 = (*arg1.offset(14 as libc::c_int as isize) as uint32_t) << 10 as libc::c_int; - x19 = (*arg1.offset(13 as libc::c_int as isize) as uint32_t) << 2 as libc::c_int; - x20 = (*arg1.offset(12 as libc::c_int as isize) as uint32_t) << 19 as libc::c_int; - x21 = (*arg1.offset(11 as libc::c_int as isize) as uint32_t) << 11 as libc::c_int; - x22 = (*arg1.offset(10 as libc::c_int as isize) as uint32_t) << 3 as libc::c_int; - x23 = (*arg1.offset(9 as libc::c_int as isize) as uint32_t) << 21 as libc::c_int; - x24 = (*arg1.offset(8 as libc::c_int as isize) as uint32_t) << 13 as libc::c_int; - x25 = (*arg1.offset(7 as libc::c_int as isize) as uint32_t) << 5 as libc::c_int; - x26 = (*arg1.offset(6 as libc::c_int as isize) as uint32_t) << 22 as libc::c_int; - x27 = (*arg1.offset(5 as libc::c_int as isize) as uint32_t) << 14 as libc::c_int; - x28 = (*arg1.offset(4 as libc::c_int as isize) as uint32_t) << 6 as libc::c_int; - x29 = (*arg1.offset(3 as libc::c_int as isize) as uint32_t) << 24 as libc::c_int; - x30 = (*arg1.offset(2 as libc::c_int as isize) as uint32_t) << 16 as libc::c_int; - x31 = (*arg1.offset(1 as libc::c_int as isize) as uint32_t) << 8 as libc::c_int; - x32 = *arg1.offset(0 as libc::c_int as isize); - x33 = x31.wrapping_add(x32 as uint32_t); - x34 = x30.wrapping_add(x33); - x35 = x29.wrapping_add(x34); - x36 = x35 & 0x3ffffff as libc::c_uint; - x37 = (x35 >> 26 as libc::c_int) as uint8_t; - x38 = x28.wrapping_add(x37 as uint32_t); - x39 = x27.wrapping_add(x38); - x40 = x26.wrapping_add(x39); - x41 = x40 & 0x1ffffff as libc::c_uint; - x42 = (x40 >> 25 as libc::c_int) as uint8_t; - x43 = x25.wrapping_add(x42 as uint32_t); - x44 = x24.wrapping_add(x43); - x45 = x23.wrapping_add(x44); - x46 = x45 & 0x3ffffff as libc::c_uint; - x47 = (x45 >> 26 as libc::c_int) as uint8_t; - x48 = x22.wrapping_add(x47 as uint32_t); - x49 = x21.wrapping_add(x48); - x50 = x20.wrapping_add(x49); - x51 = x50 & 0x1ffffff as libc::c_uint; - x52 = (x50 >> 25 as libc::c_int) as uint8_t; - x53 = x19.wrapping_add(x52 as uint32_t); - x54 = x18.wrapping_add(x53); - x55 = x17.wrapping_add(x54); - x56 = x15.wrapping_add(x16 as uint32_t); - x57 = x14.wrapping_add(x56); - x58 = x13.wrapping_add(x57); - x59 = x58 & 0x1ffffff as libc::c_uint; - x60 = (x58 >> 25 as libc::c_int) as uint8_t; - x61 = x12.wrapping_add(x60 as uint32_t); - x62 = x11.wrapping_add(x61); - x63 = x10.wrapping_add(x62); - x64 = x63 & 0x3ffffff as libc::c_uint; - x65 = (x63 >> 26 as libc::c_int) as uint8_t; - x66 = x9.wrapping_add(x65 as uint32_t); - x67 = x8.wrapping_add(x66); - x68 = x7.wrapping_add(x67); - x69 = x68 & 0x1ffffff as libc::c_uint; - x70 = (x68 >> 25 as libc::c_int) as uint8_t; - x71 = x6.wrapping_add(x70 as uint32_t); - x72 = x5.wrapping_add(x71); - x73 = x4.wrapping_add(x72); - x74 = x73 & 0x3ffffff as libc::c_uint; - x75 = (x73 >> 26 as libc::c_int) as uint8_t; - x76 = x3.wrapping_add(x75 as uint32_t); - x77 = x2.wrapping_add(x76); - x78 = x1.wrapping_add(x77); - *out1.offset(0 as libc::c_int as isize) = x36; - *out1.offset(1 as libc::c_int as isize) = x41; - *out1.offset(2 as libc::c_int as isize) = x46; - *out1.offset(3 as libc::c_int as isize) = x51; - *out1.offset(4 as libc::c_int as isize) = x55; - *out1.offset(5 as libc::c_int as isize) = x59; - *out1.offset(6 as libc::c_int as isize) = x64; - *out1.offset(7 as libc::c_int as isize) = x69; - *out1.offset(8 as libc::c_int as isize) = x74; - *out1.offset(9 as libc::c_int as isize) = x78; -} -#[inline] -unsafe extern "C" fn fiat_25519_carry_scmul_121666( - mut out1: *mut uint32_t, - mut arg1: *const uint32_t, -) { - let mut x1: uint64_t = 0; - let mut x2: uint64_t = 0; - let mut x3: uint64_t = 0; - let mut x4: uint64_t = 0; - let mut x5: uint64_t = 0; - let mut x6: uint64_t = 0; - let mut x7: uint64_t = 0; - let mut x8: uint64_t = 0; - let mut x9: uint64_t = 0; - let mut x10: uint64_t = 0; - let mut x11: uint32_t = 0; - let mut x12: uint32_t = 0; - let mut x13: uint64_t = 0; - let mut x14: uint32_t = 0; - let mut x15: uint32_t = 0; - let mut x16: uint64_t = 0; - let mut x17: uint32_t = 0; - let mut x18: uint32_t = 0; - let mut x19: uint64_t = 0; - let mut x20: uint32_t = 0; - let mut x21: uint32_t = 0; - let mut x22: uint64_t = 0; - let mut x23: uint32_t = 0; - let mut x24: uint32_t = 0; - let mut x25: uint64_t = 0; - let mut x26: uint32_t = 0; - let mut x27: uint32_t = 0; - let mut x28: uint64_t = 0; - let mut x29: uint32_t = 0; - let mut x30: uint32_t = 0; - let mut x31: uint64_t = 0; - let mut x32: uint32_t = 0; - let mut x33: uint32_t = 0; - let mut x34: uint64_t = 0; - let mut x35: uint32_t = 0; - let mut x36: uint32_t = 0; - let mut x37: uint64_t = 0; - let mut x38: uint32_t = 0; - let mut x39: uint32_t = 0; - let mut x40: uint32_t = 0; - let mut x41: uint32_t = 0; - let mut x42: fiat_25519_uint1 = 0; - let mut x43: uint32_t = 0; - let mut x44: uint32_t = 0; - let mut x45: fiat_25519_uint1 = 0; - let mut x46: uint32_t = 0; - let mut x47: uint32_t = 0; - x1 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(9 as libc::c_int as isize) as libc::c_ulonglong); - x2 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(8 as libc::c_int as isize) as libc::c_ulonglong); - x3 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(7 as libc::c_int as isize) as libc::c_ulonglong); - x4 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(6 as libc::c_int as isize) as libc::c_ulonglong); - x5 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(5 as libc::c_int as isize) as libc::c_ulonglong); - x6 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(4 as libc::c_int as isize) as libc::c_ulonglong); - x7 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(3 as libc::c_int as isize) as libc::c_ulonglong); - x8 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(2 as libc::c_int as isize) as libc::c_ulonglong); - x9 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(1 as libc::c_int as isize) as libc::c_ulonglong); - x10 = (0x1db42 as libc::c_uint as uint64_t) - .wrapping_mul(*arg1.offset(0 as libc::c_int as isize) as libc::c_ulonglong); - x11 = (x10 >> 26 as libc::c_int) as uint32_t; - x12 = (x10 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x13 = (x11 as libc::c_ulonglong).wrapping_add(x9); - x14 = (x13 >> 25 as libc::c_int) as uint32_t; - x15 = (x13 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x16 = (x14 as libc::c_ulonglong).wrapping_add(x8); - x17 = (x16 >> 26 as libc::c_int) as uint32_t; - x18 = (x16 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x19 = (x17 as libc::c_ulonglong).wrapping_add(x7); - x20 = (x19 >> 25 as libc::c_int) as uint32_t; - x21 = (x19 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x22 = (x20 as libc::c_ulonglong).wrapping_add(x6); - x23 = (x22 >> 26 as libc::c_int) as uint32_t; - x24 = (x22 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x25 = (x23 as libc::c_ulonglong).wrapping_add(x5); - x26 = (x25 >> 25 as libc::c_int) as uint32_t; - x27 = (x25 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x28 = (x26 as libc::c_ulonglong).wrapping_add(x4); - x29 = (x28 >> 26 as libc::c_int) as uint32_t; - x30 = (x28 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x31 = (x29 as libc::c_ulonglong).wrapping_add(x3); - x32 = (x31 >> 25 as libc::c_int) as uint32_t; - x33 = (x31 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x34 = (x32 as libc::c_ulonglong).wrapping_add(x2); - x35 = (x34 >> 26 as libc::c_int) as uint32_t; - x36 = (x34 & 0x3ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x37 = (x35 as libc::c_ulonglong).wrapping_add(x1); - x38 = (x37 >> 25 as libc::c_int) as uint32_t; - x39 = (x37 & 0x1ffffff as libc::c_uint as libc::c_ulonglong) as uint32_t; - x40 = x38.wrapping_mul(0x13 as libc::c_int as libc::c_uint); - x41 = x12.wrapping_add(x40); - x42 = (x41 >> 26 as libc::c_int) as fiat_25519_uint1; - x43 = x41 & 0x3ffffff as libc::c_uint; - x44 = (x42 as libc::c_uint).wrapping_add(x15); - x45 = (x44 >> 25 as libc::c_int) as fiat_25519_uint1; - x46 = x44 & 0x1ffffff as libc::c_uint; - x47 = (x45 as libc::c_uint).wrapping_add(x18); - *out1.offset(0 as libc::c_int as isize) = x43; - *out1.offset(1 as libc::c_int as isize) = x46; - *out1.offset(2 as libc::c_int as isize) = x47; - *out1.offset(3 as libc::c_int as isize) = x21; - *out1.offset(4 as libc::c_int as isize) = x24; - *out1.offset(5 as libc::c_int as isize) = x27; - *out1.offset(6 as libc::c_int as isize) = x30; - *out1.offset(7 as libc::c_int as isize) = x33; - *out1.offset(8 as libc::c_int as isize) = x36; - *out1.offset(9 as libc::c_int as isize) = x39; -} -unsafe extern "C" fn load_3(mut in_0: *const uint8_t) -> uint64_t { - let mut result: uint64_t = 0; - result = *in_0.offset(0 as libc::c_int as isize) as uint64_t; - result |= (*in_0.offset(1 as libc::c_int as isize) as uint64_t) << 8 as libc::c_int; - result |= (*in_0.offset(2 as libc::c_int as isize) as uint64_t) << 16 as libc::c_int; - return result; -} -unsafe extern "C" fn load_4(mut in_0: *const uint8_t) -> uint64_t { - let mut result: uint64_t = 0; - result = *in_0.offset(0 as libc::c_int as isize) as uint64_t; - result |= (*in_0.offset(1 as libc::c_int as isize) as uint64_t) << 8 as libc::c_int; - result |= (*in_0.offset(2 as libc::c_int as isize) as uint64_t) << 16 as libc::c_int; - result |= (*in_0.offset(3 as libc::c_int as isize) as uint64_t) << 24 as libc::c_int; - return result; -} -unsafe extern "C" fn fe_frombytes_strict(mut h: *mut fe, mut s: *const uint8_t) { - fiat_25519_from_bytes(((*h).v).as_mut_ptr(), s); - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } -} -unsafe extern "C" fn fe_frombytes(mut h: *mut fe, mut s: *const uint8_t) { - let mut s_copy: [uint8_t; 32] = [0; 32]; - OPENSSL_memcpy( - s_copy.as_mut_ptr() as *mut libc::c_void, - s as *const libc::c_void, - 32 as libc::c_int as size_t, - ); - s_copy[31 as libc::c_int - as usize] = (s_copy[31 as libc::c_int as usize] as libc::c_int - & 0x7f as libc::c_int) as uint8_t; - fe_frombytes_strict(h, s_copy.as_mut_ptr() as *const uint8_t); -} -unsafe extern "C" fn fe_tobytes(mut s: *mut uint8_t, mut f: *const fe) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - fiat_25519_to_bytes(s, ((*f).v).as_ptr()); -} -unsafe extern "C" fn fe_0(mut h: *mut fe) { - OPENSSL_memset( - h as *mut libc::c_void, - 0 as libc::c_int, - ::std::mem::size_of::() as libc::c_ulong, - ); -} -unsafe extern "C" fn fe_loose_0(mut h: *mut fe_loose) { - OPENSSL_memset( - h as *mut libc::c_void, - 0 as libc::c_int, - ::std::mem::size_of::() as libc::c_ulong, - ); -} -unsafe extern "C" fn fe_1(mut h: *mut fe) { - OPENSSL_memset( - h as *mut libc::c_void, - 0 as libc::c_int, - ::std::mem::size_of::() as libc::c_ulong, - ); - (*h).v[0 as libc::c_int as usize] = 1 as libc::c_int as fe_limb_t; -} -unsafe extern "C" fn fe_loose_1(mut h: *mut fe_loose) { - OPENSSL_memset( - h as *mut libc::c_void, - 0 as libc::c_int, - ::std::mem::size_of::() as libc::c_ulong, - ); - (*h).v[0 as libc::c_int as usize] = 1 as libc::c_int as fe_limb_t; -} -unsafe extern "C" fn fe_add(mut h: *mut fe_loose, mut f: *const fe, mut g: *const fe) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } - fiat_25519_add(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); - let mut _assert_fe_i_1: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_1 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_1 = _assert_fe_i_1.wrapping_add(1); - } -} -unsafe extern "C" fn fe_sub(mut h: *mut fe_loose, mut f: *const fe, mut g: *const fe) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } - fiat_25519_sub(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); - let mut _assert_fe_i_1: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_1 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_1 = _assert_fe_i_1.wrapping_add(1); - } -} -unsafe extern "C" fn fe_carry(mut h: *mut fe, mut f: *const fe_loose) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - fiat_25519_carry(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } -} -unsafe extern "C" fn fe_mul_impl( - mut out: *mut fe_limb_t, - mut in1: *const fe_limb_t, - mut in2: *const fe_limb_t, -) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } - fiat_25519_carry_mul(out, in1, in2); - let mut _assert_fe_i_1: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_1 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_1 = _assert_fe_i_1.wrapping_add(1); - } -} -unsafe extern "C" fn fe_mul_ltt( - mut h: *mut fe_loose, - mut f: *const fe, - mut g: *const fe, -) { - fe_mul_impl(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); -} -unsafe extern "C" fn fe_mul_llt( - mut h: *mut fe_loose, - mut f: *const fe_loose, - mut g: *const fe, -) { - fe_mul_impl(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); -} -unsafe extern "C" fn fe_mul_ttt(mut h: *mut fe, mut f: *const fe, mut g: *const fe) { - fe_mul_impl(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); -} -unsafe extern "C" fn fe_mul_tlt( - mut h: *mut fe, - mut f: *const fe_loose, - mut g: *const fe, -) { - fe_mul_impl(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); -} -unsafe extern "C" fn fe_mul_ttl( - mut h: *mut fe, - mut f: *const fe, - mut g: *const fe_loose, -) { - fe_mul_impl(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); -} -unsafe extern "C" fn fe_mul_tll( - mut h: *mut fe, - mut f: *const fe_loose, - mut g: *const fe_loose, -) { - fe_mul_impl(((*h).v).as_mut_ptr(), ((*f).v).as_ptr(), ((*g).v).as_ptr()); -} -unsafe extern "C" fn fe_sq_tl(mut h: *mut fe, mut f: *const fe_loose) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - fiat_25519_carry_square(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } -} -unsafe extern "C" fn fe_sq_tt(mut h: *mut fe, mut f: *const fe) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - fiat_25519_carry_square(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } -} -unsafe extern "C" fn fe_cswap(mut f: *mut fe, mut g: *mut fe, mut b: fe_limb_t) { - b = (0 as libc::c_int as libc::c_uint).wrapping_sub(b); - let mut i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while i < 10 as libc::c_int as libc::c_uint { - let mut x: fe_limb_t = (*f).v[i as usize] ^ (*g).v[i as usize]; - x &= b; - let ref mut fresh0 = (*f).v[i as usize]; - *fresh0 ^= x; - let ref mut fresh1 = (*g).v[i as usize]; - *fresh1 ^= x; - i = i.wrapping_add(1); - } -} -unsafe extern "C" fn fe_mul121666(mut h: *mut fe, mut f: *const fe_loose) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - fiat_25519_carry_scmul_121666(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } -} -unsafe extern "C" fn fe_neg(mut h: *mut fe_loose, mut f: *const fe) { - let mut _assert_fe_i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i < 10 as libc::c_int as libc::c_uint { - _assert_fe_i = _assert_fe_i.wrapping_add(1); - } - fiat_25519_opp(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); - let mut _assert_fe_i_0: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while _assert_fe_i_0 < 10 as libc::c_int as libc::c_uint { - _assert_fe_i_0 = _assert_fe_i_0.wrapping_add(1); - } -} -unsafe extern "C" fn fe_cmov( - mut f: *mut fe_loose, - mut g: *const fe_loose, - mut b: fe_limb_t, -) { - b = (0 as libc::c_int as libc::c_uint).wrapping_sub(b); - let mut i: libc::c_uint = 0 as libc::c_int as libc::c_uint; - while i < 10 as libc::c_int as libc::c_uint { - let mut x: fe_limb_t = (*f).v[i as usize] ^ (*g).v[i as usize]; - x &= b; - let ref mut fresh2 = (*f).v[i as usize]; - *fresh2 ^= x; - i = i.wrapping_add(1); - } -} -unsafe extern "C" fn fe_copy(mut h: *mut fe, mut f: *const fe) { - fe_limbs_copy(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); -} -unsafe extern "C" fn fe_copy_lt(mut h: *mut fe_loose, mut f: *const fe) { - fe_limbs_copy(((*h).v).as_mut_ptr(), ((*f).v).as_ptr()); -} -unsafe extern "C" fn fe_loose_invert(mut out: *mut fe, mut z: *const fe_loose) { - let mut t0: fe = fe { v: [0; 10] }; - let mut t1: fe = fe { v: [0; 10] }; - let mut t2: fe = fe { v: [0; 10] }; - let mut t3: fe = fe { v: [0; 10] }; - let mut i: libc::c_int = 0; - fe_sq_tl(&mut t0, z); - fe_sq_tt(&mut t1, &mut t0); - i = 1 as libc::c_int; - while i < 2 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_tlt(&mut t1, z, &mut t1); - fe_mul_ttt(&mut t0, &mut t0, &mut t1); - fe_sq_tt(&mut t2, &mut t0); - fe_mul_ttt(&mut t1, &mut t1, &mut t2); - fe_sq_tt(&mut t2, &mut t1); - i = 1 as libc::c_int; - while i < 5 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t2, &mut t1); - fe_sq_tt(&mut t2, &mut t1); - i = 1 as libc::c_int; - while i < 10 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t2, &mut t2, &mut t1); - fe_sq_tt(&mut t3, &mut t2); - i = 1 as libc::c_int; - while i < 20 as libc::c_int { - fe_sq_tt(&mut t3, &mut t3); - i += 1; - } - fe_mul_ttt(&mut t2, &mut t3, &mut t2); - fe_sq_tt(&mut t2, &mut t2); - i = 1 as libc::c_int; - while i < 10 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t2, &mut t1); - fe_sq_tt(&mut t2, &mut t1); - i = 1 as libc::c_int; - while i < 50 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t2, &mut t2, &mut t1); - fe_sq_tt(&mut t3, &mut t2); - i = 1 as libc::c_int; - while i < 100 as libc::c_int { - fe_sq_tt(&mut t3, &mut t3); - i += 1; - } - fe_mul_ttt(&mut t2, &mut t3, &mut t2); - fe_sq_tt(&mut t2, &mut t2); - i = 1 as libc::c_int; - while i < 50 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t2, &mut t1); - fe_sq_tt(&mut t1, &mut t1); - i = 1 as libc::c_int; - while i < 5 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(out, &mut t1, &mut t0); -} -unsafe extern "C" fn fe_invert(mut out: *mut fe, mut z: *const fe) { - let mut l: fe_loose = fe_loose { v: [0; 10] }; - fe_copy_lt(&mut l, z); - fe_loose_invert(out, &mut l); -} -unsafe extern "C" fn fe_isnonzero(mut f: *const fe_loose) -> libc::c_int { - let mut tight: fe = fe { v: [0; 10] }; - fe_carry(&mut tight, f); - let mut s: [uint8_t; 32] = [0; 32]; - fe_tobytes(s.as_mut_ptr(), &mut tight); - static mut zero: [uint8_t; 32] = [ - 0 as libc::c_int as uint8_t, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ]; - return (CRYPTO_memcmp( - s.as_mut_ptr() as *const libc::c_void, - zero.as_ptr() as *const libc::c_void, - ::std::mem::size_of::<[uint8_t; 32]>() as libc::c_ulong, - ) != 0 as libc::c_int) as libc::c_int; -} -unsafe extern "C" fn fe_isnegative(mut f: *const fe) -> libc::c_int { - let mut s: [uint8_t; 32] = [0; 32]; - fe_tobytes(s.as_mut_ptr(), f); - return s[0 as libc::c_int as usize] as libc::c_int & 1 as libc::c_int; -} -unsafe extern "C" fn fe_sq2_tt(mut h: *mut fe, mut f: *const fe) { - fe_sq_tt(h, f); - let mut tmp: fe_loose = fe_loose { v: [0; 10] }; - fe_add(&mut tmp, h, h); - fe_carry(h, &mut tmp); -} -unsafe extern "C" fn fe_pow22523(mut out: *mut fe, mut z: *const fe) { - let mut t0: fe = fe { v: [0; 10] }; - let mut t1: fe = fe { v: [0; 10] }; - let mut t2: fe = fe { v: [0; 10] }; - let mut i: libc::c_int = 0; - fe_sq_tt(&mut t0, z); - fe_sq_tt(&mut t1, &mut t0); - i = 1 as libc::c_int; - while i < 2 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(&mut t1, z, &mut t1); - fe_mul_ttt(&mut t0, &mut t0, &mut t1); - fe_sq_tt(&mut t0, &mut t0); - fe_mul_ttt(&mut t0, &mut t1, &mut t0); - fe_sq_tt(&mut t1, &mut t0); - i = 1 as libc::c_int; - while i < 5 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(&mut t0, &mut t1, &mut t0); - fe_sq_tt(&mut t1, &mut t0); - i = 1 as libc::c_int; - while i < 10 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t1, &mut t0); - fe_sq_tt(&mut t2, &mut t1); - i = 1 as libc::c_int; - while i < 20 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t2, &mut t1); - fe_sq_tt(&mut t1, &mut t1); - i = 1 as libc::c_int; - while i < 10 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(&mut t0, &mut t1, &mut t0); - fe_sq_tt(&mut t1, &mut t0); - i = 1 as libc::c_int; - while i < 50 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t1, &mut t0); - fe_sq_tt(&mut t2, &mut t1); - i = 1 as libc::c_int; - while i < 100 as libc::c_int { - fe_sq_tt(&mut t2, &mut t2); - i += 1; - } - fe_mul_ttt(&mut t1, &mut t2, &mut t1); - fe_sq_tt(&mut t1, &mut t1); - i = 1 as libc::c_int; - while i < 50 as libc::c_int { - fe_sq_tt(&mut t1, &mut t1); - i += 1; - } - fe_mul_ttt(&mut t0, &mut t1, &mut t0); - fe_sq_tt(&mut t0, &mut t0); - i = 1 as libc::c_int; - while i < 2 as libc::c_int { - fe_sq_tt(&mut t0, &mut t0); - i += 1; - } - fe_mul_ttt(out, &mut t0, z); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_ge_frombytes_vartime( - mut h: *mut ge_p3, - mut s: *const uint8_t, -) -> libc::c_int { - let mut u: fe = fe { v: [0; 10] }; - let mut v: fe_loose = fe_loose { v: [0; 10] }; - let mut w: fe = fe { v: [0; 10] }; - let mut vxx: fe = fe { v: [0; 10] }; - let mut check: fe_loose = fe_loose { v: [0; 10] }; - fe_frombytes(&mut (*h).Y, s); - fe_1(&mut (*h).Z); - fe_sq_tt(&mut w, &mut (*h).Y); - fe_mul_ttt(&mut vxx, &mut w, &d); - fe_sub(&mut v, &mut w, &mut (*h).Z); - fe_carry(&mut u, &mut v); - fe_add(&mut v, &mut vxx, &mut (*h).Z); - fe_mul_ttl(&mut w, &mut u, &mut v); - fe_pow22523(&mut (*h).X, &mut w); - fe_mul_ttt(&mut (*h).X, &mut (*h).X, &mut u); - fe_sq_tt(&mut vxx, &mut (*h).X); - fe_mul_ttl(&mut vxx, &mut vxx, &mut v); - fe_sub(&mut check, &mut vxx, &mut u); - if fe_isnonzero(&mut check) != 0 { - fe_add(&mut check, &mut vxx, &mut u); - if fe_isnonzero(&mut check) != 0 { - return 0 as libc::c_int; - } - fe_mul_ttt(&mut (*h).X, &mut (*h).X, &sqrtm1); - } - if fe_isnegative(&mut (*h).X) - != *s.offset(31 as libc::c_int as isize) as libc::c_int >> 7 as libc::c_int - { - let mut t: fe_loose = fe_loose { v: [0; 10] }; - fe_neg(&mut t, &mut (*h).X); - fe_carry(&mut (*h).X, &mut t); - } - fe_mul_ttt(&mut (*h).T, &mut (*h).X, &mut (*h).Y); - return 1 as libc::c_int; -} -unsafe extern "C" fn ge_p2_0(mut h: *mut ge_p2) { - fe_0(&mut (*h).X); - fe_1(&mut (*h).Y); - fe_1(&mut (*h).Z); -} -unsafe extern "C" fn ge_p3_0(mut h: *mut ge_p3) { - fe_0(&mut (*h).X); - fe_1(&mut (*h).Y); - fe_1(&mut (*h).Z); - fe_0(&mut (*h).T); -} -unsafe extern "C" fn ge_precomp_0(mut h: *mut ge_precomp) { - fe_loose_1(&mut (*h).yplusx); - fe_loose_1(&mut (*h).yminusx); - fe_loose_0(&mut (*h).xy2d); -} -unsafe extern "C" fn ge_p3_to_p2(mut r: *mut ge_p2, mut p: *const ge_p3) { - fe_copy(&mut (*r).X, &(*p).X); - fe_copy(&mut (*r).Y, &(*p).Y); - fe_copy(&mut (*r).Z, &(*p).Z); -} -unsafe extern "C" fn x25519_ge_p3_to_cached(mut r: *mut ge_cached, mut p: *const ge_p3) { - fe_add(&mut (*r).YplusX, &(*p).Y, &(*p).X); - fe_sub(&mut (*r).YminusX, &(*p).Y, &(*p).X); - fe_copy_lt(&mut (*r).Z, &(*p).Z); - fe_mul_ltt(&mut (*r).T2d, &(*p).T, &d2); -} -unsafe extern "C" fn x25519_ge_p1p1_to_p2(mut r: *mut ge_p2, mut p: *const ge_p1p1) { - fe_mul_tll(&mut (*r).X, &(*p).X, &(*p).T); - fe_mul_tll(&mut (*r).Y, &(*p).Y, &(*p).Z); - fe_mul_tll(&mut (*r).Z, &(*p).Z, &(*p).T); -} -unsafe extern "C" fn x25519_ge_p1p1_to_p3(mut r: *mut ge_p3, mut p: *const ge_p1p1) { - fe_mul_tll(&mut (*r).X, &(*p).X, &(*p).T); - fe_mul_tll(&mut (*r).Y, &(*p).Y, &(*p).Z); - fe_mul_tll(&mut (*r).Z, &(*p).Z, &(*p).T); - fe_mul_tll(&mut (*r).T, &(*p).X, &(*p).Y); -} -unsafe extern "C" fn ge_p2_dbl(mut r: *mut ge_p1p1, mut p: *const ge_p2) { - let mut trX: fe = fe { v: [0; 10] }; - let mut trZ: fe = fe { v: [0; 10] }; - let mut trT: fe = fe { v: [0; 10] }; - let mut t0: fe = fe { v: [0; 10] }; - fe_sq_tt(&mut trX, &(*p).X); - fe_sq_tt(&mut trZ, &(*p).Y); - fe_sq2_tt(&mut trT, &(*p).Z); - fe_add(&mut (*r).Y, &(*p).X, &(*p).Y); - fe_sq_tl(&mut t0, &mut (*r).Y); - fe_add(&mut (*r).Y, &mut trZ, &mut trX); - fe_sub(&mut (*r).Z, &mut trZ, &mut trX); - fe_carry(&mut trZ, &mut (*r).Y); - fe_sub(&mut (*r).X, &mut t0, &mut trZ); - fe_carry(&mut trZ, &mut (*r).Z); - fe_sub(&mut (*r).T, &mut trT, &mut trZ); -} -unsafe extern "C" fn ge_p3_dbl(mut r: *mut ge_p1p1, mut p: *const ge_p3) { - let mut q: ge_p2 = ge_p2 { - X: fe { v: [0; 10] }, - Y: fe { v: [0; 10] }, - Z: fe { v: [0; 10] }, - }; - ge_p3_to_p2(&mut q, p); - ge_p2_dbl(r, &mut q); -} -unsafe extern "C" fn ge_madd( - mut r: *mut ge_p1p1, - mut p: *const ge_p3, - mut q: *const ge_precomp, -) { - let mut trY: fe = fe { v: [0; 10] }; - let mut trZ: fe = fe { v: [0; 10] }; - let mut trT: fe = fe { v: [0; 10] }; - fe_add(&mut (*r).X, &(*p).Y, &(*p).X); - fe_sub(&mut (*r).Y, &(*p).Y, &(*p).X); - fe_mul_tll(&mut trZ, &mut (*r).X, &(*q).yplusx); - fe_mul_tll(&mut trY, &mut (*r).Y, &(*q).yminusx); - fe_mul_tlt(&mut trT, &(*q).xy2d, &(*p).T); - fe_add(&mut (*r).T, &(*p).Z, &(*p).Z); - fe_sub(&mut (*r).X, &mut trZ, &mut trY); - fe_add(&mut (*r).Y, &mut trZ, &mut trY); - fe_carry(&mut trZ, &mut (*r).T); - fe_add(&mut (*r).Z, &mut trZ, &mut trT); - fe_sub(&mut (*r).T, &mut trZ, &mut trT); -} -unsafe extern "C" fn ge_msub( - mut r: *mut ge_p1p1, - mut p: *const ge_p3, - mut q: *const ge_precomp, -) { - let mut trY: fe = fe { v: [0; 10] }; - let mut trZ: fe = fe { v: [0; 10] }; - let mut trT: fe = fe { v: [0; 10] }; - fe_add(&mut (*r).X, &(*p).Y, &(*p).X); - fe_sub(&mut (*r).Y, &(*p).Y, &(*p).X); - fe_mul_tll(&mut trZ, &mut (*r).X, &(*q).yminusx); - fe_mul_tll(&mut trY, &mut (*r).Y, &(*q).yplusx); - fe_mul_tlt(&mut trT, &(*q).xy2d, &(*p).T); - fe_add(&mut (*r).T, &(*p).Z, &(*p).Z); - fe_sub(&mut (*r).X, &mut trZ, &mut trY); - fe_add(&mut (*r).Y, &mut trZ, &mut trY); - fe_carry(&mut trZ, &mut (*r).T); - fe_sub(&mut (*r).Z, &mut trZ, &mut trT); - fe_add(&mut (*r).T, &mut trZ, &mut trT); -} -unsafe extern "C" fn x25519_ge_add( - mut r: *mut ge_p1p1, - mut p: *const ge_p3, - mut q: *const ge_cached, -) { - let mut trX: fe = fe { v: [0; 10] }; - let mut trY: fe = fe { v: [0; 10] }; - let mut trZ: fe = fe { v: [0; 10] }; - let mut trT: fe = fe { v: [0; 10] }; - fe_add(&mut (*r).X, &(*p).Y, &(*p).X); - fe_sub(&mut (*r).Y, &(*p).Y, &(*p).X); - fe_mul_tll(&mut trZ, &mut (*r).X, &(*q).YplusX); - fe_mul_tll(&mut trY, &mut (*r).Y, &(*q).YminusX); - fe_mul_tlt(&mut trT, &(*q).T2d, &(*p).T); - fe_mul_ttl(&mut trX, &(*p).Z, &(*q).Z); - fe_add(&mut (*r).T, &mut trX, &mut trX); - fe_sub(&mut (*r).X, &mut trZ, &mut trY); - fe_add(&mut (*r).Y, &mut trZ, &mut trY); - fe_carry(&mut trZ, &mut (*r).T); - fe_add(&mut (*r).Z, &mut trZ, &mut trT); - fe_sub(&mut (*r).T, &mut trZ, &mut trT); -} -unsafe extern "C" fn x25519_ge_sub( - mut r: *mut ge_p1p1, - mut p: *const ge_p3, - mut q: *const ge_cached, -) { - let mut trX: fe = fe { v: [0; 10] }; - let mut trY: fe = fe { v: [0; 10] }; - let mut trZ: fe = fe { v: [0; 10] }; - let mut trT: fe = fe { v: [0; 10] }; - fe_add(&mut (*r).X, &(*p).Y, &(*p).X); - fe_sub(&mut (*r).Y, &(*p).Y, &(*p).X); - fe_mul_tll(&mut trZ, &mut (*r).X, &(*q).YminusX); - fe_mul_tll(&mut trY, &mut (*r).Y, &(*q).YplusX); - fe_mul_tlt(&mut trT, &(*q).T2d, &(*p).T); - fe_mul_ttl(&mut trX, &(*p).Z, &(*q).Z); - fe_add(&mut (*r).T, &mut trX, &mut trX); - fe_sub(&mut (*r).X, &mut trZ, &mut trY); - fe_add(&mut (*r).Y, &mut trZ, &mut trY); - fe_carry(&mut trZ, &mut (*r).T); - fe_sub(&mut (*r).Z, &mut trZ, &mut trT); - fe_add(&mut (*r).T, &mut trZ, &mut trT); -} -unsafe extern "C" fn cmov( - mut t: *mut ge_precomp, - mut u: *const ge_precomp, - mut b: uint8_t, -) { - fe_cmov(&mut (*t).yplusx, &(*u).yplusx, b as fe_limb_t); - fe_cmov(&mut (*t).yminusx, &(*u).yminusx, b as fe_limb_t); - fe_cmov(&mut (*t).xy2d, &(*u).xy2d, b as fe_limb_t); -} -unsafe extern "C" fn x25519_ge_scalarmult_small_precomp( - mut h: *mut ge_p3, - mut a: *const uint8_t, - mut precomp_table: *const uint8_t, -) { - let mut multiples: [ge_precomp; 15] = [ge_precomp { - yplusx: fe_loose { v: [0; 10] }, - yminusx: fe_loose { v: [0; 10] }, - xy2d: fe_loose { v: [0; 10] }, - }; 15]; - let mut i: libc::c_uint = 0; - i = 0 as libc::c_int as libc::c_uint; - while i < 15 as libc::c_int as libc::c_uint { - let mut bytes: *const uint8_t = &*precomp_table - .offset( - i.wrapping_mul((2 as libc::c_int * 32 as libc::c_int) as libc::c_uint) - as isize, - ) as *const uint8_t; - let mut x: fe = fe { v: [0; 10] }; - let mut y: fe = fe { v: [0; 10] }; - fe_frombytes_strict(&mut x, bytes); - fe_frombytes_strict(&mut y, bytes.offset(32 as libc::c_int as isize)); - let mut out: *mut ge_precomp = &mut *multiples.as_mut_ptr().offset(i as isize) - as *mut ge_precomp; - fe_add(&mut (*out).yplusx, &mut y, &mut x); - fe_sub(&mut (*out).yminusx, &mut y, &mut x); - fe_mul_ltt(&mut (*out).xy2d, &mut x, &mut y); - fe_mul_llt(&mut (*out).xy2d, &mut (*out).xy2d, &d2); - i = i.wrapping_add(1); - } - ge_p3_0(h); - i = 63 as libc::c_int as libc::c_uint; - while i < 64 as libc::c_int as libc::c_uint { - let mut j: libc::c_uint = 0; - let mut index: libc::c_schar = 0 as libc::c_int as libc::c_schar; - j = 0 as libc::c_int as libc::c_uint; - while j < 4 as libc::c_int as libc::c_uint { - let bit: uint8_t = (1 as libc::c_int - & *a - .offset( - (8 as libc::c_int as libc::c_uint) - .wrapping_mul(j) - .wrapping_add( - i.wrapping_div(8 as libc::c_int as libc::c_uint), - ) as isize, - ) as libc::c_int >> (i & 7 as libc::c_int as libc::c_uint)) - as uint8_t; - index = (index as libc::c_int | (bit as libc::c_int) << j) as libc::c_schar; - j = j.wrapping_add(1); - } - let mut e: ge_precomp = ge_precomp { - yplusx: fe_loose { v: [0; 10] }, - yminusx: fe_loose { v: [0; 10] }, - xy2d: fe_loose { v: [0; 10] }, - }; - ge_precomp_0(&mut e); - j = 1 as libc::c_int as libc::c_uint; - while j < 16 as libc::c_int as libc::c_uint { - cmov( - &mut e, - &mut *multiples - .as_mut_ptr() - .offset(j.wrapping_sub(1 as libc::c_int as libc::c_uint) as isize), - (1 as libc::c_int as libc::c_uint - & constant_time_eq_w(index as crypto_word_t, j)) as uint8_t, - ); - j = j.wrapping_add(1); - } - let mut cached: ge_cached = ge_cached { - YplusX: fe_loose { v: [0; 10] }, - YminusX: fe_loose { v: [0; 10] }, - Z: fe_loose { v: [0; 10] }, - T2d: fe_loose { v: [0; 10] }, - }; - let mut r: ge_p1p1 = ge_p1p1 { - X: fe_loose { v: [0; 10] }, - Y: fe_loose { v: [0; 10] }, - Z: fe_loose { v: [0; 10] }, - T: fe_loose { v: [0; 10] }, - }; - x25519_ge_p3_to_cached(&mut cached, h); - x25519_ge_add(&mut r, h, &mut cached); - x25519_ge_p1p1_to_p3(h, &mut r); - ge_madd(&mut r, h, &mut e); - x25519_ge_p1p1_to_p3(h, &mut r); - i = i.wrapping_sub(1); - } -} -#[no_mangle] -pub unsafe extern "C" fn x25519_ge_scalarmult_base( - mut h: *mut ge_p3, - mut a: *const uint8_t, - mut use_adx: libc::c_int, -) { - x25519_ge_scalarmult_small_precomp(h, a, k25519SmallPrecomp.as_ptr()); -} -unsafe extern "C" fn slide(mut r: *mut libc::c_schar, mut a: *const uint8_t) { - let mut i: libc::c_int = 0; - let mut b: libc::c_int = 0; - let mut k: libc::c_int = 0; - i = 0 as libc::c_int; - while i < 256 as libc::c_int { - *r - .offset( - i as isize, - ) = (1 as libc::c_int - & *a.offset((i >> 3 as libc::c_int) as isize) as libc::c_int - >> (i & 7 as libc::c_int)) as libc::c_schar; - i += 1; - } - i = 0 as libc::c_int; - while i < 256 as libc::c_int { - if *r.offset(i as isize) != 0 { - b = 1 as libc::c_int; - while b <= 6 as libc::c_int && i + b < 256 as libc::c_int { - if *r.offset((i + b) as isize) != 0 { - if *r.offset(i as isize) as libc::c_int - + ((*r.offset((i + b) as isize) as libc::c_int) << b) - <= 15 as libc::c_int - { - let ref mut fresh3 = *r.offset(i as isize); - *fresh3 = (*fresh3 as libc::c_int - + ((*r.offset((i + b) as isize) as libc::c_int) << b)) - as libc::c_schar; - *r.offset((i + b) as isize) = 0 as libc::c_int as libc::c_schar; - } else { - if !(*r.offset(i as isize) as libc::c_int - - ((*r.offset((i + b) as isize) as libc::c_int) << b) - >= -(15 as libc::c_int)) - { - break; - } - let ref mut fresh4 = *r.offset(i as isize); - *fresh4 = (*fresh4 as libc::c_int - - ((*r.offset((i + b) as isize) as libc::c_int) << b)) - as libc::c_schar; - k = i + b; - while k < 256 as libc::c_int { - if *r.offset(k as isize) == 0 { - *r.offset(k as isize) = 1 as libc::c_int as libc::c_schar; - break; - } else { - *r.offset(k as isize) = 0 as libc::c_int as libc::c_schar; - k += 1; - } - } - } - } - b += 1; - } - } - i += 1; - } -} -unsafe extern "C" fn ge_double_scalarmult_vartime( - mut r: *mut ge_p2, - mut a: *const uint8_t, - mut A: *const ge_p3, - mut b: *const uint8_t, -) { - let mut aslide: [libc::c_schar; 256] = [0; 256]; - let mut bslide: [libc::c_schar; 256] = [0; 256]; - let mut Ai: [ge_cached; 8] = [ge_cached { - YplusX: fe_loose { v: [0; 10] }, - YminusX: fe_loose { v: [0; 10] }, - Z: fe_loose { v: [0; 10] }, - T2d: fe_loose { v: [0; 10] }, - }; 8]; - let mut t: ge_p1p1 = ge_p1p1 { - X: fe_loose { v: [0; 10] }, - Y: fe_loose { v: [0; 10] }, - Z: fe_loose { v: [0; 10] }, - T: fe_loose { v: [0; 10] }, - }; - let mut u: ge_p3 = ge_p3 { - X: fe { v: [0; 10] }, - Y: fe { v: [0; 10] }, - Z: fe { v: [0; 10] }, - T: fe { v: [0; 10] }, - }; - let mut A2: ge_p3 = ge_p3 { - X: fe { v: [0; 10] }, - Y: fe { v: [0; 10] }, - Z: fe { v: [0; 10] }, - T: fe { v: [0; 10] }, - }; - let mut i: libc::c_int = 0; - slide(aslide.as_mut_ptr(), a); - slide(bslide.as_mut_ptr(), b); - x25519_ge_p3_to_cached(&mut *Ai.as_mut_ptr().offset(0 as libc::c_int as isize), A); - ge_p3_dbl(&mut t, A); - x25519_ge_p1p1_to_p3(&mut A2, &mut t); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(0 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(1 as libc::c_int as isize), - &mut u, - ); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(1 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(2 as libc::c_int as isize), - &mut u, - ); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(2 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(3 as libc::c_int as isize), - &mut u, - ); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(3 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(4 as libc::c_int as isize), - &mut u, - ); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(4 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(5 as libc::c_int as isize), - &mut u, - ); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(5 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(6 as libc::c_int as isize), - &mut u, - ); - x25519_ge_add( - &mut t, - &mut A2, - &mut *Ai.as_mut_ptr().offset(6 as libc::c_int as isize), - ); - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_p3_to_cached( - &mut *Ai.as_mut_ptr().offset(7 as libc::c_int as isize), - &mut u, - ); - ge_p2_0(r); - i = 255 as libc::c_int; - while i >= 0 as libc::c_int { - if aslide[i as usize] as libc::c_int != 0 - || bslide[i as usize] as libc::c_int != 0 - { - break; - } - i -= 1; - } - while i >= 0 as libc::c_int { - ge_p2_dbl(&mut t, r); - if aslide[i as usize] as libc::c_int > 0 as libc::c_int { - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_add( - &mut t, - &mut u, - &mut *Ai - .as_mut_ptr() - .offset( - (*aslide.as_mut_ptr().offset(i as isize) as libc::c_int - / 2 as libc::c_int) as isize, - ), - ); - } else if (aslide[i as usize] as libc::c_int) < 0 as libc::c_int { - x25519_ge_p1p1_to_p3(&mut u, &mut t); - x25519_ge_sub( - &mut t, - &mut u, - &mut *Ai - .as_mut_ptr() - .offset( - (-(*aslide.as_mut_ptr().offset(i as isize) as libc::c_int) - / 2 as libc::c_int) as isize, - ), - ); - } - if bslide[i as usize] as libc::c_int > 0 as libc::c_int { - x25519_ge_p1p1_to_p3(&mut u, &mut t); - ge_madd( - &mut t, - &mut u, - &*Bi - .as_ptr() - .offset( - (*bslide.as_mut_ptr().offset(i as isize) as libc::c_int - / 2 as libc::c_int) as isize, - ), - ); - } else if (bslide[i as usize] as libc::c_int) < 0 as libc::c_int { - x25519_ge_p1p1_to_p3(&mut u, &mut t); - ge_msub( - &mut t, - &mut u, - &*Bi - .as_ptr() - .offset( - (-(*bslide.as_mut_ptr().offset(i as isize) as libc::c_int) - / 2 as libc::c_int) as isize, - ), - ); - } - x25519_ge_p1p1_to_p2(r, &mut t); - i -= 1; - } -} -#[inline] -unsafe extern "C" fn int64_lshift21(mut a: int64_t) -> int64_t { - return ((a as uint64_t) << 21 as libc::c_int) as int64_t; -} -#[no_mangle] -pub unsafe extern "C" fn x25519_sc_reduce(mut s: *mut uint8_t) { - let mut s0: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s as *const uint8_t)) as int64_t; - let mut s1: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(2 as libc::c_int as isize) as *const uint8_t) - >> 5 as libc::c_int) as int64_t; - let mut s2: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(5 as libc::c_int as isize) as *const uint8_t) - >> 2 as libc::c_int) as int64_t; - let mut s3: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(7 as libc::c_int as isize) as *const uint8_t) - >> 7 as libc::c_int) as int64_t; - let mut s4: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(10 as libc::c_int as isize) as *const uint8_t) - >> 4 as libc::c_int) as int64_t; - let mut s5: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(13 as libc::c_int as isize) as *const uint8_t) - >> 1 as libc::c_int) as int64_t; - let mut s6: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(15 as libc::c_int as isize) as *const uint8_t) - >> 6 as libc::c_int) as int64_t; - let mut s7: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(18 as libc::c_int as isize) as *const uint8_t) - >> 3 as libc::c_int) as int64_t; - let mut s8: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(21 as libc::c_int as isize) as *const uint8_t)) as int64_t; - let mut s9: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(23 as libc::c_int as isize) as *const uint8_t) - >> 5 as libc::c_int) as int64_t; - let mut s10: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(26 as libc::c_int as isize) as *const uint8_t) - >> 2 as libc::c_int) as int64_t; - let mut s11: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(28 as libc::c_int as isize) as *const uint8_t) - >> 7 as libc::c_int) as int64_t; - let mut s12: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(31 as libc::c_int as isize) as *const uint8_t) - >> 4 as libc::c_int) as int64_t; - let mut s13: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(34 as libc::c_int as isize) as *const uint8_t) - >> 1 as libc::c_int) as int64_t; - let mut s14: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(36 as libc::c_int as isize) as *const uint8_t) - >> 6 as libc::c_int) as int64_t; - let mut s15: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(39 as libc::c_int as isize) as *const uint8_t) - >> 3 as libc::c_int) as int64_t; - let mut s16: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(42 as libc::c_int as isize) as *const uint8_t)) as int64_t; - let mut s17: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(44 as libc::c_int as isize) as *const uint8_t) - >> 5 as libc::c_int) as int64_t; - let mut s18: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(47 as libc::c_int as isize) as *const uint8_t) - >> 2 as libc::c_int) as int64_t; - let mut s19: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(49 as libc::c_int as isize) as *const uint8_t) - >> 7 as libc::c_int) as int64_t; - let mut s20: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(52 as libc::c_int as isize) as *const uint8_t) - >> 4 as libc::c_int) as int64_t; - let mut s21: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(s.offset(55 as libc::c_int as isize) as *const uint8_t) - >> 1 as libc::c_int) as int64_t; - let mut s22: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(s.offset(57 as libc::c_int as isize) as *const uint8_t) - >> 6 as libc::c_int) as int64_t; - let mut s23: int64_t = (load_4( - s.offset(60 as libc::c_int as isize) as *const uint8_t, - ) >> 3 as libc::c_int) as int64_t; - let mut carry0: int64_t = 0; - let mut carry1: int64_t = 0; - let mut carry2: int64_t = 0; - let mut carry3: int64_t = 0; - let mut carry4: int64_t = 0; - let mut carry5: int64_t = 0; - let mut carry6: int64_t = 0; - let mut carry7: int64_t = 0; - let mut carry8: int64_t = 0; - let mut carry9: int64_t = 0; - let mut carry10: int64_t = 0; - let mut carry11: int64_t = 0; - let mut carry12: int64_t = 0; - let mut carry13: int64_t = 0; - let mut carry14: int64_t = 0; - let mut carry15: int64_t = 0; - let mut carry16: int64_t = 0; - s11 += s23 * 666643 as libc::c_int as libc::c_longlong; - s12 += s23 * 470296 as libc::c_int as libc::c_longlong; - s13 += s23 * 654183 as libc::c_int as libc::c_longlong; - s14 -= s23 * 997805 as libc::c_int as libc::c_longlong; - s15 += s23 * 136657 as libc::c_int as libc::c_longlong; - s16 -= s23 * 683901 as libc::c_int as libc::c_longlong; - s23 = 0 as libc::c_int as int64_t; - s10 += s22 * 666643 as libc::c_int as libc::c_longlong; - s11 += s22 * 470296 as libc::c_int as libc::c_longlong; - s12 += s22 * 654183 as libc::c_int as libc::c_longlong; - s13 -= s22 * 997805 as libc::c_int as libc::c_longlong; - s14 += s22 * 136657 as libc::c_int as libc::c_longlong; - s15 -= s22 * 683901 as libc::c_int as libc::c_longlong; - s22 = 0 as libc::c_int as int64_t; - s9 += s21 * 666643 as libc::c_int as libc::c_longlong; - s10 += s21 * 470296 as libc::c_int as libc::c_longlong; - s11 += s21 * 654183 as libc::c_int as libc::c_longlong; - s12 -= s21 * 997805 as libc::c_int as libc::c_longlong; - s13 += s21 * 136657 as libc::c_int as libc::c_longlong; - s14 -= s21 * 683901 as libc::c_int as libc::c_longlong; - s21 = 0 as libc::c_int as int64_t; - s8 += s20 * 666643 as libc::c_int as libc::c_longlong; - s9 += s20 * 470296 as libc::c_int as libc::c_longlong; - s10 += s20 * 654183 as libc::c_int as libc::c_longlong; - s11 -= s20 * 997805 as libc::c_int as libc::c_longlong; - s12 += s20 * 136657 as libc::c_int as libc::c_longlong; - s13 -= s20 * 683901 as libc::c_int as libc::c_longlong; - s20 = 0 as libc::c_int as int64_t; - s7 += s19 * 666643 as libc::c_int as libc::c_longlong; - s8 += s19 * 470296 as libc::c_int as libc::c_longlong; - s9 += s19 * 654183 as libc::c_int as libc::c_longlong; - s10 -= s19 * 997805 as libc::c_int as libc::c_longlong; - s11 += s19 * 136657 as libc::c_int as libc::c_longlong; - s12 -= s19 * 683901 as libc::c_int as libc::c_longlong; - s19 = 0 as libc::c_int as int64_t; - s6 += s18 * 666643 as libc::c_int as libc::c_longlong; - s7 += s18 * 470296 as libc::c_int as libc::c_longlong; - s8 += s18 * 654183 as libc::c_int as libc::c_longlong; - s9 -= s18 * 997805 as libc::c_int as libc::c_longlong; - s10 += s18 * 136657 as libc::c_int as libc::c_longlong; - s11 -= s18 * 683901 as libc::c_int as libc::c_longlong; - s18 = 0 as libc::c_int as int64_t; - carry6 = s6 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry8 = s8 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry10 = s10 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry12 = s12 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s13 += carry12; - s12 -= int64_lshift21(carry12); - carry14 = s14 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s15 += carry14; - s14 -= int64_lshift21(carry14); - carry16 = s16 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s17 += carry16; - s16 -= int64_lshift21(carry16); - carry7 = s7 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry9 = s9 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry11 = s11 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - carry13 = s13 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s14 += carry13; - s13 -= int64_lshift21(carry13); - carry15 = s15 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s16 += carry15; - s15 -= int64_lshift21(carry15); - s5 += s17 * 666643 as libc::c_int as libc::c_longlong; - s6 += s17 * 470296 as libc::c_int as libc::c_longlong; - s7 += s17 * 654183 as libc::c_int as libc::c_longlong; - s8 -= s17 * 997805 as libc::c_int as libc::c_longlong; - s9 += s17 * 136657 as libc::c_int as libc::c_longlong; - s10 -= s17 * 683901 as libc::c_int as libc::c_longlong; - s17 = 0 as libc::c_int as int64_t; - s4 += s16 * 666643 as libc::c_int as libc::c_longlong; - s5 += s16 * 470296 as libc::c_int as libc::c_longlong; - s6 += s16 * 654183 as libc::c_int as libc::c_longlong; - s7 -= s16 * 997805 as libc::c_int as libc::c_longlong; - s8 += s16 * 136657 as libc::c_int as libc::c_longlong; - s9 -= s16 * 683901 as libc::c_int as libc::c_longlong; - s16 = 0 as libc::c_int as int64_t; - s3 += s15 * 666643 as libc::c_int as libc::c_longlong; - s4 += s15 * 470296 as libc::c_int as libc::c_longlong; - s5 += s15 * 654183 as libc::c_int as libc::c_longlong; - s6 -= s15 * 997805 as libc::c_int as libc::c_longlong; - s7 += s15 * 136657 as libc::c_int as libc::c_longlong; - s8 -= s15 * 683901 as libc::c_int as libc::c_longlong; - s15 = 0 as libc::c_int as int64_t; - s2 += s14 * 666643 as libc::c_int as libc::c_longlong; - s3 += s14 * 470296 as libc::c_int as libc::c_longlong; - s4 += s14 * 654183 as libc::c_int as libc::c_longlong; - s5 -= s14 * 997805 as libc::c_int as libc::c_longlong; - s6 += s14 * 136657 as libc::c_int as libc::c_longlong; - s7 -= s14 * 683901 as libc::c_int as libc::c_longlong; - s14 = 0 as libc::c_int as int64_t; - s1 += s13 * 666643 as libc::c_int as libc::c_longlong; - s2 += s13 * 470296 as libc::c_int as libc::c_longlong; - s3 += s13 * 654183 as libc::c_int as libc::c_longlong; - s4 -= s13 * 997805 as libc::c_int as libc::c_longlong; - s5 += s13 * 136657 as libc::c_int as libc::c_longlong; - s6 -= s13 * 683901 as libc::c_int as libc::c_longlong; - s13 = 0 as libc::c_int as int64_t; - s0 += s12 * 666643 as libc::c_int as libc::c_longlong; - s1 += s12 * 470296 as libc::c_int as libc::c_longlong; - s2 += s12 * 654183 as libc::c_int as libc::c_longlong; - s3 -= s12 * 997805 as libc::c_int as libc::c_longlong; - s4 += s12 * 136657 as libc::c_int as libc::c_longlong; - s5 -= s12 * 683901 as libc::c_int as libc::c_longlong; - s12 = 0 as libc::c_int as int64_t; - carry0 = s0 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry2 = s2 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry4 = s4 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry6 = s6 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry8 = s8 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry10 = s10 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry1 = s1 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry3 = s3 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry5 = s5 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry7 = s7 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry9 = s9 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry11 = s11 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - s0 += s12 * 666643 as libc::c_int as libc::c_longlong; - s1 += s12 * 470296 as libc::c_int as libc::c_longlong; - s2 += s12 * 654183 as libc::c_int as libc::c_longlong; - s3 -= s12 * 997805 as libc::c_int as libc::c_longlong; - s4 += s12 * 136657 as libc::c_int as libc::c_longlong; - s5 -= s12 * 683901 as libc::c_int as libc::c_longlong; - s12 = 0 as libc::c_int as int64_t; - carry0 = s0 >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry1 = s1 >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry2 = s2 >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry3 = s3 >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry4 = s4 >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry5 = s5 >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry6 = s6 >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry7 = s7 >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry8 = s8 >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry9 = s9 >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry10 = s10 >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry11 = s11 >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - s0 += s12 * 666643 as libc::c_int as libc::c_longlong; - s1 += s12 * 470296 as libc::c_int as libc::c_longlong; - s2 += s12 * 654183 as libc::c_int as libc::c_longlong; - s3 -= s12 * 997805 as libc::c_int as libc::c_longlong; - s4 += s12 * 136657 as libc::c_int as libc::c_longlong; - s5 -= s12 * 683901 as libc::c_int as libc::c_longlong; - s12 = 0 as libc::c_int as int64_t; - carry0 = s0 >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry1 = s1 >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry2 = s2 >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry3 = s3 >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry4 = s4 >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry5 = s5 >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry6 = s6 >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry7 = s7 >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry8 = s8 >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry9 = s9 >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry10 = s10 >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - *s.offset(0 as libc::c_int as isize) = (s0 >> 0 as libc::c_int) as uint8_t; - *s.offset(1 as libc::c_int as isize) = (s0 >> 8 as libc::c_int) as uint8_t; - *s - .offset( - 2 as libc::c_int as isize, - ) = (s0 >> 16 as libc::c_int | s1 << 5 as libc::c_int) as uint8_t; - *s.offset(3 as libc::c_int as isize) = (s1 >> 3 as libc::c_int) as uint8_t; - *s.offset(4 as libc::c_int as isize) = (s1 >> 11 as libc::c_int) as uint8_t; - *s - .offset( - 5 as libc::c_int as isize, - ) = (s1 >> 19 as libc::c_int | s2 << 2 as libc::c_int) as uint8_t; - *s.offset(6 as libc::c_int as isize) = (s2 >> 6 as libc::c_int) as uint8_t; - *s - .offset( - 7 as libc::c_int as isize, - ) = (s2 >> 14 as libc::c_int | s3 << 7 as libc::c_int) as uint8_t; - *s.offset(8 as libc::c_int as isize) = (s3 >> 1 as libc::c_int) as uint8_t; - *s.offset(9 as libc::c_int as isize) = (s3 >> 9 as libc::c_int) as uint8_t; - *s - .offset( - 10 as libc::c_int as isize, - ) = (s3 >> 17 as libc::c_int | s4 << 4 as libc::c_int) as uint8_t; - *s.offset(11 as libc::c_int as isize) = (s4 >> 4 as libc::c_int) as uint8_t; - *s.offset(12 as libc::c_int as isize) = (s4 >> 12 as libc::c_int) as uint8_t; - *s - .offset( - 13 as libc::c_int as isize, - ) = (s4 >> 20 as libc::c_int | s5 << 1 as libc::c_int) as uint8_t; - *s.offset(14 as libc::c_int as isize) = (s5 >> 7 as libc::c_int) as uint8_t; - *s - .offset( - 15 as libc::c_int as isize, - ) = (s5 >> 15 as libc::c_int | s6 << 6 as libc::c_int) as uint8_t; - *s.offset(16 as libc::c_int as isize) = (s6 >> 2 as libc::c_int) as uint8_t; - *s.offset(17 as libc::c_int as isize) = (s6 >> 10 as libc::c_int) as uint8_t; - *s - .offset( - 18 as libc::c_int as isize, - ) = (s6 >> 18 as libc::c_int | s7 << 3 as libc::c_int) as uint8_t; - *s.offset(19 as libc::c_int as isize) = (s7 >> 5 as libc::c_int) as uint8_t; - *s.offset(20 as libc::c_int as isize) = (s7 >> 13 as libc::c_int) as uint8_t; - *s.offset(21 as libc::c_int as isize) = (s8 >> 0 as libc::c_int) as uint8_t; - *s.offset(22 as libc::c_int as isize) = (s8 >> 8 as libc::c_int) as uint8_t; - *s - .offset( - 23 as libc::c_int as isize, - ) = (s8 >> 16 as libc::c_int | s9 << 5 as libc::c_int) as uint8_t; - *s.offset(24 as libc::c_int as isize) = (s9 >> 3 as libc::c_int) as uint8_t; - *s.offset(25 as libc::c_int as isize) = (s9 >> 11 as libc::c_int) as uint8_t; - *s - .offset( - 26 as libc::c_int as isize, - ) = (s9 >> 19 as libc::c_int | s10 << 2 as libc::c_int) as uint8_t; - *s.offset(27 as libc::c_int as isize) = (s10 >> 6 as libc::c_int) as uint8_t; - *s - .offset( - 28 as libc::c_int as isize, - ) = (s10 >> 14 as libc::c_int | s11 << 7 as libc::c_int) as uint8_t; - *s.offset(29 as libc::c_int as isize) = (s11 >> 1 as libc::c_int) as uint8_t; - *s.offset(30 as libc::c_int as isize) = (s11 >> 9 as libc::c_int) as uint8_t; - *s.offset(31 as libc::c_int as isize) = (s11 >> 17 as libc::c_int) as uint8_t; -} -unsafe extern "C" fn sc_muladd( - mut s: *mut uint8_t, - mut a: *const uint8_t, - mut b: *const uint8_t, - mut c: *const uint8_t, -) { - let mut a0: int64_t = (2097151 as libc::c_int as libc::c_ulonglong & load_3(a)) - as int64_t; - let mut a1: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(a.offset(2 as libc::c_int as isize)) >> 5 as libc::c_int) as int64_t; - let mut a2: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(a.offset(5 as libc::c_int as isize)) >> 2 as libc::c_int) as int64_t; - let mut a3: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(a.offset(7 as libc::c_int as isize)) >> 7 as libc::c_int) as int64_t; - let mut a4: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(a.offset(10 as libc::c_int as isize)) >> 4 as libc::c_int) as int64_t; - let mut a5: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(a.offset(13 as libc::c_int as isize)) >> 1 as libc::c_int) as int64_t; - let mut a6: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(a.offset(15 as libc::c_int as isize)) >> 6 as libc::c_int) as int64_t; - let mut a7: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(a.offset(18 as libc::c_int as isize)) >> 3 as libc::c_int) as int64_t; - let mut a8: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(a.offset(21 as libc::c_int as isize))) as int64_t; - let mut a9: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(a.offset(23 as libc::c_int as isize)) >> 5 as libc::c_int) as int64_t; - let mut a10: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(a.offset(26 as libc::c_int as isize)) >> 2 as libc::c_int) as int64_t; - let mut a11: int64_t = (load_4(a.offset(28 as libc::c_int as isize)) - >> 7 as libc::c_int) as int64_t; - let mut b0: int64_t = (2097151 as libc::c_int as libc::c_ulonglong & load_3(b)) - as int64_t; - let mut b1: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(b.offset(2 as libc::c_int as isize)) >> 5 as libc::c_int) as int64_t; - let mut b2: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(b.offset(5 as libc::c_int as isize)) >> 2 as libc::c_int) as int64_t; - let mut b3: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(b.offset(7 as libc::c_int as isize)) >> 7 as libc::c_int) as int64_t; - let mut b4: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(b.offset(10 as libc::c_int as isize)) >> 4 as libc::c_int) as int64_t; - let mut b5: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(b.offset(13 as libc::c_int as isize)) >> 1 as libc::c_int) as int64_t; - let mut b6: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(b.offset(15 as libc::c_int as isize)) >> 6 as libc::c_int) as int64_t; - let mut b7: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(b.offset(18 as libc::c_int as isize)) >> 3 as libc::c_int) as int64_t; - let mut b8: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(b.offset(21 as libc::c_int as isize))) as int64_t; - let mut b9: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(b.offset(23 as libc::c_int as isize)) >> 5 as libc::c_int) as int64_t; - let mut b10: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(b.offset(26 as libc::c_int as isize)) >> 2 as libc::c_int) as int64_t; - let mut b11: int64_t = (load_4(b.offset(28 as libc::c_int as isize)) - >> 7 as libc::c_int) as int64_t; - let mut c0: int64_t = (2097151 as libc::c_int as libc::c_ulonglong & load_3(c)) - as int64_t; - let mut c1: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(c.offset(2 as libc::c_int as isize)) >> 5 as libc::c_int) as int64_t; - let mut c2: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(c.offset(5 as libc::c_int as isize)) >> 2 as libc::c_int) as int64_t; - let mut c3: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(c.offset(7 as libc::c_int as isize)) >> 7 as libc::c_int) as int64_t; - let mut c4: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(c.offset(10 as libc::c_int as isize)) >> 4 as libc::c_int) as int64_t; - let mut c5: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(c.offset(13 as libc::c_int as isize)) >> 1 as libc::c_int) as int64_t; - let mut c6: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(c.offset(15 as libc::c_int as isize)) >> 6 as libc::c_int) as int64_t; - let mut c7: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(c.offset(18 as libc::c_int as isize)) >> 3 as libc::c_int) as int64_t; - let mut c8: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(c.offset(21 as libc::c_int as isize))) as int64_t; - let mut c9: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_4(c.offset(23 as libc::c_int as isize)) >> 5 as libc::c_int) as int64_t; - let mut c10: int64_t = (2097151 as libc::c_int as libc::c_ulonglong - & load_3(c.offset(26 as libc::c_int as isize)) >> 2 as libc::c_int) as int64_t; - let mut c11: int64_t = (load_4(c.offset(28 as libc::c_int as isize)) - >> 7 as libc::c_int) as int64_t; - let mut s0: int64_t = 0; - let mut s1: int64_t = 0; - let mut s2: int64_t = 0; - let mut s3: int64_t = 0; - let mut s4: int64_t = 0; - let mut s5: int64_t = 0; - let mut s6: int64_t = 0; - let mut s7: int64_t = 0; - let mut s8: int64_t = 0; - let mut s9: int64_t = 0; - let mut s10: int64_t = 0; - let mut s11: int64_t = 0; - let mut s12: int64_t = 0; - let mut s13: int64_t = 0; - let mut s14: int64_t = 0; - let mut s15: int64_t = 0; - let mut s16: int64_t = 0; - let mut s17: int64_t = 0; - let mut s18: int64_t = 0; - let mut s19: int64_t = 0; - let mut s20: int64_t = 0; - let mut s21: int64_t = 0; - let mut s22: int64_t = 0; - let mut s23: int64_t = 0; - let mut carry0: int64_t = 0; - let mut carry1: int64_t = 0; - let mut carry2: int64_t = 0; - let mut carry3: int64_t = 0; - let mut carry4: int64_t = 0; - let mut carry5: int64_t = 0; - let mut carry6: int64_t = 0; - let mut carry7: int64_t = 0; - let mut carry8: int64_t = 0; - let mut carry9: int64_t = 0; - let mut carry10: int64_t = 0; - let mut carry11: int64_t = 0; - let mut carry12: int64_t = 0; - let mut carry13: int64_t = 0; - let mut carry14: int64_t = 0; - let mut carry15: int64_t = 0; - let mut carry16: int64_t = 0; - let mut carry17: int64_t = 0; - let mut carry18: int64_t = 0; - let mut carry19: int64_t = 0; - let mut carry20: int64_t = 0; - let mut carry21: int64_t = 0; - let mut carry22: int64_t = 0; - s0 = c0 + a0 * b0; - s1 = c1 + a0 * b1 + a1 * b0; - s2 = c2 + a0 * b2 + a1 * b1 + a2 * b0; - s3 = c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; - s4 = c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; - s5 = c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; - s6 = c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; - s7 = c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + a6 * b1 - + a7 * b0; - s8 = c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + a6 * b2 - + a7 * b1 + a8 * b0; - s9 = c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + a6 * b3 - + a7 * b2 + a8 * b1 + a9 * b0; - s10 = c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + a6 * b4 - + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; - s11 = c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + a6 * b5 - + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; - s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + a8 * b4 - + a9 * b3 + a10 * b2 + a11 * b1; - s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + a9 * b4 - + a10 * b3 + a11 * b2; - s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 - + a10 * b4 + a11 * b3; - s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 - + a11 * b4; - s16 = a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; - s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; - s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; - s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; - s20 = a9 * b11 + a10 * b10 + a11 * b9; - s21 = a10 * b11 + a11 * b10; - s22 = a11 * b11; - s23 = 0 as libc::c_int as int64_t; - carry0 = s0 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry2 = s2 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry4 = s4 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry6 = s6 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry8 = s8 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry10 = s10 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry12 = s12 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s13 += carry12; - s12 -= int64_lshift21(carry12); - carry14 = s14 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s15 += carry14; - s14 -= int64_lshift21(carry14); - carry16 = s16 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s17 += carry16; - s16 -= int64_lshift21(carry16); - carry18 = s18 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s19 += carry18; - s18 -= int64_lshift21(carry18); - carry20 = s20 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s21 += carry20; - s20 -= int64_lshift21(carry20); - carry22 = s22 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s23 += carry22; - s22 -= int64_lshift21(carry22); - carry1 = s1 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry3 = s3 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry5 = s5 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry7 = s7 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry9 = s9 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry11 = s11 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - carry13 = s13 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s14 += carry13; - s13 -= int64_lshift21(carry13); - carry15 = s15 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s16 += carry15; - s15 -= int64_lshift21(carry15); - carry17 = s17 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s18 += carry17; - s17 -= int64_lshift21(carry17); - carry19 = s19 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s20 += carry19; - s19 -= int64_lshift21(carry19); - carry21 = s21 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s22 += carry21; - s21 -= int64_lshift21(carry21); - s11 += s23 * 666643 as libc::c_int as libc::c_longlong; - s12 += s23 * 470296 as libc::c_int as libc::c_longlong; - s13 += s23 * 654183 as libc::c_int as libc::c_longlong; - s14 -= s23 * 997805 as libc::c_int as libc::c_longlong; - s15 += s23 * 136657 as libc::c_int as libc::c_longlong; - s16 -= s23 * 683901 as libc::c_int as libc::c_longlong; - s23 = 0 as libc::c_int as int64_t; - s10 += s22 * 666643 as libc::c_int as libc::c_longlong; - s11 += s22 * 470296 as libc::c_int as libc::c_longlong; - s12 += s22 * 654183 as libc::c_int as libc::c_longlong; - s13 -= s22 * 997805 as libc::c_int as libc::c_longlong; - s14 += s22 * 136657 as libc::c_int as libc::c_longlong; - s15 -= s22 * 683901 as libc::c_int as libc::c_longlong; - s22 = 0 as libc::c_int as int64_t; - s9 += s21 * 666643 as libc::c_int as libc::c_longlong; - s10 += s21 * 470296 as libc::c_int as libc::c_longlong; - s11 += s21 * 654183 as libc::c_int as libc::c_longlong; - s12 -= s21 * 997805 as libc::c_int as libc::c_longlong; - s13 += s21 * 136657 as libc::c_int as libc::c_longlong; - s14 -= s21 * 683901 as libc::c_int as libc::c_longlong; - s21 = 0 as libc::c_int as int64_t; - s8 += s20 * 666643 as libc::c_int as libc::c_longlong; - s9 += s20 * 470296 as libc::c_int as libc::c_longlong; - s10 += s20 * 654183 as libc::c_int as libc::c_longlong; - s11 -= s20 * 997805 as libc::c_int as libc::c_longlong; - s12 += s20 * 136657 as libc::c_int as libc::c_longlong; - s13 -= s20 * 683901 as libc::c_int as libc::c_longlong; - s20 = 0 as libc::c_int as int64_t; - s7 += s19 * 666643 as libc::c_int as libc::c_longlong; - s8 += s19 * 470296 as libc::c_int as libc::c_longlong; - s9 += s19 * 654183 as libc::c_int as libc::c_longlong; - s10 -= s19 * 997805 as libc::c_int as libc::c_longlong; - s11 += s19 * 136657 as libc::c_int as libc::c_longlong; - s12 -= s19 * 683901 as libc::c_int as libc::c_longlong; - s19 = 0 as libc::c_int as int64_t; - s6 += s18 * 666643 as libc::c_int as libc::c_longlong; - s7 += s18 * 470296 as libc::c_int as libc::c_longlong; - s8 += s18 * 654183 as libc::c_int as libc::c_longlong; - s9 -= s18 * 997805 as libc::c_int as libc::c_longlong; - s10 += s18 * 136657 as libc::c_int as libc::c_longlong; - s11 -= s18 * 683901 as libc::c_int as libc::c_longlong; - s18 = 0 as libc::c_int as int64_t; - carry6 = s6 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry8 = s8 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry10 = s10 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry12 = s12 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s13 += carry12; - s12 -= int64_lshift21(carry12); - carry14 = s14 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s15 += carry14; - s14 -= int64_lshift21(carry14); - carry16 = s16 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s17 += carry16; - s16 -= int64_lshift21(carry16); - carry7 = s7 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry9 = s9 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry11 = s11 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - carry13 = s13 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s14 += carry13; - s13 -= int64_lshift21(carry13); - carry15 = s15 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s16 += carry15; - s15 -= int64_lshift21(carry15); - s5 += s17 * 666643 as libc::c_int as libc::c_longlong; - s6 += s17 * 470296 as libc::c_int as libc::c_longlong; - s7 += s17 * 654183 as libc::c_int as libc::c_longlong; - s8 -= s17 * 997805 as libc::c_int as libc::c_longlong; - s9 += s17 * 136657 as libc::c_int as libc::c_longlong; - s10 -= s17 * 683901 as libc::c_int as libc::c_longlong; - s17 = 0 as libc::c_int as int64_t; - s4 += s16 * 666643 as libc::c_int as libc::c_longlong; - s5 += s16 * 470296 as libc::c_int as libc::c_longlong; - s6 += s16 * 654183 as libc::c_int as libc::c_longlong; - s7 -= s16 * 997805 as libc::c_int as libc::c_longlong; - s8 += s16 * 136657 as libc::c_int as libc::c_longlong; - s9 -= s16 * 683901 as libc::c_int as libc::c_longlong; - s16 = 0 as libc::c_int as int64_t; - s3 += s15 * 666643 as libc::c_int as libc::c_longlong; - s4 += s15 * 470296 as libc::c_int as libc::c_longlong; - s5 += s15 * 654183 as libc::c_int as libc::c_longlong; - s6 -= s15 * 997805 as libc::c_int as libc::c_longlong; - s7 += s15 * 136657 as libc::c_int as libc::c_longlong; - s8 -= s15 * 683901 as libc::c_int as libc::c_longlong; - s15 = 0 as libc::c_int as int64_t; - s2 += s14 * 666643 as libc::c_int as libc::c_longlong; - s3 += s14 * 470296 as libc::c_int as libc::c_longlong; - s4 += s14 * 654183 as libc::c_int as libc::c_longlong; - s5 -= s14 * 997805 as libc::c_int as libc::c_longlong; - s6 += s14 * 136657 as libc::c_int as libc::c_longlong; - s7 -= s14 * 683901 as libc::c_int as libc::c_longlong; - s14 = 0 as libc::c_int as int64_t; - s1 += s13 * 666643 as libc::c_int as libc::c_longlong; - s2 += s13 * 470296 as libc::c_int as libc::c_longlong; - s3 += s13 * 654183 as libc::c_int as libc::c_longlong; - s4 -= s13 * 997805 as libc::c_int as libc::c_longlong; - s5 += s13 * 136657 as libc::c_int as libc::c_longlong; - s6 -= s13 * 683901 as libc::c_int as libc::c_longlong; - s13 = 0 as libc::c_int as int64_t; - s0 += s12 * 666643 as libc::c_int as libc::c_longlong; - s1 += s12 * 470296 as libc::c_int as libc::c_longlong; - s2 += s12 * 654183 as libc::c_int as libc::c_longlong; - s3 -= s12 * 997805 as libc::c_int as libc::c_longlong; - s4 += s12 * 136657 as libc::c_int as libc::c_longlong; - s5 -= s12 * 683901 as libc::c_int as libc::c_longlong; - s12 = 0 as libc::c_int as int64_t; - carry0 = s0 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry2 = s2 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry4 = s4 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry6 = s6 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry8 = s8 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry10 = s10 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry1 = s1 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry3 = s3 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry5 = s5 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry7 = s7 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry9 = s9 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry11 = s11 + ((1 as libc::c_int) << 20 as libc::c_int) as libc::c_longlong - >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - s0 += s12 * 666643 as libc::c_int as libc::c_longlong; - s1 += s12 * 470296 as libc::c_int as libc::c_longlong; - s2 += s12 * 654183 as libc::c_int as libc::c_longlong; - s3 -= s12 * 997805 as libc::c_int as libc::c_longlong; - s4 += s12 * 136657 as libc::c_int as libc::c_longlong; - s5 -= s12 * 683901 as libc::c_int as libc::c_longlong; - s12 = 0 as libc::c_int as int64_t; - carry0 = s0 >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry1 = s1 >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry2 = s2 >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry3 = s3 >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry4 = s4 >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry5 = s5 >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry6 = s6 >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry7 = s7 >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry8 = s8 >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry9 = s9 >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry10 = s10 >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - carry11 = s11 >> 21 as libc::c_int; - s12 += carry11; - s11 -= int64_lshift21(carry11); - s0 += s12 * 666643 as libc::c_int as libc::c_longlong; - s1 += s12 * 470296 as libc::c_int as libc::c_longlong; - s2 += s12 * 654183 as libc::c_int as libc::c_longlong; - s3 -= s12 * 997805 as libc::c_int as libc::c_longlong; - s4 += s12 * 136657 as libc::c_int as libc::c_longlong; - s5 -= s12 * 683901 as libc::c_int as libc::c_longlong; - s12 = 0 as libc::c_int as int64_t; - carry0 = s0 >> 21 as libc::c_int; - s1 += carry0; - s0 -= int64_lshift21(carry0); - carry1 = s1 >> 21 as libc::c_int; - s2 += carry1; - s1 -= int64_lshift21(carry1); - carry2 = s2 >> 21 as libc::c_int; - s3 += carry2; - s2 -= int64_lshift21(carry2); - carry3 = s3 >> 21 as libc::c_int; - s4 += carry3; - s3 -= int64_lshift21(carry3); - carry4 = s4 >> 21 as libc::c_int; - s5 += carry4; - s4 -= int64_lshift21(carry4); - carry5 = s5 >> 21 as libc::c_int; - s6 += carry5; - s5 -= int64_lshift21(carry5); - carry6 = s6 >> 21 as libc::c_int; - s7 += carry6; - s6 -= int64_lshift21(carry6); - carry7 = s7 >> 21 as libc::c_int; - s8 += carry7; - s7 -= int64_lshift21(carry7); - carry8 = s8 >> 21 as libc::c_int; - s9 += carry8; - s8 -= int64_lshift21(carry8); - carry9 = s9 >> 21 as libc::c_int; - s10 += carry9; - s9 -= int64_lshift21(carry9); - carry10 = s10 >> 21 as libc::c_int; - s11 += carry10; - s10 -= int64_lshift21(carry10); - *s.offset(0 as libc::c_int as isize) = (s0 >> 0 as libc::c_int) as uint8_t; - *s.offset(1 as libc::c_int as isize) = (s0 >> 8 as libc::c_int) as uint8_t; - *s - .offset( - 2 as libc::c_int as isize, - ) = (s0 >> 16 as libc::c_int | s1 << 5 as libc::c_int) as uint8_t; - *s.offset(3 as libc::c_int as isize) = (s1 >> 3 as libc::c_int) as uint8_t; - *s.offset(4 as libc::c_int as isize) = (s1 >> 11 as libc::c_int) as uint8_t; - *s - .offset( - 5 as libc::c_int as isize, - ) = (s1 >> 19 as libc::c_int | s2 << 2 as libc::c_int) as uint8_t; - *s.offset(6 as libc::c_int as isize) = (s2 >> 6 as libc::c_int) as uint8_t; - *s - .offset( - 7 as libc::c_int as isize, - ) = (s2 >> 14 as libc::c_int | s3 << 7 as libc::c_int) as uint8_t; - *s.offset(8 as libc::c_int as isize) = (s3 >> 1 as libc::c_int) as uint8_t; - *s.offset(9 as libc::c_int as isize) = (s3 >> 9 as libc::c_int) as uint8_t; - *s - .offset( - 10 as libc::c_int as isize, - ) = (s3 >> 17 as libc::c_int | s4 << 4 as libc::c_int) as uint8_t; - *s.offset(11 as libc::c_int as isize) = (s4 >> 4 as libc::c_int) as uint8_t; - *s.offset(12 as libc::c_int as isize) = (s4 >> 12 as libc::c_int) as uint8_t; - *s - .offset( - 13 as libc::c_int as isize, - ) = (s4 >> 20 as libc::c_int | s5 << 1 as libc::c_int) as uint8_t; - *s.offset(14 as libc::c_int as isize) = (s5 >> 7 as libc::c_int) as uint8_t; - *s - .offset( - 15 as libc::c_int as isize, - ) = (s5 >> 15 as libc::c_int | s6 << 6 as libc::c_int) as uint8_t; - *s.offset(16 as libc::c_int as isize) = (s6 >> 2 as libc::c_int) as uint8_t; - *s.offset(17 as libc::c_int as isize) = (s6 >> 10 as libc::c_int) as uint8_t; - *s - .offset( - 18 as libc::c_int as isize, - ) = (s6 >> 18 as libc::c_int | s7 << 3 as libc::c_int) as uint8_t; - *s.offset(19 as libc::c_int as isize) = (s7 >> 5 as libc::c_int) as uint8_t; - *s.offset(20 as libc::c_int as isize) = (s7 >> 13 as libc::c_int) as uint8_t; - *s.offset(21 as libc::c_int as isize) = (s8 >> 0 as libc::c_int) as uint8_t; - *s.offset(22 as libc::c_int as isize) = (s8 >> 8 as libc::c_int) as uint8_t; - *s - .offset( - 23 as libc::c_int as isize, - ) = (s8 >> 16 as libc::c_int | s9 << 5 as libc::c_int) as uint8_t; - *s.offset(24 as libc::c_int as isize) = (s9 >> 3 as libc::c_int) as uint8_t; - *s.offset(25 as libc::c_int as isize) = (s9 >> 11 as libc::c_int) as uint8_t; - *s - .offset( - 26 as libc::c_int as isize, - ) = (s9 >> 19 as libc::c_int | s10 << 2 as libc::c_int) as uint8_t; - *s.offset(27 as libc::c_int as isize) = (s10 >> 6 as libc::c_int) as uint8_t; - *s - .offset( - 28 as libc::c_int as isize, - ) = (s10 >> 14 as libc::c_int | s11 << 7 as libc::c_int) as uint8_t; - *s.offset(29 as libc::c_int as isize) = (s11 >> 1 as libc::c_int) as uint8_t; - *s.offset(30 as libc::c_int as isize) = (s11 >> 9 as libc::c_int) as uint8_t; - *s.offset(31 as libc::c_int as isize) = (s11 >> 17 as libc::c_int) as uint8_t; -} -#[no_mangle] -pub unsafe extern "C" fn x25519_scalar_mult_generic_masked( - mut out: *mut uint8_t, - mut scalar_masked: *const uint8_t, - mut point: *const uint8_t, -) { - let mut x1: fe = fe { v: [0; 10] }; - let mut x2: fe = fe { v: [0; 10] }; - let mut z2: fe = fe { v: [0; 10] }; - let mut x3: fe = fe { v: [0; 10] }; - let mut z3: fe = fe { v: [0; 10] }; - let mut tmp0: fe = fe { v: [0; 10] }; - let mut tmp1: fe = fe { v: [0; 10] }; - let mut x2l: fe_loose = fe_loose { v: [0; 10] }; - let mut z2l: fe_loose = fe_loose { v: [0; 10] }; - let mut x3l: fe_loose = fe_loose { v: [0; 10] }; - let mut tmp0l: fe_loose = fe_loose { v: [0; 10] }; - let mut tmp1l: fe_loose = fe_loose { v: [0; 10] }; - let mut e: [uint8_t; 32] = [0; 32]; - OPENSSL_memcpy( - e.as_mut_ptr() as *mut libc::c_void, - scalar_masked as *const libc::c_void, - 32 as libc::c_int as size_t, - ); - fe_frombytes(&mut x1, point); - fe_1(&mut x2); - fe_0(&mut z2); - fe_copy(&mut x3, &mut x1); - fe_1(&mut z3); - let mut swap: libc::c_uint = 0 as libc::c_int as libc::c_uint; - let mut pos: libc::c_int = 0; - pos = 254 as libc::c_int; - while pos >= 0 as libc::c_int { - let mut b: libc::c_uint = (1 as libc::c_int - & e[(pos / 8 as libc::c_int) as usize] as libc::c_int - >> (pos & 7 as libc::c_int)) as libc::c_uint; - swap ^= b; - fe_cswap(&mut x2, &mut x3, swap); - fe_cswap(&mut z2, &mut z3, swap); - swap = b; - fe_sub(&mut tmp0l, &mut x3, &mut z3); - fe_sub(&mut tmp1l, &mut x2, &mut z2); - fe_add(&mut x2l, &mut x2, &mut z2); - fe_add(&mut z2l, &mut x3, &mut z3); - fe_mul_tll(&mut z3, &mut tmp0l, &mut x2l); - fe_mul_tll(&mut z2, &mut z2l, &mut tmp1l); - fe_sq_tl(&mut tmp0, &mut tmp1l); - fe_sq_tl(&mut tmp1, &mut x2l); - fe_add(&mut x3l, &mut z3, &mut z2); - fe_sub(&mut z2l, &mut z3, &mut z2); - fe_mul_ttt(&mut x2, &mut tmp1, &mut tmp0); - fe_sub(&mut tmp1l, &mut tmp1, &mut tmp0); - fe_sq_tl(&mut z2, &mut z2l); - fe_mul121666(&mut z3, &mut tmp1l); - fe_sq_tl(&mut x3, &mut x3l); - fe_add(&mut tmp0l, &mut tmp0, &mut z3); - fe_mul_ttt(&mut z3, &mut x1, &mut z2); - fe_mul_tll(&mut z2, &mut tmp1l, &mut tmp0l); - pos -= 1; - } - fe_cswap(&mut x2, &mut x3, swap); - fe_cswap(&mut z2, &mut z3, swap); - fe_invert(&mut z2, &mut z2); - fe_mul_ttt(&mut x2, &mut x2, &mut z2); - fe_tobytes(out, &mut x2); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_public_from_private_generic_masked( - mut out_public_value: *mut uint8_t, - mut private_key_masked: *const uint8_t, - mut use_adx: libc::c_int, -) { - let mut e: [uint8_t; 32] = [0; 32]; - OPENSSL_memcpy( - e.as_mut_ptr() as *mut libc::c_void, - private_key_masked as *const libc::c_void, - 32 as libc::c_int as size_t, - ); - let mut A: ge_p3 = ge_p3 { - X: fe { v: [0; 10] }, - Y: fe { v: [0; 10] }, - Z: fe { v: [0; 10] }, - T: fe { v: [0; 10] }, - }; - x25519_ge_scalarmult_base(&mut A, e.as_mut_ptr() as *const uint8_t, use_adx); - let mut zplusy: fe_loose = fe_loose { v: [0; 10] }; - let mut zminusy: fe_loose = fe_loose { v: [0; 10] }; - let mut zminusy_inv: fe = fe { v: [0; 10] }; - fe_add(&mut zplusy, &mut A.Z, &mut A.Y); - fe_sub(&mut zminusy, &mut A.Z, &mut A.Y); - fe_loose_invert(&mut zminusy_inv, &mut zminusy); - fe_mul_tlt(&mut zminusy_inv, &mut zplusy, &mut zminusy_inv); - fe_tobytes(out_public_value, &mut zminusy_inv); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_fe_invert(mut out: *mut fe, mut z: *const fe) { - fe_invert(out, z); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_fe_isnegative(mut f: *const fe) -> uint8_t { - return fe_isnegative(f) as uint8_t; -} -#[no_mangle] -pub unsafe extern "C" fn x25519_fe_mul_ttt( - mut h: *mut fe, - mut f: *const fe, - mut g: *const fe, -) { - fe_mul_ttt(h, f, g); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_fe_neg(mut f: *mut fe) { - let mut t: fe_loose = fe_loose { v: [0; 10] }; - fe_neg(&mut t, f); - fe_carry(f, &mut t); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_fe_tobytes(mut s: *mut uint8_t, mut h: *const fe) { - fe_tobytes(s, h); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_ge_double_scalarmult_vartime( - mut r: *mut ge_p2, - mut a: *const uint8_t, - mut A: *const ge_p3, - mut b: *const uint8_t, -) { - ge_double_scalarmult_vartime(r, a, A, b); -} -#[no_mangle] -pub unsafe extern "C" fn x25519_sc_mask(mut a: *mut uint8_t) { - let ref mut fresh5 = *a.offset(0 as libc::c_int as isize); - *fresh5 = (*fresh5 as libc::c_int & 248 as libc::c_int) as uint8_t; - let ref mut fresh6 = *a.offset(31 as libc::c_int as isize); - *fresh6 = (*fresh6 as libc::c_int & 127 as libc::c_int) as uint8_t; - let ref mut fresh7 = *a.offset(31 as libc::c_int as isize); - *fresh7 = (*fresh7 as libc::c_int | 64 as libc::c_int) as uint8_t; -} -#[no_mangle] -pub unsafe extern "C" fn x25519_sc_muladd( - mut s: *mut uint8_t, - mut a: *const uint8_t, - mut b: *const uint8_t, - mut c: *const uint8_t, -) { - sc_muladd(s, a, b, c); -} diff --git a/crypto/fipsmodule/aes/aes_nohw.rs b/crypto/fipsmodule/aes/aes_nohw.rs deleted file mode 100644 index 5537fc51ef..0000000000 --- a/crypto/fipsmodule/aes/aes_nohw.rs +++ /dev/null @@ -1,1109 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(label_break_value, register_tool)] -extern "C" { - fn memcpy( - _: *mut libc::c_void, - _: *const libc::c_void, - _: libc::c_uint, - ) -> *mut libc::c_void; - fn memset( - _: *mut libc::c_void, - _: libc::c_int, - _: libc::c_uint, - ) -> *mut libc::c_void; - fn __assert_fail( - __assertion: *const libc::c_char, - __file: *const libc::c_char, - __line: libc::c_uint, - __function: *const libc::c_char, - ) -> !; -} -pub type size_t = libc::c_uint; -pub type __uint8_t = libc::c_uchar; -pub type __uint32_t = libc::c_uint; -pub type uint8_t = __uint8_t; -pub type uint32_t = __uint32_t; -#[derive(Copy, Clone)] -#[repr(C)] -pub struct aes_key_st { - pub rd_key: [uint32_t; 60], - pub rounds: libc::c_uint, -} -pub type AES_KEY = aes_key_st; -pub type aes_word_t = uint32_t; -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AES_NOHW_BATCH { - pub w: [aes_word_t; 8], -} -#[derive(Copy, Clone)] -#[repr(C)] -pub struct AES_NOHW_SCHEDULE { - pub keys: [AES_NOHW_BATCH; 15], -} -#[inline] -unsafe extern "C" fn CRYPTO_bswap4(mut x: uint32_t) -> uint32_t { - return x.swap_bytes(); -} -#[inline] -unsafe extern "C" fn CRYPTO_store_u32_be(mut out: *mut libc::c_void, mut v: uint32_t) { - v = CRYPTO_bswap4(v); - OPENSSL_memcpy( - out, - &mut v as *mut uint32_t as *const libc::c_void, - ::std::mem::size_of::() as libc::c_ulong, - ); -} -#[inline] -unsafe extern "C" fn CRYPTO_load_u32_be(mut in_0: *const libc::c_void) -> uint32_t { - let mut v: uint32_t = 0; - OPENSSL_memcpy( - &mut v as *mut uint32_t as *mut libc::c_void, - in_0, - ::std::mem::size_of::() as libc::c_ulong, - ); - return CRYPTO_bswap4(v); -} -#[inline] -unsafe extern "C" fn OPENSSL_memcpy( - mut dst: *mut libc::c_void, - mut src: *const libc::c_void, - mut n: size_t, -) -> *mut libc::c_void { - if n == 0 as libc::c_int as libc::c_uint { - return dst; - } - return memcpy(dst, src, n); -} -#[inline] -unsafe extern "C" fn OPENSSL_memset( - mut dst: *mut libc::c_void, - mut c: libc::c_int, - mut n: size_t, -) -> *mut libc::c_void { - if n == 0 as libc::c_int as libc::c_uint { - return dst; - } - return memset(dst, c, n); -} -#[inline] -unsafe extern "C" fn aes_nohw_and(mut a: aes_word_t, mut b: aes_word_t) -> aes_word_t { - return a & b; -} -#[inline] -unsafe extern "C" fn aes_nohw_or(mut a: aes_word_t, mut b: aes_word_t) -> aes_word_t { - return a | b; -} -#[inline] -unsafe extern "C" fn aes_nohw_xor(mut a: aes_word_t, mut b: aes_word_t) -> aes_word_t { - return a ^ b; -} -#[inline] -unsafe extern "C" fn aes_nohw_not(mut a: aes_word_t) -> aes_word_t { - return !a; -} -#[inline] -unsafe extern "C" fn aes_nohw_shift_left( - mut a: aes_word_t, - mut i: aes_word_t, -) -> aes_word_t { - return a << i.wrapping_mul(2 as libc::c_int as libc::c_uint); -} -#[inline] -unsafe extern "C" fn aes_nohw_shift_right( - mut a: aes_word_t, - mut i: aes_word_t, -) -> aes_word_t { - return a >> i.wrapping_mul(2 as libc::c_int as libc::c_uint); -} -#[inline] -unsafe extern "C" fn aes_nohw_batch_set( - mut batch: *mut AES_NOHW_BATCH, - mut in_0: *const aes_word_t, - mut i: size_t, -) { - (*batch).w[i as usize] = *in_0.offset(0 as libc::c_int as isize); - (*batch) - .w[i.wrapping_add(2 as libc::c_int as libc::c_uint) - as usize] = *in_0.offset(1 as libc::c_int as isize); - (*batch) - .w[i.wrapping_add(4 as libc::c_int as libc::c_uint) - as usize] = *in_0.offset(2 as libc::c_int as isize); - (*batch) - .w[i.wrapping_add(6 as libc::c_int as libc::c_uint) - as usize] = *in_0.offset(3 as libc::c_int as isize); -} -#[inline] -unsafe extern "C" fn aes_nohw_batch_get( - mut batch: *const AES_NOHW_BATCH, - mut out: *mut aes_word_t, - mut i: size_t, -) { - *out.offset(0 as libc::c_int as isize) = (*batch).w[i as usize]; - *out - .offset( - 1 as libc::c_int as isize, - ) = (*batch).w[i.wrapping_add(2 as libc::c_int as libc::c_uint) as usize]; - *out - .offset( - 2 as libc::c_int as isize, - ) = (*batch).w[i.wrapping_add(4 as libc::c_int as libc::c_uint) as usize]; - *out - .offset( - 3 as libc::c_int as isize, - ) = (*batch).w[i.wrapping_add(6 as libc::c_int as libc::c_uint) as usize]; -} -#[inline] -unsafe extern "C" fn aes_nohw_delta_swap( - mut a: aes_word_t, - mut mask: aes_word_t, - mut shift: aes_word_t, -) -> aes_word_t { - let mut b: aes_word_t = (a ^ a >> shift) & mask; - return a ^ b ^ b << shift; -} -#[inline] -unsafe extern "C" fn aes_nohw_compact_word(mut a: uint32_t) -> uint32_t { - a = aes_nohw_delta_swap( - a, - 0xcc00cc as libc::c_int as aes_word_t, - 6 as libc::c_int as aes_word_t, - ); - a = aes_nohw_delta_swap( - a, - 0xf0f0 as libc::c_int as aes_word_t, - 12 as libc::c_int as aes_word_t, - ); - return a; -} -#[inline] -unsafe extern "C" fn aes_nohw_uncompact_word(mut a: uint32_t) -> uint32_t { - a = aes_nohw_delta_swap( - a, - 0xf0f0 as libc::c_int as aes_word_t, - 12 as libc::c_int as aes_word_t, - ); - a = aes_nohw_delta_swap( - a, - 0xcc00cc as libc::c_int as aes_word_t, - 6 as libc::c_int as aes_word_t, - ); - return a; -} -#[inline] -unsafe extern "C" fn aes_nohw_word_from_bytes( - mut a0: uint8_t, - mut a1: uint8_t, - mut a2: uint8_t, - mut a3: uint8_t, -) -> uint32_t { - return a0 as uint32_t | (a1 as uint32_t) << 8 as libc::c_int - | (a2 as uint32_t) << 16 as libc::c_int | (a3 as uint32_t) << 24 as libc::c_int; -} -#[inline] -unsafe extern "C" fn lo(mut a: uint32_t) -> uint8_t { - return a as uint8_t; -} -#[inline] -unsafe extern "C" fn aes_nohw_compact_block( - mut out: *mut aes_word_t, - mut in_0: *const uint8_t, -) { - OPENSSL_memcpy( - out as *mut libc::c_void, - in_0 as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - let mut a0: uint32_t = aes_nohw_compact_word(*out.offset(0 as libc::c_int as isize)); - let mut a1: uint32_t = aes_nohw_compact_word(*out.offset(1 as libc::c_int as isize)); - let mut a2: uint32_t = aes_nohw_compact_word(*out.offset(2 as libc::c_int as isize)); - let mut a3: uint32_t = aes_nohw_compact_word(*out.offset(3 as libc::c_int as isize)); - *out - .offset( - 0 as libc::c_int as isize, - ) = aes_nohw_word_from_bytes(lo(a0), lo(a1), lo(a2), lo(a3)); - *out - .offset( - 1 as libc::c_int as isize, - ) = aes_nohw_word_from_bytes( - lo(a0 >> 8 as libc::c_int), - lo(a1 >> 8 as libc::c_int), - lo(a2 >> 8 as libc::c_int), - lo(a3 >> 8 as libc::c_int), - ); - *out - .offset( - 2 as libc::c_int as isize, - ) = aes_nohw_word_from_bytes( - lo(a0 >> 16 as libc::c_int), - lo(a1 >> 16 as libc::c_int), - lo(a2 >> 16 as libc::c_int), - lo(a3 >> 16 as libc::c_int), - ); - *out - .offset( - 3 as libc::c_int as isize, - ) = aes_nohw_word_from_bytes( - lo(a0 >> 24 as libc::c_int), - lo(a1 >> 24 as libc::c_int), - lo(a2 >> 24 as libc::c_int), - lo(a3 >> 24 as libc::c_int), - ); -} -#[inline] -unsafe extern "C" fn aes_nohw_uncompact_block( - mut out: *mut uint8_t, - mut in_0: *const aes_word_t, -) { - let mut a0: uint32_t = *in_0.offset(0 as libc::c_int as isize); - let mut a1: uint32_t = *in_0.offset(1 as libc::c_int as isize); - let mut a2: uint32_t = *in_0.offset(2 as libc::c_int as isize); - let mut a3: uint32_t = *in_0.offset(3 as libc::c_int as isize); - let mut b0: uint32_t = aes_nohw_word_from_bytes(lo(a0), lo(a1), lo(a2), lo(a3)); - let mut b1: uint32_t = aes_nohw_word_from_bytes( - lo(a0 >> 8 as libc::c_int), - lo(a1 >> 8 as libc::c_int), - lo(a2 >> 8 as libc::c_int), - lo(a3 >> 8 as libc::c_int), - ); - let mut b2: uint32_t = aes_nohw_word_from_bytes( - lo(a0 >> 16 as libc::c_int), - lo(a1 >> 16 as libc::c_int), - lo(a2 >> 16 as libc::c_int), - lo(a3 >> 16 as libc::c_int), - ); - let mut b3: uint32_t = aes_nohw_word_from_bytes( - lo(a0 >> 24 as libc::c_int), - lo(a1 >> 24 as libc::c_int), - lo(a2 >> 24 as libc::c_int), - lo(a3 >> 24 as libc::c_int), - ); - b0 = aes_nohw_uncompact_word(b0); - b1 = aes_nohw_uncompact_word(b1); - b2 = aes_nohw_uncompact_word(b2); - b3 = aes_nohw_uncompact_word(b3); - OPENSSL_memcpy( - out as *mut libc::c_void, - &mut b0 as *mut uint32_t as *const libc::c_void, - 4 as libc::c_int as size_t, - ); - OPENSSL_memcpy( - out.offset(4 as libc::c_int as isize) as *mut libc::c_void, - &mut b1 as *mut uint32_t as *const libc::c_void, - 4 as libc::c_int as size_t, - ); - OPENSSL_memcpy( - out.offset(8 as libc::c_int as isize) as *mut libc::c_void, - &mut b2 as *mut uint32_t as *const libc::c_void, - 4 as libc::c_int as size_t, - ); - OPENSSL_memcpy( - out.offset(12 as libc::c_int as isize) as *mut libc::c_void, - &mut b3 as *mut uint32_t as *const libc::c_void, - 4 as libc::c_int as size_t, - ); -} -#[inline] -unsafe extern "C" fn aes_nohw_swap_bits( - mut a: *mut aes_word_t, - mut b: *mut aes_word_t, - mut mask: uint32_t, - mut shift: aes_word_t, -) { - let mut mask_w: aes_word_t = mask; - let mut swap: aes_word_t = (*a >> shift ^ *b) & mask_w; - *a ^= swap << shift; - *b ^= swap; -} -unsafe extern "C" fn aes_nohw_transpose(mut batch: *mut AES_NOHW_BATCH) { - aes_nohw_swap_bits( - &mut *((*batch).w).as_mut_ptr().offset(0 as libc::c_int as isize), - &mut *((*batch).w).as_mut_ptr().offset(1 as libc::c_int as isize), - 0x55555555 as libc::c_int as uint32_t, - 1 as libc::c_int as aes_word_t, - ); - aes_nohw_swap_bits( - &mut *((*batch).w).as_mut_ptr().offset(2 as libc::c_int as isize), - &mut *((*batch).w).as_mut_ptr().offset(3 as libc::c_int as isize), - 0x55555555 as libc::c_int as uint32_t, - 1 as libc::c_int as aes_word_t, - ); - aes_nohw_swap_bits( - &mut *((*batch).w).as_mut_ptr().offset(4 as libc::c_int as isize), - &mut *((*batch).w).as_mut_ptr().offset(5 as libc::c_int as isize), - 0x55555555 as libc::c_int as uint32_t, - 1 as libc::c_int as aes_word_t, - ); - aes_nohw_swap_bits( - &mut *((*batch).w).as_mut_ptr().offset(6 as libc::c_int as isize), - &mut *((*batch).w).as_mut_ptr().offset(7 as libc::c_int as isize), - 0x55555555 as libc::c_int as uint32_t, - 1 as libc::c_int as aes_word_t, - ); -} -unsafe extern "C" fn aes_nohw_to_batch( - mut out: *mut AES_NOHW_BATCH, - mut in_0: *const uint8_t, - mut num_blocks: size_t, -) { - OPENSSL_memset( - out as *mut libc::c_void, - 0 as libc::c_int, - ::std::mem::size_of::() as libc::c_ulong, - ); - if num_blocks <= 2 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"num_blocks <= 2\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/aes/aes_nohw.c\0" as *const u8 as *const libc::c_char, - 479 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 66], - &[libc::c_char; 66], - >(b"void aes_nohw_to_batch(AES_NOHW_BATCH *, const uint8_t *, size_t)\0")) - .as_ptr(), - ); - } - let mut i: size_t = 0 as libc::c_int as size_t; - while i < num_blocks { - let mut block: [aes_word_t; 4] = [0; 4]; - aes_nohw_compact_block( - block.as_mut_ptr(), - in_0.offset((16 as libc::c_int as libc::c_uint).wrapping_mul(i) as isize), - ); - aes_nohw_batch_set(out, block.as_mut_ptr() as *const aes_word_t, i); - i = i.wrapping_add(1); - } - aes_nohw_transpose(out); -} -unsafe extern "C" fn aes_nohw_from_batch( - mut out: *mut uint8_t, - mut num_blocks: size_t, - mut batch: *const AES_NOHW_BATCH, -) { - let mut copy: AES_NOHW_BATCH = *batch; - aes_nohw_transpose(&mut copy); - if num_blocks <= 2 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"num_blocks <= 2\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/aes/aes_nohw.c\0" as *const u8 as *const libc::c_char, - 496 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 68], - &[libc::c_char; 68], - >(b"void aes_nohw_from_batch(uint8_t *, size_t, const AES_NOHW_BATCH *)\0")) - .as_ptr(), - ); - } - let mut i: size_t = 0 as libc::c_int as size_t; - while i < num_blocks { - let mut block: [aes_word_t; 4] = [0; 4]; - aes_nohw_batch_get(&mut copy, block.as_mut_ptr(), i); - aes_nohw_uncompact_block( - out.offset((16 as libc::c_int as libc::c_uint).wrapping_mul(i) as isize), - block.as_mut_ptr() as *const aes_word_t, - ); - i = i.wrapping_add(1); - } -} -unsafe extern "C" fn aes_nohw_add_round_key( - mut batch: *mut AES_NOHW_BATCH, - mut key: *const AES_NOHW_BATCH, -) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < 8 as libc::c_int as libc::c_uint { - (*batch) - .w[i as usize] = aes_nohw_xor((*batch).w[i as usize], (*key).w[i as usize]); - i = i.wrapping_add(1); - } -} -unsafe extern "C" fn aes_nohw_sub_bytes(mut batch: *mut AES_NOHW_BATCH) { - let mut x0: aes_word_t = (*batch).w[7 as libc::c_int as usize]; - let mut x1: aes_word_t = (*batch).w[6 as libc::c_int as usize]; - let mut x2: aes_word_t = (*batch).w[5 as libc::c_int as usize]; - let mut x3: aes_word_t = (*batch).w[4 as libc::c_int as usize]; - let mut x4: aes_word_t = (*batch).w[3 as libc::c_int as usize]; - let mut x5: aes_word_t = (*batch).w[2 as libc::c_int as usize]; - let mut x6: aes_word_t = (*batch).w[1 as libc::c_int as usize]; - let mut x7: aes_word_t = (*batch).w[0 as libc::c_int as usize]; - let mut y14: aes_word_t = aes_nohw_xor(x3, x5); - let mut y13: aes_word_t = aes_nohw_xor(x0, x6); - let mut y9: aes_word_t = aes_nohw_xor(x0, x3); - let mut y8: aes_word_t = aes_nohw_xor(x0, x5); - let mut t0: aes_word_t = aes_nohw_xor(x1, x2); - let mut y1: aes_word_t = aes_nohw_xor(t0, x7); - let mut y4: aes_word_t = aes_nohw_xor(y1, x3); - let mut y12: aes_word_t = aes_nohw_xor(y13, y14); - let mut y2: aes_word_t = aes_nohw_xor(y1, x0); - let mut y5: aes_word_t = aes_nohw_xor(y1, x6); - let mut y3: aes_word_t = aes_nohw_xor(y5, y8); - let mut t1: aes_word_t = aes_nohw_xor(x4, y12); - let mut y15: aes_word_t = aes_nohw_xor(t1, x5); - let mut y20: aes_word_t = aes_nohw_xor(t1, x1); - let mut y6: aes_word_t = aes_nohw_xor(y15, x7); - let mut y10: aes_word_t = aes_nohw_xor(y15, t0); - let mut y11: aes_word_t = aes_nohw_xor(y20, y9); - let mut y7: aes_word_t = aes_nohw_xor(x7, y11); - let mut y17: aes_word_t = aes_nohw_xor(y10, y11); - let mut y19: aes_word_t = aes_nohw_xor(y10, y8); - let mut y16: aes_word_t = aes_nohw_xor(t0, y11); - let mut y21: aes_word_t = aes_nohw_xor(y13, y16); - let mut y18: aes_word_t = aes_nohw_xor(x0, y16); - let mut t2: aes_word_t = aes_nohw_and(y12, y15); - let mut t3: aes_word_t = aes_nohw_and(y3, y6); - let mut t4: aes_word_t = aes_nohw_xor(t3, t2); - let mut t5: aes_word_t = aes_nohw_and(y4, x7); - let mut t6: aes_word_t = aes_nohw_xor(t5, t2); - let mut t7: aes_word_t = aes_nohw_and(y13, y16); - let mut t8: aes_word_t = aes_nohw_and(y5, y1); - let mut t9: aes_word_t = aes_nohw_xor(t8, t7); - let mut t10: aes_word_t = aes_nohw_and(y2, y7); - let mut t11: aes_word_t = aes_nohw_xor(t10, t7); - let mut t12: aes_word_t = aes_nohw_and(y9, y11); - let mut t13: aes_word_t = aes_nohw_and(y14, y17); - let mut t14: aes_word_t = aes_nohw_xor(t13, t12); - let mut t15: aes_word_t = aes_nohw_and(y8, y10); - let mut t16: aes_word_t = aes_nohw_xor(t15, t12); - let mut t17: aes_word_t = aes_nohw_xor(t4, t14); - let mut t18: aes_word_t = aes_nohw_xor(t6, t16); - let mut t19: aes_word_t = aes_nohw_xor(t9, t14); - let mut t20: aes_word_t = aes_nohw_xor(t11, t16); - let mut t21: aes_word_t = aes_nohw_xor(t17, y20); - let mut t22: aes_word_t = aes_nohw_xor(t18, y19); - let mut t23: aes_word_t = aes_nohw_xor(t19, y21); - let mut t24: aes_word_t = aes_nohw_xor(t20, y18); - let mut t25: aes_word_t = aes_nohw_xor(t21, t22); - let mut t26: aes_word_t = aes_nohw_and(t21, t23); - let mut t27: aes_word_t = aes_nohw_xor(t24, t26); - let mut t28: aes_word_t = aes_nohw_and(t25, t27); - let mut t29: aes_word_t = aes_nohw_xor(t28, t22); - let mut t30: aes_word_t = aes_nohw_xor(t23, t24); - let mut t31: aes_word_t = aes_nohw_xor(t22, t26); - let mut t32: aes_word_t = aes_nohw_and(t31, t30); - let mut t33: aes_word_t = aes_nohw_xor(t32, t24); - let mut t34: aes_word_t = aes_nohw_xor(t23, t33); - let mut t35: aes_word_t = aes_nohw_xor(t27, t33); - let mut t36: aes_word_t = aes_nohw_and(t24, t35); - let mut t37: aes_word_t = aes_nohw_xor(t36, t34); - let mut t38: aes_word_t = aes_nohw_xor(t27, t36); - let mut t39: aes_word_t = aes_nohw_and(t29, t38); - let mut t40: aes_word_t = aes_nohw_xor(t25, t39); - let mut t41: aes_word_t = aes_nohw_xor(t40, t37); - let mut t42: aes_word_t = aes_nohw_xor(t29, t33); - let mut t43: aes_word_t = aes_nohw_xor(t29, t40); - let mut t44: aes_word_t = aes_nohw_xor(t33, t37); - let mut t45: aes_word_t = aes_nohw_xor(t42, t41); - let mut z0: aes_word_t = aes_nohw_and(t44, y15); - let mut z1: aes_word_t = aes_nohw_and(t37, y6); - let mut z2: aes_word_t = aes_nohw_and(t33, x7); - let mut z3: aes_word_t = aes_nohw_and(t43, y16); - let mut z4: aes_word_t = aes_nohw_and(t40, y1); - let mut z5: aes_word_t = aes_nohw_and(t29, y7); - let mut z6: aes_word_t = aes_nohw_and(t42, y11); - let mut z7: aes_word_t = aes_nohw_and(t45, y17); - let mut z8: aes_word_t = aes_nohw_and(t41, y10); - let mut z9: aes_word_t = aes_nohw_and(t44, y12); - let mut z10: aes_word_t = aes_nohw_and(t37, y3); - let mut z11: aes_word_t = aes_nohw_and(t33, y4); - let mut z12: aes_word_t = aes_nohw_and(t43, y13); - let mut z13: aes_word_t = aes_nohw_and(t40, y5); - let mut z14: aes_word_t = aes_nohw_and(t29, y2); - let mut z15: aes_word_t = aes_nohw_and(t42, y9); - let mut z16: aes_word_t = aes_nohw_and(t45, y14); - let mut z17: aes_word_t = aes_nohw_and(t41, y8); - let mut t46: aes_word_t = aes_nohw_xor(z15, z16); - let mut t47: aes_word_t = aes_nohw_xor(z10, z11); - let mut t48: aes_word_t = aes_nohw_xor(z5, z13); - let mut t49: aes_word_t = aes_nohw_xor(z9, z10); - let mut t50: aes_word_t = aes_nohw_xor(z2, z12); - let mut t51: aes_word_t = aes_nohw_xor(z2, z5); - let mut t52: aes_word_t = aes_nohw_xor(z7, z8); - let mut t53: aes_word_t = aes_nohw_xor(z0, z3); - let mut t54: aes_word_t = aes_nohw_xor(z6, z7); - let mut t55: aes_word_t = aes_nohw_xor(z16, z17); - let mut t56: aes_word_t = aes_nohw_xor(z12, t48); - let mut t57: aes_word_t = aes_nohw_xor(t50, t53); - let mut t58: aes_word_t = aes_nohw_xor(z4, t46); - let mut t59: aes_word_t = aes_nohw_xor(z3, t54); - let mut t60: aes_word_t = aes_nohw_xor(t46, t57); - let mut t61: aes_word_t = aes_nohw_xor(z14, t57); - let mut t62: aes_word_t = aes_nohw_xor(t52, t58); - let mut t63: aes_word_t = aes_nohw_xor(t49, t58); - let mut t64: aes_word_t = aes_nohw_xor(z4, t59); - let mut t65: aes_word_t = aes_nohw_xor(t61, t62); - let mut t66: aes_word_t = aes_nohw_xor(z1, t63); - let mut s0: aes_word_t = aes_nohw_xor(t59, t63); - let mut s6: aes_word_t = aes_nohw_xor(t56, aes_nohw_not(t62)); - let mut s7: aes_word_t = aes_nohw_xor(t48, aes_nohw_not(t60)); - let mut t67: aes_word_t = aes_nohw_xor(t64, t65); - let mut s3: aes_word_t = aes_nohw_xor(t53, t66); - let mut s4: aes_word_t = aes_nohw_xor(t51, t66); - let mut s5: aes_word_t = aes_nohw_xor(t47, t65); - let mut s1: aes_word_t = aes_nohw_xor(t64, aes_nohw_not(s3)); - let mut s2: aes_word_t = aes_nohw_xor(t55, aes_nohw_not(t67)); - (*batch).w[0 as libc::c_int as usize] = s7; - (*batch).w[1 as libc::c_int as usize] = s6; - (*batch).w[2 as libc::c_int as usize] = s5; - (*batch).w[3 as libc::c_int as usize] = s4; - (*batch).w[4 as libc::c_int as usize] = s3; - (*batch).w[5 as libc::c_int as usize] = s2; - (*batch).w[6 as libc::c_int as usize] = s1; - (*batch).w[7 as libc::c_int as usize] = s0; -} -unsafe extern "C" fn aes_nohw_shift_rows(mut batch: *mut AES_NOHW_BATCH) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < 8 as libc::c_int as libc::c_uint { - let mut row0: aes_word_t = aes_nohw_and( - (*batch).w[i as usize], - 0x3030303 as libc::c_int as aes_word_t, - ); - let mut row1: aes_word_t = aes_nohw_and( - (*batch).w[i as usize], - 0xc0c0c0c as libc::c_int as aes_word_t, - ); - let mut row2: aes_word_t = aes_nohw_and( - (*batch).w[i as usize], - 0x30303030 as libc::c_int as aes_word_t, - ); - let mut row3: aes_word_t = aes_nohw_and( - (*batch).w[i as usize], - 0xc0c0c0c0 as libc::c_uint, - ); - row1 = aes_nohw_or( - aes_nohw_shift_right( - row1, - (1 as libc::c_int * 4 as libc::c_int) as aes_word_t, - ), - aes_nohw_shift_left( - row1, - (16 as libc::c_int - 1 as libc::c_int * 4 as libc::c_int) as aes_word_t, - ), - ); - row2 = aes_nohw_or( - aes_nohw_shift_right( - row2, - (2 as libc::c_int * 4 as libc::c_int) as aes_word_t, - ), - aes_nohw_shift_left( - row2, - (16 as libc::c_int - 2 as libc::c_int * 4 as libc::c_int) as aes_word_t, - ), - ); - row3 = aes_nohw_or( - aes_nohw_shift_right( - row3, - (3 as libc::c_int * 4 as libc::c_int) as aes_word_t, - ), - aes_nohw_shift_left( - row3, - (16 as libc::c_int - 3 as libc::c_int * 4 as libc::c_int) as aes_word_t, - ), - ); - (*batch) - .w[i - as usize] = aes_nohw_or(aes_nohw_or(row0, row1), aes_nohw_or(row2, row3)); - i = i.wrapping_add(1); - } -} -#[inline] -unsafe extern "C" fn aes_nohw_rotate_rows_down(mut v: aes_word_t) -> aes_word_t { - return v >> 2 as libc::c_int & 0x3f3f3f3f as libc::c_int as libc::c_uint - | v << 6 as libc::c_int & 0xc0c0c0c0 as libc::c_uint; -} -#[inline] -unsafe extern "C" fn aes_nohw_rotate_rows_twice(mut v: aes_word_t) -> aes_word_t { - return v >> 4 as libc::c_int & 0xf0f0f0f as libc::c_int as libc::c_uint - | v << 4 as libc::c_int & 0xf0f0f0f0 as libc::c_uint; -} -unsafe extern "C" fn aes_nohw_mix_columns(mut batch: *mut AES_NOHW_BATCH) { - let mut a0: aes_word_t = (*batch).w[0 as libc::c_int as usize]; - let mut a1: aes_word_t = (*batch).w[1 as libc::c_int as usize]; - let mut a2: aes_word_t = (*batch).w[2 as libc::c_int as usize]; - let mut a3: aes_word_t = (*batch).w[3 as libc::c_int as usize]; - let mut a4: aes_word_t = (*batch).w[4 as libc::c_int as usize]; - let mut a5: aes_word_t = (*batch).w[5 as libc::c_int as usize]; - let mut a6: aes_word_t = (*batch).w[6 as libc::c_int as usize]; - let mut a7: aes_word_t = (*batch).w[7 as libc::c_int as usize]; - let mut r0: aes_word_t = aes_nohw_rotate_rows_down(a0); - let mut a0_r0: aes_word_t = aes_nohw_xor(a0, r0); - let mut r1: aes_word_t = aes_nohw_rotate_rows_down(a1); - let mut a1_r1: aes_word_t = aes_nohw_xor(a1, r1); - let mut r2: aes_word_t = aes_nohw_rotate_rows_down(a2); - let mut a2_r2: aes_word_t = aes_nohw_xor(a2, r2); - let mut r3: aes_word_t = aes_nohw_rotate_rows_down(a3); - let mut a3_r3: aes_word_t = aes_nohw_xor(a3, r3); - let mut r4: aes_word_t = aes_nohw_rotate_rows_down(a4); - let mut a4_r4: aes_word_t = aes_nohw_xor(a4, r4); - let mut r5: aes_word_t = aes_nohw_rotate_rows_down(a5); - let mut a5_r5: aes_word_t = aes_nohw_xor(a5, r5); - let mut r6: aes_word_t = aes_nohw_rotate_rows_down(a6); - let mut a6_r6: aes_word_t = aes_nohw_xor(a6, r6); - let mut r7: aes_word_t = aes_nohw_rotate_rows_down(a7); - let mut a7_r7: aes_word_t = aes_nohw_xor(a7, r7); - (*batch) - .w[0 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a7_r7, r0), - aes_nohw_rotate_rows_twice(a0_r0), - ); - (*batch) - .w[1 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a0_r0, a7_r7), - aes_nohw_xor(r1, aes_nohw_rotate_rows_twice(a1_r1)), - ); - (*batch) - .w[2 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a1_r1, r2), - aes_nohw_rotate_rows_twice(a2_r2), - ); - (*batch) - .w[3 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a2_r2, a7_r7), - aes_nohw_xor(r3, aes_nohw_rotate_rows_twice(a3_r3)), - ); - (*batch) - .w[4 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a3_r3, a7_r7), - aes_nohw_xor(r4, aes_nohw_rotate_rows_twice(a4_r4)), - ); - (*batch) - .w[5 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a4_r4, r5), - aes_nohw_rotate_rows_twice(a5_r5), - ); - (*batch) - .w[6 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a5_r5, r6), - aes_nohw_rotate_rows_twice(a6_r6), - ); - (*batch) - .w[7 as libc::c_int - as usize] = aes_nohw_xor( - aes_nohw_xor(a6_r6, r7), - aes_nohw_rotate_rows_twice(a7_r7), - ); -} -unsafe extern "C" fn aes_nohw_encrypt_batch( - mut key: *const AES_NOHW_SCHEDULE, - mut num_rounds: size_t, - mut batch: *mut AES_NOHW_BATCH, -) { - aes_nohw_add_round_key( - batch, - &*((*key).keys).as_ptr().offset(0 as libc::c_int as isize), - ); - let mut i: size_t = 1 as libc::c_int as size_t; - while i < num_rounds { - aes_nohw_sub_bytes(batch); - aes_nohw_shift_rows(batch); - aes_nohw_mix_columns(batch); - aes_nohw_add_round_key(batch, &*((*key).keys).as_ptr().offset(i as isize)); - i = i.wrapping_add(1); - } - aes_nohw_sub_bytes(batch); - aes_nohw_shift_rows(batch); - aes_nohw_add_round_key(batch, &*((*key).keys).as_ptr().offset(num_rounds as isize)); -} -unsafe extern "C" fn aes_nohw_expand_round_keys( - mut out: *mut AES_NOHW_SCHEDULE, - mut key: *const AES_KEY, -) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i <= (*key).rounds { - let mut j: size_t = 0 as libc::c_int as size_t; - while j < 2 as libc::c_int as libc::c_uint { - let mut tmp: [aes_word_t; 4] = [0; 4]; - OPENSSL_memcpy( - tmp.as_mut_ptr() as *mut libc::c_void, - ((*key).rd_key) - .as_ptr() - .offset((4 as libc::c_int as libc::c_uint).wrapping_mul(i) as isize) - as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - aes_nohw_batch_set( - &mut *((*out).keys).as_mut_ptr().offset(i as isize), - tmp.as_mut_ptr() as *const aes_word_t, - j, - ); - j = j.wrapping_add(1); - } - aes_nohw_transpose(&mut *((*out).keys).as_mut_ptr().offset(i as isize)); - i = i.wrapping_add(1); - } -} -static mut aes_nohw_rcon: [uint8_t; 10] = [ - 0x1 as libc::c_int as uint8_t, - 0x2 as libc::c_int as uint8_t, - 0x4 as libc::c_int as uint8_t, - 0x8 as libc::c_int as uint8_t, - 0x10 as libc::c_int as uint8_t, - 0x20 as libc::c_int as uint8_t, - 0x40 as libc::c_int as uint8_t, - 0x80 as libc::c_int as uint8_t, - 0x1b as libc::c_int as uint8_t, - 0x36 as libc::c_int as uint8_t, -]; -#[inline] -unsafe extern "C" fn aes_nohw_rcon_slice( - mut rcon: uint8_t, - mut i: size_t, -) -> aes_word_t { - rcon = (rcon as libc::c_int >> i.wrapping_mul(2 as libc::c_int as libc::c_uint) - & ((1 as libc::c_int) << 2 as libc::c_int) - 1 as libc::c_int) as uint8_t; - return rcon as aes_word_t; -} -unsafe extern "C" fn aes_nohw_sub_block( - mut out: *mut aes_word_t, - mut in_0: *const aes_word_t, -) { - let mut batch: AES_NOHW_BATCH = AES_NOHW_BATCH { w: [0; 8] }; - OPENSSL_memset( - &mut batch as *mut AES_NOHW_BATCH as *mut libc::c_void, - 0 as libc::c_int, - ::std::mem::size_of::() as libc::c_ulong, - ); - aes_nohw_batch_set(&mut batch, in_0, 0 as libc::c_int as size_t); - aes_nohw_transpose(&mut batch); - aes_nohw_sub_bytes(&mut batch); - aes_nohw_transpose(&mut batch); - aes_nohw_batch_get(&mut batch, out, 0 as libc::c_int as size_t); -} -unsafe extern "C" fn aes_nohw_setup_key_128( - mut key: *mut AES_KEY, - mut in_0: *const uint8_t, -) { - (*key).rounds = 10 as libc::c_int as libc::c_uint; - let mut block: [aes_word_t; 4] = [0; 4]; - aes_nohw_compact_block(block.as_mut_ptr(), in_0); - OPENSSL_memcpy( - ((*key).rd_key).as_mut_ptr() as *mut libc::c_void, - block.as_mut_ptr() as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - let mut i: size_t = 1 as libc::c_int as size_t; - while i <= 10 as libc::c_int as libc::c_uint { - let mut sub: [aes_word_t; 4] = [0; 4]; - aes_nohw_sub_block(sub.as_mut_ptr(), block.as_mut_ptr() as *const aes_word_t); - let mut rcon: uint8_t = aes_nohw_rcon[i - .wrapping_sub(1 as libc::c_int as libc::c_uint) as usize]; - let mut j: size_t = 0 as libc::c_int as size_t; - while j - < (16 as libc::c_int as libc::c_uint) - .wrapping_div(::std::mem::size_of::() as libc::c_ulong) - { - block[j - as usize] = aes_nohw_xor( - block[j as usize], - aes_nohw_rcon_slice(rcon, j), - ); - block[j - as usize] = aes_nohw_xor( - block[j as usize], - aes_nohw_shift_right( - aes_nohw_rotate_rows_down(sub[j as usize]), - 12 as libc::c_int as aes_word_t, - ), - ); - let mut v: aes_word_t = block[j as usize]; - block[j - as usize] = aes_nohw_xor( - block[j as usize], - aes_nohw_shift_left(v, 4 as libc::c_int as aes_word_t), - ); - block[j - as usize] = aes_nohw_xor( - block[j as usize], - aes_nohw_shift_left(v, 8 as libc::c_int as aes_word_t), - ); - block[j - as usize] = aes_nohw_xor( - block[j as usize], - aes_nohw_shift_left(v, 12 as libc::c_int as aes_word_t), - ); - j = j.wrapping_add(1); - } - OPENSSL_memcpy( - ((*key).rd_key) - .as_mut_ptr() - .offset((4 as libc::c_int as libc::c_uint).wrapping_mul(i) as isize) - as *mut libc::c_void, - block.as_mut_ptr() as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - i = i.wrapping_add(1); - } -} -unsafe extern "C" fn aes_nohw_setup_key_256( - mut key: *mut AES_KEY, - mut in_0: *const uint8_t, -) { - (*key).rounds = 14 as libc::c_int as libc::c_uint; - let mut block1: [aes_word_t; 4] = [0; 4]; - let mut block2: [aes_word_t; 4] = [0; 4]; - aes_nohw_compact_block(block1.as_mut_ptr(), in_0); - OPENSSL_memcpy( - ((*key).rd_key).as_mut_ptr() as *mut libc::c_void, - block1.as_mut_ptr() as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - aes_nohw_compact_block(block2.as_mut_ptr(), in_0.offset(16 as libc::c_int as isize)); - OPENSSL_memcpy( - ((*key).rd_key).as_mut_ptr().offset(4 as libc::c_int as isize) - as *mut libc::c_void, - block2.as_mut_ptr() as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - let mut i: size_t = 2 as libc::c_int as size_t; - while i <= 14 as libc::c_int as libc::c_uint { - let mut sub: [aes_word_t; 4] = [0; 4]; - aes_nohw_sub_block(sub.as_mut_ptr(), block2.as_mut_ptr() as *const aes_word_t); - let mut rcon: uint8_t = aes_nohw_rcon[i - .wrapping_div(2 as libc::c_int as libc::c_uint) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as usize]; - let mut j: size_t = 0 as libc::c_int as size_t; - while j - < (16 as libc::c_int as libc::c_uint) - .wrapping_div(::std::mem::size_of::() as libc::c_ulong) - { - block1[j - as usize] = aes_nohw_xor( - block1[j as usize], - aes_nohw_rcon_slice(rcon, j), - ); - block1[j - as usize] = aes_nohw_xor( - block1[j as usize], - aes_nohw_shift_right( - aes_nohw_rotate_rows_down(sub[j as usize]), - 12 as libc::c_int as aes_word_t, - ), - ); - let mut v: aes_word_t = block1[j as usize]; - block1[j - as usize] = aes_nohw_xor( - block1[j as usize], - aes_nohw_shift_left(v, 4 as libc::c_int as aes_word_t), - ); - block1[j - as usize] = aes_nohw_xor( - block1[j as usize], - aes_nohw_shift_left(v, 8 as libc::c_int as aes_word_t), - ); - block1[j - as usize] = aes_nohw_xor( - block1[j as usize], - aes_nohw_shift_left(v, 12 as libc::c_int as aes_word_t), - ); - j = j.wrapping_add(1); - } - OPENSSL_memcpy( - ((*key).rd_key) - .as_mut_ptr() - .offset((4 as libc::c_int as libc::c_uint).wrapping_mul(i) as isize) - as *mut libc::c_void, - block1.as_mut_ptr() as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - if i == 14 as libc::c_int as libc::c_uint { - break; - } - aes_nohw_sub_block(sub.as_mut_ptr(), block1.as_mut_ptr() as *const aes_word_t); - let mut j_0: size_t = 0 as libc::c_int as size_t; - while j_0 - < (16 as libc::c_int as libc::c_uint) - .wrapping_div(::std::mem::size_of::() as libc::c_ulong) - { - block2[j_0 - as usize] = aes_nohw_xor( - block2[j_0 as usize], - aes_nohw_shift_right(sub[j_0 as usize], 12 as libc::c_int as aes_word_t), - ); - let mut v_0: aes_word_t = block2[j_0 as usize]; - block2[j_0 - as usize] = aes_nohw_xor( - block2[j_0 as usize], - aes_nohw_shift_left(v_0, 4 as libc::c_int as aes_word_t), - ); - block2[j_0 - as usize] = aes_nohw_xor( - block2[j_0 as usize], - aes_nohw_shift_left(v_0, 8 as libc::c_int as aes_word_t), - ); - block2[j_0 - as usize] = aes_nohw_xor( - block2[j_0 as usize], - aes_nohw_shift_left(v_0, 12 as libc::c_int as aes_word_t), - ); - j_0 = j_0.wrapping_add(1); - } - OPENSSL_memcpy( - ((*key).rd_key) - .as_mut_ptr() - .offset( - (4 as libc::c_int as libc::c_uint) - .wrapping_mul(i.wrapping_add(1 as libc::c_int as libc::c_uint)) - as isize, - ) as *mut libc::c_void, - block2.as_mut_ptr() as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - i = (i as libc::c_uint).wrapping_add(2 as libc::c_int as libc::c_uint) as size_t - as size_t; - } -} -#[no_mangle] -pub unsafe extern "C" fn aes_nohw_set_encrypt_key( - mut key: *const uint8_t, - mut bits: libc::c_uint, - mut aeskey: *mut AES_KEY, -) -> libc::c_int { - match bits { - 128 => { - aes_nohw_setup_key_128(aeskey, key); - return 0 as libc::c_int; - } - 256 => { - aes_nohw_setup_key_256(aeskey, key); - return 0 as libc::c_int; - } - _ => {} - } - return 1 as libc::c_int; -} -#[no_mangle] -pub unsafe extern "C" fn aes_nohw_encrypt( - mut in_0: *const uint8_t, - mut out: *mut uint8_t, - mut key: *const AES_KEY, -) { - let mut sched: AES_NOHW_SCHEDULE = AES_NOHW_SCHEDULE { - keys: [AES_NOHW_BATCH { w: [0; 8] }; 15], - }; - aes_nohw_expand_round_keys(&mut sched, key); - let mut batch: AES_NOHW_BATCH = AES_NOHW_BATCH { w: [0; 8] }; - aes_nohw_to_batch(&mut batch, in_0, 1 as libc::c_int as size_t); - aes_nohw_encrypt_batch(&mut sched, (*key).rounds, &mut batch); - aes_nohw_from_batch(out, 1 as libc::c_int as size_t, &mut batch); -} -#[inline] -unsafe extern "C" fn aes_nohw_xor_block( - mut out: *mut uint8_t, - mut a: *const uint8_t, - mut b: *const uint8_t, -) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < 16 as libc::c_int as libc::c_uint { - let mut x: aes_word_t = 0; - let mut y: aes_word_t = 0; - OPENSSL_memcpy( - &mut x as *mut aes_word_t as *mut libc::c_void, - a.offset(i as isize) as *const libc::c_void, - ::std::mem::size_of::() as libc::c_ulong, - ); - OPENSSL_memcpy( - &mut y as *mut aes_word_t as *mut libc::c_void, - b.offset(i as isize) as *const libc::c_void, - ::std::mem::size_of::() as libc::c_ulong, - ); - x = aes_nohw_xor(x, y); - OPENSSL_memcpy( - out.offset(i as isize) as *mut libc::c_void, - &mut x as *mut aes_word_t as *const libc::c_void, - ::std::mem::size_of::() as libc::c_ulong, - ); - i = (i as libc::c_uint) - .wrapping_add(::std::mem::size_of::() as libc::c_ulong) as size_t - as size_t; - } -} -#[no_mangle] -pub unsafe extern "C" fn aes_nohw_ctr32_encrypt_blocks( - mut in_0: *const uint8_t, - mut out: *mut uint8_t, - mut blocks: size_t, - mut key: *const AES_KEY, - mut ivec: *const uint8_t, -) { - if blocks == 0 as libc::c_int as libc::c_uint { - return; - } - let mut sched: AES_NOHW_SCHEDULE = AES_NOHW_SCHEDULE { - keys: [AES_NOHW_BATCH { w: [0; 8] }; 15], - }; - aes_nohw_expand_round_keys(&mut sched, key); - let mut ivs: [uint8_t; 32] = [0; 32]; - let mut enc_ivs: [uint8_t; 32] = [0; 32]; - let mut i: size_t = 0 as libc::c_int as size_t; - while i < 2 as libc::c_int as libc::c_uint { - OPENSSL_memcpy( - ivs - .as_mut_ptr() - .offset((16 as libc::c_int as libc::c_uint).wrapping_mul(i) as isize) - as *mut libc::c_void, - ivec as *const libc::c_void, - 16 as libc::c_int as size_t, - ); - i = i.wrapping_add(1); - } - let mut ctr: uint32_t = CRYPTO_load_u32_be( - ivs.as_mut_ptr().offset(12 as libc::c_int as isize) as *const libc::c_void, - ); - loop { - let mut i_0: size_t = 0 as libc::c_int as size_t; - while i_0 < 2 as libc::c_int as libc::c_uint { - CRYPTO_store_u32_be( - ivs - .as_mut_ptr() - .offset( - (16 as libc::c_int as libc::c_uint).wrapping_mul(i_0) as isize, - ) - .offset(12 as libc::c_int as isize) as *mut libc::c_void, - ctr.wrapping_add(i_0), - ); - i_0 = i_0.wrapping_add(1); - } - let mut todo: size_t = if blocks >= 2 as libc::c_int as libc::c_uint { - 2 as libc::c_int as libc::c_uint - } else { - blocks - }; - let mut batch: AES_NOHW_BATCH = AES_NOHW_BATCH { w: [0; 8] }; - aes_nohw_to_batch(&mut batch, ivs.as_mut_ptr(), todo); - aes_nohw_encrypt_batch(&mut sched, (*key).rounds, &mut batch); - aes_nohw_from_batch(enc_ivs.as_mut_ptr(), todo, &mut batch); - let mut i_1: size_t = 0 as libc::c_int as size_t; - while i_1 < todo { - aes_nohw_xor_block( - out - .offset( - (16 as libc::c_int as libc::c_uint).wrapping_mul(i_1) as isize, - ), - in_0 - .offset( - (16 as libc::c_int as libc::c_uint).wrapping_mul(i_1) as isize, - ), - enc_ivs - .as_mut_ptr() - .offset( - (16 as libc::c_int as libc::c_uint).wrapping_mul(i_1) as isize, - ) as *const uint8_t, - ); - i_1 = i_1.wrapping_add(1); - } - blocks = (blocks as libc::c_uint).wrapping_sub(todo) as size_t as size_t; - if blocks == 0 as libc::c_int as libc::c_uint { - break; - } - in_0 = in_0.offset((16 as libc::c_int * 2 as libc::c_int) as isize); - out = out.offset((16 as libc::c_int * 2 as libc::c_int) as isize); - ctr = (ctr as libc::c_uint).wrapping_add(2 as libc::c_int as libc::c_uint) - as uint32_t as uint32_t; - }; -} diff --git a/crypto/fipsmodule/bn/montgomery.rs b/crypto/fipsmodule/bn/montgomery.rs deleted file mode 100644 index 6e7977ec82..0000000000 --- a/crypto/fipsmodule/bn/montgomery.rs +++ /dev/null @@ -1,158 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(asm, label_break_value, register_tool)] -use std::arch::asm; -extern "C" { - fn __assert_fail( - __assertion: *const libc::c_char, - __file: *const libc::c_char, - __line: libc::c_uint, - __function: *const libc::c_char, - ) -> !; - fn limbs_mul_add_limb( - r: *mut Limb, - a: *const Limb, - b: Limb, - num_limbs: size_t, - ) -> Limb; -} -pub type size_t = libc::c_uint; -pub type __uint32_t = libc::c_uint; -pub type __uint64_t = libc::c_ulonglong; -pub type uint32_t = __uint32_t; -pub type uint64_t = __uint64_t; -pub type crypto_word_t = uint32_t; -pub type BN_ULONG = crypto_word_t; -pub type Limb = crypto_word_t; -pub type Carry = Limb; -pub type DoubleLimb = uint64_t; -#[inline] -unsafe extern "C" fn value_barrier_w(mut a: crypto_word_t) -> crypto_word_t { - asm!("", inlateout(reg) a, options(preserves_flags, pure, readonly)); - return a; -} -#[inline] -unsafe extern "C" fn constant_time_select_w( - mut mask: crypto_word_t, - mut a: crypto_word_t, - mut b: crypto_word_t, -) -> crypto_word_t { - mask = value_barrier_w(mask); - return mask & a | !mask & b; -} -#[inline] -unsafe extern "C" fn limb_sbb( - mut r: *mut Limb, - mut a: Limb, - mut b: Limb, - mut borrow_in: Carry, -) -> Carry { - let mut ret: Carry = 0; - let mut x: DoubleLimb = (a as DoubleLimb) - .wrapping_sub(b as libc::c_ulonglong) - .wrapping_sub(borrow_in as libc::c_ulonglong); - *r = x as Limb; - ret = (x >> 32 as libc::c_uint & 1 as libc::c_int as libc::c_ulonglong) as Carry; - return ret; -} -#[inline] -unsafe extern "C" fn limb_sub(mut r: *mut Limb, mut a: Limb, mut b: Limb) -> Carry { - let mut ret: Carry = 0; - let mut x: DoubleLimb = (a as DoubleLimb).wrapping_sub(b as libc::c_ulonglong); - *r = x as Limb; - ret = (x >> 32 as libc::c_uint & 1 as libc::c_int as libc::c_ulonglong) as Carry; - return ret; -} -#[inline] -unsafe extern "C" fn limbs_sub( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, - mut num_limbs: size_t, -) -> Carry { - if num_limbs >= 1 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"num_limbs >= 1\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/bn/../../limbs/limbs.inl\0" as *const u8 - as *const libc::c_char, - 129 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 60], - &[libc::c_char; 60], - >(b"Carry limbs_sub(Limb *, const Limb *, const Limb *, size_t)\0")) - .as_ptr(), - ); - } - let mut borrow: Carry = limb_sub( - &mut *r.offset(0 as libc::c_int as isize), - *a.offset(0 as libc::c_int as isize), - *b.offset(0 as libc::c_int as isize), - ); - let mut i: size_t = 1 as libc::c_int as size_t; - while i < num_limbs { - borrow = limb_sbb( - &mut *r.offset(i as isize), - *a.offset(i as isize), - *b.offset(i as isize), - borrow, - ); - i = i.wrapping_add(1); - } - return borrow; -} -#[no_mangle] -pub unsafe extern "C" fn bn_from_montgomery_in_place( - mut r: *mut BN_ULONG, - mut num_r: size_t, - mut a: *mut BN_ULONG, - mut num_a: size_t, - mut n: *const BN_ULONG, - mut num_n: size_t, - mut n0_: *const BN_ULONG, -) -> libc::c_int { - if num_n == 0 as libc::c_int as libc::c_uint || num_r != num_n - || num_a != (2 as libc::c_int as libc::c_uint).wrapping_mul(num_n) - { - return 0 as libc::c_int; - } - let mut n0: BN_ULONG = *n0_.offset(0 as libc::c_int as isize); - let mut carry: BN_ULONG = 0 as libc::c_int as BN_ULONG; - let mut i: size_t = 0 as libc::c_int as size_t; - while i < num_n { - let mut v: BN_ULONG = limbs_mul_add_limb( - a.offset(i as isize), - n, - (*a.offset(i as isize)).wrapping_mul(n0), - num_n, - ); - v = (v as libc::c_uint) - .wrapping_add(carry.wrapping_add(*a.offset(i.wrapping_add(num_n) as isize))) - as BN_ULONG as BN_ULONG; - carry - |= (v != *a.offset(i.wrapping_add(num_n) as isize)) as libc::c_int - as libc::c_uint; - carry - &= (v <= *a.offset(i.wrapping_add(num_n) as isize)) as libc::c_int - as libc::c_uint; - *a.offset(i.wrapping_add(num_n) as isize) = v; - i = i.wrapping_add(1); - } - a = a.offset(num_n as isize); - let mut v_0: BN_ULONG = (limbs_sub(r, a as *const Limb, n, num_n)) - .wrapping_sub(carry); - v_0 = (0 as libc::c_uint).wrapping_sub(v_0); - let mut i_0: size_t = 0 as libc::c_int as size_t; - while i_0 < num_n { - *r - .offset( - i_0 as isize, - ) = constant_time_select_w( - v_0, - *a.offset(i_0 as isize), - *r.offset(i_0 as isize), - ); - *a.offset(i_0 as isize) = 0 as libc::c_int as BN_ULONG; - i_0 = i_0.wrapping_add(1); - } - return 1 as libc::c_int; -} diff --git a/crypto/fipsmodule/bn/montgomery_inv.rs b/crypto/fipsmodule/bn/montgomery_inv.rs deleted file mode 100644 index 513b58ce98..0000000000 --- a/crypto/fipsmodule/bn/montgomery_inv.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(register_tool)] -pub type size_t = libc::c_uint; -pub type __uint64_t = libc::c_ulonglong; -pub type uint64_t = __uint64_t; -#[no_mangle] -pub unsafe extern "C" fn bn_neg_inv_mod_r_u64(mut n: uint64_t) -> uint64_t { - static mut alpha: uint64_t = (1 as libc::c_ulonglong) - << 2 as libc::c_int * 32 as libc::c_int - 1 as libc::c_int; - let beta: uint64_t = n; - let mut u: uint64_t = 1 as libc::c_int as uint64_t; - let mut v: uint64_t = 0 as libc::c_int as uint64_t; - let mut i: size_t = 0 as libc::c_int as size_t; - while i < (2 as libc::c_int * 32 as libc::c_int) as libc::c_uint { - let mut u_is_odd: uint64_t = (0 as libc::c_ulonglong) - .wrapping_sub(u & 1 as libc::c_int as libc::c_ulonglong); - let mut beta_if_u_is_odd: uint64_t = beta & u_is_odd; - u = ((u ^ beta_if_u_is_odd) >> 1 as libc::c_int) - .wrapping_add(u & beta_if_u_is_odd); - let mut alpha_if_u_is_odd: uint64_t = alpha & u_is_odd; - v = (v >> 1 as libc::c_int).wrapping_add(alpha_if_u_is_odd); - i = i.wrapping_add(1); - } - return v; -} diff --git a/crypto/fipsmodule/ec/ecp_nistz.rs b/crypto/fipsmodule/ec/ecp_nistz.rs deleted file mode 100644 index d33c7119a6..0000000000 --- a/crypto/fipsmodule/ec/ecp_nistz.rs +++ /dev/null @@ -1,102 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(label_break_value, register_tool)] -extern "C" { - fn __assert_fail( - __assertion: *const libc::c_char, - __file: *const libc::c_char, - __line: libc::c_uint, - __function: *const libc::c_char, - ) -> !; -} -pub type size_t = libc::c_uint; -pub type __uint8_t = libc::c_uchar; -pub type __uint32_t = libc::c_uint; -pub type uint8_t = __uint8_t; -pub type uint32_t = __uint32_t; -pub type crypto_word_t = uint32_t; -pub type Limb = crypto_word_t; -#[no_mangle] -pub unsafe extern "C" fn little_endian_bytes_from_scalar( - mut str: *mut uint8_t, - mut str_len: size_t, - mut scalar: *const Limb, - mut num_limbs: size_t, -) { - if str_len - == num_limbs - .wrapping_mul(::std::mem::size_of::() as libc::c_ulong) - .wrapping_add(1 as libc::c_int as libc::c_uint) - {} else { - __assert_fail( - b"str_len == (num_limbs * sizeof(Limb)) + 1\0" as *const u8 - as *const libc::c_char, - b"crypto/fipsmodule/ec/ecp_nistz.c\0" as *const u8 as *const libc::c_char, - 31 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 78], - &[libc::c_char; 78], - >( - b"void little_endian_bytes_from_scalar(uint8_t *, size_t, const Limb *, size_t)\0", - )) - .as_ptr(), - ); - } - let mut i: size_t = 0; - i = 0 as libc::c_int as size_t; - while i < num_limbs.wrapping_mul(::std::mem::size_of::() as libc::c_ulong) { - let mut d: Limb = *scalar - .offset( - i.wrapping_div(::std::mem::size_of::() as libc::c_ulong) as isize, - ); - *str - .offset( - i.wrapping_add(0 as libc::c_int as libc::c_uint) as isize, - ) = (d & 0xff as libc::c_int as libc::c_uint) as uint8_t; - *str - .offset( - i.wrapping_add(1 as libc::c_int as libc::c_uint) as isize, - ) = (d >> 8 as libc::c_int & 0xff as libc::c_int as libc::c_uint) as uint8_t; - *str - .offset( - i.wrapping_add(2 as libc::c_int as libc::c_uint) as isize, - ) = (d >> 16 as libc::c_int & 0xff as libc::c_int as libc::c_uint) - as uint8_t; - d >>= 24 as libc::c_int; - *str - .offset( - i.wrapping_add(3 as libc::c_int as libc::c_uint) as isize, - ) = (d & 0xff as libc::c_int as libc::c_uint) as uint8_t; - if ::std::mem::size_of::() as libc::c_ulong - == 8 as libc::c_int as libc::c_uint - { - d >>= 8 as libc::c_int; - *str - .offset( - i.wrapping_add(4 as libc::c_int as libc::c_uint) as isize, - ) = (d & 0xff as libc::c_int as libc::c_uint) as uint8_t; - *str - .offset( - i.wrapping_add(5 as libc::c_int as libc::c_uint) as isize, - ) = (d >> 8 as libc::c_int & 0xff as libc::c_int as libc::c_uint) - as uint8_t; - *str - .offset( - i.wrapping_add(6 as libc::c_int as libc::c_uint) as isize, - ) = (d >> 16 as libc::c_int & 0xff as libc::c_int as libc::c_uint) - as uint8_t; - *str - .offset( - i.wrapping_add(7 as libc::c_int as libc::c_uint) as isize, - ) = (d >> 24 as libc::c_int & 0xff as libc::c_int as libc::c_uint) - as uint8_t; - } - i = (i as libc::c_uint) - .wrapping_add(::std::mem::size_of::() as libc::c_ulong) as size_t - as size_t; - } - while i < str_len { - *str.offset(i as isize) = 0 as libc::c_int as uint8_t; - i = i.wrapping_add(1); - } -} diff --git a/crypto/fipsmodule/ec/gfp_p256.rs b/crypto/fipsmodule/ec/gfp_p256.rs deleted file mode 100644 index 7456baffd3..0000000000 --- a/crypto/fipsmodule/ec/gfp_p256.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(register_tool)] -extern "C" { - fn bn_mul_mont( - rp: *mut BN_ULONG, - ap: *const BN_ULONG, - bp: *const BN_ULONG, - np: *const BN_ULONG, - n0: *const BN_ULONG, - num: size_t, - ); -} -pub type size_t = libc::c_uint; -pub type __uint32_t = libc::c_uint; -pub type uint32_t = __uint32_t; -pub type crypto_word_t = uint32_t; -pub type BN_ULONG = crypto_word_t; -pub type Limb = crypto_word_t; -static mut N: [BN_ULONG; 8] = [ - 0xfc632551 as libc::c_uint, - 0xf3b9cac2 as libc::c_uint, - 0xa7179e84 as libc::c_uint, - 0xbce6faad as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0 as libc::c_int as BN_ULONG, - 0xffffffff as libc::c_uint, -]; -static mut N_N0: [BN_ULONG; 2] = [ - 0xee00bc4f as libc::c_uint, - 0xccd1c8aa as libc::c_uint, -]; -#[no_mangle] -pub unsafe extern "C" fn p256_scalar_mul_mont( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, -) { - bn_mul_mont( - r, - a, - b, - N.as_ptr(), - N_N0.as_ptr(), - (256 as libc::c_int / 32 as libc::c_int) as size_t, - ); -} -#[no_mangle] -pub unsafe extern "C" fn p256_scalar_sqr_rep_mont( - mut r: *mut Limb, - mut a: *const Limb, - mut rep: Limb, -) { - p256_scalar_mul_mont(r, a, a); - let mut i: Limb = 1 as libc::c_int as Limb; - while i < rep { - p256_scalar_mul_mont(r, r as *const Limb, r as *const Limb); - i = i.wrapping_add(1); - } -} diff --git a/crypto/fipsmodule/ec/gfp_p384.rs b/crypto/fipsmodule/ec/gfp_p384.rs deleted file mode 100644 index a90a8334e7..0000000000 --- a/crypto/fipsmodule/ec/gfp_p384.rs +++ /dev/null @@ -1,1094 +0,0 @@ -#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals, unused_assignments, unused_mut)] -#![register_tool(c2rust)] -#![feature(asm, label_break_value, register_tool)] -use std::arch::asm; -extern "C" { - fn __assert_fail( - __assertion: *const libc::c_char, - __file: *const libc::c_char, - __line: libc::c_uint, - __function: *const libc::c_char, - ) -> !; - fn LIMBS_shl_mod(r: *mut Limb, a: *const Limb, m: *const Limb, num_limbs: size_t); - fn LIMBS_sub_mod( - r: *mut Limb, - a: *const Limb, - b: *const Limb, - m: *const Limb, - num_limbs: size_t, - ); - fn LIMBS_add_mod( - r: *mut Limb, - a: *const Limb, - b: *const Limb, - m: *const Limb, - num_limbs: size_t, - ); - fn LIMBS_equal(a: *const Limb, b: *const Limb, num_limbs: size_t) -> Limb; - fn LIMBS_are_zero(a: *const Limb, num_limbs: size_t) -> Limb; - fn bn_mul_mont( - rp: *mut BN_ULONG, - ap: *const BN_ULONG, - bp: *const BN_ULONG, - np: *const BN_ULONG, - n0: *const BN_ULONG, - num: size_t, - ); - fn little_endian_bytes_from_scalar( - str: *mut uint8_t, - str_len: size_t, - scalar: *const Limb, - num_limbs: size_t, - ); -} -pub type size_t = libc::c_uint; -pub type __uint8_t = libc::c_uchar; -pub type __uint32_t = libc::c_uint; -pub type __uint64_t = libc::c_ulonglong; -pub type uint8_t = __uint8_t; -pub type uint32_t = __uint32_t; -pub type uint64_t = __uint64_t; -pub type crypto_word_t = uint32_t; -pub type Limb = crypto_word_t; -#[derive(Copy, Clone)] -#[repr(C)] -pub struct P384_POINT { - pub X: [Limb; 12], - pub Y: [Limb; 12], - pub Z: [Limb; 12], -} -pub type BN_ULONG = crypto_word_t; -pub type Carry = Limb; -pub type DoubleLimb = uint64_t; -pub type Elem = [Limb; 12]; -#[inline] -unsafe extern "C" fn value_barrier_w(mut a: crypto_word_t) -> crypto_word_t { - asm!("", inlateout(reg) a, options(preserves_flags, pure, readonly)); - return a; -} -#[inline] -unsafe extern "C" fn constant_time_msb_w(mut a: crypto_word_t) -> crypto_word_t { - return (0 as libc::c_uint) - .wrapping_sub( - a - >> (::std::mem::size_of::() as libc::c_ulong) - .wrapping_mul(8 as libc::c_int as libc::c_uint) - .wrapping_sub(1 as libc::c_int as libc::c_uint), - ); -} -#[inline] -unsafe extern "C" fn constant_time_is_zero_w(mut a: crypto_word_t) -> crypto_word_t { - return constant_time_msb_w(!a & a.wrapping_sub(1 as libc::c_int as libc::c_uint)); -} -#[inline] -unsafe extern "C" fn constant_time_is_nonzero_w(mut a: crypto_word_t) -> crypto_word_t { - return !constant_time_is_zero_w(a); -} -#[inline] -unsafe extern "C" fn constant_time_eq_w( - mut a: crypto_word_t, - mut b: crypto_word_t, -) -> crypto_word_t { - return constant_time_is_zero_w(a ^ b); -} -#[inline] -unsafe extern "C" fn constant_time_select_w( - mut mask: crypto_word_t, - mut a: crypto_word_t, - mut b: crypto_word_t, -) -> crypto_word_t { - mask = value_barrier_w(mask); - return mask & a | !mask & b; -} -#[inline] -unsafe extern "C" fn limb_adc( - mut r: *mut Limb, - mut a: Limb, - mut b: Limb, - mut carry_in: Carry, -) -> Carry { - let mut ret: Carry = 0; - let mut x: DoubleLimb = (a as DoubleLimb) - .wrapping_add(b as libc::c_ulonglong) - .wrapping_add(carry_in as libc::c_ulonglong); - *r = x as Limb; - ret = (x >> 32 as libc::c_uint) as Carry; - return ret; -} -#[inline] -unsafe extern "C" fn limb_add(mut r: *mut Limb, mut a: Limb, mut b: Limb) -> Carry { - let mut ret: Carry = 0; - let mut x: DoubleLimb = (a as DoubleLimb).wrapping_add(b as libc::c_ulonglong); - *r = x as Limb; - ret = (x >> 32 as libc::c_uint) as Carry; - return ret; -} -#[inline] -unsafe extern "C" fn limb_sbb( - mut r: *mut Limb, - mut a: Limb, - mut b: Limb, - mut borrow_in: Carry, -) -> Carry { - let mut ret: Carry = 0; - let mut x: DoubleLimb = (a as DoubleLimb) - .wrapping_sub(b as libc::c_ulonglong) - .wrapping_sub(borrow_in as libc::c_ulonglong); - *r = x as Limb; - ret = (x >> 32 as libc::c_uint & 1 as libc::c_int as libc::c_ulonglong) as Carry; - return ret; -} -#[inline] -unsafe extern "C" fn limb_sub(mut r: *mut Limb, mut a: Limb, mut b: Limb) -> Carry { - let mut ret: Carry = 0; - let mut x: DoubleLimb = (a as DoubleLimb).wrapping_sub(b as libc::c_ulonglong); - *r = x as Limb; - ret = (x >> 32 as libc::c_uint & 1 as libc::c_int as libc::c_ulonglong) as Carry; - return ret; -} -#[inline] -unsafe extern "C" fn limbs_add( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, - mut num_limbs: size_t, -) -> Carry { - if num_limbs >= 1 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"num_limbs >= 1\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/ec/../../limbs/limbs.inl\0" as *const u8 - as *const libc::c_char, - 118 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 60], - &[libc::c_char; 60], - >(b"Carry limbs_add(Limb *, const Limb *, const Limb *, size_t)\0")) - .as_ptr(), - ); - } - let mut carry: Carry = limb_add( - &mut *r.offset(0 as libc::c_int as isize), - *a.offset(0 as libc::c_int as isize), - *b.offset(0 as libc::c_int as isize), - ); - let mut i: size_t = 1 as libc::c_int as size_t; - while i < num_limbs { - carry = limb_adc( - &mut *r.offset(i as isize), - *a.offset(i as isize), - *b.offset(i as isize), - carry, - ); - i = i.wrapping_add(1); - } - return carry; -} -#[inline] -unsafe extern "C" fn limbs_sub( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, - mut num_limbs: size_t, -) -> Carry { - if num_limbs >= 1 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"num_limbs >= 1\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/ec/../../limbs/limbs.inl\0" as *const u8 - as *const libc::c_char, - 129 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 60], - &[libc::c_char; 60], - >(b"Carry limbs_sub(Limb *, const Limb *, const Limb *, size_t)\0")) - .as_ptr(), - ); - } - let mut borrow: Carry = limb_sub( - &mut *r.offset(0 as libc::c_int as isize), - *a.offset(0 as libc::c_int as isize), - *b.offset(0 as libc::c_int as isize), - ); - let mut i: size_t = 1 as libc::c_int as size_t; - while i < num_limbs { - borrow = limb_sbb( - &mut *r.offset(i as isize), - *a.offset(i as isize), - *b.offset(i as isize), - borrow, - ); - i = i.wrapping_add(1); - } - return borrow; -} -#[inline] -unsafe extern "C" fn limbs_copy( - mut r: *mut Limb, - mut a: *const Limb, - mut num_limbs: size_t, -) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < num_limbs { - *r.offset(i as isize) = *a.offset(i as isize); - i = i.wrapping_add(1); - } -} -#[inline] -unsafe extern "C" fn limbs_zero(mut r: *mut Limb, mut num_limbs: size_t) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < num_limbs { - *r.offset(i as isize) = 0 as libc::c_int as Limb; - i = i.wrapping_add(1); - } -} -static mut Q: [BN_ULONG; 12] = [ - 0xffffffff as libc::c_uint, - 0 as libc::c_int as BN_ULONG, - 0 as libc::c_int as BN_ULONG, - 0xffffffff as libc::c_uint, - 0xfffffffe as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, -]; -static mut N: [BN_ULONG; 12] = [ - 0xccc52973 as libc::c_uint, - 0xecec196a as libc::c_uint, - 0x48b0a77a as libc::c_int as BN_ULONG, - 0x581a0db2 as libc::c_int as BN_ULONG, - 0xf4372ddf as libc::c_uint, - 0xc7634d81 as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, -]; -static mut ONE: [BN_ULONG; 12] = [ - 1 as libc::c_int as BN_ULONG, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0 as libc::c_int as BN_ULONG, - 1 as libc::c_int as BN_ULONG, - 0 as libc::c_int as BN_ULONG, - 0 as libc::c_int as BN_ULONG, - 0 as libc::c_int as BN_ULONG, - 0 as libc::c_int as BN_ULONG, - 0 as libc::c_int as BN_ULONG, - 0, - 0, -]; -static mut Q_PLUS_1_SHR_1: Elem = [ - 0x80000000 as libc::c_uint, - 0 as libc::c_int as Limb, - 0x80000000 as libc::c_uint, - 0x7fffffff as libc::c_int as Limb, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0xffffffff as libc::c_uint, - 0x7fffffff as libc::c_int as Limb, -]; -static mut Q_N0: [BN_ULONG; 2] = [ - 1 as libc::c_int as BN_ULONG, - 1 as libc::c_int as BN_ULONG, -]; -static mut N_N0: [BN_ULONG; 2] = [ - 0xe88fdc45 as libc::c_uint, - 0x6ed46089 as libc::c_int as BN_ULONG, -]; -#[inline] -unsafe extern "C" fn is_equal(mut a: *const Limb, mut b: *const Limb) -> Limb { - return LIMBS_equal(a, b, (384 as libc::c_uint).wrapping_div(32 as libc::c_uint)); -} -#[inline] -unsafe extern "C" fn is_zero(mut a: *const BN_ULONG) -> Limb { - return LIMBS_are_zero(a, (384 as libc::c_uint).wrapping_div(32 as libc::c_uint)); -} -#[inline] -unsafe extern "C" fn copy_conditional( - mut r: *mut Limb, - mut a: *const Limb, - condition: Limb, -) { - let mut i: size_t = 0 as libc::c_int as size_t; - while i < (384 as libc::c_uint).wrapping_div(32 as libc::c_uint) { - *r - .offset( - i as isize, - ) = constant_time_select_w( - condition, - *a.offset(i as isize), - *r.offset(i as isize), - ); - i = i.wrapping_add(1); - } -} -#[inline] -unsafe extern "C" fn elem_add(mut r: *mut Limb, mut a: *const Limb, mut b: *const Limb) { - LIMBS_add_mod( - r, - a, - b, - Q.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -#[inline] -unsafe extern "C" fn elem_sub(mut r: *mut Limb, mut a: *const Limb, mut b: *const Limb) { - LIMBS_sub_mod( - r, - a, - b, - Q.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -unsafe extern "C" fn elem_div_by_2(mut r: *mut Limb, mut a: *const Limb) { - let mut is_odd: Limb = constant_time_is_nonzero_w( - *a.offset(0 as libc::c_int as isize) & 1 as libc::c_int as libc::c_uint, - ); - let mut carry: Limb = *a - .offset( - (384 as libc::c_uint) - .wrapping_div(32 as libc::c_uint) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as isize, - ) & 1 as libc::c_int as libc::c_uint; - *r - .offset( - (384 as libc::c_uint) - .wrapping_div(32 as libc::c_uint) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as isize, - ) = *a - .offset( - (384 as libc::c_uint) - .wrapping_div(32 as libc::c_uint) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as isize, - ) >> 1 as libc::c_int; - let mut i: size_t = 1 as libc::c_int as size_t; - while i < (384 as libc::c_uint).wrapping_div(32 as libc::c_uint) { - let mut new_carry: Limb = *a - .offset( - (384 as libc::c_uint) - .wrapping_div(32 as libc::c_uint) - .wrapping_sub(i) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as isize, - ); - *r - .offset( - (384 as libc::c_uint) - .wrapping_div(32 as libc::c_uint) - .wrapping_sub(i) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as isize, - ) = *a - .offset( - (384 as libc::c_uint) - .wrapping_div(32 as libc::c_uint) - .wrapping_sub(i) - .wrapping_sub(1 as libc::c_int as libc::c_uint) as isize, - ) >> 1 as libc::c_int - | carry - << (32 as libc::c_uint).wrapping_sub(1 as libc::c_int as libc::c_uint); - carry = new_carry; - i = i.wrapping_add(1); - } - let mut adjusted: Elem = [0; 12]; - let mut carry2: BN_ULONG = limbs_add( - adjusted.as_mut_ptr(), - r as *const Limb, - Q_PLUS_1_SHR_1.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - copy_conditional(r, adjusted.as_mut_ptr() as *const Limb, is_odd); -} -#[inline] -unsafe extern "C" fn elem_mul_mont( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, -) { - bn_mul_mont( - r, - a, - b, - Q.as_ptr(), - Q_N0.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -#[inline] -unsafe extern "C" fn elem_mul_by_2(mut r: *mut Limb, mut a: *const Limb) { - LIMBS_shl_mod( - r, - a, - Q.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -#[inline] -unsafe extern "C" fn elem_mul_by_3(mut r: *mut Limb, mut a: *const Limb) { - let mut doubled: Elem = [0; 12]; - elem_add(doubled.as_mut_ptr(), a, a); - elem_add(r, doubled.as_mut_ptr() as *const Limb, a); -} -#[inline] -unsafe extern "C" fn elem_sqr_mont(mut r: *mut Limb, mut a: *const Limb) { - elem_mul_mont(r, a, a); -} -#[no_mangle] -pub unsafe extern "C" fn p384_elem_sub( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, -) { - elem_sub(r, a, b); -} -#[no_mangle] -pub unsafe extern "C" fn p384_elem_div_by_2(mut r: *mut Limb, mut a: *const Limb) { - elem_div_by_2(r, a); -} -#[no_mangle] -pub unsafe extern "C" fn p384_elem_mul_mont( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, -) { - elem_mul_mont(r, a, b); -} -#[no_mangle] -pub unsafe extern "C" fn p384_elem_neg(mut r: *mut Limb, mut a: *const Limb) { - let mut is_zero_0: Limb = LIMBS_are_zero( - a, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - let mut borrow: Carry = limbs_sub( - r, - Q.as_ptr(), - a, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - let mut i: size_t = 0 as libc::c_int as size_t; - while i < (384 as libc::c_uint).wrapping_div(32 as libc::c_uint) { - *r - .offset( - i as isize, - ) = constant_time_select_w( - is_zero_0, - 0 as libc::c_int as crypto_word_t, - *r.offset(i as isize), - ); - i = i.wrapping_add(1); - } -} -#[no_mangle] -pub unsafe extern "C" fn p384_scalar_mul_mont( - mut r: *mut Limb, - mut a: *const Limb, - mut b: *const Limb, -) { - bn_mul_mont( - r, - a, - b, - N.as_ptr(), - N_N0.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -unsafe extern "C" fn p384_point_select_w5( - mut out: *mut P384_POINT, - mut table: *const P384_POINT, - mut index: size_t, -) { - let mut x: Elem = [0; 12]; - limbs_zero(x.as_mut_ptr(), (384 as libc::c_uint).wrapping_div(32 as libc::c_uint)); - let mut y: Elem = [0; 12]; - limbs_zero(y.as_mut_ptr(), (384 as libc::c_uint).wrapping_div(32 as libc::c_uint)); - let mut z: Elem = [0; 12]; - limbs_zero(z.as_mut_ptr(), (384 as libc::c_uint).wrapping_div(32 as libc::c_uint)); - let mut i: size_t = 0 as libc::c_int as size_t; - while i < 16 as libc::c_int as libc::c_uint { - let mut equal: crypto_word_t = constant_time_eq_w( - index, - i.wrapping_add(1 as libc::c_int as libc::c_uint), - ); - let mut j: size_t = 0 as libc::c_int as size_t; - while j < (384 as libc::c_uint).wrapping_div(32 as libc::c_uint) { - x[j - as usize] = constant_time_select_w( - equal, - (*table.offset(i as isize)).X[j as usize], - x[j as usize], - ); - y[j - as usize] = constant_time_select_w( - equal, - (*table.offset(i as isize)).Y[j as usize], - y[j as usize], - ); - z[j - as usize] = constant_time_select_w( - equal, - (*table.offset(i as isize)).Z[j as usize], - z[j as usize], - ); - j = j.wrapping_add(1); - } - i = i.wrapping_add(1); - } - limbs_copy( - ((*out).X).as_mut_ptr(), - x.as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - ((*out).Y).as_mut_ptr(), - y.as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - ((*out).Z).as_mut_ptr(), - z.as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -#[inline] -unsafe extern "C" fn booth_recode( - mut is_negative: *mut crypto_word_t, - mut digit: *mut crypto_word_t, - mut in_0: crypto_word_t, - mut w: crypto_word_t, -) { - if w >= 2 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"w >= 2\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/ec/ecp_nistz.h\0" as *const u8 as *const libc::c_char, - 251 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 82], - &[libc::c_char; 82], - >( - b"void booth_recode(crypto_word_t *, crypto_word_t *, crypto_word_t, crypto_word_t)\0", - )) - .as_ptr(), - ); - } - if w <= 7 as libc::c_int as libc::c_uint {} else { - __assert_fail( - b"w <= 7\0" as *const u8 as *const libc::c_char, - b"crypto/fipsmodule/ec/ecp_nistz.h\0" as *const u8 as *const libc::c_char, - 252 as libc::c_int as libc::c_uint, - (*::std::mem::transmute::< - &[u8; 82], - &[libc::c_char; 82], - >( - b"void booth_recode(crypto_word_t *, crypto_word_t *, crypto_word_t, crypto_word_t)\0", - )) - .as_ptr(), - ); - } - let mut s: crypto_word_t = !(in_0 >> w) - .wrapping_sub(1 as libc::c_int as libc::c_uint); - let mut d: crypto_word_t = 0; - d = ((1 as libc::c_uint) << w.wrapping_add(1 as libc::c_int as libc::c_uint)) - .wrapping_sub(in_0) - .wrapping_sub(1 as libc::c_int as libc::c_uint); - d = d & s | in_0 & !s; - d = (d >> 1 as libc::c_int).wrapping_add(d & 1 as libc::c_int as libc::c_uint); - *is_negative = constant_time_is_nonzero_w(s & 1 as libc::c_int as libc::c_uint); - *digit = d; -} -unsafe extern "C" fn nistz384_point_double( - mut r: *mut P384_POINT, - mut a: *const P384_POINT, -) { - let mut S: [BN_ULONG; 12] = [0; 12]; - let mut M: [BN_ULONG; 12] = [0; 12]; - let mut Zsqr: [BN_ULONG; 12] = [0; 12]; - let mut tmp0: [BN_ULONG; 12] = [0; 12]; - let mut in_x: *const BN_ULONG = ((*a).X).as_ptr(); - let mut in_y: *const BN_ULONG = ((*a).Y).as_ptr(); - let mut in_z: *const BN_ULONG = ((*a).Z).as_ptr(); - let mut res_x: *mut BN_ULONG = ((*r).X).as_mut_ptr(); - let mut res_y: *mut BN_ULONG = ((*r).Y).as_mut_ptr(); - let mut res_z: *mut BN_ULONG = ((*r).Z).as_mut_ptr(); - elem_mul_by_2(S.as_mut_ptr(), in_y); - elem_sqr_mont(Zsqr.as_mut_ptr(), in_z); - elem_sqr_mont(S.as_mut_ptr(), S.as_mut_ptr() as *const Limb); - elem_mul_mont(res_z, in_z, in_y); - elem_mul_by_2(res_z, res_z as *const Limb); - elem_add(M.as_mut_ptr(), in_x, Zsqr.as_mut_ptr() as *const Limb); - elem_sub(Zsqr.as_mut_ptr(), in_x, Zsqr.as_mut_ptr() as *const Limb); - elem_sqr_mont(res_y, S.as_mut_ptr() as *const Limb); - elem_div_by_2(res_y, res_y as *const Limb); - elem_mul_mont( - M.as_mut_ptr(), - M.as_mut_ptr() as *const Limb, - Zsqr.as_mut_ptr() as *const Limb, - ); - elem_mul_by_3(M.as_mut_ptr(), M.as_mut_ptr() as *const Limb); - elem_mul_mont(S.as_mut_ptr(), S.as_mut_ptr() as *const Limb, in_x); - elem_mul_by_2(tmp0.as_mut_ptr(), S.as_mut_ptr() as *const Limb); - elem_sqr_mont(res_x, M.as_mut_ptr() as *const Limb); - elem_sub(res_x, res_x as *const Limb, tmp0.as_mut_ptr() as *const Limb); - elem_sub(S.as_mut_ptr(), S.as_mut_ptr() as *const Limb, res_x as *const Limb); - elem_mul_mont( - S.as_mut_ptr(), - S.as_mut_ptr() as *const Limb, - M.as_mut_ptr() as *const Limb, - ); - elem_sub(res_y, S.as_mut_ptr() as *const Limb, res_y as *const Limb); -} -unsafe extern "C" fn nistz384_point_add( - mut r: *mut P384_POINT, - mut a: *const P384_POINT, - mut b: *const P384_POINT, -) { - let mut U2: [BN_ULONG; 12] = [0; 12]; - let mut S2: [BN_ULONG; 12] = [0; 12]; - let mut U1: [BN_ULONG; 12] = [0; 12]; - let mut S1: [BN_ULONG; 12] = [0; 12]; - let mut Z1sqr: [BN_ULONG; 12] = [0; 12]; - let mut Z2sqr: [BN_ULONG; 12] = [0; 12]; - let mut H: [BN_ULONG; 12] = [0; 12]; - let mut R: [BN_ULONG; 12] = [0; 12]; - let mut Hsqr: [BN_ULONG; 12] = [0; 12]; - let mut Rsqr: [BN_ULONG; 12] = [0; 12]; - let mut Hcub: [BN_ULONG; 12] = [0; 12]; - let mut res_x: [BN_ULONG; 12] = [0; 12]; - let mut res_y: [BN_ULONG; 12] = [0; 12]; - let mut res_z: [BN_ULONG; 12] = [0; 12]; - let mut in1_x: *const BN_ULONG = ((*a).X).as_ptr(); - let mut in1_y: *const BN_ULONG = ((*a).Y).as_ptr(); - let mut in1_z: *const BN_ULONG = ((*a).Z).as_ptr(); - let mut in2_x: *const BN_ULONG = ((*b).X).as_ptr(); - let mut in2_y: *const BN_ULONG = ((*b).Y).as_ptr(); - let mut in2_z: *const BN_ULONG = ((*b).Z).as_ptr(); - let mut in1infty: BN_ULONG = is_zero(((*a).Z).as_ptr()); - let mut in2infty: BN_ULONG = is_zero(((*b).Z).as_ptr()); - elem_sqr_mont(Z2sqr.as_mut_ptr(), in2_z); - elem_sqr_mont(Z1sqr.as_mut_ptr(), in1_z); - elem_mul_mont(S1.as_mut_ptr(), Z2sqr.as_mut_ptr() as *const Limb, in2_z); - elem_mul_mont(S2.as_mut_ptr(), Z1sqr.as_mut_ptr() as *const Limb, in1_z); - elem_mul_mont(S1.as_mut_ptr(), S1.as_mut_ptr() as *const Limb, in1_y); - elem_mul_mont(S2.as_mut_ptr(), S2.as_mut_ptr() as *const Limb, in2_y); - elem_sub( - R.as_mut_ptr(), - S2.as_mut_ptr() as *const Limb, - S1.as_mut_ptr() as *const Limb, - ); - elem_mul_mont(U1.as_mut_ptr(), in1_x, Z2sqr.as_mut_ptr() as *const Limb); - elem_mul_mont(U2.as_mut_ptr(), in2_x, Z1sqr.as_mut_ptr() as *const Limb); - elem_sub( - H.as_mut_ptr(), - U2.as_mut_ptr() as *const Limb, - U1.as_mut_ptr() as *const Limb, - ); - let mut is_exceptional: BN_ULONG = is_equal( - U1.as_mut_ptr() as *const Limb, - U2.as_mut_ptr() as *const Limb, - ) & !in1infty & !in2infty; - if is_exceptional != 0 { - if is_equal(S1.as_mut_ptr() as *const Limb, S2.as_mut_ptr() as *const Limb) != 0 - { - nistz384_point_double(r, a); - } else { - limbs_zero( - ((*r).X).as_mut_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_zero( - ((*r).Y).as_mut_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_zero( - ((*r).Z).as_mut_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - } - return; - } - elem_sqr_mont(Rsqr.as_mut_ptr(), R.as_mut_ptr() as *const Limb); - elem_mul_mont(res_z.as_mut_ptr(), H.as_mut_ptr() as *const Limb, in1_z); - elem_sqr_mont(Hsqr.as_mut_ptr(), H.as_mut_ptr() as *const Limb); - elem_mul_mont(res_z.as_mut_ptr(), res_z.as_mut_ptr() as *const Limb, in2_z); - elem_mul_mont( - Hcub.as_mut_ptr(), - Hsqr.as_mut_ptr() as *const Limb, - H.as_mut_ptr() as *const Limb, - ); - elem_mul_mont( - U2.as_mut_ptr(), - U1.as_mut_ptr() as *const Limb, - Hsqr.as_mut_ptr() as *const Limb, - ); - elem_mul_by_2(Hsqr.as_mut_ptr(), U2.as_mut_ptr() as *const Limb); - elem_sub( - res_x.as_mut_ptr(), - Rsqr.as_mut_ptr() as *const Limb, - Hsqr.as_mut_ptr() as *const Limb, - ); - elem_sub( - res_x.as_mut_ptr(), - res_x.as_mut_ptr() as *const Limb, - Hcub.as_mut_ptr() as *const Limb, - ); - elem_sub( - res_y.as_mut_ptr(), - U2.as_mut_ptr() as *const Limb, - res_x.as_mut_ptr() as *const Limb, - ); - elem_mul_mont( - S2.as_mut_ptr(), - S1.as_mut_ptr() as *const Limb, - Hcub.as_mut_ptr() as *const Limb, - ); - elem_mul_mont( - res_y.as_mut_ptr(), - R.as_mut_ptr() as *const Limb, - res_y.as_mut_ptr() as *const Limb, - ); - elem_sub( - res_y.as_mut_ptr(), - res_y.as_mut_ptr() as *const Limb, - S2.as_mut_ptr() as *const Limb, - ); - copy_conditional(res_x.as_mut_ptr(), in2_x, in1infty); - copy_conditional(res_y.as_mut_ptr(), in2_y, in1infty); - copy_conditional(res_z.as_mut_ptr(), in2_z, in1infty); - copy_conditional(res_x.as_mut_ptr(), in1_x, in2infty); - copy_conditional(res_y.as_mut_ptr(), in1_y, in2infty); - copy_conditional(res_z.as_mut_ptr(), in1_z, in2infty); - limbs_copy( - ((*r).X).as_mut_ptr(), - res_x.as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - ((*r).Y).as_mut_ptr(), - res_y.as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - ((*r).Z).as_mut_ptr(), - res_z.as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -unsafe extern "C" fn add_precomputed_w5( - mut r: *mut P384_POINT, - mut wvalue: crypto_word_t, - mut table: *const P384_POINT, -) { - let mut recoded_is_negative: crypto_word_t = 0; - let mut recoded: crypto_word_t = 0; - booth_recode( - &mut recoded_is_negative, - &mut recoded, - wvalue, - 5 as libc::c_int as crypto_word_t, - ); - let mut h: P384_POINT = P384_POINT { - X: [0; 12], - Y: [0; 12], - Z: [0; 12], - }; - p384_point_select_w5(&mut h, table, recoded); - let mut tmp: [BN_ULONG; 12] = [0; 12]; - p384_elem_neg(tmp.as_mut_ptr(), (h.Y).as_mut_ptr() as *const Limb); - copy_conditional( - (h.Y).as_mut_ptr(), - tmp.as_mut_ptr() as *const Limb, - recoded_is_negative, - ); - nistz384_point_add(r, r, &mut h); -} -unsafe extern "C" fn nistz384_point_mul( - mut r: *mut P384_POINT, - mut p_scalar: *const BN_ULONG, - mut p_x: *const Limb, - mut p_y: *const Limb, -) { - static mut kWindowSize: size_t = 5 as libc::c_int as size_t; - static mut kMask: crypto_word_t = (((1 as libc::c_int) - << 5 as libc::c_int + 1 as libc::c_int) - 1 as libc::c_int) as crypto_word_t; - let mut p_str: [uint8_t; 49] = [0; 49]; - little_endian_bytes_from_scalar( - p_str.as_mut_ptr(), - (::std::mem::size_of::<[uint8_t; 49]>() as libc::c_ulong) - .wrapping_div(::std::mem::size_of::() as libc::c_ulong), - p_scalar, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - let mut table: [P384_POINT; 16] = [P384_POINT { - X: [0; 12], - Y: [0; 12], - Z: [0; 12], - }; 16]; - let mut row: *mut P384_POINT = table.as_mut_ptr(); - limbs_copy( - ((*row.offset((1 as libc::c_int - 1 as libc::c_int) as isize)).X).as_mut_ptr(), - p_x, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - ((*row.offset((1 as libc::c_int - 1 as libc::c_int) as isize)).Y).as_mut_ptr(), - p_y, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - ((*row.offset((1 as libc::c_int - 1 as libc::c_int) as isize)).Z).as_mut_ptr(), - ONE.as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - nistz384_point_double( - &mut *row.offset((2 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((3 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((2 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((4 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((2 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((6 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((3 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((8 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((4 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((12 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((6 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((5 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((4 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((7 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((6 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((9 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((8 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((13 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((12 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((14 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((7 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((10 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((5 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((15 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((14 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_add( - &mut *row.offset((11 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((10 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((1 as libc::c_int - 1 as libc::c_int) as isize), - ); - nistz384_point_double( - &mut *row.offset((16 as libc::c_int - 1 as libc::c_int) as isize), - &mut *row.offset((8 as libc::c_int - 1 as libc::c_int) as isize), - ); - static mut START_INDEX: size_t = (384 as libc::c_int - 4 as libc::c_int) as size_t; - let mut index: size_t = START_INDEX; - let mut recoded_is_negative: BN_ULONG = 0; - let mut recoded: crypto_word_t = 0; - let mut wvalue: crypto_word_t = p_str[index - .wrapping_sub(1 as libc::c_int as libc::c_uint) - .wrapping_div(8 as libc::c_int as libc::c_uint) as usize] as crypto_word_t; - wvalue = wvalue - >> index - .wrapping_sub(1 as libc::c_int as libc::c_uint) - .wrapping_rem(8 as libc::c_int as libc::c_uint) & kMask; - booth_recode( - &mut recoded_is_negative, - &mut recoded, - wvalue, - 5 as libc::c_int as crypto_word_t, - ); - p384_point_select_w5(r, table.as_mut_ptr() as *const P384_POINT, recoded); - while index >= kWindowSize { - if index != START_INDEX { - let mut off: size_t = index - .wrapping_sub(1 as libc::c_int as libc::c_uint) - .wrapping_div(8 as libc::c_int as libc::c_uint); - wvalue = (p_str[off as usize] as libc::c_int - | (p_str[off.wrapping_add(1 as libc::c_int as libc::c_uint) as usize] - as libc::c_int) << 8 as libc::c_int) as crypto_word_t; - wvalue = wvalue - >> index - .wrapping_sub(1 as libc::c_int as libc::c_uint) - .wrapping_rem(8 as libc::c_int as libc::c_uint) & kMask; - add_precomputed_w5(r, wvalue, table.as_mut_ptr() as *const P384_POINT); - } - index = (index as libc::c_uint).wrapping_sub(kWindowSize) as size_t as size_t; - nistz384_point_double(r, r); - nistz384_point_double(r, r); - nistz384_point_double(r, r); - nistz384_point_double(r, r); - nistz384_point_double(r, r); - } - wvalue = p_str[0 as libc::c_int as usize] as crypto_word_t; - wvalue = wvalue << 1 as libc::c_int & kMask; - add_precomputed_w5(r, wvalue, table.as_mut_ptr() as *const P384_POINT); -} -#[no_mangle] -pub unsafe extern "C" fn p384_point_double( - mut r: *mut [Limb; 12], - mut a: *const [Limb; 12], -) { - let mut t: P384_POINT = P384_POINT { - X: [0; 12], - Y: [0; 12], - Z: [0; 12], - }; - limbs_copy( - (t.X).as_mut_ptr(), - (*a.offset(0 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (t.Y).as_mut_ptr(), - (*a.offset(1 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (t.Z).as_mut_ptr(), - (*a.offset(2 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - nistz384_point_double(&mut t, &mut t); - limbs_copy( - (*r.offset(0 as libc::c_int as isize)).as_mut_ptr(), - (t.X).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (*r.offset(1 as libc::c_int as isize)).as_mut_ptr(), - (t.Y).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (*r.offset(2 as libc::c_int as isize)).as_mut_ptr(), - (t.Z).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -#[no_mangle] -pub unsafe extern "C" fn p384_point_add( - mut r: *mut [Limb; 12], - mut a: *const [Limb; 12], - mut b: *const [Limb; 12], -) { - let mut t1: P384_POINT = P384_POINT { - X: [0; 12], - Y: [0; 12], - Z: [0; 12], - }; - limbs_copy( - (t1.X).as_mut_ptr(), - (*a.offset(0 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (t1.Y).as_mut_ptr(), - (*a.offset(1 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (t1.Z).as_mut_ptr(), - (*a.offset(2 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - let mut t2: P384_POINT = P384_POINT { - X: [0; 12], - Y: [0; 12], - Z: [0; 12], - }; - limbs_copy( - (t2.X).as_mut_ptr(), - (*b.offset(0 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (t2.Y).as_mut_ptr(), - (*b.offset(1 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (t2.Z).as_mut_ptr(), - (*b.offset(2 as libc::c_int as isize)).as_ptr(), - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - nistz384_point_add(&mut t1, &mut t1, &mut t2); - limbs_copy( - (*r.offset(0 as libc::c_int as isize)).as_mut_ptr(), - (t1.X).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (*r.offset(1 as libc::c_int as isize)).as_mut_ptr(), - (t1.Y).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (*r.offset(2 as libc::c_int as isize)).as_mut_ptr(), - (t1.Z).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} -#[no_mangle] -pub unsafe extern "C" fn p384_point_mul( - mut r: *mut [Limb; 12], - mut p_scalar: *const BN_ULONG, - mut p_x: *const Limb, - mut p_y: *const Limb, -) { - let mut acc: P384_POINT = P384_POINT { - X: [0; 12], - Y: [0; 12], - Z: [0; 12], - }; - nistz384_point_mul(&mut acc, p_scalar, p_x, p_y); - limbs_copy( - (*r.offset(0 as libc::c_int as isize)).as_mut_ptr(), - (acc.X).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (*r.offset(1 as libc::c_int as isize)).as_mut_ptr(), - (acc.Y).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); - limbs_copy( - (*r.offset(2 as libc::c_int as isize)).as_mut_ptr(), - (acc.Z).as_mut_ptr() as *const Limb, - (384 as libc::c_uint).wrapping_div(32 as libc::c_uint), - ); -} diff --git a/ring-transpile-c2rust.py b/ring-transpile-c2rust.py index c50d42e378..cb188b29af 100644 --- a/ring-transpile-c2rust.py +++ b/ring-transpile-c2rust.py @@ -201,6 +201,7 @@ def run(): "build/tmp.o", "-m32", "-Iinclude", + "-Ipregenerated/tmp", "-UOPENSSL_X86_64", "-U__x86_64", "-D__xous__", diff --git a/src/c2rust/gfp_p384.rs b/src/c2rust/gfp_p384.rs index 0aeb18bcd9..dd0ad955b0 100644 --- a/src/c2rust/gfp_p384.rs +++ b/src/c2rust/gfp_p384.rs @@ -3,13 +3,13 @@ #![allow(non_upper_case_globals)] extern "C" { - fn LIMBS_shl_mod(r: *mut Limb, a: *const Limb, m: *const Limb, num_limbs: size_t); fn __assert_fail( __assertion: *const core::ffi::c_char, __file: *const core::ffi::c_char, __line: core::ffi::c_uint, __function: *const core::ffi::c_char, ) -> !; + fn LIMBS_shl_mod(r: *mut Limb, a: *const Limb, m: *const Limb, num_limbs: size_t); fn LIMBS_sub_mod( r: *mut Limb, a: *const Limb, diff --git a/src/c2rust/montgomery.rs b/src/c2rust/montgomery.rs index 7650a19b51..ae1e8766f2 100644 --- a/src/c2rust/montgomery.rs +++ b/src/c2rust/montgomery.rs @@ -143,39 +143,3 @@ pub unsafe extern "C" fn bn_from_montgomery_in_place( } return 1 as core::ffi::c_int; } -#[no_mangle] -pub unsafe extern "C" fn bn_mul_mont( - mut rp: *mut BN_ULONG, - mut ap: *const BN_ULONG, - mut bp: *const BN_ULONG, - mut np: *const BN_ULONG, - mut n0: *const BN_ULONG, - mut num: size_t, -) { - let vla = (2 as core::ffi::c_int as core::ffi::c_uint).wrapping_mul(num) as usize; - let mut tmp: alloc::vec::Vec = alloc::vec::from_elem(0, vla); - let mut i: size_t = 0 as core::ffi::c_int as size_t; - while i < num { - *tmp.as_mut_ptr().offset(i as isize) = 0 as core::ffi::c_int as Limb; - i = i.wrapping_add(1); - } - let mut i_0: size_t = 0 as core::ffi::c_int as size_t; - while i_0 < num { - *tmp.as_mut_ptr().offset(num.wrapping_add(i_0) as isize) = limbs_mul_add_limb( - tmp.as_mut_ptr().offset(i_0 as isize), - ap, - *bp.offset(i_0 as isize), - num, - ); - i_0 = i_0.wrapping_add(1); - } - bn_from_montgomery_in_place( - rp, - num, - tmp.as_mut_ptr(), - (2 as core::ffi::c_int as core::ffi::c_uint).wrapping_mul(num), - np, - num, - n0, - ); -}