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
@@ -20,7 +20,8 @@
20
20
  // this returns the X coordinate of n * P = (X, Y), or 0 when n * P is the
21
21
  // point at infinity. Both n and X inputs are first slightly modified/mangled
22
22
  // as specified in the relevant RFC (https://www.rfc-editor.org/rfc/rfc7748);
23
- // in particular the lower three bits of n are set to zero.
23
+ // in particular the lower three bits of n are set to zero. Does not implement
24
+ // the zero-check specified in Section 6.1.
24
25
  //
25
26
  // Standard x86-64 ABI: RDI = res, RSI = scalar, RDX = point
26
27
  // Microsoft x64 ABI: RCX = res, RDX = scalar, R8 = point
@@ -65,12 +66,12 @@
65
66
 
66
67
  #define sn (4*NUMSIZE)(%rsp)
67
68
 
68
- #define zn (5*NUMSIZE)(%rsp)
69
69
  #define dn (5*NUMSIZE)(%rsp)
70
70
  #define e (5*NUMSIZE)(%rsp)
71
71
 
72
72
  #define dmsn (6*NUMSIZE)(%rsp)
73
73
  #define p (6*NUMSIZE)(%rsp)
74
+ #define zn (7*NUMSIZE)(%rsp)
74
75
 
75
76
  #define xm (8*NUMSIZE)(%rsp)
76
77
  #define dnsm (8*NUMSIZE)(%rsp)
@@ -790,430 +791,1372 @@ curve25519_x25519_scalarloop:
790
791
  mul_p25519(zn,p,e)
791
792
 
792
793
  // The projective result of the scalar multiplication is now (xn,zn).
793
- // First set up the constant sn = 2^255 - 19 for the modular inverse.
794
-
795
- movq $-19, %rax
796
- movq $-1, %rcx
797
- movq $0x7fffffffffffffff, %rdx
798
- movq %rax, 128(%rsp)
799
- movq %rcx, 136(%rsp)
800
- movq %rcx, 144(%rsp)
801
- movq %rdx, 152(%rsp)
802
-
803
- // Prepare to call the modular inverse function to get zm = 1/zn
804
-
805
- movq $4, %rdi
806
- leaq 96(%rsp), %rsi
807
- leaq 160(%rsp), %rdx
808
- leaq 128(%rsp), %rcx
809
- leaq 192(%rsp), %r8
810
-
811
- // Inline copy of bignum_modinv, identical except for stripping out the
812
- // prologue and epilogue saving and restoring registers and the initial
813
- // test for k = 0 (which is trivially false here since k = 4). For more
814
- // details and explanations see "x86/generic/bignum_modinv.S". Note
815
- // that the stack it uses for its own temporaries is 80 bytes so it
816
- // only overwrites pointx, scalar and dm, which are no longer needed.
817
-
818
- movq %rsi, 0x40(%rsp)
819
- movq %r8, 0x38(%rsp)
820
- movq %rcx, 0x48(%rsp)
821
- leaq (%r8,%rdi,8), %r10
822
- movq %r10, 0x30(%rsp)
823
- leaq (%r10,%rdi,8), %r15
824
- xorq %r11, %r11
825
- xorq %r9, %r9
826
- curve25519_x25519_copyloop:
827
- movq (%rdx,%r9,8), %rax
828
- movq (%rcx,%r9,8), %rbx
829
- movq %rax, (%r10,%r9,8)
830
- movq %rbx, (%r15,%r9,8)
831
- movq %rbx, (%r8,%r9,8)
832
- movq %r11, (%rsi,%r9,8)
833
- incq %r9
834
- cmpq %rdi, %r9
835
- jb curve25519_x25519_copyloop
836
- movq (%r8), %rax
837
- movq %rax, %rbx
838
- decq %rbx
839
- movq %rbx, (%r8)
840
- movq %rax, %rbp
841
- movq %rax, %r12
842
- shlq $0x2, %rbp
843
- subq %rbp, %r12
844
- xorq $0x2, %r12
845
- movq %r12, %rbp
846
- imulq %rax, %rbp
847
- movl $0x2, %eax
848
- addq %rbp, %rax
849
- addq $0x1, %rbp
850
- imulq %rax, %r12
851
- imulq %rbp, %rbp
852
- movl $0x1, %eax
853
- addq %rbp, %rax
854
- imulq %rax, %r12
855
- imulq %rbp, %rbp
856
- movl $0x1, %eax
857
- addq %rbp, %rax
858
- imulq %rax, %r12
859
- imulq %rbp, %rbp
794
+ // Prepare to call the modular inverse function to get xm = 1/zn
795
+
796
+ leaq 256(%rsp), %rdi
797
+ leaq 224(%rsp), %rsi
798
+
799
+ // Inline copy of bignum_inv_p25519, identical except for stripping out
800
+ // the prologue and epilogue saving and restoring registers and making
801
+ // and reclaiming room on the stack. For more details and explanations see
802
+ // "x86/curve25519/bignum_inv_p25519.S". Note that the stack it uses for
803
+ // its own temporaries is 208 bytes, so it has no effect on variables
804
+ // that are needed in the rest of our computation here: res, xm and zn.
805
+
806
+ movq %rdi, 0xc0(%rsp)
807
+ xorl %eax, %eax
808
+ leaq -0x13(%rax), %rcx
809
+ notq %rax
810
+ movq %rcx, (%rsp)
811
+ movq %rax, 0x8(%rsp)
812
+ movq %rax, 0x10(%rsp)
813
+ btr $0x3f, %rax
814
+ movq %rax, 0x18(%rsp)
815
+ movq (%rsi), %rdx
816
+ movq 0x8(%rsi), %rcx
817
+ movq 0x10(%rsi), %r8
818
+ movq 0x18(%rsi), %r9
860
819
  movl $0x1, %eax
861
- addq %rbp, %rax
862
- imulq %rax, %r12
863
- movq %r12, 0x28(%rsp)
864
- movq %rdi, %rax
865
- shlq $0x7, %rax
866
- movq %rax, 0x20(%rsp)
867
- curve25519_x25519_outerloop:
868
- movq 0x20(%rsp), %r13
869
- addq $0x3f, %r13
870
- shrq $0x6, %r13
871
- cmpq %rdi, %r13
872
- cmovaeq %rdi, %r13
873
- xorq %r12, %r12
874
- xorq %r14, %r14
875
- xorq %rbp, %rbp
876
- xorq %rsi, %rsi
877
- xorq %r11, %r11
878
- movq 0x30(%rsp), %r8
879
- leaq (%r8,%rdi,8), %r15
880
- xorq %r9, %r9
881
- curve25519_x25519_toploop:
882
- movq (%r8,%r9,8), %rbx
883
- movq (%r15,%r9,8), %rcx
884
- movq %r11, %r10
885
- andq %r12, %r10
886
- andq %rbp, %r11
887
- movq %rbx, %rax
888
- orq %rcx, %rax
889
- negq %rax
890
- cmovbq %r10, %r14
891
- cmovbq %r11, %rsi
892
- cmovbq %rbx, %r12
893
- cmovbq %rcx, %rbp
894
- sbbq %r11, %r11
895
- incq %r9
896
- cmpq %r13, %r9
897
- jb curve25519_x25519_toploop
898
- movq %r12, %rax
899
- orq %rbp, %rax
900
- bsrq %rax, %rcx
901
- xorq $0x3f, %rcx
902
- shldq %cl, %r14, %r12
903
- shldq %cl, %rsi, %rbp
904
- movq (%r8), %rax
905
- movq %rax, %r14
906
- movq (%r15), %rax
907
- movq %rax, %rsi
908
- movl $0x1, %r10d
909
- movl $0x0, %r11d
910
- movl $0x0, %ecx
911
- movl $0x1, %edx
912
- movl $0x3a, %r9d
913
- movq %rdi, 0x8(%rsp)
914
- movq %r13, 0x10(%rsp)
915
- movq %r8, (%rsp)
916
- movq %r15, 0x18(%rsp)
917
- curve25519_x25519_innerloop:
820
+ xorl %r10d, %r10d
821
+ bts $0x3f, %r9
822
+ adcq %r10, %rax
823
+ imulq $0x13, %rax, %rax
824
+ addq %rax, %rdx
825
+ adcq %r10, %rcx
826
+ adcq %r10, %r8
827
+ adcq %r10, %r9
828
+ movl $0x13, %eax
829
+ cmovbq %r10, %rax
830
+ subq %rax, %rdx
831
+ sbbq %r10, %rcx
832
+ sbbq %r10, %r8
833
+ sbbq %r10, %r9
834
+ btr $0x3f, %r9
835
+ movq %rdx, 0x20(%rsp)
836
+ movq %rcx, 0x28(%rsp)
837
+ movq %r8, 0x30(%rsp)
838
+ movq %r9, 0x38(%rsp)
918
839
  xorl %eax, %eax
840
+ movq %rax, 0x40(%rsp)
841
+ movq %rax, 0x48(%rsp)
842
+ movq %rax, 0x50(%rsp)
843
+ movq %rax, 0x58(%rsp)
844
+ movabsq $0xa0f99e2375022099, %rax
845
+ movq %rax, 0x60(%rsp)
846
+ movabsq $0xa8c68f3f1d132595, %rax
847
+ movq %rax, 0x68(%rsp)
848
+ movabsq $0x6c6c893805ac5242, %rax
849
+ movq %rax, 0x70(%rsp)
850
+ movabsq $0x276508b241770615, %rax
851
+ movq %rax, 0x78(%rsp)
852
+ movq $0xa, 0x90(%rsp)
853
+ movq $0x1, 0x98(%rsp)
854
+ jmp curve25519_x25519_midloop
855
+ curve25519_x25519_inverseloop:
856
+ movq %r8, %r9
857
+ sarq $0x3f, %r9
858
+ xorq %r9, %r8
859
+ subq %r9, %r8
860
+ movq %r10, %r11
861
+ sarq $0x3f, %r11
862
+ xorq %r11, %r10
863
+ subq %r11, %r10
864
+ movq %r12, %r13
865
+ sarq $0x3f, %r13
866
+ xorq %r13, %r12
867
+ subq %r13, %r12
868
+ movq %r14, %r15
869
+ sarq $0x3f, %r15
870
+ xorq %r15, %r14
871
+ subq %r15, %r14
872
+ movq %r8, %rax
873
+ andq %r9, %rax
874
+ movq %r10, %rdi
875
+ andq %r11, %rdi
876
+ addq %rax, %rdi
877
+ movq %rdi, 0x80(%rsp)
878
+ movq %r12, %rax
879
+ andq %r13, %rax
880
+ movq %r14, %rsi
881
+ andq %r15, %rsi
882
+ addq %rax, %rsi
883
+ movq %rsi, 0x88(%rsp)
919
884
  xorl %ebx, %ebx
