aws-crt 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (581) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/VERSION +1 -1
  4. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/auth.h +1 -0
  5. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/aws_imds_client.h +5 -0
  6. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/credentials.h +5 -0
  7. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/aws_signing.h +1 -0
  8. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/credentials_utils.h +2 -0
  9. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/signing_config.h +1 -0
  10. data/aws-crt-ffi/crt/aws-c-auth/source/auth.c +3 -1
  11. data/aws-crt-ffi/crt/aws-c-auth/source/aws_imds_client.c +146 -63
  12. data/aws-crt-ffi/crt/aws-c-auth/source/aws_signing.c +41 -19
  13. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_imds.c +1 -0
  14. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_utils.c +1 -0
  15. data/aws-crt-ffi/crt/aws-c-auth/source/signable_http_request.c +2 -1
  16. data/aws-crt-ffi/crt/aws-c-auth/source/signing_config.c +25 -0
  17. data/aws-crt-ffi/crt/aws-c-auth/tests/CMakeLists.txt +3 -0
  18. data/aws-crt-ffi/crt/aws-c-auth/tests/aws_imds_client_test.c +197 -31
  19. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_imds_tests.c +16 -18
  20. data/aws-crt-ffi/crt/aws-c-auth/tests/sigv4_signing_tests.c +3 -1
  21. data/aws-crt-ffi/crt/aws-c-cal/include/aws/cal/private/opensslcrypto_common.h +22 -0
  22. data/aws-crt-ffi/crt/aws-c-cal/source/darwin/commoncrypto_aes.c +46 -17
  23. data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_aes.c +1 -0
  24. data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_platform_init.c +7 -0
  25. data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_rsa.c +59 -2
  26. data/aws-crt-ffi/crt/aws-c-cal/source/unix/opensslcrypto_ecc.c +1 -0
  27. data/aws-crt-ffi/crt/aws-c-common/CMakeLists.txt +13 -1
  28. data/aws-crt-ffi/crt/aws-c-common/THIRD-PARTY-LICENSES.txt +28 -7
  29. data/aws-crt-ffi/crt/aws-c-common/bin/system_info/CMakeLists.txt +18 -0
  30. data/aws-crt-ffi/crt/aws-c-common/bin/system_info/print_system_info.c +48 -0
  31. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/allocator.h +23 -0
  32. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/byte_buf.h +12 -0
  33. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/cross_process_lock.h +35 -0
  34. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/hash_table.h +1 -0
  35. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/priority_queue.h +24 -0
  36. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/private/system_info_priv.h +37 -0
  37. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/system_info.h +47 -0
  38. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/system_resource_util.h +30 -0
  39. data/aws-crt-ffi/crt/aws-c-common/include/aws/testing/aws_test_harness.h +3 -2
  40. data/aws-crt-ffi/crt/aws-c-common/source/allocator.c +64 -13
  41. data/aws-crt-ffi/crt/aws-c-common/source/android/logging.c +14 -0
  42. data/aws-crt-ffi/crt/aws-c-common/source/common.c +3 -3
  43. data/aws-crt-ffi/crt/aws-c-common/source/file.c +96 -35
  44. data/aws-crt-ffi/crt/aws-c-common/source/linux/system_info.c +24 -0
  45. data/aws-crt-ffi/crt/aws-c-common/source/memtrace.c +10 -3
  46. data/aws-crt-ffi/crt/aws-c-common/source/platform_fallback_stubs/system_info.c +21 -0
  47. data/aws-crt-ffi/crt/aws-c-common/source/posix/cross_process_lock.c +141 -0
  48. data/aws-crt-ffi/crt/aws-c-common/source/posix/system_info.c +1 -1
  49. data/aws-crt-ffi/crt/aws-c-common/source/posix/system_resource_utils.c +32 -0
  50. data/aws-crt-ffi/crt/aws-c-common/source/priority_queue.c +24 -0
  51. data/aws-crt-ffi/crt/aws-c-common/source/system_info.c +80 -0
  52. data/aws-crt-ffi/crt/aws-c-common/source/task_scheduler.c +2 -2
  53. data/aws-crt-ffi/crt/aws-c-common/source/windows/cross_process_lock.c +93 -0
  54. data/aws-crt-ffi/crt/aws-c-common/source/windows/system_resource_utils.c +31 -0
  55. data/aws-crt-ffi/crt/aws-c-common/tests/CMakeLists.txt +16 -0
  56. data/aws-crt-ffi/crt/aws-c-common/tests/alloc_test.c +83 -22
  57. data/aws-crt-ffi/crt/aws-c-common/tests/cross_process_lock_tests.c +116 -0
  58. data/aws-crt-ffi/crt/aws-c-common/tests/file_test.c +103 -0
  59. data/aws-crt-ffi/crt/aws-c-common/tests/priority_queue_test.c +36 -0
  60. data/aws-crt-ffi/crt/aws-c-common/tests/system_info_tests.c +19 -0
  61. data/aws-crt-ffi/crt/aws-c-common/tests/system_resource_util_test.c +37 -0
  62. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection.h +9 -0
  63. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/http.h +1 -0
  64. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_impl.h +5 -4
  65. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_manager_system_vtable.h +10 -18
  66. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/proxy_impl.h +5 -1
  67. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/request_response_impl.h +5 -0
  68. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/request_response.h +10 -0
  69. data/aws-crt-ffi/crt/aws-c-http/source/connection.c +5 -2
  70. data/aws-crt-ffi/crt/aws-c-http/source/connection_manager.c +22 -21
  71. data/aws-crt-ffi/crt/aws-c-http/source/h1_connection.c +102 -17
  72. data/aws-crt-ffi/crt/aws-c-http/source/h1_stream.c +1 -0
  73. data/aws-crt-ffi/crt/aws-c-http/source/http.c +3 -0
  74. data/aws-crt-ffi/crt/aws-c-http/source/proxy_connection.c +2 -2
  75. data/aws-crt-ffi/crt/aws-c-http/tests/CMakeLists.txt +2 -0
  76. data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_manager.c +18 -18
  77. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_client.c +111 -1
  78. data/aws-crt-ffi/crt/aws-c-http/tests/test_proxy.c +2 -2
  79. data/aws-crt-ffi/crt/aws-c-http/tests/test_stream_manager.c +2 -2
  80. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/retry_strategy.h +1 -1
  81. data/aws-crt-ffi/crt/aws-c-io/source/exponential_backoff_retry_strategy.c +1 -1
  82. data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_tls_op_handler.c +2 -4
  83. data/aws-crt-ffi/crt/aws-lc/CMakeLists.txt +16 -8
  84. data/aws-crt-ffi/crt/aws-lc/cmake/go.cmake +6 -0
  85. data/aws-crt-ffi/crt/aws-lc/crypto/CMakeLists.txt +6 -9
  86. data/aws-crt-ffi/crt/aws-lc/crypto/asn1/a_time.c +34 -1
  87. data/aws-crt-ffi/crt/aws-lc/crypto/asn1/a_utctm.c +4 -1
  88. data/aws-crt-ffi/crt/aws-lc/crypto/asn1/asn1_test.cc +41 -0
  89. data/aws-crt-ffi/crt/aws-lc/crypto/bio/bio_mem.c +6 -7
  90. data/aws-crt-ffi/crt/aws-lc/crypto/bio/bio_test.cc +152 -16
  91. data/aws-crt-ffi/crt/aws-lc/crypto/bio/connect.c +6 -12
  92. data/aws-crt-ffi/crt/aws-lc/crypto/bio/fd.c +2 -2
  93. data/aws-crt-ffi/crt/aws-lc/crypto/bio/file.c +20 -8
  94. data/aws-crt-ffi/crt/aws-lc/crypto/bio/socket.c +2 -2
  95. data/aws-crt-ffi/crt/aws-lc/crypto/bio/socket_helper.c +2 -2
  96. data/aws-crt-ffi/crt/aws-lc/crypto/blake2/blake2.c +11 -1
  97. data/aws-crt-ffi/crt/aws-lc/crypto/bytestring/cbb.c +13 -3
  98. data/aws-crt-ffi/crt/aws-lc/crypto/bytestring/cbs.c +9 -0
  99. data/aws-crt-ffi/crt/aws-lc/crypto/chacha/asm/chacha-armv8.pl +1 -1
  100. data/aws-crt-ffi/crt/aws-lc/crypto/chacha/chacha.c +49 -8
  101. data/aws-crt-ffi/crt/aws-lc/crypto/chacha/chacha_test.cc +110 -0
  102. data/aws-crt-ffi/crt/aws-lc/crypto/chacha/internal.h +8 -1
  103. data/aws-crt-ffi/crt/aws-lc/crypto/compiler_test.cc +4 -1
  104. data/aws-crt-ffi/crt/aws-lc/crypto/conf/conf_test.cc +1 -0
  105. data/aws-crt-ffi/crt/aws-lc/crypto/crypto_test.cc +9 -0
  106. data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/curve25519.c +189 -108
  107. data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/curve25519_nohw.c +78 -6
  108. data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/ed25519_test.cc +9 -0
  109. data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/internal.h +24 -10
  110. data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/spake25519.c +4 -4
  111. data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/x25519_test.cc +80 -11
  112. data/aws-crt-ffi/crt/aws-lc/crypto/decrepit/evp/evp_do_all.c +2 -0
  113. data/aws-crt-ffi/crt/aws-lc/crypto/digest_extra/digest_extra.c +8 -0
  114. data/aws-crt-ffi/crt/aws-lc/crypto/digest_extra/digest_test.cc +110 -45
  115. data/aws-crt-ffi/crt/aws-lc/crypto/dsa/dsa_test.cc +8 -2
  116. data/aws-crt-ffi/crt/aws-lc/crypto/dsa/internal.h +18 -0
  117. data/aws-crt-ffi/crt/aws-lc/crypto/dynamic_loading_test.c +8 -5
  118. data/aws-crt-ffi/crt/aws-lc/crypto/ec_extra/ec_derive.c +4 -3
  119. data/aws-crt-ffi/crt/aws-lc/crypto/ec_extra/hash_to_curve.c +6 -18
  120. data/aws-crt-ffi/crt/aws-lc/crypto/endian_test.cc +308 -0
  121. data/aws-crt-ffi/crt/aws-lc/crypto/err/ssl.errordata +2 -0
  122. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_extra_test.cc +2 -0
  123. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_test.cc +11 -1
  124. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_tests.txt +25 -0
  125. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_ec_asn1.c +1 -1
  126. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_kem.c +2 -2
  127. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_rsa_asn1.c +1 -0
  128. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/print.c +7 -6
  129. data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/scrypt.c +13 -1
  130. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/CMakeLists.txt +13 -4
  131. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/aes/aes_nohw.c +18 -6
  132. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bcm.c +12 -4
  133. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bn_assert_test.cc +77 -0
  134. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bn_test.cc +30 -0
  135. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bytes.c +112 -22
  136. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/div.c +12 -5
  137. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/exponentiation.c +54 -1
  138. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/gcd.c +5 -6
  139. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/internal.h +37 -15
  140. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/montgomery.c +4 -11
  141. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/montgomery_inv.c +51 -15
  142. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/cipher/aead.c +2 -2
  143. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/digest.c +29 -6
  144. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/digests.c +89 -0
  145. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/internal.h +4 -0
  146. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec.c +19 -36
  147. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_key.c +3 -3
  148. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_montgomery.c +9 -7
  149. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_test.cc +33 -9
  150. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/internal.h +17 -12
  151. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p224-64.c +5 -8
  152. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p256-nistz.c +8 -8
  153. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p256.c +9 -8
  154. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p384.c +33 -16
  155. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p521.c +14 -6
  156. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/scalar.c +26 -24
  157. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/simple_mul.c +8 -5
  158. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/wnaf.c +3 -3
  159. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ecdsa/ecdsa.c +9 -3
  160. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/evp/evp.c +43 -12
  161. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/evp/p_ec.c +4 -3
  162. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/hmac/hmac.c +3 -1
  163. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/modes/xts.c +26 -3
  164. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/cpu_jitter_test.cc +1 -1
  165. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/internal.h +20 -11
  166. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/rand.c +10 -10
  167. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/urandom.c +2 -2
  168. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/internal.h +59 -0
  169. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/padding.c +9 -3
  170. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/rsa.c +7 -0
  171. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/rsa_impl.c +51 -60
  172. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/service_indicator/service_indicator.c +5 -2
  173. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/service_indicator/service_indicator_test.cc +205 -5
  174. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/asm/sha1-armv8.pl +1 -1
  175. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/asm/sha512-armv8.pl +1 -1
  176. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/internal.h +8 -0
  177. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha3.c +37 -15
  178. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha3_test.cc +115 -110
  179. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha512.c +55 -1
  180. data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sshkdf/sshkdf.c +2 -2
  181. data/aws-crt-ffi/crt/aws-lc/crypto/hmac_extra/hmac_test.cc +12 -0
  182. data/aws-crt-ffi/crt/aws-lc/crypto/hmac_extra/hmac_tests.txt +10 -0
  183. data/aws-crt-ffi/crt/aws-lc/crypto/hrss/asm/poly_rq_mul.S +2 -6
  184. data/aws-crt-ffi/crt/aws-lc/crypto/impl_dispatch_test.cc +9 -1
  185. data/aws-crt-ffi/crt/aws-lc/crypto/internal.h +90 -8
  186. data/aws-crt-ffi/crt/aws-lc/crypto/kem/kem.c +28 -27
  187. data/aws-crt-ffi/crt/aws-lc/crypto/kyber/kem_kyber.h +14 -0
  188. data/aws-crt-ffi/crt/aws-lc/crypto/obj/obj_dat.h +52 -2
  189. data/aws-crt-ffi/crt/aws-lc/crypto/obj/obj_mac.num +5 -0
  190. data/aws-crt-ffi/crt/aws-lc/crypto/obj/objects.txt +7 -0
  191. data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/arm-xlate.pl +3 -14
  192. data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/ppc-xlate.pl +1 -5
  193. data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/x86_64-xlate.pl +4 -15
  194. data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/x86asm.pl +4 -13
  195. data/aws-crt-ffi/crt/aws-lc/crypto/poly1305/poly1305_arm_asm.S +3 -13
  196. data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/deterministic.c +4 -3
  197. data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/fuchsia.c +4 -4
  198. data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/rand_test.cc +0 -63
  199. data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/windows.c +41 -19
  200. data/aws-crt-ffi/crt/aws-lc/crypto/rsa_extra/rsa_test.cc +3 -3
  201. data/aws-crt-ffi/crt/aws-lc/crypto/siphash/siphash.c +12 -5
  202. data/aws-crt-ffi/crt/aws-lc/crypto/siphash/siphash_test.cc +5 -5
  203. data/aws-crt-ffi/crt/aws-lc/crypto/stack/stack.c +68 -46
  204. data/aws-crt-ffi/crt/aws-lc/crypto/trust_token/pmbtoken.c +4 -4
  205. data/aws-crt-ffi/crt/aws-lc/crypto/trust_token/voprf.c +2 -2
  206. data/aws-crt-ffi/crt/aws-lc/crypto/x509/by_dir.c +0 -6
  207. data/aws-crt-ffi/crt/aws-lc/crypto/x509/internal.h +4 -1
  208. data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_lu.c +33 -9
  209. data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_test.cc +87 -0
  210. data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_trs.c +1 -1
  211. data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_vfy.c +35 -13
  212. data/aws-crt-ffi/crt/aws-lc/crypto/x509v3/v3_lib.c +2 -0
  213. data/aws-crt-ffi/crt/aws-lc/crypto/x509v3/v3_purp.c +4 -6
  214. data/aws-crt-ffi/crt/aws-lc/generated-src/crypto_test_data.cc +179 -151
  215. data/aws-crt-ffi/crt/aws-lc/generated-src/err_data.c +353 -349
  216. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/chacha/chacha-armv8.S +4 -14
  217. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
  218. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
  219. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
  220. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
  221. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
  222. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/bn-armv8.S +4 -14
  223. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +4 -14
  224. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
  225. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
  226. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
  227. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
  228. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
  229. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
  230. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
  231. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
  232. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
  233. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/test/trampoline-armv8.S +4 -14
  234. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/chacha/chacha-armv4.S +3 -13
  235. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/aesv8-armx.S +3 -13
  236. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/armv4-mont.S +3 -13
  237. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/bsaes-armv7.S +3 -13
  238. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/ghash-armv4.S +3 -13
  239. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/ghashv8-armx.S +3 -13
  240. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha1-armv4-large.S +3 -13
  241. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha256-armv4.S +3 -13
  242. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha512-armv4.S +3 -13
  243. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/vpaes-armv7.S +3 -13
  244. data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/test/trampoline-armv4.S +3 -13
  245. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/chacha/chacha-armv8.S +4 -14
  246. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
  247. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
  248. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
  249. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
  250. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
  251. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/bn-armv8.S +3 -13
  252. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +3 -13
  253. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
  254. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
  255. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
  256. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
  257. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
  258. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
  259. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
  260. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
  261. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
  262. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/test/trampoline-armv8.S +3 -13
  263. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/chacha/chacha-armv4.S +3 -13
  264. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/aesv8-armx.S +3 -13
  265. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/armv4-mont.S +3 -13
  266. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/bsaes-armv7.S +3 -13
  267. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/ghash-armv4.S +3 -13
  268. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/ghashv8-armx.S +3 -13
  269. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha1-armv4-large.S +3 -13
  270. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha256-armv4.S +3 -13
  271. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha512-armv4.S +3 -13
  272. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/vpaes-armv7.S +3 -13
  273. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/test/trampoline-armv4.S +3 -13
  274. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S +1 -5
  275. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S +1 -5
  276. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/test/trampoline-ppc.S +1 -5
  277. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/chacha/chacha-x86.S +3 -12
  278. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/aesni-x86.S +3 -12
  279. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/bn-586.S +4 -13
  280. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/co-586.S +4 -13
  281. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S +3 -12
  282. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/ghash-x86.S +3 -12
  283. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/md5-586.S +4 -13
  284. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha1-586.S +4 -13
  285. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha256-586.S +3 -12
  286. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha512-586.S +3 -12
  287. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/vpaes-x86.S +3 -12
  288. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/x86-mont.S +3 -12
  289. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/test/trampoline-x86.S +3 -12
  290. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/chacha/chacha-x86_64.S +2 -11
  291. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S +2 -11
  292. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S +2 -11
  293. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S +2 -11
  294. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S +2 -11
  295. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S +2 -11
  296. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S +2 -11
  297. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S +2 -11
  298. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-xts-avx512.S +2 -11
  299. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S +2 -11
  300. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S +2 -11
  301. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/md5-x86_64.S +2 -11
  302. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +2 -11
  303. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S +2 -11
  304. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S +2 -11
  305. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S +2 -11
  306. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S +2 -11
  307. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S +2 -11
  308. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S +2 -11
  309. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S +2 -11
  310. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont.S +2 -11
  311. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S +2 -11
  312. data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/test/trampoline-x86_64.S +2 -11
  313. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/chacha/chacha-x86.S +3 -12
  314. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/aesni-x86.S +3 -12
  315. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/bn-586.S +3 -12
  316. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/co-586.S +3 -12
  317. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S +3 -12
  318. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/ghash-x86.S +3 -12
  319. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/md5-586.S +3 -12
  320. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha1-586.S +3 -12
  321. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha256-586.S +3 -12
  322. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha512-586.S +3 -12
  323. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/vpaes-x86.S +3 -12
  324. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/x86-mont.S +3 -12
  325. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/test/trampoline-x86.S +3 -12
  326. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/chacha/chacha-x86_64.S +2 -11
  327. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S +2 -11
  328. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S +2 -11
  329. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S +2 -11
  330. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S +2 -11
  331. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S +2 -11
  332. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S +2 -11
  333. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S +2 -11
  334. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-xts-avx512.S +2 -11
  335. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S +2 -11
  336. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S +2 -11
  337. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/md5-x86_64.S +2 -11
  338. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +2 -11
  339. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S +2 -11
  340. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S +2 -11
  341. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S +2 -11
  342. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S +2 -11
  343. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S +2 -11
  344. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S +2 -11
  345. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S +2 -11
  346. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont.S +2 -11
  347. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S +2 -11
  348. data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/test/trampoline-x86_64.S +2 -11
  349. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/chacha/chacha-armv8.S +4 -14
  350. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
  351. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
  352. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
  353. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
  354. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
  355. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/bn-armv8.S +4 -14
  356. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +4 -14
  357. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
  358. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
  359. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
  360. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
  361. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
  362. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
  363. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
  364. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
  365. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
  366. data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/test/trampoline-armv8.S +4 -14
  367. data/aws-crt-ffi/crt/aws-lc/go.mod +4 -4
  368. data/aws-crt-ffi/crt/aws-lc/go.sum +8 -10
  369. data/aws-crt-ffi/crt/aws-lc/include/openssl/aead.h +2 -2
  370. data/aws-crt-ffi/crt/aws-lc/include/openssl/arm_arch.h +4 -119
  371. data/aws-crt-ffi/crt/aws-lc/include/openssl/asm_base.h +185 -0
  372. data/aws-crt-ffi/crt/aws-lc/include/openssl/asn1.h +5 -0
  373. data/aws-crt-ffi/crt/aws-lc/include/openssl/base.h +31 -134
  374. data/aws-crt-ffi/crt/aws-lc/include/openssl/bio.h +30 -18
  375. data/aws-crt-ffi/crt/aws-lc/include/openssl/bn.h +0 -2
  376. data/aws-crt-ffi/crt/aws-lc/include/openssl/chacha.h +6 -0
  377. data/aws-crt-ffi/crt/aws-lc/include/openssl/cipher.h +2 -2
  378. data/aws-crt-ffi/crt/aws-lc/include/openssl/digest.h +9 -6
  379. data/aws-crt-ffi/crt/aws-lc/include/openssl/dsa.h +0 -21
  380. data/aws-crt-ffi/crt/aws-lc/include/openssl/ec.h +1 -1
  381. data/aws-crt-ffi/crt/aws-lc/include/openssl/err.h +1 -1
  382. data/aws-crt-ffi/crt/aws-lc/include/openssl/evp.h +8 -5
  383. data/aws-crt-ffi/crt/aws-lc/include/openssl/nid.h +21 -0
  384. data/aws-crt-ffi/crt/aws-lc/include/openssl/rsa.h +1 -65
  385. data/aws-crt-ffi/crt/aws-lc/include/openssl/sha.h +22 -1
  386. data/aws-crt-ffi/crt/aws-lc/include/openssl/ssl.h +121 -13
  387. data/aws-crt-ffi/crt/aws-lc/include/openssl/stack.h +229 -208
  388. data/aws-crt-ffi/crt/aws-lc/include/openssl/target.h +166 -0
  389. data/aws-crt-ffi/crt/aws-lc/include/openssl/x509.h +30 -10
  390. data/aws-crt-ffi/crt/aws-lc/include/openssl/x509v3.h +6 -4
  391. data/aws-crt-ffi/crt/aws-lc/sources.cmake +2 -0
  392. data/aws-crt-ffi/crt/aws-lc/ssl/extensions.cc +12 -7
  393. data/aws-crt-ffi/crt/aws-lc/ssl/handshake_server.cc +28 -18
  394. data/aws-crt-ffi/crt/aws-lc/ssl/internal.h +41 -6
  395. data/aws-crt-ffi/crt/aws-lc/ssl/s3_both.cc +9 -17
  396. data/aws-crt-ffi/crt/aws-lc/ssl/ssl_cipher.cc +13 -5
  397. data/aws-crt-ffi/crt/aws-lc/ssl/ssl_key_share.cc +542 -2
  398. data/aws-crt-ffi/crt/aws-lc/ssl/ssl_lib.cc +35 -0
  399. data/aws-crt-ffi/crt/aws-lc/ssl/ssl_test.cc +1847 -14
  400. data/aws-crt-ffi/crt/aws-lc/ssl/ssl_x509.cc +128 -0
  401. data/aws-crt-ffi/crt/aws-lc/ssl/test/PORTING.md +10 -7
  402. data/aws-crt-ffi/crt/aws-lc/ssl/test/bssl_shim.cc +133 -77
  403. data/aws-crt-ffi/crt/aws-lc/ssl/test/handshake_util.cc +3 -3
  404. data/aws-crt-ffi/crt/aws-lc/ssl/test/handshaker.cc +4 -0
  405. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_client.go +6 -2
  406. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_messages.go +894 -1042
  407. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_server.go +24 -23
  408. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/prf.go +6 -5
  409. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/runner.go +56 -55
  410. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/shim_dispatcher.go +188 -0
  411. data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/ticket.go +37 -39
  412. data/aws-crt-ffi/crt/aws-lc/ssl/test/test_config.cc +59 -24
  413. data/aws-crt-ffi/crt/aws-lc/ssl/test/test_config.h +3 -2
  414. data/aws-crt-ffi/crt/aws-lc/ssl/tls13_server.cc +10 -11
  415. data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/app.py +4 -4
  416. data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/{aws_lc_mac_arm_ci_stack.py → aws_lc_ec2_test_framework_ci_stack.py} +13 -29
  417. data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/ssm/general_test_run_ssm_document.yaml +43 -0
  418. data/aws-crt-ffi/crt/aws-lc/tests/ci/common_posix_setup.sh +10 -0
  419. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-aarch/amazonlinux-2023_base/Dockerfile +5 -1
  420. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-aarch/ubuntu-22.04_base/Dockerfile +19 -3
  421. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/amazonlinux-2_gcc-7x-intel-sde/Dockerfile +5 -4
  422. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/build_images.sh +1 -0
  423. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/push_images.sh +2 -1
  424. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-20.04_clang-10x_formal-verification/create_image.sh +1 -1
  425. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-22.04_base/Dockerfile +1 -0
  426. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-22.04_clang-14x-sde/Dockerfile +42 -0
  427. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/windows/vs2017/Dockerfile +14 -0
  428. data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/windows/windows_base/Dockerfile +3 -0
  429. data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/README.md +12 -0
  430. data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/nginx_patch/aws-lc-nginx.patch +68 -23
  431. data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/run_crt_integration.sh +27 -0
  432. data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/run_monit_integration.sh +56 -0
  433. data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/sslproxy_patch/aws-lc-sslproxy.patch +2 -2
  434. data/aws-crt-ffi/crt/aws-lc/tests/ci/run_ec2_test_framework.sh +135 -0
  435. data/aws-crt-ffi/crt/aws-lc/tests/ci/run_fips_tests.sh +14 -2
  436. data/aws-crt-ffi/crt/aws-lc/tests/ci/run_tests_with_sde.sh +4 -1
  437. data/aws-crt-ffi/crt/aws-lc/tests/ci/run_tests_with_sde_asan.sh +14 -0
  438. data/aws-crt-ffi/crt/aws-lc/tests/ci/run_windows_tests.bat +39 -3
  439. data/aws-crt-ffi/crt/aws-lc/third_party/fiat/README.md +21 -6
  440. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519.S +284 -0
  441. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519_alt.S +210 -0
  442. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_mod_n25519.S +186 -0
  443. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_neg_p25519.S +65 -0
  444. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519.S +1043 -352
  445. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_alt.S +1043 -352
  446. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_byte.S +1043 -352
  447. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_byte_alt.S +1043 -352
  448. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base.S +1042 -352
  449. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_alt.S +1042 -352
  450. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_byte.S +1042 -352
  451. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_byte_alt.S +1043 -354
  452. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_decode.S +700 -0
  453. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_decode_alt.S +563 -0
  454. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_encode.S +131 -0
  455. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmulbase.S +9626 -0
  456. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmulbase_alt.S +9468 -0
  457. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmuldouble.S +3157 -0
  458. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmuldouble_alt.S +2941 -0
  459. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/p384/Makefile +1 -1
  460. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/p521/Makefile +1 -1
  461. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/include/s2n-bignum_aws-lc.h +34 -0
  462. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_madd_n25519.S +219 -0
  463. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_madd_n25519_alt.S +245 -0
  464. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_mod_n25519.S +228 -0
  465. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_neg_p25519.S +86 -0
  466. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519.S +1350 -407
  467. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519_alt.S +1350 -407
  468. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519base.S +1344 -400
  469. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519base_alt.S +1348 -402
  470. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_decode.S +670 -0
  471. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_decode_alt.S +751 -0
  472. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_encode.S +81 -0
  473. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmulbase.S +9910 -0
  474. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmulbase_alt.S +9986 -0
  475. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmuldouble.S +3619 -0
  476. data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmuldouble_alt.S +3736 -0
  477. data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_224_test.json +1978 -0
  478. data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_224_test.txt +1403 -0
  479. data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_256_test.json +1993 -0
  480. data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_256_test.txt +1416 -0
  481. data/aws-crt-ffi/crt/aws-lc/tool/digest.cc +4 -0
  482. data/aws-crt-ffi/crt/aws-lc/tool/internal.h +1 -0
  483. data/aws-crt-ffi/crt/aws-lc/tool/speed.cc +53 -6
  484. data/aws-crt-ffi/crt/aws-lc/util/all_tests.go +43 -12
  485. data/aws-crt-ffi/crt/aws-lc/util/all_tests.json +13 -5
  486. data/aws-crt-ffi/crt/aws-lc/util/bot/DEPS +4 -4
  487. data/aws-crt-ffi/crt/aws-lc/util/bot/update_clang.py +8 -2
  488. data/aws-crt-ffi/crt/aws-lc/util/codecov-ci.sh +82 -0
  489. data/aws-crt-ffi/crt/aws-lc/util/convert_wycheproof/convert_wycheproof.go +7 -5
  490. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/ACVP.md +7 -0
  491. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/hash.go +24 -9
  492. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/rsa.go +3 -4
  493. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/subprocess.go +15 -10
  494. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/HMAC-SHA2-512-224.bz2 +0 -0
  495. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHA2-512-224.bz2 +0 -0
  496. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHAKE-128.bz2 +0 -0
  497. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHAKE-256.bz2 +0 -0
  498. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/sha512-224-tests.json +1 -0
  499. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/shake-128-tests.json +1 -0
  500. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/shake-256-tests.json +1 -0
  501. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/tests.json +1 -0
  502. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/HMAC-SHA2-512-224.bz2 +0 -0
  503. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHA2-512-224.bz2 +0 -0
  504. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHAKE-128.bz2 +0 -0
  505. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHAKE-256.bz2 +0 -0
  506. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/modulewrapper/main.cc +4 -0
  507. data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/modulewrapper/modulewrapper.cc +144 -1
  508. data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/delocate.go +9 -3
  509. data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/testdata/aarch64-Basic/in.s +4 -0
  510. data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/testdata/aarch64-Basic/out.s +11 -0
  511. data/aws-crt-ffi/crt/aws-lc/util/fipstools/inject_hash/inject_hash.go +13 -4
  512. data/aws-crt-ffi/crt/aws-lc/util/fipstools/test-break-kat.sh +2 -0
  513. data/aws-crt-ffi/crt/aws-lc/util/testconfig/testconfig.go +2 -1
  514. data/aws-crt-ffi/crt/s2n/api/s2n.h +9 -5
  515. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/handshake.rs +9 -6
  516. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/resumption.rs +14 -14
  517. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/throughput.rs +9 -6
  518. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/harness.rs +106 -102
  519. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/openssl.rs +24 -20
  520. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/rustls.rs +28 -24
  521. data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/s2n_tls.rs +52 -50
  522. data/aws-crt-ffi/crt/s2n/bindings/rust/generate/Cargo.toml +1 -0
  523. data/aws-crt-ffi/crt/s2n/bindings/rust/integration/Cargo.toml +3 -0
  524. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/Cargo.toml +2 -2
  525. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/src/connection.rs +9 -0
  526. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/templates/Cargo.template +2 -1
  527. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/Cargo.toml +2 -2
  528. data/aws-crt-ffi/crt/s2n/tests/cbmc/sources/make_common_datastructures.c +9 -2
  529. data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_client_cert_verify_recv_test.c +1 -1
  530. data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_hybrid_ecdhe_kyber_r3_fuzz_test.c +1 -1
  531. data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_tls13_cert_verify_recv_test.c +1 -1
  532. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_version_negotiation.py +4 -4
  533. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_auth_selection_test.c +19 -9
  534. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_auth_handshake_test.c +3 -3
  535. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_cert_verify_test.c +1 -1
  536. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_recv_test.c +1 -1
  537. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_test.c +4 -4
  538. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_signature_algorithms_extension_test.c +4 -5
  539. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_protocol_versions_test.c +390 -0
  540. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_test.c +8 -4
  541. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_handshake_test.c +2 -1
  542. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_quic_support_io_test.c +106 -0
  543. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_security_policies_test.c +6 -2
  544. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_offload_signing_test.c +3 -3
  545. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_session_resumption_test.c +135 -0
  546. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_server_new_session_ticket_test.c +32 -0
  547. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_server_signature_algorithms_extension_test.c +1 -1
  548. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_signature_algorithms_test.c +307 -283
  549. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_cert_request_test.c +1 -1
  550. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_cert_verify_test.c +18 -17
  551. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_x509_validator_test.c +125 -0
  552. data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_signature_algorithms.c +8 -1
  553. data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_supported_versions.c +43 -11
  554. data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_supported_versions.h +3 -0
  555. data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_server_signature_algorithms.c +8 -1
  556. data/aws-crt-ffi/crt/s2n/tls/s2n_auth_selection.c +4 -2
  557. data/aws-crt-ffi/crt/s2n/tls/s2n_client_cert_verify.c +7 -10
  558. data/aws-crt-ffi/crt/s2n/tls/s2n_client_hello.c +2 -2
  559. data/aws-crt-ffi/crt/s2n/tls/s2n_connection.c +75 -14
  560. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake.h +2 -2
  561. data/aws-crt-ffi/crt/s2n/tls/s2n_post_handshake.c +1 -1
  562. data/aws-crt-ffi/crt/s2n/tls/s2n_post_handshake.h +1 -0
  563. data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.c +29 -0
  564. data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.h +5 -0
  565. data/aws-crt-ffi/crt/s2n/tls/s2n_security_policies.c +40 -0
  566. data/aws-crt-ffi/crt/s2n/tls/s2n_security_policies.h +4 -0
  567. data/aws-crt-ffi/crt/s2n/tls/s2n_server_cert_request.c +1 -1
  568. data/aws-crt-ffi/crt/s2n/tls/s2n_server_hello.c +0 -3
  569. data/aws-crt-ffi/crt/s2n/tls/s2n_server_key_exchange.c +8 -9
  570. data/aws-crt-ffi/crt/s2n/tls/s2n_server_new_session_ticket.c +8 -0
  571. data/aws-crt-ffi/crt/s2n/tls/s2n_signature_algorithms.c +111 -72
  572. data/aws-crt-ffi/crt/s2n/tls/s2n_signature_algorithms.h +11 -9
  573. data/aws-crt-ffi/crt/s2n/tls/s2n_signature_scheme.c +9 -0
  574. data/aws-crt-ffi/crt/s2n/tls/s2n_signature_scheme.h +2 -0
  575. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_certificate_verify.c +12 -18
  576. data/aws-crt-ffi/crt/s2n/tls/s2n_x509_validator.c +7 -7
  577. data/aws-crt-ffi/src/api.h +1 -0
  578. data/lib/aws-crt/native.rb +1 -1
  579. metadata +68 -5
  580. data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/ssm/m1_tests_ssm_document.yaml +0 -34
  581. data/aws-crt-ffi/crt/aws-lc/tests/ci/run_m1_ec2_instance.sh +0 -96
