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
@@ -874,416 +874,1368 @@ curve25519_x25519base_scalarloop:
874
874
  //
875
875
  // First the addition and subtraction:
876
876
 
877
- add_twice4(y_3,x_3,w_3)
878
- sub_twice4(z_3,x_3,w_3)
877
+ add_twice4(t1,x_3,w_3)
878
+ sub_twice4(t2,x_3,w_3)
879
879
 
880
- // Prepare to call the modular inverse function to get x_3 = 1/z_3
880
+ // Prepare to call the modular inverse function to get t0 = 1/t2
881
881
  // Note that this works for the weakly normalized z_3 equally well.
882
882
  // The non-coprime case z_3 == 0 (mod p_25519) cannot arise anyway.
883
883
 
884
- movq $4, %rdi
885
- leaq 128(%rsp), %rsi
886
- leaq 192(%rsp), %rdx
887
- leaq curve25519_x25519base_p_25519(%rip), %rcx
888
- leaq 256(%rsp), %r8
889
-
890
- // Inline copy of bignum_modinv, identical except for stripping out the
891
- // prologue and epilogue saving and restoring registers and the initial
892
- // test for k = 0 (which is trivially false here since k = 4). For more
893
- // details and explanations see "x86/generic/bignum_modinv.S". Note
894
- // that the stack it uses for its own temporaries is 80 bytes so it
895
- // only overwrites local variables that are no longer needed.
896
-
897
- movq %rsi, 0x40(%rsp)
898
- movq %r8, 0x38(%rsp)
899
- movq %rcx, 0x48(%rsp)
900
- leaq (%r8,%rdi,8), %r10
901
- movq %r10, 0x30(%rsp)
902
- leaq (%r10,%rdi,8), %r15
903
- xorq %r11, %r11
904
- xorq %r9, %r9
905
- curve25519_x25519base_copyloop:
906
- movq (%rdx,%r9,8), %rax
907
- movq (%rcx,%r9,8), %rbx
908
- movq %rax, (%r10,%r9,8)
909
- movq %rbx, (%r15,%r9,8)
910
- movq %rbx, (%r8,%r9,8)
911
- movq %r11, (%rsi,%r9,8)
912
- incq %r9
913
- cmpq %rdi, %r9
914
- jb curve25519_x25519base_copyloop
915
- movq (%r8), %rax
916
- movq %rax, %rbx
917
- decq %rbx
918
- movq %rbx, (%r8)
919
- movq %rax, %rbp
920
- movq %rax, %r12
921
- shlq $0x2, %rbp
922
- subq %rbp, %r12
923
- xorq $0x2, %r12
924
- movq %r12, %rbp
925
- imulq %rax, %rbp
926
- movl $0x2, %eax
927
- addq %rbp, %rax
928
- addq $0x1, %rbp
929
- imulq %rax, %r12
930
- imulq %rbp, %rbp
931
- movl $0x1, %eax
932
- addq %rbp, %rax
933
- imulq %rax, %r12
934
- imulq %rbp, %rbp
935
- movl $0x1, %eax
936
- addq %rbp, %rax
937
- imulq %rax, %r12
938
- imulq %rbp, %rbp
884
+ leaq 256(%rsp), %rdi
885
+ leaq 320(%rsp), %rsi
886
+
887
+ // Inline copy of bignum_inv_p25519, identical except for stripping out
888
+ // the prologue and epilogue saving and restoring registers and making
889
+ // and reclaiming room on the stack. For more details and explanations see
890
+ // "x86/curve25519/bignum_inv_p25519.S". Note that the stack it uses for
891
+ // its own temporaries is 208 bytes, so it has no effect on variables
892
+ // that are needed in the rest of our computation here: res, t0, t1, t2.
893
+
894
+ movq %rdi, 0xc0(%rsp)
895
+ xorl %eax, %eax
896
+ leaq -0x13(%rax), %rcx
897
+ notq %rax
898
+ movq %rcx, (%rsp)
899
+ movq %rax, 0x8(%rsp)
900
+ movq %rax, 0x10(%rsp)
901
+ btr $0x3f, %rax
902
+ movq %rax, 0x18(%rsp)
903
+ movq (%rsi), %rdx
904
+ movq 0x8(%rsi), %rcx
905
+ movq 0x10(%rsi), %r8
906
+ movq 0x18(%rsi), %r9
939
907
  movl $0x1, %eax
940
- addq %rbp, %rax
941
- imulq %rax, %r12
942
- movq %r12, 0x28(%rsp)
943
- movq %rdi, %rax
944
- shlq $0x7, %rax
945
- movq %rax, 0x20(%rsp)
946
- curve25519_x25519base_outerloop:
947
- movq 0x20(%rsp), %r13
948
- addq $0x3f, %r13
949
- shrq $0x6, %r13
950
- cmpq %rdi, %r13
951
- cmovaeq %rdi, %r13
952
- xorq %r12, %r12
953
- xorq %r14, %r14
954
- xorq %rbp, %rbp
955
- xorq %rsi, %rsi
956
- xorq %r11, %r11
957
- movq 0x30(%rsp), %r8
958
- leaq (%r8,%rdi,8), %r15
959
- xorq %r9, %r9
960
- curve25519_x25519base_toploop:
961
- movq (%r8,%r9,8), %rbx
962
- movq (%r15,%r9,8), %rcx
963
- movq %r11, %r10
964
- andq %r12, %r10
965
- andq %rbp, %r11
966
- movq %rbx, %rax
967
- orq %rcx, %rax
968
- negq %rax
969
- cmovbq %r10, %r14
970
- cmovbq %r11, %rsi
971
- cmovbq %rbx, %r12
972
- cmovbq %rcx, %rbp
973
- sbbq %r11, %r11
974
- incq %r9
975
- cmpq %r13, %r9
976
- jb curve25519_x25519base_toploop
977
- movq %r12, %rax
978
- orq %rbp, %rax
979
- bsrq %rax, %rcx
980
- xorq $0x3f, %rcx
981
- shldq %cl, %r14, %r12
982
- shldq %cl, %rsi, %rbp
983
- movq (%r8), %rax
984
- movq %rax, %r14
985
- movq (%r15), %rax
986
- movq %rax, %rsi
987
- movl $0x1, %r10d
988
- movl $0x0, %r11d
989
- movl $0x0, %ecx
990
- movl $0x1, %edx
991
- movl $0x3a, %r9d
992
- movq %rdi, 0x8(%rsp)
993
- movq %r13, 0x10(%rsp)
994
- movq %r8, (%rsp)
995
- movq %r15, 0x18(%rsp)
996
- curve25519_x25519base_innerloop:
908
+ xorl %r10d, %r10d
909
+ bts $0x3f, %r9
910
+ adcq %r10, %rax
911
+ imulq $0x13, %rax, %rax
912
+ addq %rax, %rdx
913
+ adcq %r10, %rcx
914
+ adcq %r10, %r8
915
+ adcq %r10, %r9
916
+ movl $0x13, %eax
917
+ cmovbq %r10, %rax
918
+ subq %rax, %rdx
919
+ sbbq %r10, %rcx
920
+ sbbq %r10, %r8
921
+ sbbq %r10, %r9
922
+ btr $0x3f, %r9
923
+ movq %rdx, 0x20(%rsp)
924
+ movq %rcx, 0x28(%rsp)
925
+ movq %r8, 0x30(%rsp)
926
+ movq %r9, 0x38(%rsp)
997
927
  xorl %eax, %eax
928
+ movq %rax, 0x40(%rsp)
929
+ movq %rax, 0x48(%rsp)
930
+ movq %rax, 0x50(%rsp)
931
+ movq %rax, 0x58(%rsp)
932
+ movabsq $0xa0f99e2375022099, %rax
933
+ movq %rax, 0x60(%rsp)
934
+ movabsq $0xa8c68f3f1d132595, %rax
935
+ movq %rax, 0x68(%rsp)
936
+ movabsq $0x6c6c893805ac5242, %rax
937
+ movq %rax, 0x70(%rsp)
938
+ movabsq $0x276508b241770615, %rax
939
+ movq %rax, 0x78(%rsp)
940
+ movq $0xa, 0x90(%rsp)
941
+ movq $0x1, 0x98(%rsp)
942
+ jmp curve25519_x25519base_midloop
943
+ curve25519_x25519base_inverseloop:
944
+ movq %r8, %r9
945
+ sarq $0x3f, %r9
946
+ xorq %r9, %r8
947
+ subq %r9, %r8
948
+ movq %r10, %r11
949
+ sarq $0x3f, %r11
950
+ xorq %r11, %r10
951
+ subq %r11, %r10
952
+ movq %r12, %r13
953
+ sarq $0x3f, %r13
954
+ xorq %r13, %r12
955
+ subq %r13, %r12
956
+ movq %r14, %r15
957
+ sarq $0x3f, %r15
958
+ xorq %r15, %r14
959
+ subq %r15, %r14
960
+ movq %r8, %rax
961
+ andq %r9, %rax
962
+ movq %r10, %rdi
963
+ andq %r11, %rdi
964
+ addq %rax, %rdi
965
+ movq %rdi, 0x80(%rsp)
966
+ movq %r12, %rax
967
+ andq %r13, %rax
968
+ movq %r14, %rsi
969
+ andq %r15, %rsi
970
+ addq %rax, %rsi
971
+ movq %rsi, 0x88(%rsp)
998
972
  xorl %ebx, %ebx