920
- xorq %r8, %r8
921
- xorq %r15, %r15
922
- btq $0x0, %r14
923
- cmovbq %rbp, %rax
924
- cmovbq %rsi, %rbx
925
- cmovbq %rcx, %r8
926
- cmovbq %rdx, %r15
927
- movq %r14, %r13
928
- subq %rbx, %r14
929
- subq %r13, %rbx
930
- movq %r12, %rdi
931
- subq %rax, %rdi
932
- cmovbq %r12, %rbp
933
- leaq -0x1(%rdi), %r12
934
- cmovbq %rbx, %r14
935
- cmovbq %r13, %rsi
936
- notq %r12
937
- cmovbq %r10, %rcx
938
- cmovbq %r11, %rdx
939
- cmovaeq %rdi, %r12
940
- shrq $1, %r14
941
- addq %r8, %r10
942
- addq %r15, %r11
943
- shrq $1, %r12
944
- addq %rcx, %rcx
945
- addq %rdx, %rdx
946
- decq %r9
947
- jne curve25519_x25519_innerloop
948
- movq 0x8(%rsp), %rdi
949
- movq 0x10(%rsp), %r13
950
- movq (%rsp), %r8
951
- movq 0x18(%rsp), %r15
952
- movq %r10, (%rsp)
953
- movq %r11, 0x8(%rsp)
954
- movq %rcx, 0x10(%rsp)
955
- movq %rdx, 0x18(%rsp)
956
- movq 0x38(%rsp), %r8
957
- movq 0x40(%rsp), %r15
958
- xorq %r14, %r14
959
- xorq %rsi, %rsi
960
- xorq %r10, %r10
961
- xorq %r11, %r11
962
- xorq %r9, %r9
963
- curve25519_x25519_congloop:
964
- movq (%r8,%r9,8), %rcx
965
885
  movq (%rsp), %rax
966
- mulq %rcx
967
- addq %rax, %r14
968
- adcq $0x0, %rdx
969
- movq %rdx, %r12
970
- movq 0x10(%rsp), %rax
971
- mulq %rcx
886
+ xorq %r9, %rax
887
+ mulq %r8
888
+ addq %rax, %rdi
889
+ adcq %rdx, %rbx
890
+ movq 0x20(%rsp), %rax
891
+ xorq %r11, %rax
892
+ mulq %r10
893
+ addq %rax, %rdi
894
+ adcq %rdx, %rbx
895
+ xorl %ebp, %ebp
896
+ movq (%rsp), %rax
897
+ xorq %r13, %rax
898
+ mulq %r12
972
899
  addq %rax, %rsi
973
- adcq $0x0, %rdx
974
- movq %rdx, %rbp
975
- movq (%r15,%r9,8), %rcx
900
+ adcq %rdx, %rbp
901
+ movq 0x20(%rsp), %rax
902
+ xorq %r15, %rax
903
+ mulq %r14
904
+ addq %rax, %rsi
905
+ adcq %rdx, %rbp
906
+ xorl %ecx, %ecx
976
907
  movq 0x8(%rsp), %rax
977
- mulq %rcx
978
- addq %rax, %r14
979
- adcq %rdx, %r12
980
- shrdq $0x3a, %r14, %r10
981
- movq %r10, (%r8,%r9,8)
982
- movq %r14, %r10
983
- movq %r12, %r14
908
+ xorq %r9, %rax
909
+ mulq %r8
910
+ addq %rax, %rbx
911
+ adcq %rdx, %rcx
912
+ movq 0x28(%rsp), %rax
913
+ xorq %r11, %rax
914
+ mulq %r10
915
+ addq %rax, %rbx
916
+ adcq %rdx, %rcx
917
+ shrdq $0x3b, %rbx, %rdi
918
+ movq %rdi, (%rsp)
919
+ xorl %edi, %edi
920
+ movq 0x8(%rsp), %rax
921
+ xorq %r13, %rax
922
+ mulq %r12
923
+ addq %rax, %rbp
924
+ adcq %rdx, %rdi
925
+ movq 0x28(%rsp), %rax
926
+ xorq %r15, %rax
927
+ mulq %r14
928
+ addq %rax, %rbp
929
+ adcq %rdx, %rdi
930
+ shrdq $0x3b, %rbp, %rsi
931
+ movq %rsi, 0x20(%rsp)
932
+ xorl %esi, %esi
933
+ movq 0x10(%rsp), %rax
934
+ xorq %r9, %rax
935
+ mulq %r8
936
+ addq %rax, %rcx
937
+ adcq %rdx, %rsi
938
+ movq 0x30(%rsp), %rax
939
+ xorq %r11, %rax
940
+ mulq %r10
941
+ addq %rax, %rcx
942
+ adcq %rdx, %rsi
943
+ shrdq $0x3b, %rcx, %rbx
944
+ movq %rbx, 0x8(%rsp)
945
+ xorl %ebx, %ebx
946
+ movq 0x10(%rsp), %rax
947
+ xorq %r13, %rax
948
+ mulq %r12
949
+ addq %rax, %rdi
950
+ adcq %rdx, %rbx
951
+ movq 0x30(%rsp), %rax
952
+ xorq %r15, %rax
953
+ mulq %r14
954
+ addq %rax, %rdi
955
+ adcq %rdx, %rbx
956
+ shrdq $0x3b, %rdi, %rbp
957
+ movq %rbp, 0x28(%rsp)
984
958
  movq 0x18(%rsp), %rax
985
- mulq %rcx
959
+ xorq %r9, %rax
960
+ movq %rax, %rbp
961
+ sarq $0x3f, %rbp
962
+ andq %r8, %rbp
963
+ negq %rbp
964
+ mulq %r8
986
965
  addq %rax, %rsi
987
966
  adcq %rdx, %rbp
988
- shrdq $0x3a, %rsi, %r11
989
- movq %r11, (%r15,%r9,8)
990
- movq %rsi, %r11
991
- movq %rbp, %rsi
992
- incq %r9
993
- cmpq %rdi, %r9
994
- jb curve25519_x25519_congloop
995
- shldq $0x6, %r10, %r14
996
- shldq $0x6, %r11, %rsi
997
- movq 0x48(%rsp), %r15
998
- movq (%r8), %rbx
999
- movq 0x28(%rsp), %r12
1000
- imulq %rbx, %r12
1001
- movq (%r15), %rax
967
+ movq 0x38(%rsp), %rax
968
+ xorq %r11, %rax
969
+ movq %rax, %rdx
970
+ sarq $0x3f, %rdx
971
+ andq %r10, %rdx
972
+ subq %rdx, %rbp
973
+ mulq %r10
974
+ addq %rax, %rsi
975
+ adcq %rdx, %rbp
976
+ shrdq $0x3b, %rsi, %rcx
977
+ movq %rcx, 0x10(%rsp)
978
+ shrdq $0x3b, %rbp, %rsi
979
+ movq 0x18(%rsp), %rax
980
+ movq %rsi, 0x18(%rsp)
981
+ xorq %r13, %rax
982
+ movq %rax, %rsi
983
+ sarq $0x3f, %rsi
984
+ andq %r12, %rsi
985
+ negq %rsi
1002
986
  mulq %r12
1003
- addq %rbx, %rax
1004
- movq %rdx, %r10
1005
- movl $0x1, %r9d
1006
- movq %rdi, %rcx
1007
- decq %rcx
1008
- je curve25519_x25519_wmontend
1009
- curve25519_x25519_wmontloop:
1010
- adcq (%r8,%r9,8), %r10
1011
- sbbq %rbx, %rbx
1012
- movq (%r15,%r9,8), %rax
987
+ addq %rax, %rbx
988
+ adcq %rdx, %rsi
989
+ movq 0x38(%rsp), %rax
990
+ xorq %r15, %rax
991
+ movq %rax, %rdx
992
+ sarq $0x3f, %rdx
993
+ andq %r14, %rdx
994
+ subq %rdx, %rsi
995
+ mulq %r14
996
+ addq %rax, %rbx
997
+ adcq %rdx, %rsi
998
+ shrdq $0x3b, %rbx, %rdi
999
+ movq %rdi, 0x30(%rsp)
1000
+ shrdq $0x3b, %rsi, %rbx
1001
+ movq %rbx, 0x38(%rsp)
1002
+ movq 0x80(%rsp), %rbx
1003
+ movq 0x88(%rsp), %rbp
1004
+ xorl %ecx, %ecx
1005
+ movq 0x40(%rsp), %rax
1006
+ xorq %r9, %rax
1007
+ mulq %r8
1008
+ addq %rax, %rbx
1009
+ adcq %rdx, %rcx
1010
+ movq 0x60(%rsp), %rax
1011
+ xorq %r11, %rax
1012
+ mulq %r10
1013
+ addq %rax, %rbx
1014
+ adcq %rdx, %rcx
1015
+ xorl %esi, %esi
1016
+ movq 0x40(%rsp), %rax
1017
+ xorq %r13, %rax
1013
1018
  mulq %r12