@@ -950,414 +950,1368 @@ curve25519_x25519base_alt_scalarloop:
950
950
  //
951
951
  // First the addition and subtraction:
952
952
 
953
- add_twice4(y_3,x_3,w_3)
954
- sub_twice4(z_3,x_3,w_3)
955
-
956
- // Prepare to call the modular inverse function to get x_3 = 1/z_3
957
-
958
- movq $4, %rdi
959
- leaq 128(%rsp), %rsi
960
- leaq 192(%rsp), %rdx
961
- leaq curve25519_x25519base_alt_p_25519(%rip), %rcx
962
- leaq 256(%rsp), %r8
963
-
964
- // Inline copy of bignum_modinv, identical except for stripping out the
965
- // prologue and epilogue saving and restoring registers and the initial
966
- // test for k = 0 (which is trivially false here since k = 4). For more
967
- // details and explanations see "x86/generic/bignum_modinv.S". Note
968
- // that the stack it uses for its own temporaries is 80 bytes so it
969
- // only overwrites local variables that are no longer needed.
970
-
971
- movq %rsi, 0x40(%rsp)
972
- movq %r8, 0x38(%rsp)
973
- movq %rcx, 0x48(%rsp)
974
- leaq (%r8,%rdi,8), %r10
975
- movq %r10, 0x30(%rsp)
976
- leaq (%r10,%rdi,8), %r15
977
- xorq %r11, %r11
978
- xorq %r9, %r9
979
- curve25519_x25519base_alt_copyloop:
980
- movq (%rdx,%r9,8), %rax
981
- movq (%rcx,%r9,8), %rbx
982
- movq %rax, (%r10,%r9,8)
983
- movq %rbx, (%r15,%r9,8)
984
- movq %rbx, (%r8,%r9,8)
985
- movq %r11, (%rsi,%r9,8)
986
- incq %r9
987
- cmpq %rdi, %r9
988
- jb curve25519_x25519base_alt_copyloop
989
- movq (%r8), %rax
990
- movq %rax, %rbx
991
- decq %rbx
992
- movq %rbx, (%r8)
993
- movq %rax, %rbp
994
- movq %rax, %r12
995
- shlq $0x2, %rbp
996
- subq %rbp, %r12
997
- xorq $0x2, %r12
998
- movq %r12, %rbp
999
- imulq %rax, %rbp
1000
- movl $0x2, %eax
1001
- addq %rbp, %rax
1002
- addq $0x1, %rbp
1003
- imulq %rax, %r12
1004
- imulq %rbp, %rbp
1005
- movl $0x1, %eax
1006
- addq %rbp, %rax
1007
- imulq %rax, %r12
1008
- imulq %rbp, %rbp
1009
- movl $0x1, %eax
1010
- addq %rbp, %rax
1011
- imulq %rax, %r12
1012
- imulq %rbp, %rbp
953
+ add_twice4(t1,x_3,w_3)
954
+ sub_twice4(t2,x_3,w_3)
955
+
956
+ // Prepare to call the modular inverse function to get t0 = 1/t2
957
+ // Note that this works for the weakly normalized z_3 equally well.
958
+ // The non-coprime case z_3 == 0 (mod p_25519) cannot arise anyway.
959
+
960
+ leaq 256(%rsp), %rdi
961
+ leaq 320(%rsp), %rsi
962
+
963
+ // Inline copy of bignum_inv_p25519, identical except for stripping out
964
+ // the prologue and epilogue saving and restoring registers and making
965
+ // and reclaiming room on the stack. For more details and explanations see
966
+ // "x86/curve25519/bignum_inv_p25519.S". Note that the stack it uses for
967
+ // its own temporaries is 208 bytes, so it has no effect on variables
968
+ // that are needed in the rest of our computation here: res, t0, t1, t2.
969
+
970
+ movq %rdi, 0xc0(%rsp)
971
+ xorl %eax, %eax
972
+ leaq -0x13(%rax), %rcx
973
+ notq %rax
974
+ movq %rcx, (%rsp)
975
+ movq %rax, 0x8(%rsp)
976
+ movq %rax, 0x10(%rsp)
977
+ btr $0x3f, %rax
978
+ movq %rax, 0x18(%rsp)
979
+ movq (%rsi), %rdx
980
+ movq 0x8(%rsi), %rcx
981
+ movq 0x10(%rsi), %r8
982
+ movq 0x18(%rsi), %r9
1013
983
  movl $0x1, %eax