999
- xorq %r8, %r8
1000
- xorq %r15, %r15
1001
- btq $0x0, %r14
1002
- cmovbq %rbp, %rax
1003
- cmovbq %rsi, %rbx
1004
- cmovbq %rcx, %r8
1005
- cmovbq %rdx, %r15
1006
- movq %r14, %r13
1007
- subq %rbx, %r14
1008
- subq %r13, %rbx
1009
- movq %r12, %rdi
1010
- subq %rax, %rdi
1011
- cmovbq %r12, %rbp
1012
- leaq -0x1(%rdi), %r12
1013
- cmovbq %rbx, %r14
1014
- cmovbq %r13, %rsi
1015
- notq %r12
1016
- cmovbq %r10, %rcx
1017
- cmovbq %r11, %rdx
1018
- cmovaeq %rdi, %r12
1019
- shrq $1, %r14
1020
- addq %r8, %r10
1021
- addq %r15, %r11
1022
- shrq $1, %r12
1023
- addq %rcx, %rcx
1024
- addq %rdx, %rdx
1025
- decq %r9
1026
- jne curve25519_x25519base_innerloop
1027
- movq 0x8(%rsp), %rdi
1028
- movq 0x10(%rsp), %r13
1029
- movq (%rsp), %r8
1030
- movq 0x18(%rsp), %r15
1031
- movq %r10, (%rsp)
1032
- movq %r11, 0x8(%rsp)
1033
- movq %rcx, 0x10(%rsp)
1034
- movq %rdx, 0x18(%rsp)
1035
- movq 0x38(%rsp), %r8
1036
- movq 0x40(%rsp), %r15
1037
- xorq %r14, %r14
1038
- xorq %rsi, %rsi
1039
- xorq %r10, %r10
1040
- xorq %r11, %r11
1041
- xorq %r9, %r9
1042
- curve25519_x25519base_congloop:
1043
- movq (%r8,%r9,8), %rcx
1044
973
  movq (%rsp), %rax
1045
- mulq %rcx
1046
- addq %rax, %r14
1047
- adcq $0x0, %rdx
1048
- movq %rdx, %r12
1049
- movq 0x10(%rsp), %rax
1050
- mulq %rcx
974
+ xorq %r9, %rax
975
+ mulq %r8
976
+ addq %rax, %rdi
977
+ adcq %rdx, %rbx
978
+ movq 0x20(%rsp), %rax
979
+ xorq %r11, %rax
980
+ mulq %r10
981
+ addq %rax, %rdi
982
+ adcq %rdx, %rbx
983
+ xorl %ebp, %ebp
984
+ movq (%rsp), %rax
985
+ xorq %r13, %rax
986
+ mulq %r12
987
+ addq %rax, %rsi
988
+ adcq %rdx, %rbp
989
+ movq 0x20(%rsp), %rax
990
+ xorq %r15, %rax
991
+ mulq %r14
1051
992
  addq %rax, %rsi
1052
- adcq $0x0, %rdx
1053
- movq %rdx, %rbp
1054
- movq (%r15,%r9,8), %rcx
993
+ adcq %rdx, %rbp
994
+ xorl %ecx, %ecx
1055
995
  movq 0x8(%rsp), %rax
1056
- mulq %rcx
1057
- addq %rax, %r14
1058
- adcq %rdx, %r12
1059
- shrdq $0x3a, %r14, %r10
1060
- movq %r10, (%r8,%r9,8)
1061
- movq %r14, %r10
1062
- movq %r12, %r14
996
+ xorq %r9, %rax
997
+ mulq %r8
998
+ addq %rax, %rbx
999
+ adcq %rdx, %rcx
1000
+ movq 0x28(%rsp), %rax
1001
+ xorq %r11, %rax
1002
+ mulq %r10
1003
+ addq %rax, %rbx
1004
+ adcq %rdx, %rcx
1005
+ shrdq $0x3b, %rbx, %rdi
1006
+ movq %rdi, (%rsp)
1007
+ xorl %edi, %edi
1008
+ movq 0x8(%rsp), %rax
1009
+ xorq %r13, %rax
1010
+ mulq %r12
1011
+ addq %rax, %rbp
1012
+ adcq %rdx, %rdi
1013
+ movq 0x28(%rsp), %rax
1014
+ xorq %r15, %rax
1015
+ mulq %r14
1016
+ addq %rax, %rbp
1017
+ adcq %rdx, %rdi
1018
+ shrdq $0x3b, %rbp, %rsi
1019
+ movq %rsi, 0x20(%rsp)
1020
+ xorl %esi, %esi
1021
+ movq 0x10(%rsp), %rax
1022
+ xorq %r9, %rax
1023
+ mulq %r8
1024
+ addq %rax, %rcx
1025
+ adcq %rdx, %rsi
1026
+ movq 0x30(%rsp), %rax
1027
+ xorq %r11, %rax
1028
+ mulq %r10
1029
+ addq %rax, %rcx
1030
+ adcq %rdx, %rsi
1031
+ shrdq $0x3b, %rcx, %rbx
1032
+ movq %rbx, 0x8(%rsp)
1033
+ xorl %ebx, %ebx
1034
+ movq 0x10(%rsp), %rax
1035
+ xorq %r13, %rax
1036
+ mulq %r12
1037
+ addq %rax, %rdi
1038
+ adcq %rdx, %rbx
1039
+ movq 0x30(%rsp), %rax
1040
+ xorq %r15, %rax
1041
+ mulq %r14
1042
+ addq %rax, %rdi
1043
+ adcq %rdx, %rbx
1044
+ shrdq $0x3b, %rdi, %rbp
1045
+ movq %rbp, 0x28(%rsp)
1063
1046
  movq 0x18(%rsp), %rax
1064
- mulq %rcx
1047
+ xorq %r9, %rax
1048
+ movq %rax, %rbp
1049
+ sarq $0x3f, %rbp
1050
+ andq %r8, %rbp
1051
+ negq %rbp
1052
+ mulq %r8
1065
1053
  addq %rax, %rsi
1066
1054
  adcq %rdx, %rbp
1067
- shrdq $0x3a, %rsi, %r11
1068
- movq %r11, (%r15,%r9,8)
1069
- movq %rsi, %r11
1070
- movq %rbp, %rsi
1071
- incq %r9
1072
- cmpq %rdi, %r9
1073
- jb curve25519_x25519base_congloop
1074
- shldq $0x6, %r10, %r14
1075
- shldq $0x6, %r11, %rsi
1076
- movq 0x48(%rsp), %r15
1077
- movq (%r8), %rbx
1078
- movq 0x28(%rsp), %r12
1079
- imulq %rbx, %r12
1080
- movq (%r15), %rax
1055
+ movq 0x38(%rsp), %rax
1056
+ xorq %r11, %rax
1057
+ movq %rax, %rdx
1058
+ sarq $0x3f, %rdx
1059
+ andq %r10, %rdx
1060
+ subq %rdx, %rbp
1061
+ mulq %r10
1062
+ addq %rax, %rsi
1063
+ adcq %rdx, %rbp
1064
+ shrdq $0x3b, %rsi, %rcx
1065
+ movq %rcx, 0x10(%rsp)
1066
+ shrdq $0x3b, %rbp, %rsi
1067
+ movq 0x18(%rsp), %rax
1068
+ movq %rsi, 0x18(%rsp)
1069
+ xorq %r13, %rax
1070
+ movq %rax, %rsi
1071
+ sarq $0x3f, %rsi
1072
+ andq %r12, %rsi
1073
+ negq %rsi
1081
1074
  mulq %r12
1082
- addq %rbx, %rax
1083
- movq %rdx, %r10
1084
- movl $0x1, %r9d
1085
- movq %rdi, %rcx
1086
- decq %rcx
1087
- je curve25519_x25519base_wmontend
1088
- curve25519_x25519base_wmontloop:
1089
- adcq (%r8,%r9,8), %r10
1090
- sbbq %rbx, %rbx
1091
- movq (%r15,%r9,8), %rax
1075
+ addq %rax, %rbx
1076
+ adcq %rdx, %rsi
1077
+ movq 0x38(%rsp), %rax
1078
+ xorq %r15, %rax
1079
+ movq %rax, %rdx
1080
+ sarq $0x3f, %rdx
1081
+ andq %r14, %rdx
1082
+ subq %rdx, %rsi
1083
+ mulq %r14
1084
+ addq %rax, %rbx
1085
+ adcq %rdx, %rsi
1086
+ shrdq $0x3b, %rbx, %rdi
1087
+ movq %rdi, 0x30(%rsp)
1088
+ shrdq $0x3b, %rsi, %rbx
1089
+ movq %rbx, 0x38(%rsp)
1090
+ movq 0x80(%rsp), %rbx
1091
+ movq 0x88(%rsp), %rbp
1092
+ xorl %ecx, %ecx
1093
+ movq 0x40(%rsp), %rax
1094
+ xorq %r9, %rax
1095
+ mulq %r8
1096
+ addq %rax, %rbx
1097
+ adcq %rdx, %rcx
1098
+ movq 0x60(%rsp), %rax
1099
+ xorq %r11, %rax
1100
+ mulq %r10
1101
+ addq %rax, %rbx
1102
+ adcq %rdx, %rcx
1103
+ xorl %esi, %esi
1104
+ movq 0x40(%rsp), %rax
1105
+ xorq %r13, %rax
1092
1106
  mulq %r12