1014
- subq %rbx, %rdx
1015
- addq %r10, %rax
1016
- movq %rax, -0x8(%r8,%r9,8)
1017
- movq %rdx, %r10
1018
- incq %r9
1019
- decq %rcx
1020
- jne curve25519_x25519_wmontloop
1021
- curve25519_x25519_wmontend:
1022
- adcq %r14, %r10
1023
- movq %r10, -0x8(%r8,%rdi,8)
1024
- sbbq %r10, %r10
1025
- negq %r10
1026
- movq %rdi, %rcx
1027
- xorq %r9, %r9
1028
- curve25519_x25519_wcmploop:
1029
- movq (%r8,%r9,8), %rax
1030
- sbbq (%r15,%r9,8), %rax
1031
- incq %r9
1032
- decq %rcx
1033
- jne curve25519_x25519_wcmploop
1034
- sbbq $0x0, %r10
1035
- sbbq %r10, %r10
1036
- notq %r10
1037
- xorq %rcx, %rcx
1038
- xorq %r9, %r9
1039
- curve25519_x25519_wcorrloop:
1040
- movq (%r8,%r9,8), %rax
1041
- movq (%r15,%r9,8), %rbx
1042
- andq %r10, %rbx
1043
- negq %rcx
1044
- sbbq %rbx, %rax
1045
- sbbq %rcx, %rcx
1046
- movq %rax, (%r8,%r9,8)
1047
- incq %r9
1048
- cmpq %rdi, %r9
1049
- jb curve25519_x25519_wcorrloop
1019
+ movq %rbx, 0x40(%rsp)
1020
+ addq %rax, %rbp
1021
+ adcq %rdx, %rsi
1022
+ movq 0x60(%rsp), %rax
1023
+ xorq %r15, %rax
1024
+ mulq %r14
1025
+ addq %rax, %rbp
1026
+ adcq %rdx, %rsi
1027
+ movq %rbp, 0x60(%rsp)
1028
+ xorl %ebx, %ebx
1029
+ movq 0x48(%rsp), %rax
1030
+ xorq %r9, %rax
1031
+ mulq %r8
1032
+ addq %rax, %rcx
1033
+ adcq %rdx, %rbx
1034
+ movq 0x68(%rsp), %rax
1035
+ xorq %r11, %rax
1036
+ mulq %r10
1037
+ addq %rax, %rcx
1038
+ adcq %rdx, %rbx
1039
+ xorl %ebp, %ebp
1040
+ movq 0x48(%rsp), %rax
1041
+ xorq %r13, %rax
1042
+ mulq %r12
1043
+ movq %rcx, 0x48(%rsp)
1044
+ addq %rax, %rsi
1045
+ adcq %rdx, %rbp
1046
+ movq 0x68(%rsp), %rax
1047
+ xorq %r15, %rax
1048
+ mulq %r14
1049
+ addq %rax, %rsi
1050
+ adcq %rdx, %rbp
1051
+ movq %rsi, 0x68(%rsp)
1052
+ xorl %ecx, %ecx
1053
+ movq 0x50(%rsp), %rax
1054
+ xorq %r9, %rax
1055
+ mulq %r8
1056
+ addq %rax, %rbx
1057
+ adcq %rdx, %rcx
1058
+ movq 0x70(%rsp), %rax
1059
+ xorq %r11, %rax
1060
+ mulq %r10
1061
+ addq %rax, %rbx
1062
+ adcq %rdx, %rcx
1063
+ xorl %esi, %esi
1064
+ movq 0x50(%rsp), %rax
1065
+ xorq %r13, %rax
1066
+ mulq %r12
1067
+ movq %rbx, 0x50(%rsp)
1068
+ addq %rax, %rbp
1069
+ adcq %rdx, %rsi
1070
+ movq 0x70(%rsp), %rax
1071
+ xorq %r15, %rax
1072
+ mulq %r14
1073
+ addq %rax, %rbp
1074
+ adcq %rdx, %rsi
1075
+ movq %rbp, 0x70(%rsp)
1076
+ movq 0x58(%rsp), %rax
1077
+ xorq %r9, %rax
1078
+ movq %r9, %rbx
1079
+ andq %r8, %rbx
1080
+ negq %rbx
1081
+ mulq %r8
1082
+ addq %rax, %rcx
1083
+ adcq %rdx, %rbx
1084
+ movq 0x78(%rsp), %rax
1085
+ xorq %r11, %rax
1086
+ movq %r11, %rdx
1087
+ andq %r10, %rdx
1088
+ subq %rdx, %rbx
1089
+ mulq %r10
1090
+ addq %rax, %rcx
1091
+ adcq %rbx, %rdx
1092
+ movq %rdx, %rbx
1093
+ shldq $0x1, %rcx, %rdx
1094
+ sarq $0x3f, %rbx
1095
+ addq %rbx, %rdx
1096
+ movl $0x13, %eax
1097
+ imulq %rdx
1050
1098
  movq 0x40(%rsp), %r8
1051
- movq (%r8), %rbx
1052
- movq 0x28(%rsp), %rbp
1053
- imulq %rbx, %rbp
1054
- movq (%r15), %rax
1055
- mulq %rbp
1056
- addq %rbx, %rax
1057
- movq %rdx, %r11
1058
- movl $0x1, %r9d
1059
- movq %rdi, %rcx
1060
- decq %rcx
1061
- je curve25519_x25519_zmontend
1062
- curve25519_x25519_zmontloop:
1063
- adcq (%r8,%r9,8), %r11
1064
- sbbq %rbx, %rbx
1065
- movq (%r15,%r9,8), %rax
1066
- mulq %rbp
1067
- subq %rbx, %rdx
1068
- addq %r11, %rax
1069
- movq %rax, -0x8(%r8,%r9,8)
1070
- movq %rdx, %r11
1071
- incq %r9
1072
- decq %rcx
1073
- jne curve25519_x25519_zmontloop
1074
- curve25519_x25519_zmontend:
1075
- adcq %rsi, %r11
1076
- movq %r11, -0x8(%r8,%rdi,8)
1077
- sbbq %r11, %r11
1078
- negq %r11
1079
- movq %rdi, %rcx
1080
- xorq %r9, %r9
1081
- curve25519_x25519_zcmploop:
1082
- movq (%r8,%r9,8), %rax
1083
- sbbq (%r15,%r9,8), %rax
1084
- incq %r9
1085
- decq %rcx
1086
- jne curve25519_x25519_zcmploop
1087
- sbbq $0x0, %r11
1088
- sbbq %r11, %r11
1089
- notq %r11
1090
- xorq %rcx, %rcx
1091
- xorq %r9, %r9
1092
- curve25519_x25519_zcorrloop:
1093
- movq (%r8,%r9,8), %rax
1094
- movq (%r15,%r9,8), %rbx
1095
- andq %r11, %rbx
1099
+ addq %rax, %r8
1100
+ movq %r8, 0x40(%rsp)
1101
+ movq 0x48(%rsp), %r8
1102
+ adcq %rdx, %r8
1103
+ movq %r8, 0x48(%rsp)
1104
+ movq 0x50(%rsp), %r8
1105
+ adcq %rbx, %r8
1106
+ movq %r8, 0x50(%rsp)
1107
+ adcq %rbx, %rcx
1108
+ shlq $0x3f, %rax
1109
+ addq %rax, %rcx
1110
+ movq 0x58(%rsp), %rax
1111
+ movq %rcx, 0x58(%rsp)
1112
+ xorq %r13, %rax
1113
+ movq %r13, %rcx
1114
+ andq %r12, %rcx
1096
1115
  negq %rcx
1097
- sbbq %rbx, %rax
1098
- sbbq %rcx, %rcx
1099
- movq %rax, (%r8,%r9,8)
1100
- incq %r9
1101
- cmpq %rdi, %r9
1102
- jb curve25519_x25519_zcorrloop
1103
- movq 0x30(%rsp), %r8
1104
- leaq (%r8,%rdi,8), %r15
1105
- xorq %r9, %r9
1106
- xorq %r12, %r12
1107
- xorq %r14, %r14
1108
- xorq %rbp, %rbp
1109
- xorq %rsi, %rsi
1110
- curve25519_x25519_crossloop:
1111
- movq (%r8,%r9,8), %rcx
1112
- movq (%rsp), %rax
1113
- mulq %rcx
1114
- addq %rax, %r14
1115
- adcq $0x0, %rdx
1116
- movq %rdx, %r10
1117
- movq 0x10(%rsp), %rax
1118
- mulq %rcx
1116
+ mulq %r12
1119
1117
  addq %rax, %rsi