1014
- addq %rbp, %rax
1015
- imulq %rax, %r12
1016
- movq %r12, 0x28(%rsp)
1017
- movq %rdi, %rax
1018
- shlq $0x7, %rax
1019
- movq %rax, 0x20(%rsp)
1020
- curve25519_x25519base_alt_outerloop:
1021
- movq 0x20(%rsp), %r13
1022
- addq $0x3f, %r13
1023
- shrq $0x6, %r13
1024
- cmpq %rdi, %r13
1025
- cmovaeq %rdi, %r13
1026
- xorq %r12, %r12
1027
- xorq %r14, %r14
1028
- xorq %rbp, %rbp
1029
- xorq %rsi, %rsi
1030
- xorq %r11, %r11
1031
- movq 0x30(%rsp), %r8
1032
- leaq (%r8,%rdi,8), %r15
1033
- xorq %r9, %r9
1034
- curve25519_x25519base_alt_toploop:
1035
- movq (%r8,%r9,8), %rbx
1036
- movq (%r15,%r9,8), %rcx
1037
- movq %r11, %r10
1038
- andq %r12, %r10
1039
- andq %rbp, %r11
1040
- movq %rbx, %rax
1041
- orq %rcx, %rax
1042
- negq %rax
1043
- cmovbq %r10, %r14
1044
- cmovbq %r11, %rsi
1045
- cmovbq %rbx, %r12
1046
- cmovbq %rcx, %rbp
1047
- sbbq %r11, %r11
1048
- incq %r9
1049
- cmpq %r13, %r9
1050
- jb curve25519_x25519base_alt_toploop
1051
- movq %r12, %rax
1052
- orq %rbp, %rax
1053
- bsrq %rax, %rcx
1054
- xorq $0x3f, %rcx
1055
- shldq %cl, %r14, %r12
1056
- shldq %cl, %rsi, %rbp
1057
- movq (%r8), %rax
1058
- movq %rax, %r14
1059
- movq (%r15), %rax
1060
- movq %rax, %rsi
1061
- movl $0x1, %r10d
1062
- movl $0x0, %r11d
1063
- movl $0x0, %ecx
1064
- movl $0x1, %edx
1065
- movl $0x3a, %r9d
1066
- movq %rdi, 0x8(%rsp)
1067
- movq %r13, 0x10(%rsp)
1068
- movq %r8, (%rsp)
1069
- movq %r15, 0x18(%rsp)
1070
- curve25519_x25519base_alt_innerloop:
984
+ xorl %r10d, %r10d
985
+ bts $0x3f, %r9
986
+ adcq %r10, %rax
987
+ imulq $0x13, %rax, %rax
988
+ addq %rax, %rdx
989
+ adcq %r10, %rcx
990
+ adcq %r10, %r8
991
+ adcq %r10, %r9
992
+ movl $0x13, %eax
993
+ cmovbq %r10, %rax
994
+ subq %rax, %rdx
995
+ sbbq %r10, %rcx
996
+ sbbq %r10, %r8
997
+ sbbq %r10, %r9
998
+ btr $0x3f, %r9
999
+ movq %rdx, 0x20(%rsp)
1000
+ movq %rcx, 0x28(%rsp)
1001
+ movq %r8, 0x30(%rsp)
1002
+ movq %r9, 0x38(%rsp)
1071
1003
  xorl %eax, %eax