1093
- subq %rbx, %rdx
1094
- addq %r10, %rax
1095
- movq %rax, -0x8(%r8,%r9,8)
1096
- movq %rdx, %r10
1097
- incq %r9
1098
- decq %rcx
1099
- jne curve25519_x25519base_wmontloop
1100
- curve25519_x25519base_wmontend:
1101
- adcq %r14, %r10
1102
- movq %r10, -0x8(%r8,%rdi,8)
1103
- sbbq %r10, %r10
1104
- negq %r10
1105
- movq %rdi, %rcx
1106
- xorq %r9, %r9
1107
- curve25519_x25519base_wcmploop:
1108
- movq (%r8,%r9,8), %rax
1109
- sbbq (%r15,%r9,8), %rax
1110
- incq %r9
1111
- decq %rcx
1112
- jne curve25519_x25519base_wcmploop
1113
- sbbq $0x0, %r10
1114
- sbbq %r10, %r10
1115
- notq %r10
1116
- xorq %rcx, %rcx
1117
- xorq %r9, %r9
1118
- curve25519_x25519base_wcorrloop:
1119
- movq (%r8,%r9,8), %rax
1120
- movq (%r15,%r9,8), %rbx
1121
- andq %r10, %rbx
1122
- negq %rcx
1123
- sbbq %rbx, %rax
1124
- sbbq %rcx, %rcx
1125
- movq %rax, (%r8,%r9,8)
1126
- incq %r9
1127
- cmpq %rdi, %r9
1128
- jb curve25519_x25519base_wcorrloop
1107
+ movq %rbx, 0x40(%rsp)
1108
+ addq %rax, %rbp
1109
+ adcq %rdx, %rsi
1110
+ movq 0x60(%rsp), %rax
1111
+ xorq %r15, %rax
1112
+ mulq %r14
1113
+ addq %rax, %rbp
1114
+ adcq %rdx, %rsi
1115
+ movq %rbp, 0x60(%rsp)
1116
+ xorl %ebx, %ebx
1117
+ movq 0x48(%rsp), %rax
1118
+ xorq %r9, %rax
1119
+ mulq %r8
1120
+ addq %rax, %rcx
1121
+ adcq %rdx, %rbx
1122
+ movq 0x68(%rsp), %rax
1123
+ xorq %r11, %rax
1124
+ mulq %r10
1125
+ addq %rax, %rcx
1126
+ adcq %rdx, %rbx
1127
+ xorl %ebp, %ebp
1128
+ movq 0x48(%rsp), %rax
1129
+ xorq %r13, %rax
1130
+ mulq %r12
1131
+ movq %rcx, 0x48(%rsp)
1132
+ addq %rax, %rsi
1133
+ adcq %rdx, %rbp
1134
+ movq 0x68(%rsp), %rax
1135
+ xorq %r15, %rax
1136
+ mulq %r14
1137
+ addq %rax, %rsi
1138
+ adcq %rdx, %rbp
1139
+ movq %rsi, 0x68(%rsp)
1140
+ xorl %ecx, %ecx
1141
+ movq 0x50(%rsp), %rax
1142
+ xorq %r9, %rax
1143
+ mulq %r8
1144
+ addq %rax, %rbx
1145
+ adcq %rdx, %rcx
1146
+ movq 0x70(%rsp), %rax
1147
+ xorq %r11, %rax
1148
+ mulq %r10
1149
+ addq %rax, %rbx
1150
+ adcq %rdx, %rcx
1151
+ xorl %esi, %esi
1152
+ movq 0x50(%rsp), %rax
1153
+ xorq %r13, %rax
1154
+ mulq %r12
1155
+ movq %rbx, 0x50(%rsp)
1156
+ addq %rax, %rbp
1157
+ adcq %rdx, %rsi
1158
+ movq 0x70(%rsp), %rax
1159
+ xorq %r15, %rax
1160
+ mulq %r14
1161
+ addq %rax, %rbp
1162
+ adcq %rdx, %rsi
1163
+ movq %rbp, 0x70(%rsp)
1164
+ movq 0x58(%rsp), %rax
1165
+ xorq %r9, %rax
1166
+ movq %r9, %rbx
1167
+ andq %r8, %rbx
1168
+ negq %rbx
1169
+ mulq %r8
1170
+ addq %rax, %rcx
1171
+ adcq %rdx, %rbx
1172
+ movq 0x78(%rsp), %rax
1173
+ xorq %r11, %rax
1174
+ movq %r11, %rdx
1175
+ andq %r10, %rdx
1176
+ subq %rdx, %rbx
1177
+ mulq %r10
1178
+ addq %rax, %rcx
1179
+ adcq %rbx, %rdx
1180
+ movq %rdx, %rbx
1181
+ shldq $0x1, %rcx, %rdx
1182
+ sarq $0x3f, %rbx
1183
+ addq %rbx, %rdx
1184
+ movl $0x13, %eax
1185
+ imulq %rdx
1129
1186
  movq 0x40(%rsp), %r8
1130
- movq (%r8), %rbx
1131
- movq 0x28(%rsp), %rbp
1132
- imulq %rbx, %rbp
1133
- movq (%r15), %rax
1134
- mulq %rbp
1135
- addq %rbx, %rax
1136
- movq %rdx, %r11
1137
- movl $0x1, %r9d
1138
- movq %rdi, %rcx
1139
- decq %rcx
1140
- je curve25519_x25519base_zmontend
1141
- curve25519_x25519base_zmontloop:
1142
- adcq (%r8,%r9,8), %r11
1143
- sbbq %rbx, %rbx
1144
- movq (%r15,%r9,8), %rax
1145
- mulq %rbp
1146
- subq %rbx, %rdx
1147
- addq %r11, %rax
1148
- movq %rax, -0x8(%r8,%r9,8)
1149
- movq %rdx, %r11
1150
- incq %r9
1151
- decq %rcx
1152
- jne curve25519_x25519base_zmontloop
1153
- curve25519_x25519base_zmontend:
1154
- adcq %rsi, %r11
1155
- movq %r11, -0x8(%r8,%rdi,8)
1156
- sbbq %r11, %r11
1157
- negq %r11
1158
- movq %rdi, %rcx
1159
- xorq %r9, %r9
1160
- curve25519_x25519base_zcmploop:
1161
- movq (%r8,%r9,8), %rax
1162
- sbbq (%r15,%r9,8), %rax
1163
- incq %r9
1164
- decq %rcx
1165
- jne curve25519_x25519base_zcmploop
1166
- sbbq $0x0, %r11
1167
- sbbq %r11, %r11
1168
- notq %r11
1169
- xorq %rcx, %rcx
1170
- xorq %r9, %r9
1171
- curve25519_x25519base_zcorrloop:
1172
- movq (%r8,%r9,8), %rax
1173
- movq (%r15,%r9,8), %rbx
1174
- andq %r11, %rbx
1187
+ addq %rax, %r8
1188
+ movq %r8, 0x40(%rsp)
1189
+ movq 0x48(%rsp), %r8
1190
+ adcq %rdx, %r8
1191
+ movq %r8, 0x48(%rsp)
1192
+ movq 0x50(%rsp), %r8
1193
+ adcq %rbx, %r8
1194
+ movq %r8, 0x50(%rsp)
1195
+ adcq %rbx, %rcx
1196
+ shlq $0x3f, %rax
1197
+ addq %rax, %rcx
1198
+ movq 0x58(%rsp), %rax
1199
+ movq %rcx, 0x58(%rsp)
1200
+ xorq %r13, %rax
1201
+ movq %r13, %rcx
1202
+ andq %r12, %rcx
1175
1203
  negq %rcx
1176
- sbbq %rbx, %rax
1177
- sbbq %rcx, %rcx
1178
- movq %rax, (%r8,%r9,8)
1179
- incq %r9
1180
- cmpq %rdi, %r9
1181
- jb curve25519_x25519base_zcorrloop
1182
- movq 0x30(%rsp), %r8
1183
- leaq (%r8,%rdi,8), %r15
1184
- xorq %r9, %r9
1185
- xorq %r12, %r12
1186
- xorq %r14, %r14
1187
- xorq %rbp, %rbp
1188
- xorq %rsi, %rsi
1189
- curve25519_x25519base_crossloop:
1190
- movq (%r8,%r9,8), %rcx
1191
- movq (%rsp), %rax
1192
- mulq %rcx
1193
- addq %rax, %r14
1194
- adcq $0x0, %rdx
1195
- movq %rdx, %r10
1196
- movq 0x10(%rsp), %rax
1197
- mulq %rcx
1204
+ mulq %r12
1198
1205
  addq %rax, %rsi
1199
- adcq $0x0, %rdx
1200
- movq %rdx, %r11
1201
- movq (%r15,%r9,8), %rcx
1202
- movq 0x8(%rsp), %rax
1203
- mulq %rcx
1204
- subq %r12, %rdx
1205
- subq %rax, %r14
1206
- sbbq %rdx, %r10
1207
- sbbq %r12, %r12
1208
- movq %r14, (%r8,%r9,8)
1209
- movq %r10, %r14
1210
- movq 0x18(%rsp), %rax
1211
- mulq %rcx
1212
- subq %rbp, %rdx
1206
+ adcq %rdx, %rcx
1207
+ movq 0x78(%rsp), %rax
1208
+ xorq %r15, %rax
1209
+ movq %r15, %rdx
1210
+ andq %r14, %rdx
1211
+ subq %rdx, %rcx
1212
+ mulq %r14
1213
+ addq %rax, %rsi
1214
+ adcq %rcx, %rdx
1215
+ movq %rdx, %rcx
1216
+ shldq $0x1, %rsi, %rdx
1217
+ sarq $0x3f, %rcx
1218
+ movl $0x13, %eax
1219
+ addq %rcx, %rdx
1220
+ imulq %rdx
1221
+ movq 0x60(%rsp), %r8
1222
+ addq %rax, %r8
1223
+ movq %r8, 0x60(%rsp)
1224
+ movq 0x68(%rsp), %r8
1225
+ adcq %rdx, %r8
1226
+ movq %r8, 0x68(%rsp)
1227
+ movq 0x70(%rsp), %r8
1228
+ adcq %rcx, %r8
1229
+ movq %r8, 0x70(%rsp)
1230
+ adcq %rcx, %rsi
1231
+ shlq $0x3f, %rax
1232
+ addq %rax, %rsi
1233
+ movq %rsi, 0x78(%rsp)
1234
+ curve25519_x25519base_midloop:
1235
+ movq 0x98(%rsp), %rsi
1236
+ movq (%rsp), %rdx
1237
+ movq 0x20(%rsp), %rcx
1238
+ movq %rdx, %rbx
1239
+ andq $0xfffff, %rbx
1240
+ movabsq $0xfffffe0000000000, %rax
1241
+ orq %rax, %rbx
1242
+ andq $0xfffff, %rcx
1243
+ movabsq $0xc000000000000000, %rax
1244
+ orq %rax, %rcx
1245
+ movq $0xfffffffffffffffe, %rax
1246
+ xorl %ebp, %ebp
1247
+ movl $0x2, %edx
1248
+ movq %rbx, %rdi
1249
+ movq %rax, %r8
1250
+ testq %rsi, %rsi
1251
+ cmovs %rbp, %r8
1252
+ testq $0x1, %rcx
1253
+ cmoveq %rbp, %r8
1254
+ cmoveq %rbp, %rdi
1255
+ xorq %r8, %rdi
1256
+ xorq %r8, %rsi
1257
+ btq $0x3f, %r8
1258
+ cmovbq %rcx, %rbx
1259
+ movq %rax, %r8
1213
1260
  subq %rax, %rsi