1120
- adcq $0x0, %rdx
1121
- movq %rdx, %r11
1122
- movq (%r15,%r9,8), %rcx
1123
- movq 0x8(%rsp), %rax
1124
- mulq %rcx
1125
- subq %r12, %rdx
1126
- subq %rax, %r14
1127
- sbbq %rdx, %r10
1128
- sbbq %r12, %r12
1129
- movq %r14, (%r8,%r9,8)
1130
- movq %r10, %r14
1131
- movq 0x18(%rsp), %rax
1132
- mulq %rcx
1133
- subq %rbp, %rdx
1118
+ adcq %rdx, %rcx
1119
+ movq 0x78(%rsp), %rax
1120
+ xorq %r15, %rax
1121
+ movq %r15, %rdx
1122
+ andq %r14, %rdx
1123
+ subq %rdx, %rcx
1124
+ mulq %r14
1125
+ addq %rax, %rsi
1126
+ adcq %rcx, %rdx
1127
+ movq %rdx, %rcx
1128
+ shldq $0x1, %rsi, %rdx
1129
+ sarq $0x3f, %rcx
1130
+ movl $0x13, %eax
1131
+ addq %rcx, %rdx
1132
+ imulq %rdx
1133
+ movq 0x60(%rsp), %r8
1134
+ addq %rax, %r8
1135
+ movq %r8, 0x60(%rsp)
1136
+ movq 0x68(%rsp), %r8
1137
+ adcq %rdx, %r8
1138
+ movq %r8, 0x68(%rsp)
1139
+ movq 0x70(%rsp), %r8
1140
+ adcq %rcx, %r8
1141
+ movq %r8, 0x70(%rsp)
1142
+ adcq %rcx, %rsi
1143
+ shlq $0x3f, %rax
1144
+ addq %rax, %rsi
1145
+ movq %rsi, 0x78(%rsp)
1146
+ curve25519_x25519_midloop:
1147
+ movq 0x98(%rsp), %rsi
1148
+ movq (%rsp), %rdx
1149
+ movq 0x20(%rsp), %rcx
1150
+ movq %rdx, %rbx
1151
+ andq $0xfffff, %rbx
1152
+ movabsq $0xfffffe0000000000, %rax
1153
+ orq %rax, %rbx
1154
+ andq $0xfffff, %rcx
1155
+ movabsq $0xc000000000000000, %rax
1156
+ orq %rax, %rcx
1157
+ movq $0xfffffffffffffffe, %rax
1158
+ xorl %ebp, %ebp
1159
+ movl $0x2, %edx
1160
+ movq %rbx, %rdi
1161
+ movq %rax, %r8
1162
+ testq %rsi, %rsi
1163
+ cmovs %rbp, %r8
1164
+ testq $0x1, %rcx
1165
+ cmoveq %rbp, %r8
1166
+ cmoveq %rbp, %rdi
1167
+ xorq %r8, %rdi
1168
+ xorq %r8, %rsi
1169
+ btq $0x3f, %r8
1170
+ cmovbq %rcx, %rbx
1171
+ movq %rax, %r8
1134
1172
  subq %rax, %rsi