1004
+ movq %rax, 0x40(%rsp)
1005
+ movq %rax, 0x48(%rsp)
1006
+ movq %rax, 0x50(%rsp)
1007
+ movq %rax, 0x58(%rsp)
1008
+ movabsq $0xa0f99e2375022099, %rax
1009
+ movq %rax, 0x60(%rsp)
1010
+ movabsq $0xa8c68f3f1d132595, %rax
1011
+ movq %rax, 0x68(%rsp)
1012
+ movabsq $0x6c6c893805ac5242, %rax
1013
+ movq %rax, 0x70(%rsp)
1014
+ movabsq $0x276508b241770615, %rax
1015
+ movq %rax, 0x78(%rsp)
1016
+ movq $0xa, 0x90(%rsp)
1017
+ movq $0x1, 0x98(%rsp)
1018
+ jmp curve25519_x25519base_alt_midloop
1019
+ curve25519_x25519base_alt_inverseloop:
1020
+ movq %r8, %r9
1021
+ sarq $0x3f, %r9
1022
+ xorq %r9, %r8
1023
+ subq %r9, %r8
1024
+ movq %r10, %r11
1025
+ sarq $0x3f, %r11
1026
+ xorq %r11, %r10
1027
+ subq %r11, %r10
1028
+ movq %r12, %r13
1029
+ sarq $0x3f, %r13
1030
+ xorq %r13, %r12
1031
+ subq %r13, %r12
1032
+ movq %r14, %r15
1033
+ sarq $0x3f, %r15
1034
+ xorq %r15, %r14
1035
+ subq %r15, %r14
1036
+ movq %r8, %rax
1037
+ andq %r9, %rax
1038
+ movq %r10, %rdi
1039
+ andq %r11, %rdi
1040
+ addq %rax, %rdi
1041
+ movq %rdi, 0x80(%rsp)
1042
+ movq %r12, %rax
1043
+ andq %r13, %rax
1044
+ movq %r14, %rsi
1045
+ andq %r15, %rsi
1046
+ addq %rax, %rsi
1047
+ movq %rsi, 0x88(%rsp)
1072
1048
  xorl %ebx, %ebx
1073
- xorq %r8, %r8
1074
- xorq %r15, %r15
1075
- btq $0x0, %r14
1076
- cmovbq %rbp, %rax
1077
- cmovbq %rsi, %rbx
1078
- cmovbq %rcx, %r8
1079
- cmovbq %rdx, %r15
1080
- movq %r14, %r13
1081
- subq %rbx, %r14
1082
- subq %r13, %rbx
1083
- movq %r12, %rdi
1084
- subq %rax, %rdi
1085
- cmovbq %r12, %rbp
1086
- leaq -0x1(%rdi), %r12
1087
- cmovbq %rbx, %r14
1088
- cmovbq %r13, %rsi
1089
- notq %r12
1090
- cmovbq %r10, %rcx
1091
- cmovbq %r11, %rdx
1092
- cmovaeq %rdi, %r12
1093
- shrq $1, %r14
1094
- addq %r8, %r10
1095
- addq %r15, %r11
1096
- shrq $1, %r12
1097
- addq %rcx, %rcx
1098
- addq %rdx, %rdx
1099
- decq %r9
1100
- jne curve25519_x25519base_alt_innerloop
1101
- movq 0x8(%rsp), %rdi
1102
- movq 0x10(%rsp), %r13
1103
- movq (%rsp), %r8
1104
- movq 0x18(%rsp), %r15
1105
- movq %r10, (%rsp)
1106
- movq %r11, 0x8(%rsp)
1107
- movq %rcx, 0x10(%rsp)
1108
- movq %rdx, 0x18(%rsp)
1109
- movq 0x38(%rsp), %r8
1110
- movq 0x40(%rsp), %r15
1111
- xorq %r14, %r14
1112
- xorq %rsi, %rsi
1113
- xorq %r10, %r10
1114
- xorq %r11, %r11
1115
- xorq %r9, %r9
1116
- curve25519_x25519base_alt_congloop:
1117
- movq (%r8,%r9,8), %rcx
1118
1049
  movq (%rsp), %rax
1119
- mulq %rcx
1120
- addq %rax, %r14
1121
- adcq $0x0, %rdx
1122
- movq %rdx, %r12
1123
- movq 0x10(%rsp), %rax
1124
- mulq %rcx
1050
+ xorq %r9, %rax
1051
+ mulq %r8
1052
+ addq %rax, %rdi
1053
+ adcq %rdx, %rbx
1054
+ movq 0x20(%rsp), %rax
1055
+ xorq %r11, %rax
1056
+ mulq %r10
1057
+ addq %rax, %rdi
1058
+ adcq %rdx, %rbx
1059
+ xorl %ebp, %ebp
1060
+ movq (%rsp), %rax
1061
+ xorq %r13, %rax
1062
+ mulq %r12
1063
+ addq %rax, %rsi
1064
+ adcq %rdx, %rbp
1065
+ movq 0x20(%rsp), %rax
1066
+ xorq %r15, %rax
1067
+ mulq %r14
1125
1068
  addq %rax, %rsi
1126
- adcq $0x0, %rdx
1127
- movq %rdx, %rbp
1128
- movq (%r15,%r9,8), %rcx
1069
+ adcq %rdx, %rbp
1070
+ xorl %ecx, %ecx
1129
1071
  movq 0x8(%rsp), %rax
1130
- mulq %rcx
1131
- addq %rax, %r14
1132
- adcq %rdx, %r12
1133
- shrdq $0x3a, %r14, %r10
1134
- movq %r10, (%r8,%r9,8)
1135
- movq %r14, %r10
1136
- movq %r12, %r14
1072
+ xorq %r9, %rax
1073
+ mulq %r8
1074
+ addq %rax, %rbx
1075
+ adcq %rdx, %rcx
1076
+ movq 0x28(%rsp), %rax
1077
+ xorq %r11, %rax
1078
+ mulq %r10
1079
+ addq %rax, %rbx
1080
+ adcq %rdx, %rcx
1081
+ shrdq $0x3b, %rbx, %rdi
1082
+ movq %rdi, (%rsp)
1083
+ xorl %edi, %edi
1084
+ movq 0x8(%rsp), %rax
1085
+ xorq %r13, %rax
1086
+ mulq %r12
1087
+ addq %rax, %rbp
1088
+ adcq %rdx, %rdi
1089
+ movq 0x28(%rsp), %rax
1090
+ xorq %r15, %rax
1091
+ mulq %r14
1092
+ addq %rax, %rbp
1093
+ adcq %rdx, %rdi
1094
+ shrdq $0x3b, %rbp, %rsi
1095
+ movq %rsi, 0x20(%rsp)
1096
+ xorl %esi, %esi
1097
+ movq 0x10(%rsp), %rax
1098
+ xorq %r9, %rax
1099
+ mulq %r8
1100
+ addq %rax, %rcx
1101
+ adcq %rdx, %rsi
1102
+ movq 0x30(%rsp), %rax
1103
+ xorq %r11, %rax
1104
+ mulq %r10
1105
+ addq %rax, %rcx
1106
+ adcq %rdx, %rsi
1107
+ shrdq $0x3b, %rcx, %rbx
1108
+ movq %rbx, 0x8(%rsp)
1109
+ xorl %ebx, %ebx
1110
+ movq 0x10(%rsp), %rax
1111
+ xorq %r13, %rax
1112
+ mulq %r12
1113
+ addq %rax, %rdi
1114
+ adcq %rdx, %rbx
1115
+ movq 0x30(%rsp), %rax
1116
+ xorq %r15, %rax
1117
+ mulq %r14
1118
+ addq %rax, %rdi
1119
+ adcq %rdx, %rbx
1120
+ shrdq $0x3b, %rdi, %rbp
1121
+ movq %rbp, 0x28(%rsp)
1137
1122
  movq 0x18(%rsp), %rax
1138
- mulq %rcx
1123
+ xorq %r9, %rax
1124
+ movq %rax, %rbp
1125
+ sarq $0x3f, %rbp
1126
+ andq %r8, %rbp
1127
+ negq %rbp
1128
+ mulq %r8
1129
+ addq %rax, %rsi
1130
+ adcq %rdx, %rbp
1131
+ movq 0x38(%rsp), %rax
1132
+ xorq %r11, %rax
1133
+ movq %rax, %rdx
1134
+ sarq $0x3f, %rdx
1135
+ andq %r10, %rdx
1136
+ subq %rdx, %rbp
1137
+ mulq %r10
1139
1138
  addq %rax, %rsi
1140
1139
  adcq %rdx, %rbp
1141
- shrdq $0x3a, %rsi, %r11
1142
- movq %r11, (%r15,%r9,8)
1143
- movq %rsi, %r11
1144
- movq %rbp, %rsi
1145
- incq %r9
1146
- cmpq %rdi, %r9
1147
- jb curve25519_x25519base_alt_congloop
1148
- shldq $0x6, %r10, %r14
1149
- shldq $0x6, %r11, %rsi
1150
- movq 0x48(%rsp), %r15
1151
- movq (%r8), %rbx
1152
- movq 0x28(%rsp), %r12
1153
- imulq %rbx, %r12
1154
- movq (%r15), %rax
1140
+ shrdq $0x3b, %rsi, %rcx
1141
+ movq %rcx, 0x10(%rsp)
1142
+ shrdq $0x3b, %rbp, %rsi
1143
+ movq 0x18(%rsp), %rax
1144
+ movq %rsi, 0x18(%rsp)
1145
+ xorq %r13, %rax
1146
+ movq %rax, %rsi
1147
+ sarq $0x3f, %rsi
1148
+ andq %r12, %rsi
1149
+ negq %rsi
1155
1150
  mulq %r12
1156
- addq %rbx, %rax
1157
- movq %rdx, %r10
1158
- movl $0x1, %r9d
1159
- movq %rdi, %rcx
1160
- decq %rcx
1161
- je curve25519_x25519base_alt_wmontend
1162
- curve25519_x25519base_alt_wmontloop:
1163
- adcq (%r8,%r9,8), %r10
1164
- sbbq %rbx, %rbx
1165
- movq (%r15,%r9,8), %rax
1151
+ addq %rax, %rbx
1152
+ adcq %rdx, %rsi
1153
+ movq 0x38(%rsp), %rax
1154
+ xorq %r15, %rax
1155
+ movq %rax, %rdx
1156
+ sarq $0x3f, %rdx
1157
+ andq %r14, %rdx
1158
+ subq %rdx, %rsi
1159
+ mulq %r14
1160
+ addq %rax, %rbx
1161
+ adcq %rdx, %rsi
1162
+ shrdq $0x3b, %rbx, %rdi
1163
+ movq %rdi, 0x30(%rsp)
1164
+ shrdq $0x3b, %rsi, %rbx
1165
+ movq %rbx, 0x38(%rsp)
1166
+ movq 0x80(%rsp), %rbx
1167
+ movq 0x88(%rsp), %rbp
1168
+ xorl %ecx, %ecx
1169
+ movq 0x40(%rsp), %rax
1170
+ xorq %r9, %rax
1171
+ mulq %r8
1172
+ addq %rax, %rbx
1173
+ adcq %rdx, %rcx
1174
+ movq 0x60(%rsp), %rax
1175
+ xorq %r11, %rax
1176
+ mulq %r10
1177
+ addq %rax, %rbx
1178
+ adcq %rdx, %rcx
1179
+ xorl %esi, %esi
1180
+ movq 0x40(%rsp), %rax
1181
+ xorq %r13, %rax
1166
1182
  mulq %r12