1214
- sbbq %rdx, %r11
1215
- sbbq %rbp, %rbp
1216
- movq %rsi, (%r15,%r9,8)
1217
- movq %r11, %rsi
1218
- incq %r9
1219
- cmpq %r13, %r9
1220
- jb curve25519_x25519base_crossloop
1221
- xorq %r9, %r9
1222
- movq %r12, %r10
1223
- movq %rbp, %r11
1224
- xorq %r12, %r14
1225
- xorq %rbp, %rsi
1226
- curve25519_x25519base_optnegloop:
1227
- movq (%r8,%r9,8), %rax
1228
- xorq %r12, %rax
1229
- negq %r10
1230
- adcq $0x0, %rax
1231
- sbbq %r10, %r10
1232
- movq %rax, (%r8,%r9,8)
1233
- movq (%r15,%r9,8), %rax
1234
- xorq %rbp, %rax
1235
- negq %r11
1236
- adcq $0x0, %rax
1237
- sbbq %r11, %r11
1238
- movq %rax, (%r15,%r9,8)
1239
- incq %r9
1240
- cmpq %r13, %r9
1241
- jb curve25519_x25519base_optnegloop
1242
- subq %r10, %r14
1243
- subq %r11, %rsi
1244
- movq %r13, %r9
1245
- curve25519_x25519base_shiftloop:
1246
- movq -0x8(%r8,%r9,8), %rax
1247
- movq %rax, %r10
1248
- shrdq $0x3a, %r14, %rax
1249
- movq %rax, -0x8(%r8,%r9,8)
1250
- movq %r10, %r14
1251
- movq -0x8(%r15,%r9,8), %rax
1252
- movq %rax, %r11
1253
- shrdq $0x3a, %rsi, %rax
1254
- movq %rax, -0x8(%r15,%r9,8)
1255
- movq %r11, %rsi
1256
- decq %r9
1257
- jne curve25519_x25519base_shiftloop
1258
- notq %rbp
1259
- movq 0x48(%rsp), %rcx
1260
- movq 0x38(%rsp), %r8
1261
- movq 0x40(%rsp), %r15
1262
- movq %r12, %r10
1263
- movq %rbp, %r11
1264
- xorq %r9, %r9
1265
- curve25519_x25519base_fliploop:
1266
- movq %rbp, %rdx
1267
- movq (%rcx,%r9,8), %rax
1268
- andq %rax, %rdx
1269
- andq %r12, %rax
1270
- movq (%r8,%r9,8), %rbx
1271
- xorq %r12, %rbx
1272
- negq %r10
1273
- adcq %rbx, %rax
1274
- sbbq %r10, %r10
1275
- movq %rax, (%r8,%r9,8)
1276
- movq (%r15,%r9,8), %rbx
1277
- xorq %rbp, %rbx
1278
- negq %r11
1279
- adcq %rbx, %rdx
1280
- sbbq %r11, %r11
1281
- movq %rdx, (%r15,%r9,8)
1282
- incq %r9
1283
- cmpq %rdi, %r9
1284
- jb curve25519_x25519base_fliploop
1285
- subq $0x3a, 0x20(%rsp)
1286
- ja curve25519_x25519base_outerloop
1261
+ leaq (%rcx,%rdi), %rcx
1262
+ cmovs %rbp, %r8
1263
+ movq %rbx, %rdi
1264
+ testq %rdx, %rcx
1265
+ cmoveq %rbp, %r8
1266
+ cmoveq %rbp, %rdi
1267
+ sarq $1, %rcx
1268
+ xorq %r8, %rdi
1269
+ xorq %r8, %rsi
1270
+ btq $0x3f, %r8
1271
+ cmovbq %rcx, %rbx
1272
+ movq %rax, %r8
1273
+ subq %rax, %rsi
1274
+ leaq (%rcx,%rdi), %rcx
1275
+ cmovs %rbp, %r8
1276
+ movq %rbx, %rdi
1277
+ testq %rdx, %rcx
1278
+ cmoveq %rbp, %r8
1279
+ cmoveq %rbp, %rdi
1280
+ sarq $1, %rcx
1281
+ xorq %r8, %rdi
1282
+ xorq %r8, %rsi
1283
+ btq $0x3f, %r8
1284
+ cmovbq %rcx, %rbx
1285
+ movq %rax, %r8
1286
+ subq %rax, %rsi
1287
+ leaq (%rcx,%rdi), %rcx
1288
+ cmovs %rbp, %r8
1289
+ movq %rbx, %rdi
1290
+ testq %rdx, %rcx
1291
+ cmoveq %rbp, %r8
1292
+ cmoveq %rbp, %rdi
1293
+ sarq $1, %rcx
1294
+ xorq %r8, %rdi
1295
+ xorq %r8, %rsi
1296
+ btq $0x3f, %r8
1297
+ cmovbq %rcx, %rbx
1298
+ movq %rax, %r8
1299
+ subq %rax, %rsi
1300
+ leaq (%rcx,%rdi), %rcx
1301
+ cmovs %rbp, %r8
1302
+ movq %rbx, %rdi
1303
+ testq %rdx, %rcx
1304
+ cmoveq %rbp, %r8
1305
+ cmoveq %rbp, %rdi
1306
+ sarq $1, %rcx
1307
+ xorq %r8, %rdi
1308
+ xorq %r8, %rsi
1309
+ btq $0x3f, %r8
1310
+ cmovbq %rcx, %rbx
1311
+ movq %rax, %r8
1312
+ subq %rax, %rsi
1313
+ leaq (%rcx,%rdi), %rcx
1314
+ cmovs %rbp, %r8
1315
+ movq %rbx, %rdi
1316
+ testq %rdx, %rcx
1317
+ cmoveq %rbp, %r8
1318
+ cmoveq %rbp, %rdi
1319
+ sarq $1, %rcx
1320
+ xorq %r8, %rdi
1321
+ xorq %r8, %rsi
1322
+ btq $0x3f, %r8
1323
+ cmovbq %rcx, %rbx
1324
+ movq %rax, %r8
1325
+ subq %rax, %rsi
1326
+ leaq (%rcx,%rdi), %rcx
1327
+ cmovs %rbp, %r8
1328
+ movq %rbx, %rdi
1329
+ testq %rdx, %rcx
1330
+ cmoveq %rbp, %r8
1331
+ cmoveq %rbp, %rdi
1332
+ sarq $1, %rcx
1333
+ xorq %r8, %rdi
1334
+ xorq %r8, %rsi
1335
+ btq $0x3f, %r8
1336
+ cmovbq %rcx, %rbx
1337
+ movq %rax, %r8
1338
+ subq %rax, %rsi
1339
+ leaq (%rcx,%rdi), %rcx
1340
+ cmovs %rbp, %r8
1341
+ movq %rbx, %rdi
1342
+ testq %rdx, %rcx
1343
+ cmoveq %rbp, %r8
1344
+ cmoveq %rbp, %rdi
1345
+ sarq $1, %rcx
1346
+ xorq %r8, %rdi
1347
+ xorq %r8, %rsi
1348
+ btq $0x3f, %r8
1349
+ cmovbq %rcx, %rbx
1350
+ movq %rax, %r8
1351
+ subq %rax, %rsi
1352
+ leaq (%rcx,%rdi), %rcx
1353
+ cmovs %rbp, %r8
1354
+ movq %rbx, %rdi
1355
+ testq %rdx, %rcx
1356
+ cmoveq %rbp, %r8
1357
+ cmoveq %rbp, %rdi
1358
+ sarq $1, %rcx
1359
+ xorq %r8, %rdi
1360
+ xorq %r8, %rsi
1361
+ btq $0x3f, %r8
1362
+ cmovbq %rcx, %rbx
1363
+ movq %rax, %r8
1364
+ subq %rax, %rsi
1365
+ leaq (%rcx,%rdi), %rcx
1366
+ cmovs %rbp, %r8
1367
+ movq %rbx, %rdi
1368
+ testq %rdx, %rcx
1369
+ cmoveq %rbp, %r8
1370
+ cmoveq %rbp, %rdi
1371
+ sarq $1, %rcx
1372
+ xorq %r8, %rdi
1373
+ xorq %r8, %rsi
1374
+ btq $0x3f, %r8
1375
+ cmovbq %rcx, %rbx
1376
+ movq %rax, %r8
1377
+ subq %rax, %rsi
1378
+ leaq (%rcx,%rdi), %rcx
1379
+ cmovs %rbp, %r8
1380
+ movq %rbx, %rdi
1381
+ testq %rdx, %rcx
1382
+ cmoveq %rbp, %r8
1383
+ cmoveq %rbp, %rdi
1384
+ sarq $1, %rcx
1385
+ xorq %r8, %rdi
1386
+ xorq %r8, %rsi
1387
+ btq $0x3f, %r8
1388
+ cmovbq %rcx, %rbx
1389
+ movq %rax, %r8
1390
+ subq %rax, %rsi
1391
+ leaq (%rcx,%rdi), %rcx
1392
+ cmovs %rbp, %r8
1393
+ movq %rbx, %rdi
1394
+ testq %rdx, %rcx
1395
+ cmoveq %rbp, %r8
1396
+ cmoveq %rbp, %rdi
1397
+ sarq $1, %rcx
1398
+ xorq %r8, %rdi
1399
+ xorq %r8, %rsi
1400
+ btq $0x3f, %r8
1401
+ cmovbq %rcx, %rbx
1402
+ movq %rax, %r8
1403
+ subq %rax, %rsi
1404
+ leaq (%rcx,%rdi), %rcx
1405
+ cmovs %rbp, %r8
1406
+ movq %rbx, %rdi
1407
+ testq %rdx, %rcx
1408
+ cmoveq %rbp, %r8
1409
+ cmoveq %rbp, %rdi
1410
+ sarq $1, %rcx
1411
+ xorq %r8, %rdi
1412
+ xorq %r8, %rsi
1413
+ btq $0x3f, %r8
1414
+ cmovbq %rcx, %rbx
1415
+ movq %rax, %r8
1416
+ subq %rax, %rsi
1417
+ leaq (%rcx,%rdi), %rcx
1418
+ cmovs %rbp, %r8
1419
+ movq %rbx, %rdi
1420
+ testq %rdx, %rcx
1421
+ cmoveq %rbp, %r8
1422
+ cmoveq %rbp, %rdi
1423
+ sarq $1, %rcx
1424
+ xorq %r8, %rdi
1425
+ xorq %r8, %rsi
1426
+ btq $0x3f, %r8
1427
+ cmovbq %rcx, %rbx
1428
+ movq %rax, %r8
1429
+ subq %rax, %rsi
1430
+ leaq (%rcx,%rdi), %rcx
1431
+ cmovs %rbp, %r8
1432
+ movq %rbx, %rdi
1433
+ testq %rdx, %rcx
1434
+ cmoveq %rbp, %r8
1435
+ cmoveq %rbp, %rdi
1436
+ sarq $1, %rcx
1437
+ xorq %r8, %rdi
1438
+ xorq %r8, %rsi
1439
+ btq $0x3f, %r8
1440
+ cmovbq %rcx, %rbx
1441
+ movq %rax, %r8
1442
+ subq %rax, %rsi
1443
+ leaq (%rcx,%rdi), %rcx
1444
+ cmovs %rbp, %r8
1445
+ movq %rbx, %rdi
1446
+ testq %rdx, %rcx
1447
+ cmoveq %rbp, %r8
1448
+ cmoveq %rbp, %rdi
1449
+ sarq $1, %rcx
1450
+ xorq %r8, %rdi
1451
+ xorq %r8, %rsi
1452
+ btq $0x3f, %r8
1453
+ cmovbq %rcx, %rbx
1454
+ movq %rax, %r8
1455
+ subq %rax, %rsi
1456
+ leaq (%rcx,%rdi), %rcx
1457
+ cmovs %rbp, %r8
1458
+ movq %rbx, %rdi
1459
+ testq %rdx, %rcx
1460
+ cmoveq %rbp, %r8
1461
+ cmoveq %rbp, %rdi
1462
+ sarq $1, %rcx
1463
+ xorq %r8, %rdi
1464
+ xorq %r8, %rsi
1465
+ btq $0x3f, %r8
1466
+ cmovbq %rcx, %rbx
1467
+ movq %rax, %r8
1468
+ subq %rax, %rsi
1469
+ leaq (%rcx,%rdi), %rcx
1470
+ cmovs %rbp, %r8
1471
+ movq %rbx, %rdi
1472
+ testq %rdx, %rcx
1473
+ cmoveq %rbp, %r8
1474
+ cmoveq %rbp, %rdi
1475
+ sarq $1, %rcx
1476
+ xorq %r8, %rdi
1477
+ xorq %r8, %rsi
1478
+ btq $0x3f, %r8
1479
+ cmovbq %rcx, %rbx
1480
+ movq %rax, %r8
1481
+ subq %rax, %rsi
1482
+ leaq (%rcx,%rdi), %rcx
1483
+ cmovs %rbp, %r8
1484
+ movq %rbx, %rdi
1485
+ testq %rdx, %rcx
1486
+ cmoveq %rbp, %r8
1487
+ cmoveq %rbp, %rdi
1488
+ sarq $1, %rcx
1489
+ xorq %r8, %rdi
1490
+ xorq %r8, %rsi
1491
+ btq $0x3f, %r8
1492
+ cmovbq %rcx, %rbx
1493
+ movq %rax, %r8
1494
+ subq %rax, %rsi
1495
+ leaq (%rcx,%rdi), %rcx
1496
+ cmovs %rbp, %r8
1497
+ movq %rbx, %rdi
1498
+ testq %rdx, %rcx
1499
+ cmoveq %rbp, %r8
1500
+ cmoveq %rbp, %rdi
1501
+ sarq $1, %rcx
1502
+ xorq %r8, %rdi
1503
+ xorq %r8, %rsi
1504
+ btq $0x3f, %r8
1505
+ cmovbq %rcx, %rbx
1506
+ movq %rax, %r8
1507
+ subq %rax, %rsi
1508
+ leaq (%rcx,%rdi), %rcx
1509
+ sarq $1, %rcx
1510
+ movl $0x100000, %eax
1511
+ leaq (%rbx,%rax), %rdx
1512
+ leaq (%rcx,%rax), %rdi
1513
+ shlq $0x16, %rdx
1514
+ shlq $0x16, %rdi
1515
+ sarq $0x2b, %rdx
1516
+ sarq $0x2b, %rdi
1517
+ movabsq $0x20000100000, %rax
1518
+ leaq (%rbx,%rax), %rbx
1519
+ leaq (%rcx,%rax), %rcx
1520
+ sarq $0x2a, %rbx
1521
+ sarq $0x2a, %rcx
1522
+ movq %rdx, 0xa0(%rsp)
1523
+ movq %rbx, 0xa8(%rsp)
1524
+ movq %rdi, 0xb0(%rsp)
1525
+ movq %rcx, 0xb8(%rsp)
1526
+ movq (%rsp), %r12
1527
+ imulq %r12, %rdi
1528
+ imulq %rdx, %r12
1529
+ movq 0x20(%rsp), %r13
1530
+ imulq %r13, %rbx
1531
+ imulq %rcx, %r13
1532
+ addq %rbx, %r12
1533
+ addq %rdi, %r13
1534
+ sarq $0x14, %r12
1535
+ sarq $0x14, %r13
1536
+ movq %r12, %rbx
1537
+ andq $0xfffff, %rbx
1538
+ movabsq $0xfffffe0000000000, %rax
1539
+ orq %rax, %rbx
1540
+ movq %r13, %rcx
1541
+ andq $0xfffff, %rcx
1542
+ movabsq $0xc000000000000000, %rax
1543
+ orq %rax, %rcx
1544
+ movq $0xfffffffffffffffe, %rax
1545
+ movl $0x2, %edx
1546
+ movq %rbx, %rdi
1547
+ movq %rax, %r8
1548
+ testq %rsi, %rsi
1549
+ cmovs %rbp, %r8
1550
+ testq $0x1, %rcx
1551
+ cmoveq %rbp, %r8
1552
+ cmoveq %rbp, %rdi
1553
+ xorq %r8, %rdi
1554
+ xorq %r8, %rsi
1555
+ btq $0x3f, %r8
1556
+ cmovbq %rcx, %rbx
1557
+ movq %rax, %r8
1558
+ subq %rax, %rsi
1559
+ leaq (%rcx,%rdi), %rcx
1560
+ cmovs %rbp, %r8
1561
+ movq %rbx, %rdi
1562
+ testq %rdx, %rcx
1563
+ cmoveq %rbp, %r8
1564
+ cmoveq %rbp, %rdi
1565
+ sarq $1, %rcx
1566
+ xorq %r8, %rdi
1567
+ xorq %r8, %rsi
1568
+ btq $0x3f, %r8
1569
+ cmovbq %rcx, %rbx
1570
+ movq %rax, %r8
1571
+ subq %rax, %rsi
1572
+ leaq (%rcx,%rdi), %rcx
1573
+ cmovs %rbp, %r8
1574
+ movq %rbx, %rdi
1575
+ testq %rdx, %rcx
1576
+ cmoveq %rbp, %r8
1577
+ cmoveq %rbp, %rdi
1578
+ sarq $1, %rcx
1579
+ xorq %r8, %rdi
1580
+ xorq %r8, %rsi
1581
+ btq $0x3f, %r8
1582
+ cmovbq %rcx, %rbx
1583
+ movq %rax, %r8
1584
+ subq %rax, %rsi
1585
+ leaq (%rcx,%rdi), %rcx
1586
+ cmovs %rbp, %r8
1587
+ movq %rbx, %rdi
1588
+ testq %rdx, %rcx
1589
+ cmoveq %rbp, %r8
1590
+ cmoveq %rbp, %rdi
1591
+ sarq $1, %rcx
1592
+ xorq %r8, %rdi
1593
+ xorq %r8, %rsi
1594
+ btq $0x3f, %r8
1595
+ cmovbq %rcx, %rbx
1596
+ movq %rax, %r8
1597
+ subq %rax, %rsi
1598
+ leaq (%rcx,%rdi), %rcx
1599
+ cmovs %rbp, %r8
1600
+ movq %rbx, %rdi
1601
+ testq %rdx, %rcx
1602
+ cmoveq %rbp, %r8
1603
+ cmoveq %rbp, %rdi
1604
+ sarq $1, %rcx
1605
+ xorq %r8, %rdi
1606
+ xorq %r8, %rsi
1607
+ btq $0x3f, %r8
1608
+ cmovbq %rcx, %rbx
1609
+ movq %rax, %r8
1610
+ subq %rax, %rsi
1611
+ leaq (%rcx,%rdi), %rcx
1612
+ cmovs %rbp, %r8
1613
+ movq %rbx, %rdi
1614
+ testq %rdx, %rcx
1615
+ cmoveq %rbp, %r8
1616
+ cmoveq %rbp, %rdi
1617
+ sarq $1, %rcx
1618
+ xorq %r8, %rdi
1619
+ xorq %r8, %rsi
1620
+ btq $0x3f, %r8
1621
+ cmovbq %rcx, %rbx
1622
+ movq %rax, %r8
1623
+ subq %rax, %rsi
1624
+ leaq (%rcx,%rdi), %rcx
1625
+ cmovs %rbp, %r8
1626
+ movq %rbx, %rdi
1627
+ testq %rdx, %rcx
1628
+ cmoveq %rbp, %r8
1629
+ cmoveq %rbp, %rdi
1630
+ sarq $1, %rcx
1631
+ xorq %r8, %rdi
1632
+ xorq %r8, %rsi
1633
+ btq $0x3f, %r8
1634
+ cmovbq %rcx, %rbx
1635
+ movq %rax, %r8
1636
+ subq %rax, %rsi
1637
+ leaq (%rcx,%rdi), %rcx
1638
+ cmovs %rbp, %r8
1639
+ movq %rbx, %rdi
1640
+ testq %rdx, %rcx
1641
+ cmoveq %rbp, %r8
1642
+ cmoveq %rbp, %rdi
1643
+ sarq $1, %rcx
1644
+ xorq %r8, %rdi
1645
+ xorq %r8, %rsi
1646
+ btq $0x3f, %r8
1647
+ cmovbq %rcx, %rbx
1648
+ movq %rax, %r8
1649
+ subq %rax, %rsi
1650
+ leaq (%rcx,%rdi), %rcx
1651
+ cmovs %rbp, %r8
1652
+ movq %rbx, %rdi
1653
+ testq %rdx, %rcx
1654
+ cmoveq %rbp, %r8
1655
+ cmoveq %rbp, %rdi
1656
+ sarq $1, %rcx
1657
+ xorq %r8, %rdi
1658
+ xorq %r8, %rsi
1659
+ btq $0x3f, %r8
1660
+ cmovbq %rcx, %rbx
1661
+ movq %rax, %r8
1662
+ subq %rax, %rsi
1663
+ leaq (%rcx,%rdi), %rcx
1664
+ cmovs %rbp, %r8
1665
+ movq %rbx, %rdi
1666
+ testq %rdx, %rcx
1667
+ cmoveq %rbp, %r8
1668
+ cmoveq %rbp, %rdi
1669
+ sarq $1, %rcx
1670
+ xorq %r8, %rdi
1671
+ xorq %r8, %rsi
1672
+ btq $0x3f, %r8
1673
+ cmovbq %rcx, %rbx
1674
+ movq %rax, %r8
1675
+ subq %rax, %rsi
1676
+ leaq (%rcx,%rdi), %rcx
1677
+ cmovs %rbp, %r8
1678
+ movq %rbx, %rdi
1679
+ testq %rdx, %rcx
1680
+ cmoveq %rbp, %r8
1681
+ cmoveq %rbp, %rdi
1682
+ sarq $1, %rcx
1683
+ xorq %r8, %rdi
1684
+ xorq %r8, %rsi
1685
+ btq $0x3f, %r8
1686
+ cmovbq %rcx, %rbx
1687
+ movq %rax, %r8
1688
+ subq %rax, %rsi
1689
+ leaq (%rcx,%rdi), %rcx
1690
+ cmovs %rbp, %r8
1691
+ movq %rbx, %rdi
1692
+ testq %rdx, %rcx
1693
+ cmoveq %rbp, %r8
1694
+ cmoveq %rbp, %rdi
1695
+ sarq $1, %rcx
1696
+ xorq %r8, %rdi
1697
+ xorq %r8, %rsi
1698
+ btq $0x3f, %r8
1699
+ cmovbq %rcx, %rbx
1700
+ movq %rax, %r8
1701
+ subq %rax, %rsi
1702
+ leaq (%rcx,%rdi), %rcx
1703
+ cmovs %rbp, %r8
1704
+ movq %rbx, %rdi
1705
+ testq %rdx, %rcx
1706
+ cmoveq %rbp, %r8
1707
+ cmoveq %rbp, %rdi
1708
+ sarq $1, %rcx
1709
+ xorq %r8, %rdi
1710
+ xorq %r8, %rsi
1711
+ btq $0x3f, %r8
1712
+ cmovbq %rcx, %rbx
1713
+ movq %rax, %r8
1714
+ subq %rax, %rsi
1715
+ leaq (%rcx,%rdi), %rcx
1716
+ cmovs %rbp, %r8
1717
+ movq %rbx, %rdi
1718
+ testq %rdx, %rcx
1719
+ cmoveq %rbp, %r8
1720
+ cmoveq %rbp, %rdi
1721
+ sarq $1, %rcx
1722
+ xorq %r8, %rdi
1723
+ xorq %r8, %rsi
1724
+ btq $0x3f, %r8
1725
+ cmovbq %rcx, %rbx
1726
+ movq %rax, %r8
1727
+ subq %rax, %rsi
1728
+ leaq (%rcx,%rdi), %rcx
1729
+ cmovs %rbp, %r8
1730
+ movq %rbx, %rdi
1731
+ testq %rdx, %rcx
1732
+ cmoveq %rbp, %r8
1733
+ cmoveq %rbp, %rdi
1734
+ sarq $1, %rcx
1735
+ xorq %r8, %rdi
1736
+ xorq %r8, %rsi
1737
+ btq $0x3f, %r8
1738
+ cmovbq %rcx, %rbx
1739
+ movq %rax, %r8
1740
+ subq %rax, %rsi
1741
+ leaq (%rcx,%rdi), %rcx
1742
+ cmovs %rbp, %r8
1743
+ movq %rbx, %rdi
1744
+ testq %rdx, %rcx
1745
+ cmoveq %rbp, %r8
1746
+ cmoveq %rbp, %rdi
1747
+ sarq $1, %rcx
1748
+ xorq %r8, %rdi
1749
+ xorq %r8, %rsi
1750
+ btq $0x3f, %r8
1751
+ cmovbq %rcx, %rbx
1752
+ movq %rax, %r8
1753
+ subq %rax, %rsi
1754
+ leaq (%rcx,%rdi), %rcx
1755
+ cmovs %rbp, %r8
1756
+ movq %rbx, %rdi
1757
+ testq %rdx, %rcx
1758
+ cmoveq %rbp, %r8
1759
+ cmoveq %rbp, %rdi
1760
+ sarq $1, %rcx
1761
+ xorq %r8, %rdi
1762
+ xorq %r8, %rsi
1763
+ btq $0x3f, %r8
1764
+ cmovbq %rcx, %rbx
1765
+ movq %rax, %r8
1766
+ subq %rax, %rsi
1767
+ leaq (%rcx,%rdi), %rcx
1768
+ cmovs %rbp, %r8
1769
+ movq %rbx, %rdi
1770
+ testq %rdx, %rcx
1771
+ cmoveq %rbp, %r8
1772
+ cmoveq %rbp, %rdi
1773
+ sarq $1, %rcx
1774
+ xorq %r8, %rdi
1775
+ xorq %r8, %rsi
1776
+ btq $0x3f, %r8
1777
+ cmovbq %rcx, %rbx
1778
+ movq %rax, %r8
1779
+ subq %rax, %rsi
1780
+ leaq (%rcx,%rdi), %rcx
1781
+ cmovs %rbp, %r8
1782
+ movq %rbx, %rdi
1783
+ testq %rdx, %rcx
1784
+ cmoveq %rbp, %r8
1785
+ cmoveq %rbp, %rdi
1786
+ sarq $1, %rcx
1787
+ xorq %r8, %rdi
1788
+ xorq %r8, %rsi
1789
+ btq $0x3f, %r8
1790
+ cmovbq %rcx, %rbx
1791
+ movq %rax, %r8
1792
+ subq %rax, %rsi
1793
+ leaq (%rcx,%rdi), %rcx
1794
+ cmovs %rbp, %r8
1795
+ movq %rbx, %rdi
1796
+ testq %rdx, %rcx
1797
+ cmoveq %rbp, %r8
1798
+ cmoveq %rbp, %rdi
1799
+ sarq $1, %rcx
1800
+ xorq %r8, %rdi
1801
+ xorq %r8, %rsi
1802
+ btq $0x3f, %r8
1803
+ cmovbq %rcx, %rbx
1804
+ movq %rax, %r8
1805
+ subq %rax, %rsi
1806
+ leaq (%rcx,%rdi), %rcx
1807
+ sarq $1, %rcx
1808
+ movl $0x100000, %eax
1809
+ leaq (%rbx,%rax), %r8
1810
+ leaq (%rcx,%rax), %r10
1811
+ shlq $0x16, %r8
1812
+ shlq $0x16, %r10
1813
+ sarq $0x2b, %r8
1814
+ sarq $0x2b, %r10
1815
+ movabsq $0x20000100000, %rax
1816
+ leaq (%rbx,%rax), %r15
1817
+ leaq (%rcx,%rax), %r11
1818
+ sarq $0x2a, %r15
1819
+ sarq $0x2a, %r11
1820
+ movq %r13, %rbx
1821
+ movq %r12, %rcx
1822
+ imulq %r8, %r12
1823
+ imulq %r15, %rbx
1824
+ addq %rbx, %r12
1825
+ imulq %r11, %r13
1826
+ imulq %r10, %rcx
1827
+ addq %rcx, %r13
1828
+ sarq $0x14, %r12
1829
+ sarq $0x14, %r13
1830
+ movq %r12, %rbx
1831
+ andq $0xfffff, %rbx
1832
+ movabsq $0xfffffe0000000000, %rax
1833
+ orq %rax, %rbx
1834
+ movq %r13, %rcx
1835
+ andq $0xfffff, %rcx
1836
+ movabsq $0xc000000000000000, %rax
1837
+ orq %rax, %rcx
1838
+ movq 0xa0(%rsp), %rax
1839
+ imulq %r8, %rax
1840
+ movq 0xb0(%rsp), %rdx
1841
+ imulq %r15, %rdx
1842
+ imulq 0xa8(%rsp), %r8
1843
+ imulq 0xb8(%rsp), %r15
1844
+ addq %r8, %r15
1845
+ leaq (%rax,%rdx), %r9
1846
+ movq 0xa0(%rsp), %rax
1847
+ imulq %r10, %rax
1848
+ movq 0xb0(%rsp), %rdx
1849
+ imulq %r11, %rdx
1850
+ imulq 0xa8(%rsp), %r10
1851
+ imulq 0xb8(%rsp), %r11
1852
+ addq %r10, %r11
1853
+ leaq (%rax,%rdx), %r13
1854
+ movq $0xfffffffffffffffe, %rax
1855
+ movl $0x2, %edx
1856
+ movq %rbx, %rdi
1857
+ movq %rax, %r8
1858
+ testq %rsi, %rsi
1859
+ cmovs %rbp, %r8
1860
+ testq $0x1, %rcx
1861
+ cmoveq %rbp, %r8
1862
+ cmoveq %rbp, %rdi
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
+ cmovs %rbp, %r8
1884
+ movq %rbx, %rdi
1885
+ testq %rdx, %rcx
1886
+ cmoveq %rbp, %r8
1887
+ cmoveq %rbp, %rdi
1888
+ sarq $1, %rcx
1889
+ xorq %r8, %rdi
1890
+ xorq %r8, %rsi
1891
+ btq $0x3f, %r8
1892
+ cmovbq %rcx, %rbx
1893
+ movq %rax, %r8
1894
+ subq %rax, %rsi
1895
+ leaq (%rcx,%rdi), %rcx
1896
+ cmovs %rbp, %r8
1897
+ movq %rbx, %rdi
1898
+ testq %rdx, %rcx
1899
+ cmoveq %rbp, %r8
1900
+ cmoveq %rbp, %rdi
1901
+ sarq $1, %rcx
1902
+ xorq %r8, %rdi
1903
+ xorq %r8, %rsi
1904
+ btq $0x3f, %r8
1905
+ cmovbq %rcx, %rbx
1906
+ movq %rax, %r8
1907
+ subq %rax, %rsi
1908
+ leaq (%rcx,%rdi), %rcx
1909
+ cmovs %rbp, %r8
1910
+ movq %rbx, %rdi
1911
+ testq %rdx, %rcx
1912
+ cmoveq %rbp, %r8
1913
+ cmoveq %rbp, %rdi
1914
+ sarq $1, %rcx
1915
+ xorq %r8, %rdi
1916
+ xorq %r8, %rsi
1917
+ btq $0x3f, %r8
1918
+ cmovbq %rcx, %rbx
1919
+ movq %rax, %r8
1920
+ subq %rax, %rsi
1921
+ leaq (%rcx,%rdi), %rcx
1922
+ cmovs %rbp, %r8
1923
+ movq %rbx, %rdi
1924
+ testq %rdx, %rcx
1925
+ cmoveq %rbp, %r8
1926
+ cmoveq %rbp, %rdi
1927
+ sarq $1, %rcx
1928
+ xorq %r8, %rdi
1929
+ xorq %r8, %rsi
1930
+ btq $0x3f, %r8
1931
+ cmovbq %rcx, %rbx
1932
+ movq %rax, %r8
1933
+ subq %rax, %rsi
1934
+ leaq (%rcx,%rdi), %rcx
1935
+ cmovs %rbp, %r8
1936
+ movq %rbx, %rdi
1937
+ testq %rdx, %rcx
1938
+ cmoveq %rbp, %r8
1939
+ cmoveq %rbp, %rdi
1940
+ sarq $1, %rcx
1941
+ xorq %r8, %rdi
1942
+ xorq %r8, %rsi
1943
+ btq $0x3f, %r8
1944
+ cmovbq %rcx, %rbx
1945
+ movq %rax, %r8
1946
+ subq %rax, %rsi
1947
+ leaq (%rcx,%rdi), %rcx
1948
+ cmovs %rbp, %r8
1949
+ movq %rbx, %rdi
1950
+ testq %rdx, %rcx
1951
+ cmoveq %rbp, %r8
1952
+ cmoveq %rbp, %rdi
1953
+ sarq $1, %rcx
1954
+ xorq %r8, %rdi
1955
+ xorq %r8, %rsi
1956
+ btq $0x3f, %r8
1957
+ cmovbq %rcx, %rbx
1958
+ movq %rax, %r8
1959
+ subq %rax, %rsi
1960
+ leaq (%rcx,%rdi), %rcx
1961
+ cmovs %rbp, %r8
1962
+ movq %rbx, %rdi
1963
+ testq %rdx, %rcx
1964
+ cmoveq %rbp, %r8
1965
+ cmoveq %rbp, %rdi
1966
+ sarq $1, %rcx
1967
+ xorq %r8, %rdi
1968
+ xorq %r8, %rsi
1969
+ btq $0x3f, %r8
1970
+ cmovbq %rcx, %rbx
1971
+ movq %rax, %r8
1972
+ subq %rax, %rsi
1973
+ leaq (%rcx,%rdi), %rcx
1974
+ cmovs %rbp, %r8
1975
+ movq %rbx, %rdi
1976
+ testq %rdx, %rcx
1977
+ cmoveq %rbp, %r8
1978
+ cmoveq %rbp, %rdi
1979
+ sarq $1, %rcx
1980
+ xorq %r8, %rdi
1981
+ xorq %r8, %rsi
1982
+ btq $0x3f, %r8
1983
+ cmovbq %rcx, %rbx
1984
+ movq %rax, %r8
1985
+ subq %rax, %rsi
1986
+ leaq (%rcx,%rdi), %rcx
1987
+ cmovs %rbp, %r8
1988
+ movq %rbx, %rdi
1989
+ testq %rdx, %rcx
1990
+ cmoveq %rbp, %r8
1991
+ cmoveq %rbp, %rdi
1992
+ sarq $1, %rcx
1993
+ xorq %r8, %rdi
1994
+ xorq %r8, %rsi
1995
+ btq $0x3f, %r8
1996
+ cmovbq %rcx, %rbx
1997
+ movq %rax, %r8
1998
+ subq %rax, %rsi
1999
+ leaq (%rcx,%rdi), %rcx
2000
+ cmovs %rbp, %r8
2001
+ movq %rbx, %rdi
2002
+ testq %rdx, %rcx
2003
+ cmoveq %rbp, %r8
2004
+ cmoveq %rbp, %rdi
2005
+ sarq $1, %rcx
2006
+ xorq %r8, %rdi
2007
+ xorq %r8, %rsi
2008
+ btq $0x3f, %r8
2009
+ cmovbq %rcx, %rbx
2010
+ movq %rax, %r8
2011
+ subq %rax, %rsi
2012
+ leaq (%rcx,%rdi), %rcx
2013
+ cmovs %rbp, %r8
2014
+ movq %rbx, %rdi
2015
+ testq %rdx, %rcx
2016
+ cmoveq %rbp, %r8
2017
+ cmoveq %rbp, %rdi
2018
+ sarq $1, %rcx
2019
+ xorq %r8, %rdi
2020
+ xorq %r8, %rsi
2021
+ btq $0x3f, %r8
2022
+ cmovbq %rcx, %rbx
2023
+ movq %rax, %r8
2024
+ subq %rax, %rsi
2025
+ leaq (%rcx,%rdi), %rcx
2026
+ cmovs %rbp, %r8
2027
+ movq %rbx, %rdi
2028
+ testq %rdx, %rcx
2029
+ cmoveq %rbp, %r8
2030
+ cmoveq %rbp, %rdi
2031
+ sarq $1, %rcx
2032
+ xorq %r8, %rdi
2033
+ xorq %r8, %rsi
2034
+ btq $0x3f, %r8
2035
+ cmovbq %rcx, %rbx
2036
+ movq %rax, %r8
2037
+ subq %rax, %rsi
2038
+ leaq (%rcx,%rdi), %rcx
2039
+ cmovs %rbp, %r8
2040
+ movq %rbx, %rdi
2041
+ testq %rdx, %rcx
2042
+ cmoveq %rbp, %r8
2043
+ cmoveq %rbp, %rdi
2044
+ sarq $1, %rcx
2045
+ xorq %r8, %rdi
2046
+ xorq %r8, %rsi
2047
+ btq $0x3f, %r8
2048
+ cmovbq %rcx, %rbx
2049
+ movq %rax, %r8
2050
+ subq %rax, %rsi
2051
+ leaq (%rcx,%rdi), %rcx
2052
+ cmovs %rbp, %r8
2053
+ movq %rbx, %rdi
2054
+ testq %rdx, %rcx
2055
+ cmoveq %rbp, %r8
2056
+ cmoveq %rbp, %rdi
2057
+ sarq $1, %rcx
2058
+ xorq %r8, %rdi
2059
+ xorq %r8, %rsi
2060
+ btq $0x3f, %r8
2061
+ cmovbq %rcx, %rbx
2062
+ movq %rax, %r8
2063
+ subq %rax, %rsi
2064
+ leaq (%rcx,%rdi), %rcx
2065
+ cmovs %rbp, %r8
2066
+ movq %rbx, %rdi
2067
+ testq %rdx, %rcx
2068
+ cmoveq %rbp, %r8
2069
+ cmoveq %rbp, %rdi
2070
+ sarq $1, %rcx
2071
+ xorq %r8, %rdi
2072
+ xorq %r8, %rsi
2073
+ btq $0x3f, %r8
2074
+ cmovbq %rcx, %rbx
2075
+ movq %rax, %r8
2076
+ subq %rax, %rsi
2077
+ leaq (%rcx,%rdi), %rcx
2078
+ cmovs %rbp, %r8
2079
+ movq %rbx, %rdi
2080
+ testq %rdx, %rcx
2081
+ cmoveq %rbp, %r8
2082
+ cmoveq %rbp, %rdi
2083
+ sarq $1, %rcx
2084
+ xorq %r8, %rdi
2085
+ xorq %r8, %rsi
2086
+ btq $0x3f, %r8
2087
+ cmovbq %rcx, %rbx
2088
+ movq %rax, %r8
2089
+ subq %rax, %rsi
2090
+ leaq (%rcx,%rdi), %rcx
2091
+ cmovs %rbp, %r8
2092
+ movq %rbx, %rdi
2093
+ testq %rdx, %rcx
2094
+ cmoveq %rbp, %r8
2095
+ cmoveq %rbp, %rdi
2096
+ sarq $1, %rcx
2097
+ xorq %r8, %rdi
2098
+ xorq %r8, %rsi
2099
+ btq $0x3f, %r8
2100
+ cmovbq %rcx, %rbx
2101
+ movq %rax, %r8
2102
+ subq %rax, %rsi
2103
+ leaq (%rcx,%rdi), %rcx
2104
+ sarq $1, %rcx
2105
+ movl $0x100000, %eax
2106
+ leaq (%rbx,%rax), %r8
2107
+ leaq (%rcx,%rax), %r12
2108
+ shlq $0x15, %r8
2109
+ shlq $0x15, %r12
2110
+ sarq $0x2b, %r8
2111
+ sarq $0x2b, %r12
2112
+ movabsq $0x20000100000, %rax
2113
+ leaq (%rbx,%rax), %r10
2114
+ leaq (%rcx,%rax), %r14
2115
+ sarq $0x2b, %r10
2116
+ sarq $0x2b, %r14
2117
+ movq %r9, %rax
2118
+ imulq %r8, %rax
2119
+ movq %r13, %rdx
2120
+ imulq %r10, %rdx
2121
+ imulq %r15, %r8
2122
+ imulq %r11, %r10
2123
+ addq %r8, %r10
2124
+ leaq (%rax,%rdx), %r8
2125
+ movq %r9, %rax
2126
+ imulq %r12, %rax
2127
+ movq %r13, %rdx
2128
+ imulq %r14, %rdx
2129
+ imulq %r15, %r12
2130
+ imulq %r11, %r14
2131
+ addq %r12, %r14
2132
+ leaq (%rax,%rdx), %r12
2133
+ movq %rsi, 0x98(%rsp)
2134
+ decq 0x90(%rsp)
2135
+ jne curve25519_x25519base_inverseloop
2136
+ movq (%rsp), %rax
2137
+ movq 0x20(%rsp), %rcx
2138
+ imulq %r8, %rax
2139
+ imulq %r10, %rcx
2140
+ addq %rcx, %rax
2141
+ sarq $0x3f, %rax
2142
+ movq %r8, %r9
2143
+ sarq $0x3f, %r9
2144
+ xorq %r9, %r8
2145
+ subq %r9, %r8
2146
+ xorq %rax, %r9
2147
+ movq %r10, %r11
2148
+ sarq $0x3f, %r11
2149
+ xorq %r11, %r10
2150
+ subq %r11, %r10
2151
+ xorq %rax, %r11
2152
+ movq %r12, %r13
2153
+ sarq $0x3f, %r13
2154
+ xorq %r13, %r12
2155
+ subq %r13, %r12
2156
+ xorq %rax, %r13
2157
+ movq %r14, %r15
2158
+ sarq $0x3f, %r15
2159
+ xorq %r15, %r14
2160
+ subq %r15, %r14
2161
+ xorq %rax, %r15
2162
+ movq %r8, %rax
2163
+ andq %r9, %rax
2164
+ movq %r10, %r12
2165
+ andq %r11, %r12
2166
+ addq %rax, %r12
2167
+ xorl %r13d, %r13d
2168
+ movq 0x40(%rsp), %rax
2169
+ xorq %r9, %rax
2170
+ mulq %r8
2171
+ addq %rax, %r12
2172
+ adcq %rdx, %r13
2173
+ movq 0x60(%rsp), %rax
2174
+ xorq %r11, %rax
2175
+ mulq %r10
2176
+ addq %rax, %r12
2177
+ adcq %rdx, %r13
2178
+ xorl %r14d, %r14d
2179
+ movq 0x48(%rsp), %rax
2180
+ xorq %r9, %rax
2181
+ mulq %r8
2182
+ addq %rax, %r13
2183
+ adcq %rdx, %r14
2184
+ movq 0x68(%rsp), %rax
2185
+ xorq %r11, %rax
2186
+ mulq %r10
2187
+ addq %rax, %r13
2188
+ adcq %rdx, %r14
2189
+ xorl %r15d, %r15d
2190
+ movq 0x50(%rsp), %rax
2191
+ xorq %r9, %rax
2192
+ mulq %r8
2193
+ addq %rax, %r14
2194
+ adcq %rdx, %r15
2195
+ movq 0x70(%rsp), %rax
2196
+ xorq %r11, %rax
2197
+ mulq %r10
2198
+ addq %rax, %r14
2199
+ adcq %rdx, %r15
2200
+ movq 0x58(%rsp), %rax
2201
+ xorq %r9, %rax
2202
+ andq %r8, %r9
2203
+ negq %r9
2204
+ mulq %r8
2205
+ addq %rax, %r15
2206
+ adcq %rdx, %r9
2207
+ movq 0x78(%rsp), %rax
2208
+ xorq %r11, %rax
2209
+ movq %r11, %rdx
2210
+ andq %r10, %rdx
2211
+ subq %rdx, %r9
2212
+ mulq %r10
2213
+ addq %rax, %r15
2214
+ adcq %rdx, %r9
2215
+ movq %r9, %rax
2216
+ shldq $0x1, %r15, %rax
2217
+ sarq $0x3f, %r9
2218
+ movl $0x13, %ebx
2219
+ leaq 0x1(%rax,%r9,1), %rax
2220
+ imulq %rbx
2221
+ xorl %ebp, %ebp
2222
+ addq %rax, %r12
2223
+ adcq %rdx, %r13
2224
+ adcq %r9, %r14
2225
+ adcq %r9, %r15
2226
+ shlq $0x3f, %rax
2227
+ addq %rax, %r15
2228
+ cmovns %rbp, %rbx
2229
+ subq %rbx, %r12
2230
+ sbbq %rbp, %r13
2231
+ sbbq %rbp, %r14
2232
+ sbbq %rbp, %r15
2233
+ btr $0x3f, %r15
2234
+ movq 0xc0(%rsp), %rdi
2235
+ movq %r12, (%rdi)
2236
+ movq %r13, 0x8(%rdi)
2237
+ movq %r14, 0x10(%rdi)
2238
+ movq %r15, 0x18(%rdi)
1287
2239
 
1288
2240
  // The final result is (X + T) / (X - T)
1289
2241
  // This is the only operation in the whole computation that
@@ -1291,7 +2243,7 @@ curve25519_x25519base_fliploop:
1291
2243
  // answer as output.
1292
2244
 
1293
2245
  movq res, %rbp
1294
- mul_p25519(resx,y_3,x_3)
2246
+ mul_p25519(resx,t1,t0)
1295
2247
 
1296
2248
  // Restore stack and registers
1297
2249
 
@@ -1313,14 +2265,6 @@ curve25519_x25519base_fliploop:
1313
2265
  // .section .rodata
1314
2266
  // ****************************************************************************
1315
2267
 
1316
- // The modulus, for the modular inverse
1317
-
1318
- curve25519_x25519base_p_25519:
1319
- .quad 0xffffffffffffffed
1320
- .quad 0xffffffffffffffff
1321
- .quad 0xffffffffffffffff
1322
- .quad 0x7fffffffffffffff
1323
-
1324
2268
  // 2^254 * G and (2^254 + 8) * G in extended-projective coordinates
1325
2269
  // but with z = 1 assumed and hence left out, so they are (X,Y,T) only.
1326
2270