1135
- sbbq %rdx, %r11
1136
- sbbq %rbp, %rbp
1137
- movq %rsi, (%r15,%r9,8)
1138
- movq %r11, %rsi
1139
- incq %r9
1140
- cmpq %r13, %r9
1141
- jb curve25519_x25519_crossloop
1142
- xorq %r9, %r9
1143
- movq %r12, %r10
1144
- movq %rbp, %r11
1145
- xorq %r12, %r14
1146
- xorq %rbp, %rsi
1147
- curve25519_x25519_optnegloop:
1148
- movq (%r8,%r9,8), %rax
1149
- xorq %r12, %rax
1150
- negq %r10
1151
- adcq $0x0, %rax
1152
- sbbq %r10, %r10
1153
- movq %rax, (%r8,%r9,8)
1154
- movq (%r15,%r9,8), %rax
1155
- xorq %rbp, %rax
1156
- negq %r11
1157
- adcq $0x0, %rax
1158
- sbbq %r11, %r11
1159
- movq %rax, (%r15,%r9,8)
1160
- incq %r9
1161
- cmpq %r13, %r9
1162
- jb curve25519_x25519_optnegloop
1163
- subq %r10, %r14
1164
- subq %r11, %rsi
1165
- movq %r13, %r9
1166
- curve25519_x25519_shiftloop:
1167
- movq -0x8(%r8,%r9,8), %rax
1168
- movq %rax, %r10
1169
- shrdq $0x3a, %r14, %rax
1170
- movq %rax, -0x8(%r8,%r9,8)
1171
- movq %r10, %r14
1172
- movq -0x8(%r15,%r9,8), %rax
1173
- movq %rax, %r11
1174
- shrdq $0x3a, %rsi, %rax
1175
- movq %rax, -0x8(%r15,%r9,8)
1176
- movq %r11, %rsi
1177
- decq %r9
1178
- jne curve25519_x25519_shiftloop
1179
- notq %rbp
1180
- movq 0x48(%rsp), %rcx
1181
- movq 0x38(%rsp), %r8
1182
- movq 0x40(%rsp), %r15
1183
- movq %r12, %r10
1184
- movq %rbp, %r11
1185
- xorq %r9, %r9
1186
- curve25519_x25519_fliploop:
1187
- movq %rbp, %rdx
1188
- movq (%rcx,%r9,8), %rax
1189
- andq %rax, %rdx
1190
- andq %r12, %rax
1191
- movq (%r8,%r9,8), %rbx
1192
- xorq %r12, %rbx
1193
- negq %r10
1194
- adcq %rbx, %rax
1195
- sbbq %r10, %r10
1196
- movq %rax, (%r8,%r9,8)
1197
- movq (%r15,%r9,8), %rbx
1198
- xorq %rbp, %rbx
1199
- negq %r11
1200
- adcq %rbx, %rdx
1201
- sbbq %r11, %r11
1202
- movq %rdx, (%r15,%r9,8)
1203
- incq %r9
1204
- cmpq %rdi, %r9
1205
- jb curve25519_x25519_fliploop
1206
- subq $0x3a, 0x20(%rsp)
1207
- ja curve25519_x25519_outerloop
1173
+ leaq (%rcx,%rdi), %rcx
1174
+ cmovs %rbp, %r8
1175
+ movq %rbx, %rdi
1176
+ testq %rdx, %rcx
1177
+ cmoveq %rbp, %r8
1178
+ cmoveq %rbp, %rdi
1179
+ sarq $1, %rcx
1180
+ xorq %r8, %rdi
1181
+ xorq %r8, %rsi
1182
+ btq $0x3f, %r8
1183
+ cmovbq %rcx, %rbx
1184
+ movq %rax, %r8
1185
+ subq %rax, %rsi
1186
+ leaq (%rcx,%rdi), %rcx
1187
+ cmovs %rbp, %r8
1188
+ movq %rbx, %rdi
1189
+ testq %rdx, %rcx
1190
+ cmoveq %rbp, %r8
1191
+ cmoveq %rbp, %rdi
1192
+ sarq $1, %rcx
1193
+ xorq %r8, %rdi
1194
+ xorq %r8, %rsi
1195
+ btq $0x3f, %r8
1196
+ cmovbq %rcx, %rbx
1197
+ movq %rax, %r8
1198
+ subq %rax, %rsi
1199
+ leaq (%rcx,%rdi), %rcx
1200
+ cmovs %rbp, %r8
1201
+ movq %rbx, %rdi
1202
+ testq %rdx, %rcx
1203
+ cmoveq %rbp, %r8
1204
+ cmoveq %rbp, %rdi
1205
+ sarq $1, %rcx
1206
+ xorq %r8, %rdi
1207
+ xorq %r8, %rsi
1208
+ btq $0x3f, %r8
1209
+ cmovbq %rcx, %rbx
1210
+ movq %rax, %r8
1211
+ subq %rax, %rsi
1212
+ leaq (%rcx,%rdi), %rcx
1213
+ cmovs %rbp, %r8
1214
+ movq %rbx, %rdi
1215
+ testq %rdx, %rcx
1216
+ cmoveq %rbp, %r8
1217
+ cmoveq %rbp, %rdi
1218
+ sarq $1, %rcx
1219
+ xorq %r8, %rdi
1220
+ xorq %r8, %rsi
1221
+ btq $0x3f, %r8
1222
+ cmovbq %rcx, %rbx
1223
+ movq %rax, %r8
1224
+ subq %rax, %rsi
1225
+ leaq (%rcx,%rdi), %rcx
1226
+ cmovs %rbp, %r8
1227
+ movq %rbx, %rdi
1228
+ testq %rdx, %rcx
1229
+ cmoveq %rbp, %r8
1230
+ cmoveq %rbp, %rdi
1231
+ sarq $1, %rcx
1232
+ xorq %r8, %rdi
1233
+ xorq %r8, %rsi
1234
+ btq $0x3f, %r8
1235
+ cmovbq %rcx, %rbx
1236
+ movq %rax, %r8
1237
+ subq %rax, %rsi
1238
+ leaq (%rcx,%rdi), %rcx
1239
+ cmovs %rbp, %r8
1240
+ movq %rbx, %rdi
1241
+ testq %rdx, %rcx
1242
+ cmoveq %rbp, %r8
1243
+ cmoveq %rbp, %rdi
1244
+ sarq $1, %rcx
1245
+ xorq %r8, %rdi
1246
+ xorq %r8, %rsi
1247
+ btq $0x3f, %r8
1248
+ cmovbq %rcx, %rbx
1249
+ movq %rax, %r8
1250
+ subq %rax, %rsi
1251
+ leaq (%rcx,%rdi), %rcx
1252
+ cmovs %rbp, %r8
1253
+ movq %rbx, %rdi
1254
+ testq %rdx, %rcx
1255
+ cmoveq %rbp, %r8
1256
+ cmoveq %rbp, %rdi
1257
+ sarq $1, %rcx
1258
+ xorq %r8, %rdi
1259
+ xorq %r8, %rsi
1260
+ btq $0x3f, %r8
1261
+ cmovbq %rcx, %rbx
1262
+ movq %rax, %r8
1263
+ subq %rax, %rsi
1264
+ leaq (%rcx,%rdi), %rcx
1265
+ cmovs %rbp, %r8
1266
+ movq %rbx, %rdi
1267
+ testq %rdx, %rcx
1268
+ cmoveq %rbp, %r8
1269
+ cmoveq %rbp, %rdi
1270
+ sarq $1, %rcx
1271
+ xorq %r8, %rdi
1272
+ xorq %r8, %rsi
1273
+ btq $0x3f, %r8
1274
+ cmovbq %rcx, %rbx
1275
+ movq %rax, %r8
1276
+ subq %rax, %rsi
1277
+ leaq (%rcx,%rdi), %rcx
1278
+ cmovs %rbp, %r8
1279
+ movq %rbx, %rdi
1280
+ testq %rdx, %rcx
1281
+ cmoveq %rbp, %r8
1282
+ cmoveq %rbp, %rdi
1283
+ sarq $1, %rcx
1284
+ xorq %r8, %rdi
1285
+ xorq %r8, %rsi
1286
+ btq $0x3f, %r8
1287
+ cmovbq %rcx, %rbx
1288
+ movq %rax, %r8
1289
+ subq %rax, %rsi
1290
+ leaq (%rcx,%rdi), %rcx
1291
+ cmovs %rbp, %r8
1292
+ movq %rbx, %rdi
1293
+ testq %rdx, %rcx
1294
+ cmoveq %rbp, %r8
1295
+ cmoveq %rbp, %rdi
1296
+ sarq $1, %rcx
1297
+ xorq %r8, %rdi
1298
+ xorq %r8, %rsi
1299
+ btq $0x3f, %r8
1300
+ cmovbq %rcx, %rbx
1301
+ movq %rax, %r8
1302
+ subq %rax, %rsi
1303
+ leaq (%rcx,%rdi), %rcx
1304
+ cmovs %rbp, %r8
1305
+ movq %rbx, %rdi
1306
+ testq %rdx, %rcx
1307
+ cmoveq %rbp, %r8
1308
+ cmoveq %rbp, %rdi
1309
+ sarq $1, %rcx
1310
+ xorq %r8, %rdi
1311
+ xorq %r8, %rsi
1312
+ btq $0x3f, %r8
1313
+ cmovbq %rcx, %rbx
1314
+ movq %rax, %r8
1315
+ subq %rax, %rsi
1316
+ leaq (%rcx,%rdi), %rcx
1317
+ cmovs %rbp, %r8
1318
+ movq %rbx, %rdi
1319
+ testq %rdx, %rcx
1320
+ cmoveq %rbp, %r8
1321
+ cmoveq %rbp, %rdi
1322
+ sarq $1, %rcx
1323
+ xorq %r8, %rdi
1324
+ xorq %r8, %rsi
1325
+ btq $0x3f, %r8
1326
+ cmovbq %rcx, %rbx
1327
+ movq %rax, %r8
1328
+ subq %rax, %rsi
1329
+ leaq (%rcx,%rdi), %rcx
1330
+ cmovs %rbp, %r8
1331
+ movq %rbx, %rdi
1332
+ testq %rdx, %rcx
1333
+ cmoveq %rbp, %r8
1334
+ cmoveq %rbp, %rdi
1335
+ sarq $1, %rcx
1336
+ xorq %r8, %rdi
1337
+ xorq %r8, %rsi
1338
+ btq $0x3f, %r8
1339
+ cmovbq %rcx, %rbx
1340
+ movq %rax, %r8
1341
+ subq %rax, %rsi
1342
+ leaq (%rcx,%rdi), %rcx
1343
+ cmovs %rbp, %r8
1344
+ movq %rbx, %rdi
1345
+ testq %rdx, %rcx
1346
+ cmoveq %rbp, %r8
1347
+ cmoveq %rbp, %rdi
1348
+ sarq $1, %rcx
1349
+ xorq %r8, %rdi
1350
+ xorq %r8, %rsi
1351
+ btq $0x3f, %r8
1352
+ cmovbq %rcx, %rbx
1353
+ movq %rax, %r8
1354
+ subq %rax, %rsi
1355
+ leaq (%rcx,%rdi), %rcx
1356
+ cmovs %rbp, %r8
1357
+ movq %rbx, %rdi
1358
+ testq %rdx, %rcx
1359
+ cmoveq %rbp, %r8
1360
+ cmoveq %rbp, %rdi
1361
+ sarq $1, %rcx
1362
+ xorq %r8, %rdi
1363
+ xorq %r8, %rsi
1364
+ btq $0x3f, %r8
1365
+ cmovbq %rcx, %rbx
1366
+ movq %rax, %r8
1367
+ subq %rax, %rsi
1368
+ leaq (%rcx,%rdi), %rcx
1369
+ cmovs %rbp, %r8
1370
+ movq %rbx, %rdi
1371
+ testq %rdx, %rcx
1372
+ cmoveq %rbp, %r8
1373
+ cmoveq %rbp, %rdi
1374
+ sarq $1, %rcx
1375
+ xorq %r8, %rdi
1376
+ xorq %r8, %rsi
1377
+ btq $0x3f, %r8
1378
+ cmovbq %rcx, %rbx
1379
+ movq %rax, %r8
1380
+ subq %rax, %rsi
1381
+ leaq (%rcx,%rdi), %rcx
1382
+ cmovs %rbp, %r8
1383
+ movq %rbx, %rdi
1384
+ testq %rdx, %rcx
1385
+ cmoveq %rbp, %r8
1386
+ cmoveq %rbp, %rdi
1387
+ sarq $1, %rcx
1388
+ xorq %r8, %rdi
1389
+ xorq %r8, %rsi
1390
+ btq $0x3f, %r8
1391
+ cmovbq %rcx, %rbx
1392
+ movq %rax, %r8
1393
+ subq %rax, %rsi
1394
+ leaq (%rcx,%rdi), %rcx
1395
+ cmovs %rbp, %r8
1396
+ movq %rbx, %rdi
1397
+ testq %rdx, %rcx
1398
+ cmoveq %rbp, %r8
1399
+ cmoveq %rbp, %rdi
1400
+ sarq $1, %rcx
1401
+ xorq %r8, %rdi
1402
+ xorq %r8, %rsi
1403
+ btq $0x3f, %r8
1404
+ cmovbq %rcx, %rbx
1405
+ movq %rax, %r8
1406
+ subq %rax, %rsi
1407
+ leaq (%rcx,%rdi), %rcx
1408
+ cmovs %rbp, %r8
1409
+ movq %rbx, %rdi
1410
+ testq %rdx, %rcx
1411
+ cmoveq %rbp, %r8
1412
+ cmoveq %rbp, %rdi
1413
+ sarq $1, %rcx
1414
+ xorq %r8, %rdi
1415
+ xorq %r8, %rsi
1416
+ btq $0x3f, %r8
1417
+ cmovbq %rcx, %rbx
1418
+ movq %rax, %r8
1419
+ subq %rax, %rsi
1420
+ leaq (%rcx,%rdi), %rcx
1421
+ sarq $1, %rcx
1422
+ movl $0x100000, %eax
1423
+ leaq (%rbx,%rax), %rdx
1424
+ leaq (%rcx,%rax), %rdi
1425
+ shlq $0x16, %rdx
1426
+ shlq $0x16, %rdi
1427
+ sarq $0x2b, %rdx
1428
+ sarq $0x2b, %rdi
1429
+ movabsq $0x20000100000, %rax
1430
+ leaq (%rbx,%rax), %rbx
1431
+ leaq (%rcx,%rax), %rcx
1432
+ sarq $0x2a, %rbx
1433
+ sarq $0x2a, %rcx
1434
+ movq %rdx, 0xa0(%rsp)
1435
+ movq %rbx, 0xa8(%rsp)
1436
+ movq %rdi, 0xb0(%rsp)
1437
+ movq %rcx, 0xb8(%rsp)
1438
+ movq (%rsp), %r12
1439
+ imulq %r12, %rdi
1440
+ imulq %rdx, %r12
1441
+ movq 0x20(%rsp), %r13
1442
+ imulq %r13, %rbx
1443
+ imulq %rcx, %r13
1444
+ addq %rbx, %r12
1445
+ addq %rdi, %r13
1446
+ sarq $0x14, %r12
1447
+ sarq $0x14, %r13
1448
+ movq %r12, %rbx
1449
+ andq $0xfffff, %rbx
1450
+ movabsq $0xfffffe0000000000, %rax
1451
+ orq %rax, %rbx
1452
+ movq %r13, %rcx
1453
+ andq $0xfffff, %rcx
1454
+ movabsq $0xc000000000000000, %rax
1455
+ orq %rax, %rcx
1456
+ movq $0xfffffffffffffffe, %rax
1457
+ movl $0x2, %edx
1458
+ movq %rbx, %rdi
1459
+ movq %rax, %r8
1460
+ testq %rsi, %rsi
1461
+ cmovs %rbp, %r8
1462
+ testq $0x1, %rcx
1463
+ cmoveq %rbp, %r8
1464
+ cmoveq %rbp, %rdi
1465
+ xorq %r8, %rdi
1466
+ xorq %r8, %rsi
1467
+ btq $0x3f, %r8
1468
+ cmovbq %rcx, %rbx
1469
+ movq %rax, %r8
1470
+ subq %rax, %rsi
1471
+ leaq (%rcx,%rdi), %rcx
1472
+ cmovs %rbp, %r8
1473
+ movq %rbx, %rdi
1474
+ testq %rdx, %rcx
1475
+ cmoveq %rbp, %r8
1476
+ cmoveq %rbp, %rdi
1477
+ sarq $1, %rcx
1478
+ xorq %r8, %rdi
1479
+ xorq %r8, %rsi
1480
+ btq $0x3f, %r8
1481
+ cmovbq %rcx, %rbx
1482
+ movq %rax, %r8
1483
+ subq %rax, %rsi
1484
+ leaq (%rcx,%rdi), %rcx
1485
+ cmovs %rbp, %r8
1486
+ movq %rbx, %rdi
1487
+ testq %rdx, %rcx
1488
+ cmoveq %rbp, %r8
1489
+ cmoveq %rbp, %rdi
1490
+ sarq $1, %rcx
1491
+ xorq %r8, %rdi
1492
+ xorq %r8, %rsi
1493
+ btq $0x3f, %r8
1494
+ cmovbq %rcx, %rbx
1495
+ movq %rax, %r8
1496
+ subq %rax, %rsi
1497
+ leaq (%rcx,%rdi), %rcx
1498
+ cmovs %rbp, %r8
1499
+ movq %rbx, %rdi
1500
+ testq %rdx, %rcx
1501
+ cmoveq %rbp, %r8
1502
+ cmoveq %rbp, %rdi
1503
+ sarq $1, %rcx
1504
+ xorq %r8, %rdi
1505
+ xorq %r8, %rsi
1506
+ btq $0x3f, %r8
1507
+ cmovbq %rcx, %rbx
1508
+ movq %rax, %r8
1509
+ subq %rax, %rsi
1510
+ leaq (%rcx,%rdi), %rcx
1511
+ cmovs %rbp, %r8
1512
+ movq %rbx, %rdi
1513
+ testq %rdx, %rcx
1514
+ cmoveq %rbp, %r8
1515
+ cmoveq %rbp, %rdi
1516
+ sarq $1, %rcx
1517
+ xorq %r8, %rdi
1518
+ xorq %r8, %rsi
1519
+ btq $0x3f, %r8
1520
+ cmovbq %rcx, %rbx
1521
+ movq %rax, %r8
1522
+ subq %rax, %rsi
1523
+ leaq (%rcx,%rdi), %rcx
1524
+ cmovs %rbp, %r8
1525
+ movq %rbx, %rdi
1526
+ testq %rdx, %rcx
1527
+ cmoveq %rbp, %r8
1528
+ cmoveq %rbp, %rdi
1529
+ sarq $1, %rcx
1530
+ xorq %r8, %rdi
1531
+ xorq %r8, %rsi
1532
+ btq $0x3f, %r8
1533
+ cmovbq %rcx, %rbx
1534
+ movq %rax, %r8
1535
+ subq %rax, %rsi
1536
+ leaq (%rcx,%rdi), %rcx
1537
+ cmovs %rbp, %r8
1538
+ movq %rbx, %rdi
1539
+ testq %rdx, %rcx
1540
+ cmoveq %rbp, %r8
1541
+ cmoveq %rbp, %rdi
1542
+ sarq $1, %rcx
1543
+ xorq %r8, %rdi
1544
+ xorq %r8, %rsi
1545
+ btq $0x3f, %r8
1546
+ cmovbq %rcx, %rbx
1547
+ movq %rax, %r8
1548
+ subq %rax, %rsi
1549
+ leaq (%rcx,%rdi), %rcx
1550
+ cmovs %rbp, %r8
1551
+ movq %rbx, %rdi
1552
+ testq %rdx, %rcx
1553
+ cmoveq %rbp, %r8
1554
+ cmoveq %rbp, %rdi
1555
+ sarq $1, %rcx
1556
+ xorq %r8, %rdi
1557
+ xorq %r8, %rsi
1558
+ btq $0x3f, %r8
1559
+ cmovbq %rcx, %rbx
1560
+ movq %rax, %r8
1561
+ subq %rax, %rsi
1562
+ leaq (%rcx,%rdi), %rcx
1563
+ cmovs %rbp, %r8
1564
+ movq %rbx, %rdi
1565
+ testq %rdx, %rcx
1566
+ cmoveq %rbp, %r8
1567
+ cmoveq %rbp, %rdi
1568
+ sarq $1, %rcx
1569
+ xorq %r8, %rdi
1570
+ xorq %r8, %rsi
1571
+ btq $0x3f, %r8
1572
+ cmovbq %rcx, %rbx
1573
+ movq %rax, %r8
1574
+ subq %rax, %rsi
1575
+ leaq (%rcx,%rdi), %rcx
1576
+ cmovs %rbp, %r8
1577
+ movq %rbx, %rdi
1578
+ testq %rdx, %rcx
1579
+ cmoveq %rbp, %r8
1580
+ cmoveq %rbp, %rdi
1581
+ sarq $1, %rcx
1582
+ xorq %r8, %rdi
1583
+ xorq %r8, %rsi
1584
+ btq $0x3f, %r8
1585
+ cmovbq %rcx, %rbx
1586
+ movq %rax, %r8
1587
+ subq %rax, %rsi
1588
+ leaq (%rcx,%rdi), %rcx
1589
+ cmovs %rbp, %r8
1590
+ movq %rbx, %rdi
1591
+ testq %rdx, %rcx
1592
+ cmoveq %rbp, %r8
1593
+ cmoveq %rbp, %rdi
1594
+ sarq $1, %rcx
1595
+ xorq %r8, %rdi
1596
+ xorq %r8, %rsi
1597
+ btq $0x3f, %r8
1598
+ cmovbq %rcx, %rbx
1599
+ movq %rax, %r8
1600
+ subq %rax, %rsi
1601
+ leaq (%rcx,%rdi), %rcx
1602
+ cmovs %rbp, %r8
1603
+ movq %rbx, %rdi
1604
+ testq %rdx, %rcx
1605
+ cmoveq %rbp, %r8
1606
+ cmoveq %rbp, %rdi
1607
+ sarq $1, %rcx
1608
+ xorq %r8, %rdi
1609
+ xorq %r8, %rsi
1610
+ btq $0x3f, %r8
1611
+ cmovbq %rcx, %rbx
1612
+ movq %rax, %r8
1613
+ subq %rax, %rsi
1614
+ leaq (%rcx,%rdi), %rcx
1615
+ cmovs %rbp, %r8
1616
+ movq %rbx, %rdi
1617
+ testq %rdx, %rcx
1618
+ cmoveq %rbp, %r8
1619
+ cmoveq %rbp, %rdi
1620
+ sarq $1, %rcx
1621
+ xorq %r8, %rdi
1622
+ xorq %r8, %rsi
1623
+ btq $0x3f, %r8
1624
+ cmovbq %rcx, %rbx
1625
+ movq %rax, %r8
1626
+ subq %rax, %rsi
1627
+ leaq (%rcx,%rdi), %rcx
1628
+ cmovs %rbp, %r8
1629
+ movq %rbx, %rdi
1630
+ testq %rdx, %rcx
1631
+ cmoveq %rbp, %r8
1632
+ cmoveq %rbp, %rdi
1633
+ sarq $1, %rcx
1634
+ xorq %r8, %rdi
1635
+ xorq %r8, %rsi
1636
+ btq $0x3f, %r8
1637
+ cmovbq %rcx, %rbx
1638
+ movq %rax, %r8
1639
+ subq %rax, %rsi
1640
+ leaq (%rcx,%rdi), %rcx
1641
+ cmovs %rbp, %r8
1642
+ movq %rbx, %rdi
1643
+ testq %rdx, %rcx
1644
+ cmoveq %rbp, %r8
1645
+ cmoveq %rbp, %rdi
1646
+ sarq $1, %rcx
1647
+ xorq %r8, %rdi
1648
+ xorq %r8, %rsi
1649
+ btq $0x3f, %r8
1650
+ cmovbq %rcx, %rbx
1651
+ movq %rax, %r8
1652
+ subq %rax, %rsi
1653
+ leaq (%rcx,%rdi), %rcx
1654
+ cmovs %rbp, %r8
1655
+ movq %rbx, %rdi
1656
+ testq %rdx, %rcx
1657
+ cmoveq %rbp, %r8
1658
+ cmoveq %rbp, %rdi
1659
+ sarq $1, %rcx
1660
+ xorq %r8, %rdi
1661
+ xorq %r8, %rsi
1662
+ btq $0x3f, %r8
1663
+ cmovbq %rcx, %rbx
1664
+ movq %rax, %r8
1665
+ subq %rax, %rsi
1666
+ leaq (%rcx,%rdi), %rcx
1667
+ cmovs %rbp, %r8
1668
+ movq %rbx, %rdi
1669
+ testq %rdx, %rcx
1670
+ cmoveq %rbp, %r8
1671
+ cmoveq %rbp, %rdi
1672
+ sarq $1, %rcx
1673
+ xorq %r8, %rdi
1674
+ xorq %r8, %rsi
1675
+ btq $0x3f, %r8
1676
+ cmovbq %rcx, %rbx
1677
+ movq %rax, %r8
1678
+ subq %rax, %rsi
1679
+ leaq (%rcx,%rdi), %rcx
1680
+ cmovs %rbp, %r8
1681
+ movq %rbx, %rdi
1682
+ testq %rdx, %rcx
1683
+ cmoveq %rbp, %r8
1684
+ cmoveq %rbp, %rdi
1685
+ sarq $1, %rcx
1686
+ xorq %r8, %rdi
1687
+ xorq %r8, %rsi
1688
+ btq $0x3f, %r8
1689
+ cmovbq %rcx, %rbx
1690
+ movq %rax, %r8
1691
+ subq %rax, %rsi
1692
+ leaq (%rcx,%rdi), %rcx
1693
+ cmovs %rbp, %r8
1694
+ movq %rbx, %rdi
1695
+ testq %rdx, %rcx
1696
+ cmoveq %rbp, %r8
1697
+ cmoveq %rbp, %rdi
1698
+ sarq $1, %rcx
1699
+ xorq %r8, %rdi
1700
+ xorq %r8, %rsi
1701
+ btq $0x3f, %r8
1702
+ cmovbq %rcx, %rbx
1703
+ movq %rax, %r8
1704
+ subq %rax, %rsi
1705
+ leaq (%rcx,%rdi), %rcx
1706
+ cmovs %rbp, %r8
1707
+ movq %rbx, %rdi
1708
+ testq %rdx, %rcx
1709
+ cmoveq %rbp, %r8
1710
+ cmoveq %rbp, %rdi
1711
+ sarq $1, %rcx
1712
+ xorq %r8, %rdi
1713
+ xorq %r8, %rsi
1714
+ btq $0x3f, %r8
1715
+ cmovbq %rcx, %rbx
1716
+ movq %rax, %r8
1717
+ subq %rax, %rsi
1718
+ leaq (%rcx,%rdi), %rcx
1719
+ sarq $1, %rcx
1720
+ movl $0x100000, %eax
1721
+ leaq (%rbx,%rax), %r8
1722
+ leaq (%rcx,%rax), %r10
1723
+ shlq $0x16, %r8
1724
+ shlq $0x16, %r10
1725
+ sarq $0x2b, %r8
1726
+ sarq $0x2b, %r10
1727
+ movabsq $0x20000100000, %rax
1728
+ leaq (%rbx,%rax), %r15
1729
+ leaq (%rcx,%rax), %r11
1730
+ sarq $0x2a, %r15
1731
+ sarq $0x2a, %r11
1732
+ movq %r13, %rbx
1733
+ movq %r12, %rcx
1734
+ imulq %r8, %r12
1735
+ imulq %r15, %rbx
1736
+ addq %rbx, %r12
1737
+ imulq %r11, %r13
1738
+ imulq %r10, %rcx
1739
+ addq %rcx, %r13
1740
+ sarq $0x14, %r12
1741
+ sarq $0x14, %r13
1742
+ movq %r12, %rbx
1743
+ andq $0xfffff, %rbx
1744
+ movabsq $0xfffffe0000000000, %rax
1745
+ orq %rax, %rbx
1746
+ movq %r13, %rcx
1747
+ andq $0xfffff, %rcx
1748
+ movabsq $0xc000000000000000, %rax
1749
+ orq %rax, %rcx
1750
+ movq 0xa0(%rsp), %rax
1751
+ imulq %r8, %rax
1752
+ movq 0xb0(%rsp), %rdx
1753
+ imulq %r15, %rdx
1754
+ imulq 0xa8(%rsp), %r8
1755
+ imulq 0xb8(%rsp), %r15
1756
+ addq %r8, %r15
1757
+ leaq (%rax,%rdx), %r9
1758
+ movq 0xa0(%rsp), %rax
1759
+ imulq %r10, %rax
1760
+ movq 0xb0(%rsp), %rdx
1761
+ imulq %r11, %rdx
1762
+ imulq 0xa8(%rsp), %r10
1763
+ imulq 0xb8(%rsp), %r11
1764
+ addq %r10, %r11
1765
+ leaq (%rax,%rdx), %r13
1766
+ movq $0xfffffffffffffffe, %rax
1767
+ movl $0x2, %edx
1768
+ movq %rbx, %rdi
1769
+ movq %rax, %r8
1770
+ testq %rsi, %rsi
1771
+ cmovs %rbp, %r8
1772
+ testq $0x1, %rcx
1773
+ cmoveq %rbp, %r8
1774
+ cmoveq %rbp, %rdi
1775
+ xorq %r8, %rdi
1776
+ xorq %r8, %rsi
1777
+ btq $0x3f, %r8
1778
+ cmovbq %rcx, %rbx
1779
+ movq %rax, %r8
1780
+ subq %rax, %rsi
1781
+ leaq (%rcx,%rdi), %rcx
1782
+ cmovs %rbp, %r8
1783
+ movq %rbx, %rdi
1784
+ testq %rdx, %rcx
1785
+ cmoveq %rbp, %r8
1786
+ cmoveq %rbp, %rdi
1787
+ sarq $1, %rcx
1788
+ xorq %r8, %rdi
1789
+ xorq %r8, %rsi
1790
+ btq $0x3f, %r8
1791
+ cmovbq %rcx, %rbx
1792
+ movq %rax, %r8
1793
+ subq %rax, %rsi
1794
+ leaq (%rcx,%rdi), %rcx
1795
+ cmovs %rbp, %r8
1796
+ movq %rbx, %rdi
1797
+ testq %rdx, %rcx
1798
+ cmoveq %rbp, %r8
1799
+ cmoveq %rbp, %rdi
1800
+ sarq $1, %rcx
1801
+ xorq %r8, %rdi
1802
+ xorq %r8, %rsi
1803
+ btq $0x3f, %r8
1804
+ cmovbq %rcx, %rbx
1805
+ movq %rax, %r8
1806
+ subq %rax, %rsi
1807
+ leaq (%rcx,%rdi), %rcx
1808
+ cmovs %rbp, %r8
1809
+ movq %rbx, %rdi
1810
+ testq %rdx, %rcx
1811
+ cmoveq %rbp, %r8
1812
+ cmoveq %rbp, %rdi
1813
+ sarq $1, %rcx
1814
+ xorq %r8, %rdi
1815
+ xorq %r8, %rsi
1816
+ btq $0x3f, %r8
1817
+ cmovbq %rcx, %rbx
1818
+ movq %rax, %r8
1819
+ subq %rax, %rsi
1820
+ leaq (%rcx,%rdi), %rcx
1821
+ cmovs %rbp, %r8
1822
+ movq %rbx, %rdi
1823
+ testq %rdx, %rcx
1824
+ cmoveq %rbp, %r8
1825
+ cmoveq %rbp, %rdi
1826
+ sarq $1, %rcx
1827
+ xorq %r8, %rdi
1828
+ xorq %r8, %rsi
1829
+ btq $0x3f, %r8
1830
+ cmovbq %rcx, %rbx
1831
+ movq %rax, %r8
1832
+ subq %rax, %rsi
1833
+ leaq (%rcx,%rdi), %rcx
1834
+ cmovs %rbp, %r8
1835
+ movq %rbx, %rdi
1836
+ testq %rdx, %rcx
1837
+ cmoveq %rbp, %r8
1838
+ cmoveq %rbp, %rdi
1839
+ sarq $1, %rcx
1840
+ xorq %r8, %rdi
1841
+ xorq %r8, %rsi
1842
+ btq $0x3f, %r8
1843
+ cmovbq %rcx, %rbx
1844
+ movq %rax, %r8
1845
+ subq %rax, %rsi
1846
+ leaq (%rcx,%rdi), %rcx
1847
+ cmovs %rbp, %r8
1848
+ movq %rbx, %rdi
1849
+ testq %rdx, %rcx
1850
+ cmoveq %rbp, %r8
1851
+ cmoveq %rbp, %rdi
1852
+ sarq $1, %rcx
1853
+ xorq %r8, %rdi
1854
+ xorq %r8, %rsi
1855
+ btq $0x3f, %r8
1856
+ cmovbq %rcx, %rbx
1857
+ movq %rax, %r8
1858
+ subq %rax, %rsi
1859
+ leaq (%rcx,%rdi), %rcx
1860
+ cmovs %rbp, %r8
1861
+ movq %rbx, %rdi
1862
+ testq %rdx, %rcx
1863
+ cmoveq %rbp, %r8
1864
+ cmoveq %rbp, %rdi
1865
+ sarq $1, %rcx
1866
+ xorq %r8, %rdi
1867
+ xorq %r8, %rsi
1868
+ btq $0x3f, %r8
1869
+ cmovbq %rcx, %rbx
1870
+ movq %rax, %r8
1871
+ subq %rax, %rsi
1872
+ leaq (%rcx,%rdi), %rcx
1873
+ cmovs %rbp, %r8
1874
+ movq %rbx, %rdi
1875
+ testq %rdx, %rcx
1876
+ cmoveq %rbp, %r8
1877
+ cmoveq %rbp, %rdi
1878
+ sarq $1, %rcx
1879
+ xorq %r8, %rdi
1880
+ xorq %r8, %rsi
1881
+ btq $0x3f, %r8
1882
+ cmovbq %rcx, %rbx
1883
+ movq %rax, %r8
1884
+ subq %rax, %rsi
1885
+ leaq (%rcx,%rdi), %rcx
1886
+ cmovs %rbp, %r8
1887
+ movq %rbx, %rdi
1888
+ testq %rdx, %rcx
1889
+ cmoveq %rbp, %r8
1890
+ cmoveq %rbp, %rdi
1891
+ sarq $1, %rcx
1892
+ xorq %r8, %rdi
1893
+ xorq %r8, %rsi
1894
+ btq $0x3f, %r8
1895
+ cmovbq %rcx, %rbx
1896
+ movq %rax, %r8
1897
+ subq %rax, %rsi
1898
+ leaq (%rcx,%rdi), %rcx
1899
+ cmovs %rbp, %r8
1900
+ movq %rbx, %rdi
1901
+ testq %rdx, %rcx
1902
+ cmoveq %rbp, %r8
1903
+ cmoveq %rbp, %rdi
1904
+ sarq $1, %rcx
1905
+ xorq %r8, %rdi
1906
+ xorq %r8, %rsi
1907
+ btq $0x3f, %r8
1908
+ cmovbq %rcx, %rbx
1909
+ movq %rax, %r8
1910
+ subq %rax, %rsi
1911
+ leaq (%rcx,%rdi), %rcx
1912
+ cmovs %rbp, %r8
1913
+ movq %rbx, %rdi
1914
+ testq %rdx, %rcx
1915
+ cmoveq %rbp, %r8
1916
+ cmoveq %rbp, %rdi
1917
+ sarq $1, %rcx
1918
+ xorq %r8, %rdi
1919
+ xorq %r8, %rsi
1920
+ btq $0x3f, %r8
1921
+ cmovbq %rcx, %rbx
1922
+ movq %rax, %r8
1923
+ subq %rax, %rsi
1924
+ leaq (%rcx,%rdi), %rcx
1925
+ cmovs %rbp, %r8
1926
+ movq %rbx, %rdi
1927
+ testq %rdx, %rcx
1928
+ cmoveq %rbp, %r8
1929
+ cmoveq %rbp, %rdi
1930
+ sarq $1, %rcx
1931
+ xorq %r8, %rdi
1932
+ xorq %r8, %rsi
1933
+ btq $0x3f, %r8
1934
+ cmovbq %rcx, %rbx
1935
+ movq %rax, %r8
1936
+ subq %rax, %rsi
1937
+ leaq (%rcx,%rdi), %rcx
1938
+ cmovs %rbp, %r8
1939
+ movq %rbx, %rdi
1940
+ testq %rdx, %rcx
1941
+ cmoveq %rbp, %r8
1942
+ cmoveq %rbp, %rdi
1943
+ sarq $1, %rcx
1944
+ xorq %r8, %rdi
1945
+ xorq %r8, %rsi
1946
+ btq $0x3f, %r8
1947
+ cmovbq %rcx, %rbx
1948
+ movq %rax, %r8
1949
+ subq %rax, %rsi
1950
+ leaq (%rcx,%rdi), %rcx
1951
+ cmovs %rbp, %r8
1952
+ movq %rbx, %rdi
1953
+ testq %rdx, %rcx
1954
+ cmoveq %rbp, %r8
1955
+ cmoveq %rbp, %rdi
1956
+ sarq $1, %rcx
1957
+ xorq %r8, %rdi
1958
+ xorq %r8, %rsi
1959
+ btq $0x3f, %r8
1960
+ cmovbq %rcx, %rbx
1961
+ movq %rax, %r8
1962
+ subq %rax, %rsi
1963
+ leaq (%rcx,%rdi), %rcx
1964
+ cmovs %rbp, %r8
1965
+ movq %rbx, %rdi
1966
+ testq %rdx, %rcx
1967
+ cmoveq %rbp, %r8
1968
+ cmoveq %rbp, %rdi
1969
+ sarq $1, %rcx
1970
+ xorq %r8, %rdi
1971
+ xorq %r8, %rsi
1972
+ btq $0x3f, %r8
1973
+ cmovbq %rcx, %rbx
1974
+ movq %rax, %r8
1975
+ subq %rax, %rsi
1976
+ leaq (%rcx,%rdi), %rcx
1977
+ cmovs %rbp, %r8
1978
+ movq %rbx, %rdi
1979
+ testq %rdx, %rcx
1980
+ cmoveq %rbp, %r8
1981
+ cmoveq %rbp, %rdi
1982
+ sarq $1, %rcx
1983
+ xorq %r8, %rdi
1984
+ xorq %r8, %rsi
1985
+ btq $0x3f, %r8
1986
+ cmovbq %rcx, %rbx
1987
+ movq %rax, %r8
1988
+ subq %rax, %rsi
1989
+ leaq (%rcx,%rdi), %rcx
1990
+ cmovs %rbp, %r8
1991
+ movq %rbx, %rdi
1992
+ testq %rdx, %rcx
1993
+ cmoveq %rbp, %r8
1994
+ cmoveq %rbp, %rdi
1995
+ sarq $1, %rcx
1996
+ xorq %r8, %rdi
1997
+ xorq %r8, %rsi
1998
+ btq $0x3f, %r8
1999
+ cmovbq %rcx, %rbx
2000
+ movq %rax, %r8
2001
+ subq %rax, %rsi
2002
+ leaq (%rcx,%rdi), %rcx
2003
+ cmovs %rbp, %r8
2004
+ movq %rbx, %rdi
2005
+ testq %rdx, %rcx
2006
+ cmoveq %rbp, %r8
2007
+ cmoveq %rbp, %rdi
2008
+ sarq $1, %rcx
2009
+ xorq %r8, %rdi
2010
+ xorq %r8, %rsi
2011
+ btq $0x3f, %r8
2012
+ cmovbq %rcx, %rbx
2013
+ movq %rax, %r8
2014
+ subq %rax, %rsi
2015
+ leaq (%rcx,%rdi), %rcx
2016
+ sarq $1, %rcx
2017
+ movl $0x100000, %eax
2018
+ leaq (%rbx,%rax), %r8
2019
+ leaq (%rcx,%rax), %r12
2020
+ shlq $0x15, %r8
2021
+ shlq $0x15, %r12
2022
+ sarq $0x2b, %r8
2023
+ sarq $0x2b, %r12
2024
+ movabsq $0x20000100000, %rax
2025
+ leaq (%rbx,%rax), %r10
2026
+ leaq (%rcx,%rax), %r14
2027
+ sarq $0x2b, %r10
2028
+ sarq $0x2b, %r14
2029
+ movq %r9, %rax
2030
+ imulq %r8, %rax
2031
+ movq %r13, %rdx
2032
+ imulq %r10, %rdx
2033
+ imulq %r15, %r8
2034
+ imulq %r11, %r10
2035
+ addq %r8, %r10
2036
+ leaq (%rax,%rdx), %r8
2037
+ movq %r9, %rax
2038
+ imulq %r12, %rax
2039
+ movq %r13, %rdx
2040
+ imulq %r14, %rdx
2041
+ imulq %r15, %r12
2042
+ imulq %r11, %r14
2043
+ addq %r12, %r14
2044
+ leaq (%rax,%rdx), %r12
2045
+ movq %rsi, 0x98(%rsp)
2046
+ decq 0x90(%rsp)
2047
+ jne curve25519_x25519_inverseloop
2048
+ movq (%rsp), %rax
2049
+ movq 0x20(%rsp), %rcx
2050
+ imulq %r8, %rax
2051
+ imulq %r10, %rcx
2052
+ addq %rcx, %rax
2053
+ sarq $0x3f, %rax
2054
+ movq %r8, %r9
2055
+ sarq $0x3f, %r9
2056
+ xorq %r9, %r8
2057
+ subq %r9, %r8
2058
+ xorq %rax, %r9
2059
+ movq %r10, %r11
2060
+ sarq $0x3f, %r11
2061
+ xorq %r11, %r10
2062
+ subq %r11, %r10
2063
+ xorq %rax, %r11
2064
+ movq %r12, %r13
2065
+ sarq $0x3f, %r13
2066
+ xorq %r13, %r12
2067
+ subq %r13, %r12
2068
+ xorq %rax, %r13
2069
+ movq %r14, %r15
2070
+ sarq $0x3f, %r15
2071
+ xorq %r15, %r14
2072
+ subq %r15, %r14
2073
+ xorq %rax, %r15
2074
+ movq %r8, %rax
2075
+ andq %r9, %rax
2076
+ movq %r10, %r12
2077
+ andq %r11, %r12
2078
+ addq %rax, %r12
2079
+ xorl %r13d, %r13d
2080
+ movq 0x40(%rsp), %rax
2081
+ xorq %r9, %rax
2082
+ mulq %r8
2083
+ addq %rax, %r12
2084
+ adcq %rdx, %r13
2085
+ movq 0x60(%rsp), %rax
2086
+ xorq %r11, %rax
2087
+ mulq %r10
2088
+ addq %rax, %r12
2089
+ adcq %rdx, %r13
2090
+ xorl %r14d, %r14d
2091
+ movq 0x48(%rsp), %rax
2092
+ xorq %r9, %rax
2093
+ mulq %r8
2094
+ addq %rax, %r13
2095
+ adcq %rdx, %r14
2096
+ movq 0x68(%rsp), %rax
2097
+ xorq %r11, %rax
2098
+ mulq %r10
2099
+ addq %rax, %r13
2100
+ adcq %rdx, %r14
2101
+ xorl %r15d, %r15d
2102
+ movq 0x50(%rsp), %rax
2103
+ xorq %r9, %rax
2104
+ mulq %r8
2105
+ addq %rax, %r14
2106
+ adcq %rdx, %r15
2107
+ movq 0x70(%rsp), %rax
2108
+ xorq %r11, %rax
2109
+ mulq %r10
2110
+ addq %rax, %r14
2111
+ adcq %rdx, %r15
2112
+ movq 0x58(%rsp), %rax
2113
+ xorq %r9, %rax
2114
+ andq %r8, %r9
2115
+ negq %r9
2116
+ mulq %r8
2117
+ addq %rax, %r15
2118
+ adcq %rdx, %r9
2119
+ movq 0x78(%rsp), %rax
2120
+ xorq %r11, %rax
2121
+ movq %r11, %rdx
2122
+ andq %r10, %rdx
2123
+ subq %rdx, %r9
2124
+ mulq %r10
2125
+ addq %rax, %r15
2126
+ adcq %rdx, %r9
2127
+ movq %r9, %rax
2128
+ shldq $0x1, %r15, %rax
2129
+ sarq $0x3f, %r9
2130
+ movl $0x13, %ebx
2131
+ leaq 0x1(%rax,%r9,1), %rax
2132
+ imulq %rbx
2133
+ xorl %ebp, %ebp
2134
+ addq %rax, %r12
2135
+ adcq %rdx, %r13
2136
+ adcq %r9, %r14
2137
+ adcq %r9, %r15
2138
+ shlq $0x3f, %rax
2139
+ addq %rax, %r15
2140
+ cmovns %rbp, %rbx
2141
+ subq %rbx, %r12
2142
+ sbbq %rbp, %r13
2143
+ sbbq %rbp, %r14
2144
+ sbbq %rbp, %r15
2145
+ btr $0x3f, %r15
2146
+ movq 0xc0(%rsp), %rdi
2147
+ movq %r12, (%rdi)
2148
+ movq %r13, 0x8(%rdi)
2149
+ movq %r14, 0x10(%rdi)
2150
+ movq %r15, 0x18(%rdi)
1208
2151
 
1209
2152
  // Since we eventually want to return 0 when the result is the point at
1210
2153
  // infinity, we force xn = 0 whenever zn = 0. This avoids building in a
1211
2154
  // dependency on the behavior of modular inverse in out-of-scope cases.
1212
2155
 
1213
- movq 160(%rsp), %rax
1214
- orq 168(%rsp), %rax
1215
- orq 176(%rsp), %rax
1216
- orq 184(%rsp), %rax
2156
+ movq 224(%rsp), %rax
2157
+ orq 232(%rsp), %rax
2158
+ orq 240(%rsp), %rax
2159
+ orq 248(%rsp), %rax
1217
2160
  movq 320(%rsp), %rcx
1218
2161
  cmovzq %rax, %rcx
1219
2162
  movq %rcx, 320(%rsp)
@@ -1230,7 +2173,7 @@ curve25519_x25519_fliploop:
1230
2173
  // Now the result is xn * (1/zn), fully reduced modulo p.
1231
2174
 
1232
2175
  movq res, %rbp
1233
- mul_p25519(resx,xn,zm)
2176
+ mul_p25519(resx,xn,xm)
1234
2177
 
1235
2178
  // Restore stack and registers
1236
2179