1167
- subq %rbx, %rdx
1168
- addq %r10, %rax
1169
- movq %rax, -0x8(%r8,%r9,8)
1170
- movq %rdx, %r10
1171
- incq %r9
1172
- decq %rcx
1173
- jne curve25519_x25519base_alt_wmontloop
1174
- curve25519_x25519base_alt_wmontend:
1175
- adcq %r14, %r10
1176
- movq %r10, -0x8(%r8,%rdi,8)
1177
- sbbq %r10, %r10
1178
- negq %r10
1179
- movq %rdi, %rcx
1180
- xorq %r9, %r9
1181
- curve25519_x25519base_alt_wcmploop:
1182
- movq (%r8,%r9,8), %rax
1183
- sbbq (%r15,%r9,8), %rax
1184
- incq %r9
1185
- decq %rcx
1186
- jne curve25519_x25519base_alt_wcmploop
1187
- sbbq $0x0, %r10
1188
- sbbq %r10, %r10
1189
- notq %r10
1190
- xorq %rcx, %rcx
1191
- xorq %r9, %r9
1192
- curve25519_x25519base_alt_wcorrloop:
1193
- movq (%r8,%r9,8), %rax
1194
- movq (%r15,%r9,8), %rbx
1195
- andq %r10, %rbx
1196
- negq %rcx
1197
- sbbq %rbx, %rax
1198
- sbbq %rcx, %rcx
1199
- movq %rax, (%r8,%r9,8)
1200
- incq %r9
1201
- cmpq %rdi, %r9
1202
- jb curve25519_x25519base_alt_wcorrloop
1183
+ movq %rbx, 0x40(%rsp)
1184
+ addq %rax, %rbp
1185
+ adcq %rdx, %rsi
1186
+ movq 0x60(%rsp), %rax
1187
+ xorq %r15, %rax
1188
+ mulq %r14
1189
+ addq %rax, %rbp
1190
+ adcq %rdx, %rsi
1191
+ movq %rbp, 0x60(%rsp)
1192
+ xorl %ebx, %ebx
1193
+ movq 0x48(%rsp), %rax
1194
+ xorq %r9, %rax
1195
+ mulq %r8
1196
+ addq %rax, %rcx
1197
+ adcq %rdx, %rbx
1198
+ movq 0x68(%rsp), %rax
1199
+ xorq %r11, %rax
1200
+ mulq %r10
1201
+ addq %rax, %rcx
1202
+ adcq %rdx, %rbx
1203
+ xorl %ebp, %ebp
1204
+ movq 0x48(%rsp), %rax
1205
+ xorq %r13, %rax
1206
+ mulq %r12
1207
+ movq %rcx, 0x48(%rsp)
1208
+ addq %rax, %rsi
1209
+ adcq %rdx, %rbp
1210
+ movq 0x68(%rsp), %rax
1211
+ xorq %r15, %rax
1212
+ mulq %r14
1213
+ addq %rax, %rsi
1214
+ adcq %rdx, %rbp
1215
+ movq %rsi, 0x68(%rsp)
1216
+ xorl %ecx, %ecx
1217
+ movq 0x50(%rsp), %rax
1218
+ xorq %r9, %rax
1219
+ mulq %r8
1220
+ addq %rax, %rbx
1221
+ adcq %rdx, %rcx
1222
+ movq 0x70(%rsp), %rax
1223
+ xorq %r11, %rax
1224
+ mulq %r10
1225
+ addq %rax, %rbx
1226
+ adcq %rdx, %rcx
1227
+ xorl %esi, %esi
1228
+ movq 0x50(%rsp), %rax
1229
+ xorq %r13, %rax
1230
+ mulq %r12
1231
+ movq %rbx, 0x50(%rsp)
1232
+ addq %rax, %rbp
1233
+ adcq %rdx, %rsi
1234
+ movq 0x70(%rsp), %rax
1235
+ xorq %r15, %rax
1236
+ mulq %r14
1237
+ addq %rax, %rbp
1238
+ adcq %rdx, %rsi
1239
+ movq %rbp, 0x70(%rsp)
1240
+ movq 0x58(%rsp), %rax
1241
+ xorq %r9, %rax
1242
+ movq %r9, %rbx
1243
+ andq %r8, %rbx
1244
+ negq %rbx
1245
+ mulq %r8
1246
+ addq %rax, %rcx
1247
+ adcq %rdx, %rbx
1248
+ movq 0x78(%rsp), %rax
1249
+ xorq %r11, %rax
1250
+ movq %r11, %rdx
1251
+ andq %r10, %rdx
1252
+ subq %rdx, %rbx
1253
+ mulq %r10
1254
+ addq %rax, %rcx
1255
+ adcq %rbx, %rdx
1256
+ movq %rdx, %rbx
1257
+ shldq $0x1, %rcx, %rdx
1258
+ sarq $0x3f, %rbx
1259
+ addq %rbx, %rdx
1260
+ movl $0x13, %eax
1261
+ imulq %rdx
1203
1262
  movq 0x40(%rsp), %r8
1204
- movq (%r8), %rbx
1205
- movq 0x28(%rsp), %rbp
1206
- imulq %rbx, %rbp
1207
- movq (%r15), %rax
1208
- mulq %rbp
1209
- addq %rbx, %rax
1210
- movq %rdx, %r11
1211
- movl $0x1, %r9d
1212
- movq %rdi, %rcx
1213
- decq %rcx
1214
- je curve25519_x25519base_alt_zmontend
1215
- curve25519_x25519base_alt_zmontloop:
1216
- adcq (%r8,%r9,8), %r11
1217
- sbbq %rbx, %rbx
1218
- movq (%r15,%r9,8), %rax
1219
- mulq %rbp
1220
- subq %rbx, %rdx
1221
- addq %r11, %rax
1222
- movq %rax, -0x8(%r8,%r9,8)
1223
- movq %rdx, %r11
1224
- incq %r9
1225
- decq %rcx
1226
- jne curve25519_x25519base_alt_zmontloop
1227
- curve25519_x25519base_alt_zmontend:
1228
- adcq %rsi, %r11
1229
- movq %r11, -0x8(%r8,%rdi,8)
1230
- sbbq %r11, %r11
1231
- negq %r11
1232
- movq %rdi, %rcx
1233
- xorq %r9, %r9
1234
- curve25519_x25519base_alt_zcmploop:
1235
- movq (%r8,%r9,8), %rax
1236
- sbbq (%r15,%r9,8), %rax
1237
- incq %r9
1238
- decq %rcx
1239
- jne curve25519_x25519base_alt_zcmploop
1240
- sbbq $0x0, %r11
1241
- sbbq %r11, %r11
1242
- notq %r11
1243
- xorq %rcx, %rcx
1244
- xorq %r9, %r9
1245
- curve25519_x25519base_alt_zcorrloop:
1246
- movq (%r8,%r9,8), %rax
1247
- movq (%r15,%r9,8), %rbx
1248
- andq %r11, %rbx
1263
+ addq %rax, %r8
1264
+ movq %r8, 0x40(%rsp)
1265
+ movq 0x48(%rsp), %r8
1266
+ adcq %rdx, %r8
1267
+ movq %r8, 0x48(%rsp)
1268
+ movq 0x50(%rsp), %r8
1269
+ adcq %rbx, %r8
1270
+ movq %r8, 0x50(%rsp)
1271
+ adcq %rbx, %rcx
1272
+ shlq $0x3f, %rax
1273
+ addq %rax, %rcx
1274
+ movq 0x58(%rsp), %rax
1275
+ movq %rcx, 0x58(%rsp)
1276
+ xorq %r13, %rax
1277
+ movq %r13, %rcx
1278
+ andq %r12, %rcx
1249
1279
  negq %rcx
1250
- sbbq %rbx, %rax
1251
- sbbq %rcx, %rcx
1252
- movq %rax, (%r8,%r9,8)
1253
- incq %r9
1254
- cmpq %rdi, %r9
1255
- jb curve25519_x25519base_alt_zcorrloop
1256
- movq 0x30(%rsp), %r8
1257
- leaq (%r8,%rdi,8), %r15
1258
- xorq %r9, %r9
1259
- xorq %r12, %r12
1260
- xorq %r14, %r14
1261
- xorq %rbp, %rbp
1262
- xorq %rsi, %rsi
1263
- curve25519_x25519base_alt_crossloop:
1264
- movq (%r8,%r9,8), %rcx
1265
- movq (%rsp), %rax
1266
- mulq %rcx
1267
- addq %rax, %r14
1268
- adcq $0x0, %rdx
1269
- movq %rdx, %r10
1270
- movq 0x10(%rsp), %rax
1271
- mulq %rcx
1280
+ mulq %r12
1272
1281
  addq %rax, %rsi
1273
- adcq $0x0, %rdx
1274
- movq %rdx, %r11
1275
- movq (%r15,%r9,8), %rcx
1276
- movq 0x8(%rsp), %rax
1277
- mulq %rcx
1278
- subq %r12, %rdx
1279
- subq %rax, %r14
1280
- sbbq %rdx, %r10
1281
- sbbq %r12, %r12
1282
- movq %r14, (%r8,%r9,8)
1283
- movq %r10, %r14
1284
- movq 0x18(%rsp), %rax
1285
- mulq %rcx
1286
- subq %rbp, %rdx
1282
+ adcq %rdx, %rcx
1283
+ movq 0x78(%rsp), %rax
1284
+ xorq %r15, %rax
1285
+ movq %r15, %rdx
1286
+ andq %r14, %rdx
1287
+ subq %rdx, %rcx
1288
+ mulq %r14
1289
+ addq %rax, %rsi
1290
+ adcq %rcx, %rdx
1291
+ movq %rdx, %rcx
1292
+ shldq $0x1, %rsi, %rdx
1293
+ sarq $0x3f, %rcx
1294
+ movl $0x13, %eax
1295
+ addq %rcx, %rdx
1296
+ imulq %rdx
1297
+ movq 0x60(%rsp), %r8
1298
+ addq %rax, %r8
1299
+ movq %r8, 0x60(%rsp)
1300
+ movq 0x68(%rsp), %r8
1301
+ adcq %rdx, %r8
1302
+ movq %r8, 0x68(%rsp)
1303
+ movq 0x70(%rsp), %r8
1304
+ adcq %rcx, %r8
1305
+ movq %r8, 0x70(%rsp)
1306
+ adcq %rcx, %rsi
1307
+ shlq $0x3f, %rax
1308
+ addq %rax, %rsi
1309
+ movq %rsi, 0x78(%rsp)
1310
+ curve25519_x25519base_alt_midloop:
1311
+ movq 0x98(%rsp), %rsi
1312
+ movq (%rsp), %rdx
1313
+ movq 0x20(%rsp), %rcx
1314
+ movq %rdx, %rbx
1315
+ andq $0xfffff, %rbx
1316
+ movabsq $0xfffffe0000000000, %rax
1317
+ orq %rax, %rbx
1318
+ andq $0xfffff, %rcx
1319
+ movabsq $0xc000000000000000, %rax
1320
+ orq %rax, %rcx
1321
+ movq $0xfffffffffffffffe, %rax
1322
+ xorl %ebp, %ebp
1323
+ movl $0x2, %edx
1324
+ movq %rbx, %rdi
1325
+ movq %rax, %r8
1326
+ testq %rsi, %rsi
1327
+ cmovs %rbp, %r8
1328
+ testq $0x1, %rcx
1329
+ cmoveq %rbp, %r8
1330
+ cmoveq %rbp, %rdi
1331
+ xorq %r8, %rdi
1332
+ xorq %r8, %rsi
1333
+ btq $0x3f, %r8
1334
+ cmovbq %rcx, %rbx
1335
+ movq %rax, %r8
1287
1336
  subq %rax, %rsi
1288
- sbbq %rdx, %r11
1289
- sbbq %rbp, %rbp
1290
- movq %rsi, (%r15,%r9,8)
1291
- movq %r11, %rsi
1292
- incq %r9
1293
- cmpq %r13, %r9
1294
- jb curve25519_x25519base_alt_crossloop
1295
- xorq %r9, %r9
1296
- movq %r12, %r10
1297
- movq %rbp, %r11
1298
- xorq %r12, %r14
1299
- xorq %rbp, %rsi
1300
- curve25519_x25519base_alt_optnegloop:
1301
- movq (%r8,%r9,8), %rax
1302
- xorq %r12, %rax
1303
- negq %r10
1304
- adcq $0x0, %rax
1305
- sbbq %r10, %r10
1306
- movq %rax, (%r8,%r9,8)
1307
- movq (%r15,%r9,8), %rax
1308
- xorq %rbp, %rax
1309
- negq %r11
1310
- adcq $0x0, %rax
1311
- sbbq %r11, %r11
1312
- movq %rax, (%r15,%r9,8)
1313
- incq %r9
1314
- cmpq %r13, %r9
1315
- jb curve25519_x25519base_alt_optnegloop
1316
- subq %r10, %r14
1317
- subq %r11, %rsi
1318
- movq %r13, %r9
1319
- curve25519_x25519base_alt_shiftloop:
1320
- movq -0x8(%r8,%r9,8), %rax
1321
- movq %rax, %r10
1322
- shrdq $0x3a, %r14, %rax
1323
- movq %rax, -0x8(%r8,%r9,8)
1324
- movq %r10, %r14
1325
- movq -0x8(%r15,%r9,8), %rax
1326
- movq %rax, %r11
1327
- shrdq $0x3a, %rsi, %rax
1328
- movq %rax, -0x8(%r15,%r9,8)
1329
- movq %r11, %rsi
1330
- decq %r9
1331
- jne curve25519_x25519base_alt_shiftloop
1332
- notq %rbp
1333
- movq 0x48(%rsp), %rcx
1334
- movq 0x38(%rsp), %r8
1335
- movq 0x40(%rsp), %r15
1336
- movq %r12, %r10
1337
- movq %rbp, %r11
1338
- xorq %r9, %r9
1339
- curve25519_x25519base_alt_fliploop:
1340
- movq %rbp, %rdx
1341
- movq (%rcx,%r9,8), %rax
1342
- andq %rax, %rdx
1343
- andq %r12, %rax
1344
- movq (%r8,%r9,8), %rbx
1345
- xorq %r12, %rbx
1346
- negq %r10
1347
- adcq %rbx, %rax
1348
- sbbq %r10, %r10
1349
- movq %rax, (%r8,%r9,8)
1350
- movq (%r15,%r9,8), %rbx
1351
- xorq %rbp, %rbx
1352
- negq %r11
1353
- adcq %rbx, %rdx
1354
- sbbq %r11, %r11
1355
- movq %rdx, (%r15,%r9,8)
1356
- incq %r9
1357
- cmpq %rdi, %r9
1358
- jb curve25519_x25519base_alt_fliploop
1359
- subq $0x3a, 0x20(%rsp)
1360
- ja curve25519_x25519base_alt_outerloop
1337
+ leaq (%rcx,%rdi), %rcx
1338
+ cmovs %rbp, %r8
1339
+ movq %rbx, %rdi
1340
+ testq %rdx, %rcx
1341
+ cmoveq %rbp, %r8
1342
+ cmoveq %rbp, %rdi
1343
+ sarq $1, %rcx
1344
+ xorq %r8, %rdi
1345
+ xorq %r8, %rsi
1346
+ btq $0x3f, %r8
1347
+ cmovbq %rcx, %rbx
1348
+ movq %rax, %r8
1349
+ subq %rax, %rsi
1350
+ leaq (%rcx,%rdi), %rcx
1351
+ cmovs %rbp, %r8
1352
+ movq %rbx, %rdi
1353
+ testq %rdx, %rcx
1354
+ cmoveq %rbp, %r8
1355
+ cmoveq %rbp, %rdi
1356
+ sarq $1, %rcx
1357
+ xorq %r8, %rdi
1358
+ xorq %r8, %rsi
1359
+ btq $0x3f, %r8
1360
+ cmovbq %rcx, %rbx
1361
+ movq %rax, %r8
1362
+ subq %rax, %rsi
1363
+ leaq (%rcx,%rdi), %rcx
1364
+ cmovs %rbp, %r8
1365
+ movq %rbx, %rdi
1366
+ testq %rdx, %rcx
1367
+ cmoveq %rbp, %r8
1368
+ cmoveq %rbp, %rdi
1369
+ sarq $1, %rcx
1370
+ xorq %r8, %rdi
1371
+ xorq %r8, %rsi
1372
+ btq $0x3f, %r8
1373
+ cmovbq %rcx, %rbx
1374
+ movq %rax, %r8
1375
+ subq %rax, %rsi
1376
+ leaq (%rcx,%rdi), %rcx
1377
+ cmovs %rbp, %r8
1378
+ movq %rbx, %rdi
1379
+ testq %rdx, %rcx
1380
+ cmoveq %rbp, %r8
1381
+ cmoveq %rbp, %rdi
1382
+ sarq $1, %rcx
1383
+ xorq %r8, %rdi
1384
+ xorq %r8, %rsi
1385
+ btq $0x3f, %r8
1386
+ cmovbq %rcx, %rbx
1387
+ movq %rax, %r8
1388
+ subq %rax, %rsi
1389
+ leaq (%rcx,%rdi), %rcx
1390
+ cmovs %rbp, %r8
1391
+ movq %rbx, %rdi
1392
+ testq %rdx, %rcx
1393
+ cmoveq %rbp, %r8
1394
+ cmoveq %rbp, %rdi
1395
+ sarq $1, %rcx
1396
+ xorq %r8, %rdi
1397
+ xorq %r8, %rsi
1398
+ btq $0x3f, %r8
1399
+ cmovbq %rcx, %rbx
1400
+ movq %rax, %r8
1401
+ subq %rax, %rsi
1402
+ leaq (%rcx,%rdi), %rcx
1403
+ cmovs %rbp, %r8
1404
+ movq %rbx, %rdi
1405
+ testq %rdx, %rcx
1406
+ cmoveq %rbp, %r8
1407
+ cmoveq %rbp, %rdi
1408
+ sarq $1, %rcx
1409
+ xorq %r8, %rdi
1410
+ xorq %r8, %rsi
1411
+ btq $0x3f, %r8
1412
+ cmovbq %rcx, %rbx
1413
+ movq %rax, %r8
1414
+ subq %rax, %rsi
1415
+ leaq (%rcx,%rdi), %rcx
1416
+ cmovs %rbp, %r8
1417
+ movq %rbx, %rdi
1418
+ testq %rdx, %rcx
1419
+ cmoveq %rbp, %r8
1420
+ cmoveq %rbp, %rdi
1421
+ sarq $1, %rcx
1422
+ xorq %r8, %rdi
1423
+ xorq %r8, %rsi
1424
+ btq $0x3f, %r8
1425
+ cmovbq %rcx, %rbx
1426
+ movq %rax, %r8
1427
+ subq %rax, %rsi
1428
+ leaq (%rcx,%rdi), %rcx
1429
+ cmovs %rbp, %r8
1430
+ movq %rbx, %rdi
1431
+ testq %rdx, %rcx
1432
+ cmoveq %rbp, %r8
1433
+ cmoveq %rbp, %rdi
1434
+ sarq $1, %rcx
1435
+ xorq %r8, %rdi
1436
+ xorq %r8, %rsi
1437
+ btq $0x3f, %r8
1438
+ cmovbq %rcx, %rbx
1439
+ movq %rax, %r8
1440
+ subq %rax, %rsi
1441
+ leaq (%rcx,%rdi), %rcx
1442
+ cmovs %rbp, %r8
1443
+ movq %rbx, %rdi
1444
+ testq %rdx, %rcx
1445
+ cmoveq %rbp, %r8
1446
+ cmoveq %rbp, %rdi
1447
+ sarq $1, %rcx
1448
+ xorq %r8, %rdi
1449
+ xorq %r8, %rsi
1450
+ btq $0x3f, %r8
1451
+ cmovbq %rcx, %rbx
1452
+ movq %rax, %r8
1453
+ subq %rax, %rsi
1454
+ leaq (%rcx,%rdi), %rcx
1455
+ cmovs %rbp, %r8
1456
+ movq %rbx, %rdi
1457
+ testq %rdx, %rcx
1458
+ cmoveq %rbp, %r8
1459
+ cmoveq %rbp, %rdi
1460
+ sarq $1, %rcx
1461
+ xorq %r8, %rdi
1462
+ xorq %r8, %rsi
1463
+ btq $0x3f, %r8
1464
+ cmovbq %rcx, %rbx
1465
+ movq %rax, %r8
1466
+ subq %rax, %rsi
1467
+ leaq (%rcx,%rdi), %rcx
1468
+ cmovs %rbp, %r8
1469
+ movq %rbx, %rdi
1470
+ testq %rdx, %rcx
1471
+ cmoveq %rbp, %r8
1472
+ cmoveq %rbp, %rdi
1473
+ sarq $1, %rcx
1474
+ xorq %r8, %rdi
1475
+ xorq %r8, %rsi
1476
+ btq $0x3f, %r8
1477
+ cmovbq %rcx, %rbx
1478
+ movq %rax, %r8
1479
+ subq %rax, %rsi
1480
+ leaq (%rcx,%rdi), %rcx
1481
+ cmovs %rbp, %r8
1482
+ movq %rbx, %rdi
1483
+ testq %rdx, %rcx
1484
+ cmoveq %rbp, %r8
1485
+ cmoveq %rbp, %rdi
1486
+ sarq $1, %rcx
1487
+ xorq %r8, %rdi
1488
+ xorq %r8, %rsi
1489
+ btq $0x3f, %r8
1490
+ cmovbq %rcx, %rbx
1491
+ movq %rax, %r8
1492
+ subq %rax, %rsi
1493
+ leaq (%rcx,%rdi), %rcx
1494
+ cmovs %rbp, %r8
1495
+ movq %rbx, %rdi
1496
+ testq %rdx, %rcx
1497
+ cmoveq %rbp, %r8
1498
+ cmoveq %rbp, %rdi
1499
+ sarq $1, %rcx
1500
+ xorq %r8, %rdi
1501
+ xorq %r8, %rsi
1502
+ btq $0x3f, %r8
1503
+ cmovbq %rcx, %rbx
1504
+ movq %rax, %r8
1505
+ subq %rax, %rsi
1506
+ leaq (%rcx,%rdi), %rcx
1507
+ cmovs %rbp, %r8
1508
+ movq %rbx, %rdi
1509
+ testq %rdx, %rcx
1510
+ cmoveq %rbp, %r8
1511
+ cmoveq %rbp, %rdi
1512
+ sarq $1, %rcx
1513
+ xorq %r8, %rdi
1514
+ xorq %r8, %rsi
1515
+ btq $0x3f, %r8
1516
+ cmovbq %rcx, %rbx
1517
+ movq %rax, %r8
1518
+ subq %rax, %rsi
1519
+ leaq (%rcx,%rdi), %rcx
1520
+ cmovs %rbp, %r8
1521
+ movq %rbx, %rdi
1522
+ testq %rdx, %rcx
1523
+ cmoveq %rbp, %r8
1524
+ cmoveq %rbp, %rdi
1525
+ sarq $1, %rcx
1526
+ xorq %r8, %rdi
1527
+ xorq %r8, %rsi
1528
+ btq $0x3f, %r8
1529
+ cmovbq %rcx, %rbx
1530
+ movq %rax, %r8
1531
+ subq %rax, %rsi
1532
+ leaq (%rcx,%rdi), %rcx
1533
+ cmovs %rbp, %r8
1534
+ movq %rbx, %rdi
1535
+ testq %rdx, %rcx
1536
+ cmoveq %rbp, %r8
1537
+ cmoveq %rbp, %rdi
1538
+ sarq $1, %rcx
1539
+ xorq %r8, %rdi
1540
+ xorq %r8, %rsi
1541
+ btq $0x3f, %r8
1542
+ cmovbq %rcx, %rbx
1543
+ movq %rax, %r8
1544
+ subq %rax, %rsi
1545
+ leaq (%rcx,%rdi), %rcx
1546
+ cmovs %rbp, %r8
1547
+ movq %rbx, %rdi
1548
+ testq %rdx, %rcx
1549
+ cmoveq %rbp, %r8
1550
+ cmoveq %rbp, %rdi
1551
+ sarq $1, %rcx
1552
+ xorq %r8, %rdi
1553
+ xorq %r8, %rsi
1554
+ btq $0x3f, %r8
1555
+ cmovbq %rcx, %rbx
1556
+ movq %rax, %r8
1557
+ subq %rax, %rsi
1558
+ leaq (%rcx,%rdi), %rcx
1559
+ cmovs %rbp, %r8
1560
+ movq %rbx, %rdi
1561
+ testq %rdx, %rcx
1562
+ cmoveq %rbp, %r8
1563
+ cmoveq %rbp, %rdi
1564
+ sarq $1, %rcx
1565
+ xorq %r8, %rdi
1566
+ xorq %r8, %rsi
1567
+ btq $0x3f, %r8
1568
+ cmovbq %rcx, %rbx
1569
+ movq %rax, %r8
1570
+ subq %rax, %rsi
1571
+ leaq (%rcx,%rdi), %rcx
1572
+ cmovs %rbp, %r8
1573
+ movq %rbx, %rdi
1574
+ testq %rdx, %rcx
1575
+ cmoveq %rbp, %r8
1576
+ cmoveq %rbp, %rdi
1577
+ sarq $1, %rcx
1578
+ xorq %r8, %rdi
1579
+ xorq %r8, %rsi
1580
+ btq $0x3f, %r8
1581
+ cmovbq %rcx, %rbx
1582
+ movq %rax, %r8
1583
+ subq %rax, %rsi
1584
+ leaq (%rcx,%rdi), %rcx
1585
+ sarq $1, %rcx
1586
+ movl $0x100000, %eax
1587
+ leaq (%rbx,%rax), %rdx
1588
+ leaq (%rcx,%rax), %rdi
1589
+ shlq $0x16, %rdx
1590
+ shlq $0x16, %rdi
1591
+ sarq $0x2b, %rdx
1592
+ sarq $0x2b, %rdi
1593
+ movabsq $0x20000100000, %rax
1594
+ leaq (%rbx,%rax), %rbx
1595
+ leaq (%rcx,%rax), %rcx
1596
+ sarq $0x2a, %rbx
1597
+ sarq $0x2a, %rcx
1598
+ movq %rdx, 0xa0(%rsp)
1599
+ movq %rbx, 0xa8(%rsp)
1600
+ movq %rdi, 0xb0(%rsp)
1601
+ movq %rcx, 0xb8(%rsp)
1602
+ movq (%rsp), %r12
1603
+ imulq %r12, %rdi
1604
+ imulq %rdx, %r12
1605
+ movq 0x20(%rsp), %r13
1606
+ imulq %r13, %rbx
1607
+ imulq %rcx, %r13
1608
+ addq %rbx, %r12
1609
+ addq %rdi, %r13
1610
+ sarq $0x14, %r12
1611
+ sarq $0x14, %r13
1612
+ movq %r12, %rbx
1613
+ andq $0xfffff, %rbx
1614
+ movabsq $0xfffffe0000000000, %rax
1615
+ orq %rax, %rbx
1616
+ movq %r13, %rcx
1617
+ andq $0xfffff, %rcx
1618
+ movabsq $0xc000000000000000, %rax
1619
+ orq %rax, %rcx
1620
+ movq $0xfffffffffffffffe, %rax
1621
+ movl $0x2, %edx
1622
+ movq %rbx, %rdi
1623
+ movq %rax, %r8
1624
+ testq %rsi, %rsi
1625
+ cmovs %rbp, %r8
1626
+ testq $0x1, %rcx
1627
+ cmoveq %rbp, %r8
1628
+ cmoveq %rbp, %rdi
1629
+ xorq %r8, %rdi
1630
+ xorq %r8, %rsi
1631
+ btq $0x3f, %r8
1632
+ cmovbq %rcx, %rbx
1633
+ movq %rax, %r8
1634
+ subq %rax, %rsi
1635
+ leaq (%rcx,%rdi), %rcx
1636
+ cmovs %rbp, %r8
1637
+ movq %rbx, %rdi
1638
+ testq %rdx, %rcx
1639
+ cmoveq %rbp, %r8
1640
+ cmoveq %rbp, %rdi
1641
+ sarq $1, %rcx
1642
+ xorq %r8, %rdi
1643
+ xorq %r8, %rsi
1644
+ btq $0x3f, %r8
1645
+ cmovbq %rcx, %rbx
1646
+ movq %rax, %r8
1647
+ subq %rax, %rsi
1648
+ leaq (%rcx,%rdi), %rcx
1649
+ cmovs %rbp, %r8
1650
+ movq %rbx, %rdi
1651
+ testq %rdx, %rcx
1652
+ cmoveq %rbp, %r8
1653
+ cmoveq %rbp, %rdi
1654
+ sarq $1, %rcx
1655
+ xorq %r8, %rdi
1656
+ xorq %r8, %rsi
1657
+ btq $0x3f, %r8
1658
+ cmovbq %rcx, %rbx
1659
+ movq %rax, %r8
1660
+ subq %rax, %rsi
1661
+ leaq (%rcx,%rdi), %rcx
1662
+ cmovs %rbp, %r8
1663
+ movq %rbx, %rdi
1664
+ testq %rdx, %rcx
1665
+ cmoveq %rbp, %r8
1666
+ cmoveq %rbp, %rdi
1667
+ sarq $1, %rcx
1668
+ xorq %r8, %rdi
1669
+ xorq %r8, %rsi
1670
+ btq $0x3f, %r8
1671
+ cmovbq %rcx, %rbx
1672
+ movq %rax, %r8
1673
+ subq %rax, %rsi
1674
+ leaq (%rcx,%rdi), %rcx
1675
+ cmovs %rbp, %r8
1676
+ movq %rbx, %rdi
1677
+ testq %rdx, %rcx
1678
+ cmoveq %rbp, %r8
1679
+ cmoveq %rbp, %rdi
1680
+ sarq $1, %rcx
1681
+ xorq %r8, %rdi
1682
+ xorq %r8, %rsi
1683
+ btq $0x3f, %r8
1684
+ cmovbq %rcx, %rbx
1685
+ movq %rax, %r8
1686
+ subq %rax, %rsi
1687
+ leaq (%rcx,%rdi), %rcx
1688
+ cmovs %rbp, %r8
1689
+ movq %rbx, %rdi
1690
+ testq %rdx, %rcx
1691
+ cmoveq %rbp, %r8
1692
+ cmoveq %rbp, %rdi
1693
+ sarq $1, %rcx
1694
+ xorq %r8, %rdi
1695
+ xorq %r8, %rsi
1696
+ btq $0x3f, %r8
1697
+ cmovbq %rcx, %rbx
1698
+ movq %rax, %r8
1699
+ subq %rax, %rsi
1700
+ leaq (%rcx,%rdi), %rcx
1701
+ cmovs %rbp, %r8
1702
+ movq %rbx, %rdi
1703
+ testq %rdx, %rcx
1704
+ cmoveq %rbp, %r8
1705
+ cmoveq %rbp, %rdi
1706
+ sarq $1, %rcx
1707
+ xorq %r8, %rdi
1708
+ xorq %r8, %rsi
1709
+ btq $0x3f, %r8
1710
+ cmovbq %rcx, %rbx
1711
+ movq %rax, %r8
1712
+ subq %rax, %rsi
1713
+ leaq (%rcx,%rdi), %rcx
1714
+ cmovs %rbp, %r8
1715
+ movq %rbx, %rdi
1716
+ testq %rdx, %rcx
1717
+ cmoveq %rbp, %r8
1718
+ cmoveq %rbp, %rdi
1719
+ sarq $1, %rcx
1720
+ xorq %r8, %rdi
1721
+ xorq %r8, %rsi
1722
+ btq $0x3f, %r8
1723
+ cmovbq %rcx, %rbx
1724
+ movq %rax, %r8
1725
+ subq %rax, %rsi
1726
+ leaq (%rcx,%rdi), %rcx
1727
+ cmovs %rbp, %r8
1728
+ movq %rbx, %rdi
1729
+ testq %rdx, %rcx
1730
+ cmoveq %rbp, %r8
1731
+ cmoveq %rbp, %rdi
1732
+ sarq $1, %rcx
1733
+ xorq %r8, %rdi
1734
+ xorq %r8, %rsi
1735
+ btq $0x3f, %r8
1736
+ cmovbq %rcx, %rbx
1737
+ movq %rax, %r8
1738
+ subq %rax, %rsi
1739
+ leaq (%rcx,%rdi), %rcx
1740
+ cmovs %rbp, %r8
1741
+ movq %rbx, %rdi
1742
+ testq %rdx, %rcx
1743
+ cmoveq %rbp, %r8
1744
+ cmoveq %rbp, %rdi
1745
+ sarq $1, %rcx
1746
+ xorq %r8, %rdi
1747
+ xorq %r8, %rsi
1748
+ btq $0x3f, %r8
1749
+ cmovbq %rcx, %rbx
1750
+ movq %rax, %r8
1751
+ subq %rax, %rsi
1752
+ leaq (%rcx,%rdi), %rcx
1753
+ cmovs %rbp, %r8
1754
+ movq %rbx, %rdi
1755
+ testq %rdx, %rcx
1756
+ cmoveq %rbp, %r8
1757
+ cmoveq %rbp, %rdi
1758
+ sarq $1, %rcx
1759
+ xorq %r8, %rdi
1760
+ xorq %r8, %rsi
1761
+ btq $0x3f, %r8
1762
+ cmovbq %rcx, %rbx
1763
+ movq %rax, %r8
1764
+ subq %rax, %rsi
1765
+ leaq (%rcx,%rdi), %rcx
1766
+ cmovs %rbp, %r8
1767
+ movq %rbx, %rdi
1768
+ testq %rdx, %rcx
1769
+ cmoveq %rbp, %r8
1770
+ cmoveq %rbp, %rdi
1771
+ sarq $1, %rcx
1772
+ xorq %r8, %rdi
1773
+ xorq %r8, %rsi
1774
+ btq $0x3f, %r8
1775
+ cmovbq %rcx, %rbx
1776
+ movq %rax, %r8
1777
+ subq %rax, %rsi
1778
+ leaq (%rcx,%rdi), %rcx
1779
+ cmovs %rbp, %r8
1780
+ movq %rbx, %rdi
1781
+ testq %rdx, %rcx
1782
+ cmoveq %rbp, %r8
1783
+ cmoveq %rbp, %rdi
1784
+ sarq $1, %rcx
1785
+ xorq %r8, %rdi
1786
+ xorq %r8, %rsi
1787
+ btq $0x3f, %r8
1788
+ cmovbq %rcx, %rbx
1789
+ movq %rax, %r8
1790
+ subq %rax, %rsi
1791
+ leaq (%rcx,%rdi), %rcx
1792
+ cmovs %rbp, %r8
1793
+ movq %rbx, %rdi
1794
+ testq %rdx, %rcx
1795
+ cmoveq %rbp, %r8
1796
+ cmoveq %rbp, %rdi
1797
+ sarq $1, %rcx
1798
+ xorq %r8, %rdi
1799
+ xorq %r8, %rsi
1800
+ btq $0x3f, %r8
1801
+ cmovbq %rcx, %rbx
1802
+ movq %rax, %r8
1803
+ subq %rax, %rsi
1804
+ leaq (%rcx,%rdi), %rcx
1805
+ cmovs %rbp, %r8
1806
+ movq %rbx, %rdi
1807
+ testq %rdx, %rcx
1808
+ cmoveq %rbp, %r8
1809
+ cmoveq %rbp, %rdi
1810
+ sarq $1, %rcx
1811
+ xorq %r8, %rdi
1812
+ xorq %r8, %rsi
1813
+ btq $0x3f, %r8
1814
+ cmovbq %rcx, %rbx
1815
+ movq %rax, %r8
1816
+ subq %rax, %rsi
1817
+ leaq (%rcx,%rdi), %rcx
1818
+ cmovs %rbp, %r8
1819
+ movq %rbx, %rdi
1820
+ testq %rdx, %rcx
1821
+ cmoveq %rbp, %r8
1822
+ cmoveq %rbp, %rdi
1823
+ sarq $1, %rcx
1824
+ xorq %r8, %rdi
1825
+ xorq %r8, %rsi
1826
+ btq $0x3f, %r8
1827
+ cmovbq %rcx, %rbx
1828
+ movq %rax, %r8
1829
+ subq %rax, %rsi
1830
+ leaq (%rcx,%rdi), %rcx
1831
+ cmovs %rbp, %r8
1832
+ movq %rbx, %rdi
1833
+ testq %rdx, %rcx
1834
+ cmoveq %rbp, %r8
1835
+ cmoveq %rbp, %rdi
1836
+ sarq $1, %rcx
1837
+ xorq %r8, %rdi
1838
+ xorq %r8, %rsi
1839
+ btq $0x3f, %r8
1840
+ cmovbq %rcx, %rbx
1841
+ movq %rax, %r8
1842
+ subq %rax, %rsi
1843
+ leaq (%rcx,%rdi), %rcx
1844
+ cmovs %rbp, %r8
1845
+ movq %rbx, %rdi
1846
+ testq %rdx, %rcx
1847
+ cmoveq %rbp, %r8
1848
+ cmoveq %rbp, %rdi
1849
+ sarq $1, %rcx
1850
+ xorq %r8, %rdi
1851
+ xorq %r8, %rsi
1852
+ btq $0x3f, %r8
1853
+ cmovbq %rcx, %rbx
1854
+ movq %rax, %r8
1855
+ subq %rax, %rsi
1856
+ leaq (%rcx,%rdi), %rcx
1857
+ cmovs %rbp, %r8
1858
+ movq %rbx, %rdi
1859
+ testq %rdx, %rcx
1860
+ cmoveq %rbp, %r8
1861
+ cmoveq %rbp, %rdi
1862
+ sarq $1, %rcx
1863
+ xorq %r8, %rdi
1864
+ xorq %r8, %rsi
1865
+ btq $0x3f, %r8
1866
+ cmovbq %rcx, %rbx
1867
+ movq %rax, %r8
1868
+ subq %rax, %rsi
1869
+ leaq (%rcx,%rdi), %rcx
1870
+ cmovs %rbp, %r8
1871
+ movq %rbx, %rdi
1872
+ testq %rdx, %rcx
1873
+ cmoveq %rbp, %r8
1874
+ cmoveq %rbp, %rdi
1875
+ sarq $1, %rcx
1876
+ xorq %r8, %rdi
1877
+ xorq %r8, %rsi
1878
+ btq $0x3f, %r8
1879
+ cmovbq %rcx, %rbx
1880
+ movq %rax, %r8
1881
+ subq %rax, %rsi
1882
+ leaq (%rcx,%rdi), %rcx
1883
+ sarq $1, %rcx
1884
+ movl $0x100000, %eax
1885
+ leaq (%rbx,%rax), %r8
1886
+ leaq (%rcx,%rax), %r10
1887
+ shlq $0x16, %r8
1888
+ shlq $0x16, %r10
1889
+ sarq $0x2b, %r8
1890
+ sarq $0x2b, %r10
1891
+ movabsq $0x20000100000, %rax
1892
+ leaq (%rbx,%rax), %r15
1893
+ leaq (%rcx,%rax), %r11
1894
+ sarq $0x2a, %r15
1895
+ sarq $0x2a, %r11
1896
+ movq %r13, %rbx
1897
+ movq %r12, %rcx
1898
+ imulq %r8, %r12
1899
+ imulq %r15, %rbx
1900
+ addq %rbx, %r12
1901
+ imulq %r11, %r13
1902
+ imulq %r10, %rcx
1903
+ addq %rcx, %r13
1904
+ sarq $0x14, %r12
1905
+ sarq $0x14, %r13
1906
+ movq %r12, %rbx
1907
+ andq $0xfffff, %rbx
1908
+ movabsq $0xfffffe0000000000, %rax
1909
+ orq %rax, %rbx
1910
+ movq %r13, %rcx
1911
+ andq $0xfffff, %rcx
1912
+ movabsq $0xc000000000000000, %rax
1913
+ orq %rax, %rcx
1914
+ movq 0xa0(%rsp), %rax
1915
+ imulq %r8, %rax
1916
+ movq 0xb0(%rsp), %rdx
1917
+ imulq %r15, %rdx
1918
+ imulq 0xa8(%rsp), %r8
1919
+ imulq 0xb8(%rsp), %r15
1920
+ addq %r8, %r15
1921
+ leaq (%rax,%rdx), %r9
1922
+ movq 0xa0(%rsp), %rax
1923
+ imulq %r10, %rax
1924
+ movq 0xb0(%rsp), %rdx
1925
+ imulq %r11, %rdx
1926
+ imulq 0xa8(%rsp), %r10
1927
+ imulq 0xb8(%rsp), %r11
1928
+ addq %r10, %r11
1929
+ leaq (%rax,%rdx), %r13
1930
+ movq $0xfffffffffffffffe, %rax
1931
+ movl $0x2, %edx
1932
+ movq %rbx, %rdi
1933
+ movq %rax, %r8
1934
+ testq %rsi, %rsi
1935
+ cmovs %rbp, %r8
1936
+ testq $0x1, %rcx
1937
+ cmoveq %rbp, %r8
1938
+ cmoveq %rbp, %rdi
1939
+ xorq %r8, %rdi
1940
+ xorq %r8, %rsi
1941
+ btq $0x3f, %r8
1942
+ cmovbq %rcx, %rbx
1943
+ movq %rax, %r8
1944
+ subq %rax, %rsi
1945
+ leaq (%rcx,%rdi), %rcx
1946
+ cmovs %rbp, %r8
1947
+ movq %rbx, %rdi
1948
+ testq %rdx, %rcx
1949
+ cmoveq %rbp, %r8
1950
+ cmoveq %rbp, %rdi
1951
+ sarq $1, %rcx
1952
+ xorq %r8, %rdi
1953
+ xorq %r8, %rsi
1954
+ btq $0x3f, %r8
1955
+ cmovbq %rcx, %rbx
1956
+ movq %rax, %r8
1957
+ subq %rax, %rsi
1958
+ leaq (%rcx,%rdi), %rcx
1959
+ cmovs %rbp, %r8
1960
+ movq %rbx, %rdi
1961
+ testq %rdx, %rcx
1962
+ cmoveq %rbp, %r8
1963
+ cmoveq %rbp, %rdi
1964
+ sarq $1, %rcx
1965
+ xorq %r8, %rdi
1966
+ xorq %r8, %rsi
1967
+ btq $0x3f, %r8
1968
+ cmovbq %rcx, %rbx
1969
+ movq %rax, %r8
1970
+ subq %rax, %rsi
1971
+ leaq (%rcx,%rdi), %rcx
1972
+ cmovs %rbp, %r8
1973
+ movq %rbx, %rdi
1974
+ testq %rdx, %rcx
1975
+ cmoveq %rbp, %r8
1976
+ cmoveq %rbp, %rdi
1977
+ sarq $1, %rcx
1978
+ xorq %r8, %rdi
1979
+ xorq %r8, %rsi
1980
+ btq $0x3f, %r8
1981
+ cmovbq %rcx, %rbx
1982
+ movq %rax, %r8
1983
+ subq %rax, %rsi
1984
+ leaq (%rcx,%rdi), %rcx
1985
+ cmovs %rbp, %r8
1986
+ movq %rbx, %rdi
1987
+ testq %rdx, %rcx
1988
+ cmoveq %rbp, %r8
1989
+ cmoveq %rbp, %rdi
1990
+ sarq $1, %rcx
1991
+ xorq %r8, %rdi
1992
+ xorq %r8, %rsi
1993
+ btq $0x3f, %r8
1994
+ cmovbq %rcx, %rbx
1995
+ movq %rax, %r8
1996
+ subq %rax, %rsi
1997
+ leaq (%rcx,%rdi), %rcx
1998
+ cmovs %rbp, %r8
1999
+ movq %rbx, %rdi
2000
+ testq %rdx, %rcx
2001
+ cmoveq %rbp, %r8
2002
+ cmoveq %rbp, %rdi
2003
+ sarq $1, %rcx
2004
+ xorq %r8, %rdi
2005
+ xorq %r8, %rsi
2006
+ btq $0x3f, %r8
2007
+ cmovbq %rcx, %rbx
2008
+ movq %rax, %r8
2009
+ subq %rax, %rsi
2010
+ leaq (%rcx,%rdi), %rcx
2011
+ cmovs %rbp, %r8
2012
+ movq %rbx, %rdi
2013
+ testq %rdx, %rcx
2014
+ cmoveq %rbp, %r8
2015
+ cmoveq %rbp, %rdi
2016
+ sarq $1, %rcx
2017
+ xorq %r8, %rdi
2018
+ xorq %r8, %rsi
2019
+ btq $0x3f, %r8
2020
+ cmovbq %rcx, %rbx
2021
+ movq %rax, %r8
2022
+ subq %rax, %rsi
2023
+ leaq (%rcx,%rdi), %rcx
2024
+ cmovs %rbp, %r8
2025
+ movq %rbx, %rdi
2026
+ testq %rdx, %rcx
2027
+ cmoveq %rbp, %r8
2028
+ cmoveq %rbp, %rdi
2029
+ sarq $1, %rcx
2030
+ xorq %r8, %rdi
2031
+ xorq %r8, %rsi
2032
+ btq $0x3f, %r8
2033
+ cmovbq %rcx, %rbx
2034
+ movq %rax, %r8
2035
+ subq %rax, %rsi
2036
+ leaq (%rcx,%rdi), %rcx
2037
+ cmovs %rbp, %r8
2038
+ movq %rbx, %rdi
2039
+ testq %rdx, %rcx
2040
+ cmoveq %rbp, %r8
2041
+ cmoveq %rbp, %rdi
2042
+ sarq $1, %rcx
2043
+ xorq %r8, %rdi
2044
+ xorq %r8, %rsi
2045
+ btq $0x3f, %r8
2046
+ cmovbq %rcx, %rbx
2047
+ movq %rax, %r8
2048
+ subq %rax, %rsi
2049
+ leaq (%rcx,%rdi), %rcx
2050
+ cmovs %rbp, %r8
2051
+ movq %rbx, %rdi
2052
+ testq %rdx, %rcx
2053
+ cmoveq %rbp, %r8
2054
+ cmoveq %rbp, %rdi
2055
+ sarq $1, %rcx
2056
+ xorq %r8, %rdi
2057
+ xorq %r8, %rsi
2058
+ btq $0x3f, %r8
2059
+ cmovbq %rcx, %rbx
2060
+ movq %rax, %r8
2061
+ subq %rax, %rsi
2062
+ leaq (%rcx,%rdi), %rcx
2063
+ cmovs %rbp, %r8
2064
+ movq %rbx, %rdi
2065
+ testq %rdx, %rcx
2066
+ cmoveq %rbp, %r8
2067
+ cmoveq %rbp, %rdi
2068
+ sarq $1, %rcx
2069
+ xorq %r8, %rdi
2070
+ xorq %r8, %rsi
2071
+ btq $0x3f, %r8
2072
+ cmovbq %rcx, %rbx
2073
+ movq %rax, %r8
2074
+ subq %rax, %rsi
2075
+ leaq (%rcx,%rdi), %rcx
2076
+ cmovs %rbp, %r8
2077
+ movq %rbx, %rdi
2078
+ testq %rdx, %rcx
2079
+ cmoveq %rbp, %r8
2080
+ cmoveq %rbp, %rdi
2081
+ sarq $1, %rcx
2082
+ xorq %r8, %rdi
2083
+ xorq %r8, %rsi
2084
+ btq $0x3f, %r8
2085
+ cmovbq %rcx, %rbx
2086
+ movq %rax, %r8
2087
+ subq %rax, %rsi
2088
+ leaq (%rcx,%rdi), %rcx
2089
+ cmovs %rbp, %r8
2090
+ movq %rbx, %rdi
2091
+ testq %rdx, %rcx
2092
+ cmoveq %rbp, %r8
2093
+ cmoveq %rbp, %rdi
2094
+ sarq $1, %rcx
2095
+ xorq %r8, %rdi
2096
+ xorq %r8, %rsi
2097
+ btq $0x3f, %r8
2098
+ cmovbq %rcx, %rbx
2099
+ movq %rax, %r8
2100
+ subq %rax, %rsi
2101
+ leaq (%rcx,%rdi), %rcx
2102
+ cmovs %rbp, %r8
2103
+ movq %rbx, %rdi
2104
+ testq %rdx, %rcx
2105
+ cmoveq %rbp, %r8
2106
+ cmoveq %rbp, %rdi
2107
+ sarq $1, %rcx
2108
+ xorq %r8, %rdi
2109
+ xorq %r8, %rsi
2110
+ btq $0x3f, %r8
2111
+ cmovbq %rcx, %rbx
2112
+ movq %rax, %r8
2113
+ subq %rax, %rsi
2114
+ leaq (%rcx,%rdi), %rcx
2115
+ cmovs %rbp, %r8
2116
+ movq %rbx, %rdi
2117
+ testq %rdx, %rcx
2118
+ cmoveq %rbp, %r8
2119
+ cmoveq %rbp, %rdi
2120
+ sarq $1, %rcx
2121
+ xorq %r8, %rdi
2122
+ xorq %r8, %rsi
2123
+ btq $0x3f, %r8
2124
+ cmovbq %rcx, %rbx
2125
+ movq %rax, %r8
2126
+ subq %rax, %rsi
2127
+ leaq (%rcx,%rdi), %rcx
2128
+ cmovs %rbp, %r8
2129
+ movq %rbx, %rdi
2130
+ testq %rdx, %rcx
2131
+ cmoveq %rbp, %r8
2132
+ cmoveq %rbp, %rdi
2133
+ sarq $1, %rcx
2134
+ xorq %r8, %rdi
2135
+ xorq %r8, %rsi
2136
+ btq $0x3f, %r8
2137
+ cmovbq %rcx, %rbx
2138
+ movq %rax, %r8
2139
+ subq %rax, %rsi
2140
+ leaq (%rcx,%rdi), %rcx
2141
+ cmovs %rbp, %r8
2142
+ movq %rbx, %rdi
2143
+ testq %rdx, %rcx
2144
+ cmoveq %rbp, %r8
2145
+ cmoveq %rbp, %rdi
2146
+ sarq $1, %rcx
2147
+ xorq %r8, %rdi
2148
+ xorq %r8, %rsi
2149
+ btq $0x3f, %r8
2150
+ cmovbq %rcx, %rbx
2151
+ movq %rax, %r8
2152
+ subq %rax, %rsi
2153
+ leaq (%rcx,%rdi), %rcx
2154
+ cmovs %rbp, %r8
2155
+ movq %rbx, %rdi
2156
+ testq %rdx, %rcx
2157
+ cmoveq %rbp, %r8
2158
+ cmoveq %rbp, %rdi
2159
+ sarq $1, %rcx
2160
+ xorq %r8, %rdi
2161
+ xorq %r8, %rsi
2162
+ btq $0x3f, %r8
2163
+ cmovbq %rcx, %rbx
2164
+ movq %rax, %r8
2165
+ subq %rax, %rsi
2166
+ leaq (%rcx,%rdi), %rcx
2167
+ cmovs %rbp, %r8
2168
+ movq %rbx, %rdi
2169
+ testq %rdx, %rcx
2170
+ cmoveq %rbp, %r8
2171
+ cmoveq %rbp, %rdi
2172
+ sarq $1, %rcx
2173
+ xorq %r8, %rdi
2174
+ xorq %r8, %rsi
2175
+ btq $0x3f, %r8
2176
+ cmovbq %rcx, %rbx
2177
+ movq %rax, %r8
2178
+ subq %rax, %rsi
2179
+ leaq (%rcx,%rdi), %rcx
2180
+ sarq $1, %rcx
2181
+ movl $0x100000, %eax
2182
+ leaq (%rbx,%rax), %r8
2183
+ leaq (%rcx,%rax), %r12
2184
+ shlq $0x15, %r8
2185
+ shlq $0x15, %r12
2186
+ sarq $0x2b, %r8
2187
+ sarq $0x2b, %r12
2188
+ movabsq $0x20000100000, %rax
2189
+ leaq (%rbx,%rax), %r10
2190
+ leaq (%rcx,%rax), %r14
2191
+ sarq $0x2b, %r10
2192
+ sarq $0x2b, %r14
2193
+ movq %r9, %rax
2194
+ imulq %r8, %rax
2195
+ movq %r13, %rdx
2196
+ imulq %r10, %rdx
2197
+ imulq %r15, %r8
2198
+ imulq %r11, %r10
2199
+ addq %r8, %r10
2200
+ leaq (%rax,%rdx), %r8
2201
+ movq %r9, %rax
2202
+ imulq %r12, %rax
2203
+ movq %r13, %rdx
2204
+ imulq %r14, %rdx
2205
+ imulq %r15, %r12
2206
+ imulq %r11, %r14
2207
+ addq %r12, %r14
2208
+ leaq (%rax,%rdx), %r12
2209
+ movq %rsi, 0x98(%rsp)
2210
+ decq 0x90(%rsp)
2211
+ jne curve25519_x25519base_alt_inverseloop
2212
+ movq (%rsp), %rax
2213
+ movq 0x20(%rsp), %rcx
2214
+ imulq %r8, %rax
2215
+ imulq %r10, %rcx
2216
+ addq %rcx, %rax
2217
+ sarq $0x3f, %rax
2218
+ movq %r8, %r9
2219
+ sarq $0x3f, %r9
2220
+ xorq %r9, %r8
2221
+ subq %r9, %r8
2222
+ xorq %rax, %r9
2223
+ movq %r10, %r11
2224
+ sarq $0x3f, %r11
2225
+ xorq %r11, %r10
2226
+ subq %r11, %r10
2227
+ xorq %rax, %r11
2228
+ movq %r12, %r13
2229
+ sarq $0x3f, %r13
2230
+ xorq %r13, %r12
2231
+ subq %r13, %r12
2232
+ xorq %rax, %r13
2233
+ movq %r14, %r15
2234
+ sarq $0x3f, %r15
2235
+ xorq %r15, %r14
2236
+ subq %r15, %r14
2237
+ xorq %rax, %r15
2238
+ movq %r8, %rax
2239
+ andq %r9, %rax
2240
+ movq %r10, %r12
2241
+ andq %r11, %r12
2242
+ addq %rax, %r12
2243
+ xorl %r13d, %r13d
2244
+ movq 0x40(%rsp), %rax
2245
+ xorq %r9, %rax
2246
+ mulq %r8
2247
+ addq %rax, %r12
2248
+ adcq %rdx, %r13
2249
+ movq 0x60(%rsp), %rax
2250
+ xorq %r11, %rax
2251
+ mulq %r10
2252
+ addq %rax, %r12
2253
+ adcq %rdx, %r13
2254
+ xorl %r14d, %r14d
2255
+ movq 0x48(%rsp), %rax
2256
+ xorq %r9, %rax
2257
+ mulq %r8
2258
+ addq %rax, %r13
2259
+ adcq %rdx, %r14
2260
+ movq 0x68(%rsp), %rax
2261
+ xorq %r11, %rax
2262
+ mulq %r10
2263
+ addq %rax, %r13
2264
+ adcq %rdx, %r14
2265
+ xorl %r15d, %r15d
2266
+ movq 0x50(%rsp), %rax
2267
+ xorq %r9, %rax
2268
+ mulq %r8
2269
+ addq %rax, %r14
2270
+ adcq %rdx, %r15
2271
+ movq 0x70(%rsp), %rax
2272
+ xorq %r11, %rax
2273
+ mulq %r10
2274
+ addq %rax, %r14
2275
+ adcq %rdx, %r15
2276
+ movq 0x58(%rsp), %rax
2277
+ xorq %r9, %rax
2278
+ andq %r8, %r9
2279
+ negq %r9
2280
+ mulq %r8
2281
+ addq %rax, %r15
2282
+ adcq %rdx, %r9
2283
+ movq 0x78(%rsp), %rax
2284
+ xorq %r11, %rax
2285
+ movq %r11, %rdx
2286
+ andq %r10, %rdx
2287
+ subq %rdx, %r9
2288
+ mulq %r10
2289
+ addq %rax, %r15
2290
+ adcq %rdx, %r9
2291
+ movq %r9, %rax
2292
+ shldq $0x1, %r15, %rax
2293
+ sarq $0x3f, %r9
2294
+ movl $0x13, %ebx
2295
+ leaq 0x1(%rax,%r9,1), %rax
2296
+ imulq %rbx
2297
+ xorl %ebp, %ebp
2298
+ addq %rax, %r12
2299
+ adcq %rdx, %r13
2300
+ adcq %r9, %r14
2301
+ adcq %r9, %r15
2302
+ shlq $0x3f, %rax
2303
+ addq %rax, %r15
2304
+ cmovns %rbp, %rbx
2305
+ subq %rbx, %r12
2306
+ sbbq %rbp, %r13
2307
+ sbbq %rbp, %r14
2308
+ sbbq %rbp, %r15
2309
+ btr $0x3f, %r15
2310
+ movq 0xc0(%rsp), %rdi
2311
+ movq %r12, (%rdi)
2312
+ movq %r13, 0x8(%rdi)
2313
+ movq %r14, 0x10(%rdi)
2314
+ movq %r15, 0x18(%rdi)
1361
2315
 
1362
2316
  // The final result is (X + T) / (X - T)
1363
2317
  // This is the only operation in the whole computation that
@@ -1365,7 +2319,7 @@ curve25519_x25519base_alt_fliploop:
1365
2319
  // answer as output.
1366
2320
 
1367
2321
  movq res, %rbp
1368
- mul_p25519(resx,y_3,x_3)
2322
+ mul_p25519(resx,t1,t0)
1369
2323
 
1370
2324
  // Restore stack and registers
1371
2325
 
@@ -1387,14 +2341,6 @@ curve25519_x25519base_alt_fliploop:
1387
2341
  // .section .rodata
1388
2342
  // ****************************************************************************
1389
2343
 
1390
- // The modulus, for the modular inverse
1391
-
1392
- curve25519_x25519base_alt_p_25519:
1393
- .quad 0xffffffffffffffed
1394
- .quad 0xffffffffffffffff
1395
- .quad 0xffffffffffffffff
1396
- .quad 0x7fffffffffffffff
1397
-
1398
2344
  // 2^254 * G and (2^254 + 8) * G in extended-projective coordinates
1399
2345
  // but with z = 1 assumed and hence left out, so they are (X,Y,T) only.
1400
2346