visaljs 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1007) hide show
  1. package/cli.js +393 -62
  2. package/node/include/js_node.h +28 -5
  3. package/node/include/js_uv.h +36 -0
  4. package/node/prelude/crypto.js +7 -10
  5. package/node/prelude/dns.js +99 -0
  6. package/node/prelude/dns_promises.js +10 -0
  7. package/node/prelude/http.js +1039 -195
  8. package/node/prelude/internal/crypto/asym.js +39 -12
  9. package/node/prelude/internal/crypto/dh_groups.js +12 -0
  10. package/node/prelude/internal/crypto/diffiehellman.js +354 -0
  11. package/node/prelude/internal/crypto/hash.js +1 -1
  12. package/node/prelude/internal/crypto/key_type.js +3 -0
  13. package/node/prelude/internal/crypto/keys.js +39 -9
  14. package/node/prelude/internal/http_agent.js +249 -0
  15. package/node/prelude/internal/net.js +33 -0
  16. package/node/prelude/internal/socketaddress.js +249 -0
  17. package/node/prelude/internal/tls/common.js +306 -0
  18. package/node/prelude/internal/tls/wrap.js +1217 -0
  19. package/node/prelude/internal/tls/x509.js +394 -0
  20. package/node/prelude/net.js +1083 -50
  21. package/node/prelude/stream.js +6 -0
  22. package/node/prelude/tls.js +141 -0
  23. package/node/prelude/util.js +5 -2
  24. package/node/prelude/util_types.js +85 -0
  25. package/node/src/host_http.c +268 -270
  26. package/node/src/host_loop.c +84 -0
  27. package/node/src/host_net.c +495 -0
  28. package/node/src/host_sys.c +16 -0
  29. package/package.json +1 -1
  30. package/runtime/include/js_builtins.h +16 -0
  31. package/runtime/include/js_console.h +2 -0
  32. package/runtime/include/js_core.def +23 -0
  33. package/runtime/include/js_crypto.h +23 -0
  34. package/runtime/include/js_generator.h +2 -3
  35. package/runtime/include/js_promise.h +0 -2
  36. package/runtime/src/async_iter.c +4 -1
  37. package/runtime/src/boringssl_support.cc +34 -0
  38. package/runtime/src/builtin_table.c +8 -0
  39. package/runtime/src/components.c +10 -0
  40. package/runtime/src/console.c +6 -18
  41. package/runtime/src/core_all.c +1 -0
  42. package/runtime/src/crypto_asym.c +450 -241
  43. package/runtime/src/crypto_bn.c +91 -0
  44. package/runtime/src/crypto_cipher.c +153 -75
  45. package/runtime/src/crypto_hash.c +68 -53
  46. package/runtime/src/crypto_internal.h +55 -26
  47. package/runtime/src/crypto_pkey.c +198 -61
  48. package/runtime/src/crypto_subtle.c +42 -16
  49. package/runtime/src/crypto_tls.c +678 -0
  50. package/runtime/src/generator.c +8 -1
  51. package/runtime/src/global.c +2 -4
  52. package/runtime/src/internal.h +0 -1
  53. package/runtime/src/jobs.c +2 -1
  54. package/runtime/src/promise.c +4 -1
  55. package/runtime/src/tls_roots.gen.h +3215 -0
  56. package/runtime/src/util_types.c +52 -0
  57. package/runtime/src/weak.c +2 -1
  58. package/runtime/third_party/boringssl/LICENSE +238 -0
  59. package/runtime/third_party/boringssl/README.md +46 -0
  60. package/runtime/third_party/boringssl/VERSION +1 -0
  61. package/runtime/third_party/boringssl/crypto/aes/aes.cc +44 -0
  62. package/runtime/third_party/boringssl/crypto/armv8_feature_parsing.h +67 -0
  63. package/runtime/third_party/boringssl/crypto/asn1/a_bitstr.cc +297 -0
  64. package/runtime/third_party/boringssl/crypto/asn1/a_bool.cc +50 -0
  65. package/runtime/third_party/boringssl/crypto/asn1/a_d2i_fp.cc +47 -0
  66. package/runtime/third_party/boringssl/crypto/asn1/a_dup.cc +42 -0
  67. package/runtime/third_party/boringssl/crypto/asn1/a_gentm.cc +130 -0
  68. package/runtime/third_party/boringssl/crypto/asn1/a_i2d_fp.cc +44 -0
  69. package/runtime/third_party/boringssl/crypto/asn1/a_int.cc +467 -0
  70. package/runtime/third_party/boringssl/crypto/asn1/a_mbstr.cc +242 -0
  71. package/runtime/third_party/boringssl/crypto/asn1/a_object.cc +191 -0
  72. package/runtime/third_party/boringssl/crypto/asn1/a_octet.cc +32 -0
  73. package/runtime/third_party/boringssl/crypto/asn1/a_strex.cc +411 -0
  74. package/runtime/third_party/boringssl/crypto/asn1/a_strnid.cc +208 -0
  75. package/runtime/third_party/boringssl/crypto/asn1/a_time.cc +248 -0
  76. package/runtime/third_party/boringssl/crypto/asn1/a_type.cc +467 -0
  77. package/runtime/third_party/boringssl/crypto/asn1/a_utctm.cc +128 -0
  78. package/runtime/third_party/boringssl/crypto/asn1/asn1_lib.cc +453 -0
  79. package/runtime/third_party/boringssl/crypto/asn1/asn1_par.cc +61 -0
  80. package/runtime/third_party/boringssl/crypto/asn1/asn_pack.cc +56 -0
  81. package/runtime/third_party/boringssl/crypto/asn1/f_int.cc +63 -0
  82. package/runtime/third_party/boringssl/crypto/asn1/f_string.cc +52 -0
  83. package/runtime/third_party/boringssl/crypto/asn1/internal.h +430 -0
  84. package/runtime/third_party/boringssl/crypto/asn1/posix_time.cc +244 -0
  85. package/runtime/third_party/boringssl/crypto/asn1/tasn_dec.cc +611 -0
  86. package/runtime/third_party/boringssl/crypto/asn1/tasn_enc.cc +348 -0
  87. package/runtime/third_party/boringssl/crypto/asn1/tasn_fre.cc +163 -0
  88. package/runtime/third_party/boringssl/crypto/asn1/tasn_new.cc +274 -0
  89. package/runtime/third_party/boringssl/crypto/asn1/tasn_typ.cc +92 -0
  90. package/runtime/third_party/boringssl/crypto/asn1/tasn_utl.cc +218 -0
  91. package/runtime/third_party/boringssl/crypto/base64/base64.cc +433 -0
  92. package/runtime/third_party/boringssl/crypto/bcm_support.h +62 -0
  93. package/runtime/third_party/boringssl/crypto/bio/bio.cc +715 -0
  94. package/runtime/third_party/boringssl/crypto/bio/bio_mem.cc +260 -0
  95. package/runtime/third_party/boringssl/crypto/bio/connect.cc +463 -0
  96. package/runtime/third_party/boringssl/crypto/bio/errno.cc +52 -0
  97. package/runtime/third_party/boringssl/crypto/bio/fd.cc +193 -0
  98. package/runtime/third_party/boringssl/crypto/bio/file.cc +283 -0
  99. package/runtime/third_party/boringssl/crypto/bio/hexdump.cc +154 -0
  100. package/runtime/third_party/boringssl/crypto/bio/internal.h +128 -0
  101. package/runtime/third_party/boringssl/crypto/bio/pair.cc +426 -0
  102. package/runtime/third_party/boringssl/crypto/bio/printf.cc +59 -0
  103. package/runtime/third_party/boringssl/crypto/bio/socket.cc +210 -0
  104. package/runtime/third_party/boringssl/crypto/bio/socket_helper.cc +179 -0
  105. package/runtime/third_party/boringssl/crypto/blake2/blake2.cc +173 -0
  106. package/runtime/third_party/boringssl/crypto/bn/bn_asn1.cc +57 -0
  107. package/runtime/third_party/boringssl/crypto/bn/convert.cc +409 -0
  108. package/runtime/third_party/boringssl/crypto/bn/div.cc +102 -0
  109. package/runtime/third_party/boringssl/crypto/bn/exponentiation.cc +168 -0
  110. package/runtime/third_party/boringssl/crypto/bn/sqrt.cc +93 -0
  111. package/runtime/third_party/boringssl/crypto/buf/buf.cc +119 -0
  112. package/runtime/third_party/boringssl/crypto/bytestring/asn1_compat.cc +54 -0
  113. package/runtime/third_party/boringssl/crypto/bytestring/ber.cc +268 -0
  114. package/runtime/third_party/boringssl/crypto/bytestring/cbb.cc +787 -0
  115. package/runtime/third_party/boringssl/crypto/bytestring/cbs.cc +977 -0
  116. package/runtime/third_party/boringssl/crypto/bytestring/internal.h +134 -0
  117. package/runtime/third_party/boringssl/crypto/bytestring/unicode.cc +156 -0
  118. package/runtime/third_party/boringssl/crypto/chacha/chacha.cc +226 -0
  119. package/runtime/third_party/boringssl/crypto/chacha/internal.h +103 -0
  120. package/runtime/third_party/boringssl/crypto/cipher/derive_key.cc +106 -0
  121. package/runtime/third_party/boringssl/crypto/cipher/e_aesctrhmac.cc +294 -0
  122. package/runtime/third_party/boringssl/crypto/cipher/e_aeseax.cc +351 -0
  123. package/runtime/third_party/boringssl/crypto/cipher/e_aesgcmsiv.cc +918 -0
  124. package/runtime/third_party/boringssl/crypto/cipher/e_chacha20poly1305.cc +404 -0
  125. package/runtime/third_party/boringssl/crypto/cipher/e_des.cc +214 -0
  126. package/runtime/third_party/boringssl/crypto/cipher/e_null.cc +55 -0
  127. package/runtime/third_party/boringssl/crypto/cipher/e_rc2.cc +432 -0
  128. package/runtime/third_party/boringssl/crypto/cipher/e_rc4.cc +56 -0
  129. package/runtime/third_party/boringssl/crypto/cipher/e_tls.cc +615 -0
  130. package/runtime/third_party/boringssl/crypto/cipher/get_cipher.cc +85 -0
  131. package/runtime/third_party/boringssl/crypto/cipher/internal.h +399 -0
  132. package/runtime/third_party/boringssl/crypto/cipher/tls_cbc.cc +476 -0
  133. package/runtime/third_party/boringssl/crypto/cms/cms.cc +178 -0
  134. package/runtime/third_party/boringssl/crypto/conf/conf.cc +637 -0
  135. package/runtime/third_party/boringssl/crypto/conf/internal.h +54 -0
  136. package/runtime/third_party/boringssl/crypto/cpu_aarch64_apple.cc +76 -0
  137. package/runtime/third_party/boringssl/crypto/cpu_aarch64_fuchsia.cc +58 -0
  138. package/runtime/third_party/boringssl/crypto/cpu_aarch64_linux.cc +66 -0
  139. package/runtime/third_party/boringssl/crypto/cpu_aarch64_openbsd.cc +45 -0
  140. package/runtime/third_party/boringssl/crypto/cpu_aarch64_sysreg.cc +66 -0
  141. package/runtime/third_party/boringssl/crypto/cpu_aarch64_win.cc +52 -0
  142. package/runtime/third_party/boringssl/crypto/cpu_arm_freebsd.cc +55 -0
  143. package/runtime/third_party/boringssl/crypto/cpu_arm_linux.cc +173 -0
  144. package/runtime/third_party/boringssl/crypto/cpu_arm_linux.h +141 -0
  145. package/runtime/third_party/boringssl/crypto/cpu_intel.cc +287 -0
  146. package/runtime/third_party/boringssl/crypto/crypto.cc +152 -0
  147. package/runtime/third_party/boringssl/crypto/curve25519/asm/x25519-asm-arm.S +2124 -0
  148. package/runtime/third_party/boringssl/crypto/curve25519/cpace.cc +227 -0
  149. package/runtime/third_party/boringssl/crypto/curve25519/curve25519.cc +2436 -0
  150. package/runtime/third_party/boringssl/crypto/curve25519/curve25519_64_adx.cc +18 -0
  151. package/runtime/third_party/boringssl/crypto/curve25519/curve25519_tables.h +3264 -0
  152. package/runtime/third_party/boringssl/crypto/curve25519/internal.h +202 -0
  153. package/runtime/third_party/boringssl/crypto/curve25519/spake25519.cc +532 -0
  154. package/runtime/third_party/boringssl/crypto/des/des.cc +837 -0
  155. package/runtime/third_party/boringssl/crypto/des/internal.h +144 -0
  156. package/runtime/third_party/boringssl/crypto/dh/dh_asn1.cc +109 -0
  157. package/runtime/third_party/boringssl/crypto/dh/params.cc +411 -0
  158. package/runtime/third_party/boringssl/crypto/digest/digest_extra.cc +361 -0
  159. package/runtime/third_party/boringssl/crypto/dsa/dsa.cc +922 -0
  160. package/runtime/third_party/boringssl/crypto/dsa/dsa_asn1.cc +306 -0
  161. package/runtime/third_party/boringssl/crypto/dsa/internal.h +56 -0
  162. package/runtime/third_party/boringssl/crypto/ec/ec_asn1.cc +542 -0
  163. package/runtime/third_party/boringssl/crypto/ec/ec_derive.cc +94 -0
  164. package/runtime/third_party/boringssl/crypto/ec/hash_to_curve.cc +773 -0
  165. package/runtime/third_party/boringssl/crypto/ec/internal.h +114 -0
  166. package/runtime/third_party/boringssl/crypto/ecdh/ecdh.cc +75 -0
  167. package/runtime/third_party/boringssl/crypto/ecdsa/ecdsa_asn1.cc +337 -0
  168. package/runtime/third_party/boringssl/crypto/ecdsa/ecdsa_p1363.cc +54 -0
  169. package/runtime/third_party/boringssl/crypto/engine/engine.cc +95 -0
  170. package/runtime/third_party/boringssl/crypto/err/err.cc +820 -0
  171. package/runtime/third_party/boringssl/crypto/err/internal.h +45 -0
  172. package/runtime/third_party/boringssl/crypto/evp/evp.cc +454 -0
  173. package/runtime/third_party/boringssl/crypto/evp/evp_asn1.cc +439 -0
  174. package/runtime/third_party/boringssl/crypto/evp/evp_ctx.cc +541 -0
  175. package/runtime/third_party/boringssl/crypto/evp/evp_kem.cc +101 -0
  176. package/runtime/third_party/boringssl/crypto/evp/internal.h +427 -0
  177. package/runtime/third_party/boringssl/crypto/evp/p_dh.cc +326 -0
  178. package/runtime/third_party/boringssl/crypto/evp/p_dsa.cc +333 -0
  179. package/runtime/third_party/boringssl/crypto/evp/p_ec.cc +736 -0
  180. package/runtime/third_party/boringssl/crypto/evp/p_ed25519.cc +359 -0
  181. package/runtime/third_party/boringssl/crypto/evp/p_hkdf.cc +204 -0
  182. package/runtime/third_party/boringssl/crypto/evp/p_mldsa.cc +549 -0
  183. package/runtime/third_party/boringssl/crypto/evp/p_mlkem.cc +510 -0
  184. package/runtime/third_party/boringssl/crypto/evp/p_rsa.cc +1185 -0
  185. package/runtime/third_party/boringssl/crypto/evp/p_x25519.cc +371 -0
  186. package/runtime/third_party/boringssl/crypto/evp/p_xwing.cc +300 -0
  187. package/runtime/third_party/boringssl/crypto/evp/pbkdf.cc +105 -0
  188. package/runtime/third_party/boringssl/crypto/evp/print.cc +287 -0
  189. package/runtime/third_party/boringssl/crypto/evp/scrypt.cc +218 -0
  190. package/runtime/third_party/boringssl/crypto/evp/sign.cc +95 -0
  191. package/runtime/third_party/boringssl/crypto/ex_data.cc +140 -0
  192. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/aes.cc.inc +208 -0
  193. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/aes_nohw.cc.inc +1279 -0
  194. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/cbc.cc.inc +132 -0
  195. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/cfb.cc.inc +168 -0
  196. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/ctr.cc.inc +102 -0
  197. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/gcm.cc.inc +614 -0
  198. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/gcm_nohw.cc.inc +304 -0
  199. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/internal.h +590 -0
  200. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/key_wrap.cc.inc +211 -0
  201. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/mode_wrappers.cc.inc +97 -0
  202. package/runtime/third_party/boringssl/crypto/fipsmodule/aes/ofb.cc.inc +55 -0
  203. package/runtime/third_party/boringssl/crypto/fipsmodule/bcm.cc +288 -0
  204. package/runtime/third_party/boringssl/crypto/fipsmodule/bcm_interface.h +953 -0
  205. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/add.cc.inc +276 -0
  206. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/asm/x86_64-gcc.cc.inc +573 -0
  207. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/bn.cc.inc +377 -0
  208. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/bytes.cc.inc +230 -0
  209. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/cmp.cc.inc +161 -0
  210. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/ctx.cc.inc +127 -0
  211. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/div.cc.inc +738 -0
  212. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/div_extra.cc.inc +90 -0
  213. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/exponentiation.cc.inc +743 -0
  214. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/gcd.cc.inc +281 -0
  215. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/gcd_extra.cc.inc +327 -0
  216. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/generic.cc.inc +579 -0
  217. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/internal.h +810 -0
  218. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/jacobi.cc.inc +101 -0
  219. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/montgomery.cc.inc +408 -0
  220. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/montgomery_inv.cc.inc +179 -0
  221. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/mul.cc.inc +347 -0
  222. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/prime.cc.inc +931 -0
  223. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/random.cc.inc +261 -0
  224. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.cc.inc +144 -0
  225. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.h +109 -0
  226. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/shift.cc.inc +317 -0
  227. package/runtime/third_party/boringssl/crypto/fipsmodule/bn/sqrt.cc.inc +370 -0
  228. package/runtime/third_party/boringssl/crypto/fipsmodule/cipher/aead.cc.inc +619 -0
  229. package/runtime/third_party/boringssl/crypto/fipsmodule/cipher/cipher.cc.inc +837 -0
  230. package/runtime/third_party/boringssl/crypto/fipsmodule/cipher/e_aes.cc.inc +1240 -0
  231. package/runtime/third_party/boringssl/crypto/fipsmodule/cipher/e_aesccm.cc.inc +440 -0
  232. package/runtime/third_party/boringssl/crypto/fipsmodule/cipher/internal.h +461 -0
  233. package/runtime/third_party/boringssl/crypto/fipsmodule/cmac/cmac.cc.inc +293 -0
  234. package/runtime/third_party/boringssl/crypto/fipsmodule/delocate.h +95 -0
  235. package/runtime/third_party/boringssl/crypto/fipsmodule/dh/check.cc.inc +198 -0
  236. package/runtime/third_party/boringssl/crypto/fipsmodule/dh/dh.cc.inc +401 -0
  237. package/runtime/third_party/boringssl/crypto/fipsmodule/dh/internal.h +63 -0
  238. package/runtime/third_party/boringssl/crypto/fipsmodule/digest/digest.cc.inc +221 -0
  239. package/runtime/third_party/boringssl/crypto/fipsmodule/digest/digests.cc.inc +184 -0
  240. package/runtime/third_party/boringssl/crypto/fipsmodule/digest/internal.h +72 -0
  241. package/runtime/third_party/boringssl/crypto/fipsmodule/digest/md32_common.h +166 -0
  242. package/runtime/third_party/boringssl/crypto/fipsmodule/digestsign/digestsign.cc.inc +230 -0
  243. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/builtin_curves.h +277 -0
  244. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/ec.cc.inc +1024 -0
  245. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/ec_key.cc.inc +536 -0
  246. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/ec_montgomery.cc.inc +379 -0
  247. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/felem.cc.inc +250 -0
  248. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/internal.h +752 -0
  249. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/oct.cc.inc +174 -0
  250. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/p256-nistz-table.h +9502 -0
  251. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/p256-nistz.cc.inc +740 -0
  252. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/p256-nistz.h +207 -0
  253. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/p256.cc.inc +578 -0
  254. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/p256_table.h +297 -0
  255. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/scalar.cc.inc +184 -0
  256. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/simple.cc.inc +246 -0
  257. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/simple_mul.cc.inc +274 -0
  258. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/util.cc.inc +258 -0
  259. package/runtime/third_party/boringssl/crypto/fipsmodule/ec/wnaf.cc.inc +224 -0
  260. package/runtime/third_party/boringssl/crypto/fipsmodule/ecdh/ecdh.cc.inc +91 -0
  261. package/runtime/third_party/boringssl/crypto/fipsmodule/ecdsa/ecdsa.cc.inc +288 -0
  262. package/runtime/third_party/boringssl/crypto/fipsmodule/ecdsa/internal.h +57 -0
  263. package/runtime/third_party/boringssl/crypto/fipsmodule/entropy/internal.h +38 -0
  264. package/runtime/third_party/boringssl/crypto/fipsmodule/entropy/jitter.cc.inc +487 -0
  265. package/runtime/third_party/boringssl/crypto/fipsmodule/entropy/sha512.cc.inc +329 -0
  266. package/runtime/third_party/boringssl/crypto/fipsmodule/fips_shared_support.cc +28 -0
  267. package/runtime/third_party/boringssl/crypto/fipsmodule/hkdf/hkdf.cc.inc +114 -0
  268. package/runtime/third_party/boringssl/crypto/fipsmodule/hmac/hmac.cc.inc +218 -0
  269. package/runtime/third_party/boringssl/crypto/fipsmodule/keccak/internal.h +165 -0
  270. package/runtime/third_party/boringssl/crypto/fipsmodule/keccak/keccak.cc.inc +647 -0
  271. package/runtime/third_party/boringssl/crypto/fipsmodule/mldsa/fips_known_values.inc +1345 -0
  272. package/runtime/third_party/boringssl/crypto/fipsmodule/mldsa/mldsa.cc.inc +3323 -0
  273. package/runtime/third_party/boringssl/crypto/fipsmodule/mlkem/fips_known_values.inc +411 -0
  274. package/runtime/third_party/boringssl/crypto/fipsmodule/mlkem/mlkem.cc.inc +1856 -0
  275. package/runtime/third_party/boringssl/crypto/fipsmodule/rand/android_entropy_client.cc.inc +82 -0
  276. package/runtime/third_party/boringssl/crypto/fipsmodule/rand/ctrdrbg.cc.inc +401 -0
  277. package/runtime/third_party/boringssl/crypto/fipsmodule/rand/internal.h +99 -0
  278. package/runtime/third_party/boringssl/crypto/fipsmodule/rand/rand.cc.inc +486 -0
  279. package/runtime/third_party/boringssl/crypto/fipsmodule/rsa/internal.h +167 -0
  280. package/runtime/third_party/boringssl/crypto/fipsmodule/rsa/padding.cc.inc +371 -0
  281. package/runtime/third_party/boringssl/crypto/fipsmodule/rsa/rsa.cc.inc +996 -0
  282. package/runtime/third_party/boringssl/crypto/fipsmodule/rsa/rsa_impl.cc.inc +1000 -0
  283. package/runtime/third_party/boringssl/crypto/fipsmodule/self_check/fips.cc.inc +129 -0
  284. package/runtime/third_party/boringssl/crypto/fipsmodule/self_check/self_check.cc.inc +1093 -0
  285. package/runtime/third_party/boringssl/crypto/fipsmodule/service_indicator/internal.h +112 -0
  286. package/runtime/third_party/boringssl/crypto/fipsmodule/service_indicator/service_indicator.cc.inc +330 -0
  287. package/runtime/third_party/boringssl/crypto/fipsmodule/sha/internal.h +205 -0
  288. package/runtime/third_party/boringssl/crypto/fipsmodule/sha/sha1.cc.inc +404 -0
  289. package/runtime/third_party/boringssl/crypto/fipsmodule/sha/sha256.cc.inc +315 -0
  290. package/runtime/third_party/boringssl/crypto/fipsmodule/sha/sha512.cc.inc +473 -0
  291. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/address.h +144 -0
  292. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/fips_known_values.inc +674 -0
  293. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/fors.cc.inc +179 -0
  294. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/fors.h +48 -0
  295. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/merkle.cc.inc +164 -0
  296. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/merkle.h +58 -0
  297. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/params.h +178 -0
  298. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/slhdsa.cc.inc +690 -0
  299. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/thash.cc.inc +326 -0
  300. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/thash.h +71 -0
  301. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/wots.cc.inc +172 -0
  302. package/runtime/third_party/boringssl/crypto/fipsmodule/slhdsa/wots.h +40 -0
  303. package/runtime/third_party/boringssl/crypto/fipsmodule/tls/internal.h +33 -0
  304. package/runtime/third_party/boringssl/crypto/fipsmodule/tls/kdf.cc.inc +180 -0
  305. package/runtime/third_party/boringssl/crypto/fuzzer_mode.cc +30 -0
  306. package/runtime/third_party/boringssl/crypto/hpke/hpke.cc +1514 -0
  307. package/runtime/third_party/boringssl/crypto/hrss/asm/poly_rq_mul.S +8489 -0
  308. package/runtime/third_party/boringssl/crypto/hrss/hrss.cc +2189 -0
  309. package/runtime/third_party/boringssl/crypto/hrss/internal.h +64 -0
  310. package/runtime/third_party/boringssl/crypto/internal.h +1767 -0
  311. package/runtime/third_party/boringssl/crypto/lhash/internal.h +222 -0
  312. package/runtime/third_party/boringssl/crypto/lhash/lhash.cc +312 -0
  313. package/runtime/third_party/boringssl/crypto/md4/md4.cc +207 -0
  314. package/runtime/third_party/boringssl/crypto/md5/internal.h +34 -0
  315. package/runtime/third_party/boringssl/crypto/md5/md5.cc +255 -0
  316. package/runtime/third_party/boringssl/crypto/mem.cc +577 -0
  317. package/runtime/third_party/boringssl/crypto/mem_internal.h +706 -0
  318. package/runtime/third_party/boringssl/crypto/mldsa/mldsa.cc +296 -0
  319. package/runtime/third_party/boringssl/crypto/mlkem/mlkem.cc +108 -0
  320. package/runtime/third_party/boringssl/crypto/obj/obj.cc +494 -0
  321. package/runtime/third_party/boringssl/crypto/obj/obj_dat.h +11722 -0
  322. package/runtime/third_party/boringssl/crypto/obj/obj_xref.cc +83 -0
  323. package/runtime/third_party/boringssl/crypto/params_internal.h +30 -0
  324. package/runtime/third_party/boringssl/crypto/pem/internal.h +135 -0
  325. package/runtime/third_party/boringssl/crypto/pem/pem_all.cc +153 -0
  326. package/runtime/third_party/boringssl/crypto/pem/pem_info.cc +250 -0
  327. package/runtime/third_party/boringssl/crypto/pem/pem_lib.cc +707 -0
  328. package/runtime/third_party/boringssl/crypto/pem/pem_oth.cc +45 -0
  329. package/runtime/third_party/boringssl/crypto/pem/pem_pk8.cc +211 -0
  330. package/runtime/third_party/boringssl/crypto/pem/pem_pkey.cc +147 -0
  331. package/runtime/third_party/boringssl/crypto/pem/pem_x509.cc +25 -0
  332. package/runtime/third_party/boringssl/crypto/pem/pem_xaux.cc +25 -0
  333. package/runtime/third_party/boringssl/crypto/pkcs7/internal.h +67 -0
  334. package/runtime/third_party/boringssl/crypto/pkcs7/pkcs7.cc +198 -0
  335. package/runtime/third_party/boringssl/crypto/pkcs7/pkcs7_x509.cc +527 -0
  336. package/runtime/third_party/boringssl/crypto/pkcs8/internal.h +98 -0
  337. package/runtime/third_party/boringssl/crypto/pkcs8/p5_pbev2.cc +286 -0
  338. package/runtime/third_party/boringssl/crypto/pkcs8/pkcs8.cc +473 -0
  339. package/runtime/third_party/boringssl/crypto/pkcs8/pkcs8_x509.cc +1328 -0
  340. package/runtime/third_party/boringssl/crypto/poly1305/internal.h +54 -0
  341. package/runtime/third_party/boringssl/crypto/poly1305/poly1305.cc +315 -0
  342. package/runtime/third_party/boringssl/crypto/poly1305/poly1305_arm.cc +294 -0
  343. package/runtime/third_party/boringssl/crypto/poly1305/poly1305_arm_asm.S +2017 -0
  344. package/runtime/third_party/boringssl/crypto/poly1305/poly1305_vec.cc +853 -0
  345. package/runtime/third_party/boringssl/crypto/pool/internal.h +95 -0
  346. package/runtime/third_party/boringssl/crypto/pool/pool.cc +282 -0
  347. package/runtime/third_party/boringssl/crypto/rand/deterministic.cc +58 -0
  348. package/runtime/third_party/boringssl/crypto/rand/fork_detect.cc +222 -0
  349. package/runtime/third_party/boringssl/crypto/rand/forkunsafe.cc +44 -0
  350. package/runtime/third_party/boringssl/crypto/rand/getentropy.cc +53 -0
  351. package/runtime/third_party/boringssl/crypto/rand/internal.h +67 -0
  352. package/runtime/third_party/boringssl/crypto/rand/ios.cc +35 -0
  353. package/runtime/third_party/boringssl/crypto/rand/rand.cc +79 -0
  354. package/runtime/third_party/boringssl/crypto/rand/trusty.cc +39 -0
  355. package/runtime/third_party/boringssl/crypto/rand/urandom.cc +149 -0
  356. package/runtime/third_party/boringssl/crypto/rand/windows.cc +91 -0
  357. package/runtime/third_party/boringssl/crypto/rc4/rc4.cc +56 -0
  358. package/runtime/third_party/boringssl/crypto/refcount.cc +49 -0
  359. package/runtime/third_party/boringssl/crypto/rsa/internal.h +51 -0
  360. package/runtime/third_party/boringssl/crypto/rsa/rsa_asn1.cc +404 -0
  361. package/runtime/third_party/boringssl/crypto/rsa/rsa_crypt.cc +530 -0
  362. package/runtime/third_party/boringssl/crypto/rsa/rsa_extra.cc +30 -0
  363. package/runtime/third_party/boringssl/crypto/rsa/rsa_print.cc +25 -0
  364. package/runtime/third_party/boringssl/crypto/sha/sha1.cc +55 -0
  365. package/runtime/third_party/boringssl/crypto/sha/sha256.cc +89 -0
  366. package/runtime/third_party/boringssl/crypto/sha/sha512.cc +106 -0
  367. package/runtime/third_party/boringssl/crypto/siphash/siphash.cc +81 -0
  368. package/runtime/third_party/boringssl/crypto/slhdsa/slhdsa.cc +167 -0
  369. package/runtime/third_party/boringssl/crypto/spake2plus/internal.h +204 -0
  370. package/runtime/third_party/boringssl/crypto/spake2plus/spake2plus.cc +501 -0
  371. package/runtime/third_party/boringssl/crypto/stack/stack.cc +462 -0
  372. package/runtime/third_party/boringssl/crypto/thread.cc +68 -0
  373. package/runtime/third_party/boringssl/crypto/thread_none.cc +48 -0
  374. package/runtime/third_party/boringssl/crypto/thread_pthread.cc +138 -0
  375. package/runtime/third_party/boringssl/crypto/thread_win.cc +227 -0
  376. package/runtime/third_party/boringssl/crypto/trust_token/internal.h +405 -0
  377. package/runtime/third_party/boringssl/crypto/trust_token/pmbtoken.cc +1672 -0
  378. package/runtime/third_party/boringssl/crypto/trust_token/trust_token.cc +701 -0
  379. package/runtime/third_party/boringssl/crypto/trust_token/voprf.cc +1266 -0
  380. package/runtime/third_party/boringssl/crypto/x509/a_digest.cc +52 -0
  381. package/runtime/third_party/boringssl/crypto/x509/a_sign.cc +100 -0
  382. package/runtime/third_party/boringssl/crypto/x509/a_verify.cc +77 -0
  383. package/runtime/third_party/boringssl/crypto/x509/algorithm.cc +167 -0
  384. package/runtime/third_party/boringssl/crypto/x509/asn1_gen.cc +540 -0
  385. package/runtime/third_party/boringssl/crypto/x509/by_dir.cc +301 -0
  386. package/runtime/third_party/boringssl/crypto/x509/by_file.cc +226 -0
  387. package/runtime/third_party/boringssl/crypto/x509/i2d_pr.cc +37 -0
  388. package/runtime/third_party/boringssl/crypto/x509/internal.h +697 -0
  389. package/runtime/third_party/boringssl/crypto/x509/name_print.cc +187 -0
  390. package/runtime/third_party/boringssl/crypto/x509/policy.cc +686 -0
  391. package/runtime/third_party/boringssl/crypto/x509/rsa_pss.cc +187 -0
  392. package/runtime/third_party/boringssl/crypto/x509/t_crl.cc +106 -0
  393. package/runtime/third_party/boringssl/crypto/x509/t_req.cc +206 -0
  394. package/runtime/third_party/boringssl/crypto/x509/t_x509.cc +292 -0
  395. package/runtime/third_party/boringssl/crypto/x509/t_x509a.cc +81 -0
  396. package/runtime/third_party/boringssl/crypto/x509/v3_akey.cc +174 -0
  397. package/runtime/third_party/boringssl/crypto/x509/v3_akeya.cc +31 -0
  398. package/runtime/third_party/boringssl/crypto/x509/v3_alt.cc +636 -0
  399. package/runtime/third_party/boringssl/crypto/x509/v3_bcons.cc +96 -0
  400. package/runtime/third_party/boringssl/crypto/x509/v3_bitst.cc +100 -0
  401. package/runtime/third_party/boringssl/crypto/x509/v3_conf.cc +369 -0
  402. package/runtime/third_party/boringssl/crypto/x509/v3_cpols.cc +417 -0
  403. package/runtime/third_party/boringssl/crypto/x509/v3_crld.cc +471 -0
  404. package/runtime/third_party/boringssl/crypto/x509/v3_enum.cc +74 -0
  405. package/runtime/third_party/boringssl/crypto/x509/v3_extku.cc +97 -0
  406. package/runtime/third_party/boringssl/crypto/x509/v3_genn.cc +238 -0
  407. package/runtime/third_party/boringssl/crypto/x509/v3_ia5.cc +83 -0
  408. package/runtime/third_party/boringssl/crypto/x509/v3_info.cc +162 -0
  409. package/runtime/third_party/boringssl/crypto/x509/v3_int.cc +83 -0
  410. package/runtime/third_party/boringssl/crypto/x509/v3_lib.cc +349 -0
  411. package/runtime/third_party/boringssl/crypto/x509/v3_ncons.cc +798 -0
  412. package/runtime/third_party/boringssl/crypto/x509/v3_ocsp.cc +92 -0
  413. package/runtime/third_party/boringssl/crypto/x509/v3_pcons.cc +102 -0
  414. package/runtime/third_party/boringssl/crypto/x509/v3_pmaps.cc +110 -0
  415. package/runtime/third_party/boringssl/crypto/x509/v3_prn.cc +183 -0
  416. package/runtime/third_party/boringssl/crypto/x509/v3_purp.cc +580 -0
  417. package/runtime/third_party/boringssl/crypto/x509/v3_skey.cc +128 -0
  418. package/runtime/third_party/boringssl/crypto/x509/v3_utl.cc +1311 -0
  419. package/runtime/third_party/boringssl/crypto/x509/x509.cc +47 -0
  420. package/runtime/third_party/boringssl/crypto/x509/x509_att.cc +188 -0
  421. package/runtime/third_party/boringssl/crypto/x509/x509_cmp.cc +243 -0
  422. package/runtime/third_party/boringssl/crypto/x509/x509_d2.cc +66 -0
  423. package/runtime/third_party/boringssl/crypto/x509/x509_def.cc +42 -0
  424. package/runtime/third_party/boringssl/crypto/x509/x509_ext.cc +161 -0
  425. package/runtime/third_party/boringssl/crypto/x509/x509_lu.cc +570 -0
  426. package/runtime/third_party/boringssl/crypto/x509/x509_mtc.cc +598 -0
  427. package/runtime/third_party/boringssl/crypto/x509/x509_obj.cc +169 -0
  428. package/runtime/third_party/boringssl/crypto/x509/x509_req.cc +248 -0
  429. package/runtime/third_party/boringssl/crypto/x509/x509_set.cc +166 -0
  430. package/runtime/third_party/boringssl/crypto/x509/x509_trs.cc +123 -0
  431. package/runtime/third_party/boringssl/crypto/x509/x509_txt.cc +147 -0
  432. package/runtime/third_party/boringssl/crypto/x509/x509_v3.cc +249 -0
  433. package/runtime/third_party/boringssl/crypto/x509/x509_vfy.cc +1531 -0
  434. package/runtime/third_party/boringssl/crypto/x509/x509_vpm.cc +449 -0
  435. package/runtime/third_party/boringssl/crypto/x509/x509cset.cc +222 -0
  436. package/runtime/third_party/boringssl/crypto/x509/x509name.cc +377 -0
  437. package/runtime/third_party/boringssl/crypto/x509/x509rset.cc +55 -0
  438. package/runtime/third_party/boringssl/crypto/x509/x509spki.cc +91 -0
  439. package/runtime/third_party/boringssl/crypto/x509/x_algor.cc +223 -0
  440. package/runtime/third_party/boringssl/crypto/x509/x_all.cc +352 -0
  441. package/runtime/third_party/boringssl/crypto/x509/x_attrib.cc +61 -0
  442. package/runtime/third_party/boringssl/crypto/x509/x_crl.cc +325 -0
  443. package/runtime/third_party/boringssl/crypto/x509/x_exten.cc +42 -0
  444. package/runtime/third_party/boringssl/crypto/x509/x_name.cc +407 -0
  445. package/runtime/third_party/boringssl/crypto/x509/x_pubkey.cc +199 -0
  446. package/runtime/third_party/boringssl/crypto/x509/x_req.cc +80 -0
  447. package/runtime/third_party/boringssl/crypto/x509/x_sig.cc +51 -0
  448. package/runtime/third_party/boringssl/crypto/x509/x_spki.cc +44 -0
  449. package/runtime/third_party/boringssl/crypto/x509/x_x509.cc +495 -0
  450. package/runtime/third_party/boringssl/crypto/x509/x_x509a.cc +169 -0
  451. package/runtime/third_party/boringssl/crypto/xwing/xwing.cc +257 -0
  452. package/runtime/third_party/boringssl/gen/bcm/aes-gcm-avx2-x86_64-apple.S +1326 -0
  453. package/runtime/third_party/boringssl/gen/bcm/aes-gcm-avx2-x86_64-linux.S +1327 -0
  454. package/runtime/third_party/boringssl/gen/bcm/aes-gcm-avx512-x86_64-apple.S +1252 -0
  455. package/runtime/third_party/boringssl/gen/bcm/aes-gcm-avx512-x86_64-linux.S +1253 -0
  456. package/runtime/third_party/boringssl/gen/bcm/aesni-gcm-x86_64-apple.S +873 -0
  457. package/runtime/third_party/boringssl/gen/bcm/aesni-gcm-x86_64-linux.S +885 -0
  458. package/runtime/third_party/boringssl/gen/bcm/aesni-x86-apple.S +2490 -0
  459. package/runtime/third_party/boringssl/gen/bcm/aesni-x86-linux.S +2530 -0
  460. package/runtime/third_party/boringssl/gen/bcm/aesni-x86_64-apple.S +2413 -0
  461. package/runtime/third_party/boringssl/gen/bcm/aesni-x86_64-linux.S +2397 -0
  462. package/runtime/third_party/boringssl/gen/bcm/aesv8-armv7-linux.S +784 -0
  463. package/runtime/third_party/boringssl/gen/bcm/aesv8-armv8-apple.S +792 -0
  464. package/runtime/third_party/boringssl/gen/bcm/aesv8-armv8-linux.S +786 -0
  465. package/runtime/third_party/boringssl/gen/bcm/aesv8-armv8-win.S +798 -0
  466. package/runtime/third_party/boringssl/gen/bcm/aesv8-gcm-armv8-apple.S +2912 -0
  467. package/runtime/third_party/boringssl/gen/bcm/aesv8-gcm-armv8-linux.S +2907 -0
  468. package/runtime/third_party/boringssl/gen/bcm/aesv8-gcm-armv8-win.S +2915 -0
  469. package/runtime/third_party/boringssl/gen/bcm/armv4-mont-linux.S +932 -0
  470. package/runtime/third_party/boringssl/gen/bcm/armv8-mont-apple.S +1440 -0
  471. package/runtime/third_party/boringssl/gen/bcm/armv8-mont-linux.S +1440 -0
  472. package/runtime/third_party/boringssl/gen/bcm/armv8-mont-win.S +1446 -0
  473. package/runtime/third_party/boringssl/gen/bcm/bn-586-apple.S +530 -0
  474. package/runtime/third_party/boringssl/gen/bcm/bn-586-linux.S +540 -0
  475. package/runtime/third_party/boringssl/gen/bcm/bn-armv8-apple.S +88 -0
  476. package/runtime/third_party/boringssl/gen/bcm/bn-armv8-linux.S +87 -0
  477. package/runtime/third_party/boringssl/gen/bcm/bn-armv8-win.S +87 -0
  478. package/runtime/third_party/boringssl/gen/bcm/bsaes-armv7-linux.S +1520 -0
  479. package/runtime/third_party/boringssl/gen/bcm/co-586-apple.S +1256 -0
  480. package/runtime/third_party/boringssl/gen/bcm/co-586-linux.S +1264 -0
  481. package/runtime/third_party/boringssl/gen/bcm/ghash-armv4-linux.S +242 -0
  482. package/runtime/third_party/boringssl/gen/bcm/ghash-neon-armv8-apple.S +337 -0
  483. package/runtime/third_party/boringssl/gen/bcm/ghash-neon-armv8-linux.S +335 -0
  484. package/runtime/third_party/boringssl/gen/bcm/ghash-neon-armv8-win.S +341 -0
  485. package/runtime/third_party/boringssl/gen/bcm/ghash-ssse3-x86-apple.S +288 -0
  486. package/runtime/third_party/boringssl/gen/bcm/ghash-ssse3-x86-linux.S +292 -0
  487. package/runtime/third_party/boringssl/gen/bcm/ghash-ssse3-x86_64-apple.S +426 -0
  488. package/runtime/third_party/boringssl/gen/bcm/ghash-ssse3-x86_64-linux.S +425 -0
  489. package/runtime/third_party/boringssl/gen/bcm/ghash-x86-apple.S +322 -0
  490. package/runtime/third_party/boringssl/gen/bcm/ghash-x86-linux.S +328 -0
  491. package/runtime/third_party/boringssl/gen/bcm/ghash-x86_64-apple.S +1134 -0
  492. package/runtime/third_party/boringssl/gen/bcm/ghash-x86_64-linux.S +1129 -0
  493. package/runtime/third_party/boringssl/gen/bcm/ghashv8-armv7-linux.S +244 -0
  494. package/runtime/third_party/boringssl/gen/bcm/ghashv8-armv8-apple.S +567 -0
  495. package/runtime/third_party/boringssl/gen/bcm/ghashv8-armv8-linux.S +563 -0
  496. package/runtime/third_party/boringssl/gen/bcm/ghashv8-armv8-win.S +571 -0
  497. package/runtime/third_party/boringssl/gen/bcm/p256-armv8-asm-apple.S +1744 -0
  498. package/runtime/third_party/boringssl/gen/bcm/p256-armv8-asm-linux.S +1725 -0
  499. package/runtime/third_party/boringssl/gen/bcm/p256-armv8-asm-win.S +1765 -0
  500. package/runtime/third_party/boringssl/gen/bcm/p256-x86_64-asm-apple.S +4544 -0
  501. package/runtime/third_party/boringssl/gen/bcm/p256-x86_64-asm-linux.S +4600 -0
  502. package/runtime/third_party/boringssl/gen/bcm/p256_beeu-armv8-asm-apple.S +310 -0
  503. package/runtime/third_party/boringssl/gen/bcm/p256_beeu-armv8-asm-linux.S +310 -0
  504. package/runtime/third_party/boringssl/gen/bcm/p256_beeu-armv8-asm-win.S +310 -0
  505. package/runtime/third_party/boringssl/gen/bcm/p256_beeu-x86_64-asm-apple.S +321 -0
  506. package/runtime/third_party/boringssl/gen/bcm/p256_beeu-x86_64-asm-linux.S +335 -0
  507. package/runtime/third_party/boringssl/gen/bcm/rdrand-x86_64-apple.S +58 -0
  508. package/runtime/third_party/boringssl/gen/bcm/rdrand-x86_64-linux.S +57 -0
  509. package/runtime/third_party/boringssl/gen/bcm/rsaz-avx2-apple.S +1756 -0
  510. package/runtime/third_party/boringssl/gen/bcm/rsaz-avx2-linux.S +1751 -0
  511. package/runtime/third_party/boringssl/gen/bcm/sha1-586-apple.S +3782 -0
  512. package/runtime/third_party/boringssl/gen/bcm/sha1-586-linux.S +3788 -0
  513. package/runtime/third_party/boringssl/gen/bcm/sha1-armv4-large-linux.S +1479 -0
  514. package/runtime/third_party/boringssl/gen/bcm/sha1-armv8-apple.S +1219 -0
  515. package/runtime/third_party/boringssl/gen/bcm/sha1-armv8-linux.S +1218 -0
  516. package/runtime/third_party/boringssl/gen/bcm/sha1-armv8-win.S +1222 -0
  517. package/runtime/third_party/boringssl/gen/bcm/sha1-x86_64-apple.S +5454 -0
  518. package/runtime/third_party/boringssl/gen/bcm/sha1-x86_64-linux.S +5450 -0
  519. package/runtime/third_party/boringssl/gen/bcm/sha256-586-apple.S +5593 -0
  520. package/runtime/third_party/boringssl/gen/bcm/sha256-586-linux.S +5599 -0
  521. package/runtime/third_party/boringssl/gen/bcm/sha256-armv4-linux.S +2840 -0
  522. package/runtime/third_party/boringssl/gen/bcm/sha256-armv8-apple.S +1195 -0
  523. package/runtime/third_party/boringssl/gen/bcm/sha256-armv8-linux.S +1194 -0
  524. package/runtime/third_party/boringssl/gen/bcm/sha256-armv8-win.S +1198 -0
  525. package/runtime/third_party/boringssl/gen/bcm/sha256-x86_64-apple.S +4173 -0
  526. package/runtime/third_party/boringssl/gen/bcm/sha256-x86_64-linux.S +4170 -0
  527. package/runtime/third_party/boringssl/gen/bcm/sha512-586-apple.S +2406 -0
  528. package/runtime/third_party/boringssl/gen/bcm/sha512-586-linux.S +2410 -0
  529. package/runtime/third_party/boringssl/gen/bcm/sha512-armv4-linux.S +1857 -0
  530. package/runtime/third_party/boringssl/gen/bcm/sha512-armv8-apple.S +1598 -0
  531. package/runtime/third_party/boringssl/gen/bcm/sha512-armv8-linux.S +1597 -0
  532. package/runtime/third_party/boringssl/gen/bcm/sha512-armv8-win.S +1601 -0
  533. package/runtime/third_party/boringssl/gen/bcm/sha512-x86_64-apple.S +2979 -0
  534. package/runtime/third_party/boringssl/gen/bcm/sha512-x86_64-linux.S +2978 -0
  535. package/runtime/third_party/boringssl/gen/bcm/vpaes-armv7-linux.S +1225 -0
  536. package/runtime/third_party/boringssl/gen/bcm/vpaes-armv8-apple.S +1238 -0
  537. package/runtime/third_party/boringssl/gen/bcm/vpaes-armv8-linux.S +1220 -0
  538. package/runtime/third_party/boringssl/gen/bcm/vpaes-armv8-win.S +1256 -0
  539. package/runtime/third_party/boringssl/gen/bcm/vpaes-x86-apple.S +680 -0
  540. package/runtime/third_party/boringssl/gen/bcm/vpaes-x86-linux.S +706 -0
  541. package/runtime/third_party/boringssl/gen/bcm/vpaes-x86_64-apple.S +1146 -0
  542. package/runtime/third_party/boringssl/gen/bcm/vpaes-x86_64-linux.S +1133 -0
  543. package/runtime/third_party/boringssl/gen/bcm/x86-mont-apple.S +216 -0
  544. package/runtime/third_party/boringssl/gen/bcm/x86-mont-linux.S +218 -0
  545. package/runtime/third_party/boringssl/gen/bcm/x86_64-mont-apple.S +1238 -0
  546. package/runtime/third_party/boringssl/gen/bcm/x86_64-mont-linux.S +1237 -0
  547. package/runtime/third_party/boringssl/gen/bcm/x86_64-mont5-apple.S +3644 -0
  548. package/runtime/third_party/boringssl/gen/bcm/x86_64-mont5-linux.S +3628 -0
  549. package/runtime/third_party/boringssl/gen/boringssl_prefix_symbols_internal_x86_64_win_asm.inc +325 -0
  550. package/runtime/third_party/boringssl/gen/boringssl_prefix_symbols_internal_x86_win_asm.inc +325 -0
  551. package/runtime/third_party/boringssl/gen/crypto/aes128gcmsiv-x86_64-apple.S +3113 -0
  552. package/runtime/third_party/boringssl/gen/crypto/aes128gcmsiv-x86_64-linux.S +3091 -0
  553. package/runtime/third_party/boringssl/gen/crypto/chacha-armv4-linux.S +1450 -0
  554. package/runtime/third_party/boringssl/gen/crypto/chacha-armv8-apple.S +1969 -0
  555. package/runtime/third_party/boringssl/gen/crypto/chacha-armv8-linux.S +1967 -0
  556. package/runtime/third_party/boringssl/gen/crypto/chacha-armv8-win.S +1973 -0
  557. package/runtime/third_party/boringssl/gen/crypto/chacha-x86-apple.S +957 -0
  558. package/runtime/third_party/boringssl/gen/crypto/chacha-x86-linux.S +961 -0
  559. package/runtime/third_party/boringssl/gen/crypto/chacha-x86_64-apple.S +1608 -0
  560. package/runtime/third_party/boringssl/gen/crypto/chacha-x86_64-linux.S +1611 -0
  561. package/runtime/third_party/boringssl/gen/crypto/chacha20_poly1305_armv8-apple.S +3010 -0
  562. package/runtime/third_party/boringssl/gen/crypto/chacha20_poly1305_armv8-linux.S +3008 -0
  563. package/runtime/third_party/boringssl/gen/crypto/chacha20_poly1305_armv8-win.S +3014 -0
  564. package/runtime/third_party/boringssl/gen/crypto/chacha20_poly1305_x86_64-apple.S +8903 -0
  565. package/runtime/third_party/boringssl/gen/crypto/chacha20_poly1305_x86_64-linux.S +8940 -0
  566. package/runtime/third_party/boringssl/gen/crypto/err_data.cc +1578 -0
  567. package/runtime/third_party/boringssl/gen/crypto/md5-586-apple.S +684 -0
  568. package/runtime/third_party/boringssl/gen/crypto/md5-586-linux.S +686 -0
  569. package/runtime/third_party/boringssl/gen/crypto/md5-x86_64-apple.S +690 -0
  570. package/runtime/third_party/boringssl/gen/crypto/md5-x86_64-linux.S +695 -0
  571. package/runtime/third_party/boringssl/include/openssl/aead.h +650 -0
  572. package/runtime/third_party/boringssl/include/openssl/aes.h +173 -0
  573. package/runtime/third_party/boringssl/include/openssl/arm_arch.h +24 -0
  574. package/runtime/third_party/boringssl/include/openssl/asm_base.h +219 -0
  575. package/runtime/third_party/boringssl/include/openssl/asn1.h +2002 -0
  576. package/runtime/third_party/boringssl/include/openssl/asn1_mac.h +18 -0
  577. package/runtime/third_party/boringssl/include/openssl/asn1t.h +584 -0
  578. package/runtime/third_party/boringssl/include/openssl/base.h +548 -0
  579. package/runtime/third_party/boringssl/include/openssl/base64.h +156 -0
  580. package/runtime/third_party/boringssl/include/openssl/bio.h +1061 -0
  581. package/runtime/third_party/boringssl/include/openssl/blake2.h +63 -0
  582. package/runtime/third_party/boringssl/include/openssl/blowfish.h +58 -0
  583. package/runtime/third_party/boringssl/include/openssl/bn.h +986 -0
  584. package/runtime/third_party/boringssl/include/openssl/buf.h +95 -0
  585. package/runtime/third_party/boringssl/include/openssl/buffer.h +18 -0
  586. package/runtime/third_party/boringssl/include/openssl/bytestring.h +798 -0
  587. package/runtime/third_party/boringssl/include/openssl/cast.h +91 -0
  588. package/runtime/third_party/boringssl/include/openssl/chacha.h +47 -0
  589. package/runtime/third_party/boringssl/include/openssl/cipher.h +819 -0
  590. package/runtime/third_party/boringssl/include/openssl/cmac.h +91 -0
  591. package/runtime/third_party/boringssl/include/openssl/cms.h +147 -0
  592. package/runtime/third_party/boringssl/include/openssl/conf.h +136 -0
  593. package/runtime/third_party/boringssl/include/openssl/configuration.h +18 -0
  594. package/runtime/third_party/boringssl/include/openssl/cpu.h +18 -0
  595. package/runtime/third_party/boringssl/include/openssl/crypto.h +235 -0
  596. package/runtime/third_party/boringssl/include/openssl/ctrdrbg.h +116 -0
  597. package/runtime/third_party/boringssl/include/openssl/curve25519.h +309 -0
  598. package/runtime/third_party/boringssl/include/openssl/des.h +134 -0
  599. package/runtime/third_party/boringssl/include/openssl/dh.h +336 -0
  600. package/runtime/third_party/boringssl/include/openssl/digest.h +399 -0
  601. package/runtime/third_party/boringssl/include/openssl/dsa.h +392 -0
  602. package/runtime/third_party/boringssl/include/openssl/dtls1.h +16 -0
  603. package/runtime/third_party/boringssl/include/openssl/e_os2.h +18 -0
  604. package/runtime/third_party/boringssl/include/openssl/ec.h +530 -0
  605. package/runtime/third_party/boringssl/include/openssl/ec_key.h +358 -0
  606. package/runtime/third_party/boringssl/include/openssl/ecdh.h +67 -0
  607. package/runtime/third_party/boringssl/include/openssl/ecdsa.h +242 -0
  608. package/runtime/third_party/boringssl/include/openssl/engine.h +109 -0
  609. package/runtime/third_party/boringssl/include/openssl/err.h +416 -0
  610. package/runtime/third_party/boringssl/include/openssl/evp.h +1645 -0
  611. package/runtime/third_party/boringssl/include/openssl/evp_errors.h +66 -0
  612. package/runtime/third_party/boringssl/include/openssl/ex_data.h +117 -0
  613. package/runtime/third_party/boringssl/include/openssl/hkdf.h +68 -0
  614. package/runtime/third_party/boringssl/include/openssl/hmac.h +151 -0
  615. package/runtime/third_party/boringssl/include/openssl/hpke.h +456 -0
  616. package/runtime/third_party/boringssl/include/openssl/hrss.h +108 -0
  617. package/runtime/third_party/boringssl/include/openssl/is_boringssl.h +16 -0
  618. package/runtime/third_party/boringssl/include/openssl/kdf.h +92 -0
  619. package/runtime/third_party/boringssl/include/openssl/lhash.h +18 -0
  620. package/runtime/third_party/boringssl/include/openssl/md4.h +73 -0
  621. package/runtime/third_party/boringssl/include/openssl/md5.h +67 -0
  622. package/runtime/third_party/boringssl/include/openssl/mem.h +215 -0
  623. package/runtime/third_party/boringssl/include/openssl/mldsa.h +486 -0
  624. package/runtime/third_party/boringssl/include/openssl/mlkem.h +222 -0
  625. package/runtime/third_party/boringssl/include/openssl/nid.h +5561 -0
  626. package/runtime/third_party/boringssl/include/openssl/obj.h +225 -0
  627. package/runtime/third_party/boringssl/include/openssl/obj_mac.h +18 -0
  628. package/runtime/third_party/boringssl/include/openssl/objects.h +18 -0
  629. package/runtime/third_party/boringssl/include/openssl/opensslconf.h +108 -0
  630. package/runtime/third_party/boringssl/include/openssl/opensslv.h +18 -0
  631. package/runtime/third_party/boringssl/include/openssl/ossl_typ.h +18 -0
  632. package/runtime/third_party/boringssl/include/openssl/params.h +42 -0
  633. package/runtime/third_party/boringssl/include/openssl/pem.h +769 -0
  634. package/runtime/third_party/boringssl/include/openssl/pkcs12.h +18 -0
  635. package/runtime/third_party/boringssl/include/openssl/pkcs7.h +239 -0
  636. package/runtime/third_party/boringssl/include/openssl/pkcs8.h +267 -0
  637. package/runtime/third_party/boringssl/include/openssl/poly1305.h +52 -0
  638. package/runtime/third_party/boringssl/include/openssl/pool.h +137 -0
  639. package/runtime/third_party/boringssl/include/openssl/posix_time.h +51 -0
  640. package/runtime/third_party/boringssl/include/openssl/prefix_symbols.h +8000 -0
  641. package/runtime/third_party/boringssl/include/openssl/prefix_symbols_internal_S.h +633 -0
  642. package/runtime/third_party/boringssl/include/openssl/prefix_symbols_internal_c.h +329 -0
  643. package/runtime/third_party/boringssl/include/openssl/rand.h +138 -0
  644. package/runtime/third_party/boringssl/include/openssl/rc4.h +54 -0
  645. package/runtime/third_party/boringssl/include/openssl/ripemd.h +71 -0
  646. package/runtime/third_party/boringssl/include/openssl/rsa.h +893 -0
  647. package/runtime/third_party/boringssl/include/openssl/safestack.h +16 -0
  648. package/runtime/third_party/boringssl/include/openssl/service_indicator.h +19 -0
  649. package/runtime/third_party/boringssl/include/openssl/sha.h +108 -0
  650. package/runtime/third_party/boringssl/include/openssl/sha2.h +201 -0
  651. package/runtime/third_party/boringssl/include/openssl/siphash.h +37 -0
  652. package/runtime/third_party/boringssl/include/openssl/slhdsa.h +250 -0
  653. package/runtime/third_party/boringssl/include/openssl/span.h +376 -0
  654. package/runtime/third_party/boringssl/include/openssl/srtp.h +18 -0
  655. package/runtime/third_party/boringssl/include/openssl/ssl.h +7211 -0
  656. package/runtime/third_party/boringssl/include/openssl/ssl3.h +171 -0
  657. package/runtime/third_party/boringssl/include/openssl/stack.h +688 -0
  658. package/runtime/third_party/boringssl/include/openssl/target.h +246 -0
  659. package/runtime/third_party/boringssl/include/openssl/thread.h +114 -0
  660. package/runtime/third_party/boringssl/include/openssl/time.h +22 -0
  661. package/runtime/third_party/boringssl/include/openssl/tls1.h +263 -0
  662. package/runtime/third_party/boringssl/include/openssl/tls_prf.h +47 -0
  663. package/runtime/third_party/boringssl/include/openssl/trust_token.h +349 -0
  664. package/runtime/third_party/boringssl/include/openssl/type_check.h +37 -0
  665. package/runtime/third_party/boringssl/include/openssl/types.h +18 -0
  666. package/runtime/third_party/boringssl/include/openssl/x509.h +5404 -0
  667. package/runtime/third_party/boringssl/include/openssl/x509_vfy.h +18 -0
  668. package/runtime/third_party/boringssl/include/openssl/x509v3.h +63 -0
  669. package/runtime/third_party/boringssl/include/openssl/x509v3_errors.h +84 -0
  670. package/runtime/third_party/boringssl/include/openssl/xwing.h +115 -0
  671. package/runtime/third_party/boringssl/sources.json +696 -0
  672. package/runtime/third_party/boringssl/ssl/bio_ssl.cc +196 -0
  673. package/runtime/third_party/boringssl/ssl/d1_both.cc +1137 -0
  674. package/runtime/third_party/boringssl/ssl/d1_lib.cc +245 -0
  675. package/runtime/third_party/boringssl/ssl/d1_pkt.cc +322 -0
  676. package/runtime/third_party/boringssl/ssl/d1_srtp.cc +128 -0
  677. package/runtime/third_party/boringssl/ssl/dtls_method.cc +216 -0
  678. package/runtime/third_party/boringssl/ssl/dtls_record.cc +586 -0
  679. package/runtime/third_party/boringssl/ssl/encrypted_client_hello.cc +1110 -0
  680. package/runtime/third_party/boringssl/ssl/extensions.cc +5368 -0
  681. package/runtime/third_party/boringssl/ssl/handoff.cc +625 -0
  682. package/runtime/third_party/boringssl/ssl/handshake.cc +694 -0
  683. package/runtime/third_party/boringssl/ssl/handshake_client.cc +1958 -0
  684. package/runtime/third_party/boringssl/ssl/handshake_server.cc +1875 -0
  685. package/runtime/third_party/boringssl/ssl/internal.h +4506 -0
  686. package/runtime/third_party/boringssl/ssl/s3_both.cc +555 -0
  687. package/runtime/third_party/boringssl/ssl/s3_lib.cc +88 -0
  688. package/runtime/third_party/boringssl/ssl/s3_pkt.cc +396 -0
  689. package/runtime/third_party/boringssl/ssl/ssl_aead_ctx.cc +416 -0
  690. package/runtime/third_party/boringssl/ssl/ssl_asn1.cc +851 -0
  691. package/runtime/third_party/boringssl/ssl/ssl_buffer.cc +304 -0
  692. package/runtime/third_party/boringssl/ssl/ssl_cert.cc +723 -0
  693. package/runtime/third_party/boringssl/ssl/ssl_cipher.cc +1762 -0
  694. package/runtime/third_party/boringssl/ssl/ssl_credential.cc +913 -0
  695. package/runtime/third_party/boringssl/ssl/ssl_file.cc +375 -0
  696. package/runtime/third_party/boringssl/ssl/ssl_key_share.cc +445 -0
  697. package/runtime/third_party/boringssl/ssl/ssl_lib.cc +4132 -0
  698. package/runtime/third_party/boringssl/ssl/ssl_privkey.cc +973 -0
  699. package/runtime/third_party/boringssl/ssl/ssl_session.cc +1273 -0
  700. package/runtime/third_party/boringssl/ssl/ssl_stat.cc +162 -0
  701. package/runtime/third_party/boringssl/ssl/ssl_transcript.cc +224 -0
  702. package/runtime/third_party/boringssl/ssl/ssl_versions.cc +436 -0
  703. package/runtime/third_party/boringssl/ssl/ssl_x509.cc +1229 -0
  704. package/runtime/third_party/boringssl/ssl/t1_enc.cc +266 -0
  705. package/runtime/third_party/boringssl/ssl/tls13_both.cc +764 -0
  706. package/runtime/third_party/boringssl/ssl/tls13_client.cc +1325 -0
  707. package/runtime/third_party/boringssl/ssl/tls13_enc.cc +746 -0
  708. package/runtime/third_party/boringssl/ssl/tls13_server.cc +1623 -0
  709. package/runtime/third_party/boringssl/ssl/tls_method.cc +266 -0
  710. package/runtime/third_party/boringssl/ssl/tls_record.cc +524 -0
  711. package/runtime/third_party/boringssl/third_party/fiat/asm/fiat_curve25519_adx_mul.S +178 -0
  712. package/runtime/third_party/boringssl/third_party/fiat/asm/fiat_curve25519_adx_square.S +146 -0
  713. package/runtime/third_party/boringssl/third_party/fiat/asm/fiat_p256_adx_mul.S +177 -0
  714. package/runtime/third_party/boringssl/third_party/fiat/asm/fiat_p256_adx_sqr.S +166 -0
  715. package/runtime/third_party/boringssl/third_party/fiat/bedrock_unverified_bareminimum.c.inc +47 -0
  716. package/runtime/third_party/boringssl/third_party/fiat/bedrock_unverified_platform.c.inc +137 -0
  717. package/runtime/third_party/boringssl/third_party/fiat/curve25519_32.h +1571 -0
  718. package/runtime/third_party/boringssl/third_party/fiat/curve25519_64.h +978 -0
  719. package/runtime/third_party/boringssl/third_party/fiat/curve25519_64_adx.h +700 -0
  720. package/runtime/third_party/boringssl/third_party/fiat/curve25519_64_msvc.h +1281 -0
  721. package/runtime/third_party/boringssl/third_party/fiat/p256_32.h +4760 -0
  722. package/runtime/third_party/boringssl/third_party/fiat/p256_64.h +1984 -0
  723. package/runtime/third_party/boringssl/third_party/fiat/p256_64_msvc.h +1939 -0
  724. package/runtime/third_party/boringssl/third_party/fiat/p256_field.c.inc +26 -0
  725. package/runtime/third_party/boringssl/third_party/fiat/p256_field_32.br.c.inc +71 -0
  726. package/runtime/third_party/boringssl/third_party/fiat/p256_field_64.br.c.inc +84 -0
  727. package/runtime/third_party/boringssl/third_party/fiat/p256_point.br.c.inc +112 -0
  728. package/runtime/third_party/v8-ieee754/README.md +2 -1
  729. package/runtime/third_party/v8-ieee754/convert.py +4 -0
  730. package/runtime/third_party/v8-ieee754/ieee754.c +1 -1
  731. package/runtime/third_party/bearssl/LICENSE.txt +0 -21
  732. package/runtime/third_party/bearssl/README.txt +0 -136
  733. package/runtime/third_party/bearssl/VERSION +0 -1
  734. package/runtime/third_party/bearssl/inc/bearssl.h +0 -183
  735. package/runtime/third_party/bearssl/inc/bearssl_aead.h +0 -1059
  736. package/runtime/third_party/bearssl/inc/bearssl_block.h +0 -2618
  737. package/runtime/third_party/bearssl/inc/bearssl_ec.h +0 -967
  738. package/runtime/third_party/bearssl/inc/bearssl_hash.h +0 -1346
  739. package/runtime/third_party/bearssl/inc/bearssl_hmac.h +0 -241
  740. package/runtime/third_party/bearssl/inc/bearssl_kdf.h +0 -284
  741. package/runtime/third_party/bearssl/inc/bearssl_pem.h +0 -294
  742. package/runtime/third_party/bearssl/inc/bearssl_prf.h +0 -150
  743. package/runtime/third_party/bearssl/inc/bearssl_rand.h +0 -397
  744. package/runtime/third_party/bearssl/inc/bearssl_rsa.h +0 -1655
  745. package/runtime/third_party/bearssl/inc/bearssl_ssl.h +0 -4296
  746. package/runtime/third_party/bearssl/inc/bearssl_x509.h +0 -1474
  747. package/runtime/third_party/bearssl/src/aead/ccm.c +0 -346
  748. package/runtime/third_party/bearssl/src/aead/eax.c +0 -525
  749. package/runtime/third_party/bearssl/src/aead/gcm.c +0 -318
  750. package/runtime/third_party/bearssl/src/codec/ccopy.c +0 -44
  751. package/runtime/third_party/bearssl/src/codec/dec16be.c +0 -38
  752. package/runtime/third_party/bearssl/src/codec/dec16le.c +0 -38
  753. package/runtime/third_party/bearssl/src/codec/dec32be.c +0 -38
  754. package/runtime/third_party/bearssl/src/codec/dec32le.c +0 -38
  755. package/runtime/third_party/bearssl/src/codec/dec64be.c +0 -38
  756. package/runtime/third_party/bearssl/src/codec/dec64le.c +0 -38
  757. package/runtime/third_party/bearssl/src/codec/enc16be.c +0 -38
  758. package/runtime/third_party/bearssl/src/codec/enc16le.c +0 -38
  759. package/runtime/third_party/bearssl/src/codec/enc32be.c +0 -38
  760. package/runtime/third_party/bearssl/src/codec/enc32le.c +0 -38
  761. package/runtime/third_party/bearssl/src/codec/enc64be.c +0 -38
  762. package/runtime/third_party/bearssl/src/codec/enc64le.c +0 -38
  763. package/runtime/third_party/bearssl/src/codec/pemdec.c +0 -526
  764. package/runtime/third_party/bearssl/src/codec/pemdec.t0 +0 -314
  765. package/runtime/third_party/bearssl/src/codec/pemenc.c +0 -173
  766. package/runtime/third_party/bearssl/src/config.h +0 -247
  767. package/runtime/third_party/bearssl/src/ec/ec_all_m15.c +0 -121
  768. package/runtime/third_party/bearssl/src/ec/ec_all_m31.c +0 -171
  769. package/runtime/third_party/bearssl/src/ec/ec_c25519_i15.c +0 -398
  770. package/runtime/third_party/bearssl/src/ec/ec_c25519_i31.c +0 -390
  771. package/runtime/third_party/bearssl/src/ec/ec_c25519_m15.c +0 -1478
  772. package/runtime/third_party/bearssl/src/ec/ec_c25519_m31.c +0 -800
  773. package/runtime/third_party/bearssl/src/ec/ec_c25519_m62.c +0 -605
  774. package/runtime/third_party/bearssl/src/ec/ec_c25519_m64.c +0 -831
  775. package/runtime/third_party/bearssl/src/ec/ec_curve25519.c +0 -46
  776. package/runtime/third_party/bearssl/src/ec/ec_default.c +0 -36
  777. package/runtime/third_party/bearssl/src/ec/ec_keygen.c +0 -86
  778. package/runtime/third_party/bearssl/src/ec/ec_p256_m15.c +0 -2124
  779. package/runtime/third_party/bearssl/src/ec/ec_p256_m31.c +0 -1469
  780. package/runtime/third_party/bearssl/src/ec/ec_p256_m62.c +0 -1765
  781. package/runtime/third_party/bearssl/src/ec/ec_p256_m64.c +0 -1781
  782. package/runtime/third_party/bearssl/src/ec/ec_prime_i15.c +0 -824
  783. package/runtime/third_party/bearssl/src/ec/ec_prime_i31.c +0 -826
  784. package/runtime/third_party/bearssl/src/ec/ec_pubkey.c +0 -85
  785. package/runtime/third_party/bearssl/src/ec/ec_secp256r1.c +0 -51
  786. package/runtime/third_party/bearssl/src/ec/ec_secp384r1.c +0 -57
  787. package/runtime/third_party/bearssl/src/ec/ec_secp521r1.c +0 -64
  788. package/runtime/third_party/bearssl/src/ec/ecdsa_atr.c +0 -134
  789. package/runtime/third_party/bearssl/src/ec/ecdsa_default_sign_asn1.c +0 -36
  790. package/runtime/third_party/bearssl/src/ec/ecdsa_default_sign_raw.c +0 -36
  791. package/runtime/third_party/bearssl/src/ec/ecdsa_default_vrfy_asn1.c +0 -36
  792. package/runtime/third_party/bearssl/src/ec/ecdsa_default_vrfy_raw.c +0 -36
  793. package/runtime/third_party/bearssl/src/ec/ecdsa_i15_bits.c +0 -47
  794. package/runtime/third_party/bearssl/src/ec/ecdsa_i15_sign_asn1.c +0 -45
  795. package/runtime/third_party/bearssl/src/ec/ecdsa_i15_sign_raw.c +0 -174
  796. package/runtime/third_party/bearssl/src/ec/ecdsa_i15_vrfy_asn1.c +0 -48
  797. package/runtime/third_party/bearssl/src/ec/ecdsa_i15_vrfy_raw.c +0 -166
  798. package/runtime/third_party/bearssl/src/ec/ecdsa_i31_bits.c +0 -47
  799. package/runtime/third_party/bearssl/src/ec/ecdsa_i31_sign_asn1.c +0 -45
  800. package/runtime/third_party/bearssl/src/ec/ecdsa_i31_sign_raw.c +0 -173
  801. package/runtime/third_party/bearssl/src/ec/ecdsa_i31_vrfy_asn1.c +0 -48
  802. package/runtime/third_party/bearssl/src/ec/ecdsa_i31_vrfy_raw.c +0 -165
  803. package/runtime/third_party/bearssl/src/ec/ecdsa_rta.c +0 -121
  804. package/runtime/third_party/bearssl/src/hash/dig_oid.c +0 -84
  805. package/runtime/third_party/bearssl/src/hash/dig_size.c +0 -50
  806. package/runtime/third_party/bearssl/src/hash/ghash_ctmul.c +0 -345
  807. package/runtime/third_party/bearssl/src/hash/ghash_ctmul32.c +0 -251
  808. package/runtime/third_party/bearssl/src/hash/ghash_ctmul64.c +0 -154
  809. package/runtime/third_party/bearssl/src/hash/ghash_pclmul.c +0 -389
  810. package/runtime/third_party/bearssl/src/hash/ghash_pwr8.c +0 -411
  811. package/runtime/third_party/bearssl/src/hash/md5.c +0 -208
  812. package/runtime/third_party/bearssl/src/hash/md5sha1.c +0 -141
  813. package/runtime/third_party/bearssl/src/hash/mgf1.c +0 -56
  814. package/runtime/third_party/bearssl/src/hash/multihash.c +0 -166
  815. package/runtime/third_party/bearssl/src/hash/sha1.c +0 -191
  816. package/runtime/third_party/bearssl/src/hash/sha2big.c +0 -285
  817. package/runtime/third_party/bearssl/src/hash/sha2small.c +0 -341
  818. package/runtime/third_party/bearssl/src/inner.h +0 -2577
  819. package/runtime/third_party/bearssl/src/int/i15_add.c +0 -46
  820. package/runtime/third_party/bearssl/src/int/i15_bitlen.c +0 -44
  821. package/runtime/third_party/bearssl/src/int/i15_decmod.c +0 -124
  822. package/runtime/third_party/bearssl/src/int/i15_decode.c +0 -56
  823. package/runtime/third_party/bearssl/src/int/i15_decred.c +0 -100
  824. package/runtime/third_party/bearssl/src/int/i15_encode.c +0 -56
  825. package/runtime/third_party/bearssl/src/int/i15_fmont.c +0 -59
  826. package/runtime/third_party/bearssl/src/int/i15_iszero.c +0 -39
  827. package/runtime/third_party/bearssl/src/int/i15_moddiv.c +0 -465
  828. package/runtime/third_party/bearssl/src/int/i15_modpow.c +0 -50
  829. package/runtime/third_party/bearssl/src/int/i15_modpow2.c +0 -160
  830. package/runtime/third_party/bearssl/src/int/i15_montmul.c +0 -184
  831. package/runtime/third_party/bearssl/src/int/i15_mulacc.c +0 -61
  832. package/runtime/third_party/bearssl/src/int/i15_muladd.c +0 -173
  833. package/runtime/third_party/bearssl/src/int/i15_ninv15.c +0 -38
  834. package/runtime/third_party/bearssl/src/int/i15_reduce.c +0 -66
  835. package/runtime/third_party/bearssl/src/int/i15_rshift.c +0 -47
  836. package/runtime/third_party/bearssl/src/int/i15_sub.c +0 -46
  837. package/runtime/third_party/bearssl/src/int/i15_tmont.c +0 -36
  838. package/runtime/third_party/bearssl/src/int/i31_add.c +0 -46
  839. package/runtime/third_party/bearssl/src/int/i31_bitlen.c +0 -44
  840. package/runtime/third_party/bearssl/src/int/i31_decmod.c +0 -124
  841. package/runtime/third_party/bearssl/src/int/i31_decode.c +0 -57
  842. package/runtime/third_party/bearssl/src/int/i31_decred.c +0 -103
  843. package/runtime/third_party/bearssl/src/int/i31_encode.c +0 -79
  844. package/runtime/third_party/bearssl/src/int/i31_fmont.c +0 -60
  845. package/runtime/third_party/bearssl/src/int/i31_iszero.c +0 -39
  846. package/runtime/third_party/bearssl/src/int/i31_moddiv.c +0 -488
  847. package/runtime/third_party/bearssl/src/int/i31_modpow.c +0 -65
  848. package/runtime/third_party/bearssl/src/int/i31_modpow2.c +0 -160
  849. package/runtime/third_party/bearssl/src/int/i31_montmul.c +0 -127
  850. package/runtime/third_party/bearssl/src/int/i31_mulacc.c +0 -74
  851. package/runtime/third_party/bearssl/src/int/i31_muladd.c +0 -157
  852. package/runtime/third_party/bearssl/src/int/i31_ninv31.c +0 -39
  853. package/runtime/third_party/bearssl/src/int/i31_reduce.c +0 -66
  854. package/runtime/third_party/bearssl/src/int/i31_rshift.c +0 -47
  855. package/runtime/third_party/bearssl/src/int/i31_sub.c +0 -46
  856. package/runtime/third_party/bearssl/src/int/i31_tmont.c +0 -36
  857. package/runtime/third_party/bearssl/src/int/i32_add.c +0 -51
  858. package/runtime/third_party/bearssl/src/int/i32_bitlen.c +0 -44
  859. package/runtime/third_party/bearssl/src/int/i32_decmod.c +0 -77
  860. package/runtime/third_party/bearssl/src/int/i32_decode.c +0 -63
  861. package/runtime/third_party/bearssl/src/int/i32_decred.c +0 -107
  862. package/runtime/third_party/bearssl/src/int/i32_div32.c +0 -56
  863. package/runtime/third_party/bearssl/src/int/i32_encode.c +0 -72
  864. package/runtime/third_party/bearssl/src/int/i32_fmont.c +0 -60
  865. package/runtime/third_party/bearssl/src/int/i32_iszero.c +0 -39
  866. package/runtime/third_party/bearssl/src/int/i32_modpow.c +0 -65
  867. package/runtime/third_party/bearssl/src/int/i32_montmul.c +0 -69
  868. package/runtime/third_party/bearssl/src/int/i32_mulacc.c +0 -56
  869. package/runtime/third_party/bearssl/src/int/i32_muladd.c +0 -138
  870. package/runtime/third_party/bearssl/src/int/i32_ninv32.c +0 -39
  871. package/runtime/third_party/bearssl/src/int/i32_reduce.c +0 -66
  872. package/runtime/third_party/bearssl/src/int/i32_sub.c +0 -51
  873. package/runtime/third_party/bearssl/src/int/i32_tmont.c +0 -36
  874. package/runtime/third_party/bearssl/src/int/i62_modpow2.c +0 -493
  875. package/runtime/third_party/bearssl/src/kdf/hkdf.c +0 -107
  876. package/runtime/third_party/bearssl/src/kdf/shake.c +0 -590
  877. package/runtime/third_party/bearssl/src/mac/hmac.c +0 -122
  878. package/runtime/third_party/bearssl/src/mac/hmac_ct.c +0 -193
  879. package/runtime/third_party/bearssl/src/rand/aesctr_drbg.c +0 -206
  880. package/runtime/third_party/bearssl/src/rand/hmac_drbg.c +0 -157
  881. package/runtime/third_party/bearssl/src/rand/sysrng.c +0 -252
  882. package/runtime/third_party/bearssl/src/rsa/rsa_default_keygen.c +0 -38
  883. package/runtime/third_party/bearssl/src/rsa/rsa_default_modulus.c +0 -36
  884. package/runtime/third_party/bearssl/src/rsa/rsa_default_oaep_decrypt.c +0 -38
  885. package/runtime/third_party/bearssl/src/rsa/rsa_default_oaep_encrypt.c +0 -38
  886. package/runtime/third_party/bearssl/src/rsa/rsa_default_pkcs1_sign.c +0 -38
  887. package/runtime/third_party/bearssl/src/rsa/rsa_default_pkcs1_vrfy.c +0 -38
  888. package/runtime/third_party/bearssl/src/rsa/rsa_default_priv.c +0 -38
  889. package/runtime/third_party/bearssl/src/rsa/rsa_default_privexp.c +0 -36
  890. package/runtime/third_party/bearssl/src/rsa/rsa_default_pss_sign.c +0 -38
  891. package/runtime/third_party/bearssl/src/rsa/rsa_default_pss_vrfy.c +0 -38
  892. package/runtime/third_party/bearssl/src/rsa/rsa_default_pub.c +0 -38
  893. package/runtime/third_party/bearssl/src/rsa/rsa_default_pubexp.c +0 -36
  894. package/runtime/third_party/bearssl/src/rsa/rsa_i15_keygen.c +0 -583
  895. package/runtime/third_party/bearssl/src/rsa/rsa_i15_modulus.c +0 -99
  896. package/runtime/third_party/bearssl/src/rsa/rsa_i15_oaep_decrypt.c +0 -41
  897. package/runtime/third_party/bearssl/src/rsa/rsa_i15_oaep_encrypt.c +0 -44
  898. package/runtime/third_party/bearssl/src/rsa/rsa_i15_pkcs1_sign.c +0 -37
  899. package/runtime/third_party/bearssl/src/rsa/rsa_i15_pkcs1_vrfy.c +0 -43
  900. package/runtime/third_party/bearssl/src/rsa/rsa_i15_priv.c +0 -209
  901. package/runtime/third_party/bearssl/src/rsa/rsa_i15_privexp.c +0 -320
  902. package/runtime/third_party/bearssl/src/rsa/rsa_i15_pss_sign.c +0 -40
  903. package/runtime/third_party/bearssl/src/rsa/rsa_i15_pss_vrfy.c +0 -44
  904. package/runtime/third_party/bearssl/src/rsa/rsa_i15_pub.c +0 -113
  905. package/runtime/third_party/bearssl/src/rsa/rsa_i15_pubexp.c +0 -152
  906. package/runtime/third_party/bearssl/src/rsa/rsa_i31_keygen.c +0 -37
  907. package/runtime/third_party/bearssl/src/rsa/rsa_i31_keygen_inner.c +0 -608
  908. package/runtime/third_party/bearssl/src/rsa/rsa_i31_modulus.c +0 -99
  909. package/runtime/third_party/bearssl/src/rsa/rsa_i31_oaep_decrypt.c +0 -41
  910. package/runtime/third_party/bearssl/src/rsa/rsa_i31_oaep_encrypt.c +0 -44
  911. package/runtime/third_party/bearssl/src/rsa/rsa_i31_pkcs1_sign.c +0 -37
  912. package/runtime/third_party/bearssl/src/rsa/rsa_i31_pkcs1_vrfy.c +0 -43
  913. package/runtime/third_party/bearssl/src/rsa/rsa_i31_priv.c +0 -203
  914. package/runtime/third_party/bearssl/src/rsa/rsa_i31_privexp.c +0 -318
  915. package/runtime/third_party/bearssl/src/rsa/rsa_i31_pss_sign.c +0 -40
  916. package/runtime/third_party/bearssl/src/rsa/rsa_i31_pss_vrfy.c +0 -44
  917. package/runtime/third_party/bearssl/src/rsa/rsa_i31_pub.c +0 -106
  918. package/runtime/third_party/bearssl/src/rsa/rsa_i31_pubexp.c +0 -152
  919. package/runtime/third_party/bearssl/src/rsa/rsa_i32_oaep_decrypt.c +0 -41
  920. package/runtime/third_party/bearssl/src/rsa/rsa_i32_oaep_encrypt.c +0 -44
  921. package/runtime/third_party/bearssl/src/rsa/rsa_i32_pkcs1_sign.c +0 -37
  922. package/runtime/third_party/bearssl/src/rsa/rsa_i32_pkcs1_vrfy.c +0 -43
  923. package/runtime/third_party/bearssl/src/rsa/rsa_i32_priv.c +0 -160
  924. package/runtime/third_party/bearssl/src/rsa/rsa_i32_pss_sign.c +0 -40
  925. package/runtime/third_party/bearssl/src/rsa/rsa_i32_pss_vrfy.c +0 -44
  926. package/runtime/third_party/bearssl/src/rsa/rsa_i32_pub.c +0 -77
  927. package/runtime/third_party/bearssl/src/rsa/rsa_i62_keygen.c +0 -57
  928. package/runtime/third_party/bearssl/src/rsa/rsa_i62_oaep_decrypt.c +0 -61
  929. package/runtime/third_party/bearssl/src/rsa/rsa_i62_oaep_encrypt.c +0 -64
  930. package/runtime/third_party/bearssl/src/rsa/rsa_i62_pkcs1_sign.c +0 -57
  931. package/runtime/third_party/bearssl/src/rsa/rsa_i62_pkcs1_vrfy.c +0 -63
  932. package/runtime/third_party/bearssl/src/rsa/rsa_i62_priv.c +0 -223
  933. package/runtime/third_party/bearssl/src/rsa/rsa_i62_pss_sign.c +0 -60
  934. package/runtime/third_party/bearssl/src/rsa/rsa_i62_pss_vrfy.c +0 -64
  935. package/runtime/third_party/bearssl/src/rsa/rsa_i62_pub.c +0 -125
  936. package/runtime/third_party/bearssl/src/rsa/rsa_oaep_pad.c +0 -112
  937. package/runtime/third_party/bearssl/src/rsa/rsa_oaep_unpad.c +0 -145
  938. package/runtime/third_party/bearssl/src/rsa/rsa_pkcs1_sig_pad.c +0 -100
  939. package/runtime/third_party/bearssl/src/rsa/rsa_pkcs1_sig_unpad.c +0 -121
  940. package/runtime/third_party/bearssl/src/rsa/rsa_pss_sig_pad.c +0 -106
  941. package/runtime/third_party/bearssl/src/rsa/rsa_pss_sig_unpad.c +0 -121
  942. package/runtime/third_party/bearssl/src/rsa/rsa_ssl_decrypt.c +0 -52
  943. package/runtime/third_party/bearssl/src/settings.c +0 -306
  944. package/runtime/third_party/bearssl/src/symcipher/aes_big_cbcdec.c +0 -69
  945. package/runtime/third_party/bearssl/src/symcipher/aes_big_cbcenc.c +0 -67
  946. package/runtime/third_party/bearssl/src/symcipher/aes_big_ctr.c +0 -84
  947. package/runtime/third_party/bearssl/src/symcipher/aes_big_ctrcbc.c +0 -142
  948. package/runtime/third_party/bearssl/src/symcipher/aes_big_dec.c +0 -254
  949. package/runtime/third_party/bearssl/src/symcipher/aes_big_enc.c +0 -157
  950. package/runtime/third_party/bearssl/src/symcipher/aes_common.c +0 -112
  951. package/runtime/third_party/bearssl/src/symcipher/aes_ct.c +0 -328
  952. package/runtime/third_party/bearssl/src/symcipher/aes_ct64.c +0 -398
  953. package/runtime/third_party/bearssl/src/symcipher/aes_ct64_cbcdec.c +0 -104
  954. package/runtime/third_party/bearssl/src/symcipher/aes_ct64_cbcenc.c +0 -81
  955. package/runtime/third_party/bearssl/src/symcipher/aes_ct64_ctr.c +0 -114
  956. package/runtime/third_party/bearssl/src/symcipher/aes_ct64_ctrcbc.c +0 -433
  957. package/runtime/third_party/bearssl/src/symcipher/aes_ct64_dec.c +0 -159
  958. package/runtime/third_party/bearssl/src/symcipher/aes_ct64_enc.c +0 -115
  959. package/runtime/third_party/bearssl/src/symcipher/aes_ct_cbcdec.c +0 -111
  960. package/runtime/third_party/bearssl/src/symcipher/aes_ct_cbcenc.c +0 -91
  961. package/runtime/third_party/bearssl/src/symcipher/aes_ct_ctr.c +0 -116
  962. package/runtime/third_party/bearssl/src/symcipher/aes_ct_ctrcbc.c +0 -422
  963. package/runtime/third_party/bearssl/src/symcipher/aes_ct_dec.c +0 -170
  964. package/runtime/third_party/bearssl/src/symcipher/aes_ct_enc.c +0 -112
  965. package/runtime/third_party/bearssl/src/symcipher/aes_pwr8.c +0 -445
  966. package/runtime/third_party/bearssl/src/symcipher/aes_pwr8_cbcdec.c +0 -670
  967. package/runtime/third_party/bearssl/src/symcipher/aes_pwr8_cbcenc.c +0 -417
  968. package/runtime/third_party/bearssl/src/symcipher/aes_pwr8_ctr.c +0 -717
  969. package/runtime/third_party/bearssl/src/symcipher/aes_pwr8_ctrcbc.c +0 -946
  970. package/runtime/third_party/bearssl/src/symcipher/aes_small_cbcdec.c +0 -69
  971. package/runtime/third_party/bearssl/src/symcipher/aes_small_cbcenc.c +0 -67
  972. package/runtime/third_party/bearssl/src/symcipher/aes_small_ctr.c +0 -84
  973. package/runtime/third_party/bearssl/src/symcipher/aes_small_ctrcbc.c +0 -142
  974. package/runtime/third_party/bearssl/src/symcipher/aes_small_dec.c +0 -176
  975. package/runtime/third_party/bearssl/src/symcipher/aes_small_enc.c +0 -129
  976. package/runtime/third_party/bearssl/src/symcipher/aes_x86ni.c +0 -240
  977. package/runtime/third_party/bearssl/src/symcipher/aes_x86ni_cbcdec.c +0 -223
  978. package/runtime/third_party/bearssl/src/symcipher/aes_x86ni_cbcenc.c +0 -122
  979. package/runtime/third_party/bearssl/src/symcipher/aes_x86ni_ctr.c +0 -211
  980. package/runtime/third_party/bearssl/src/symcipher/aes_x86ni_ctrcbc.c +0 -596
  981. package/runtime/third_party/bearssl/src/symcipher/chacha20_ct.c +0 -106
  982. package/runtime/third_party/bearssl/src/symcipher/chacha20_sse2.c +0 -237
  983. package/runtime/third_party/bearssl/src/symcipher/des_ct.c +0 -411
  984. package/runtime/third_party/bearssl/src/symcipher/des_ct_cbcdec.c +0 -87
  985. package/runtime/third_party/bearssl/src/symcipher/des_ct_cbcenc.c +0 -69
  986. package/runtime/third_party/bearssl/src/symcipher/des_support.c +0 -166
  987. package/runtime/third_party/bearssl/src/symcipher/des_tab.c +0 -310
  988. package/runtime/third_party/bearssl/src/symcipher/des_tab_cbcdec.c +0 -85
  989. package/runtime/third_party/bearssl/src/symcipher/des_tab_cbcenc.c +0 -67
  990. package/runtime/third_party/bearssl/src/symcipher/poly1305_ctmul.c +0 -260
  991. package/runtime/third_party/bearssl/src/symcipher/poly1305_ctmul32.c +0 -297
  992. package/runtime/third_party/bearssl/src/symcipher/poly1305_ctmulq.c +0 -475
  993. package/runtime/third_party/bearssl/src/symcipher/poly1305_i15.c +0 -221
  994. package/runtime/third_party/bearssl/src/x509/asn1.t0 +0 -757
  995. package/runtime/third_party/bearssl/src/x509/asn1enc.c +0 -93
  996. package/runtime/third_party/bearssl/src/x509/encode_ec_pk8der.c +0 -110
  997. package/runtime/third_party/bearssl/src/x509/encode_ec_rawder.c +0 -161
  998. package/runtime/third_party/bearssl/src/x509/encode_rsa_pk8der.c +0 -97
  999. package/runtime/third_party/bearssl/src/x509/encode_rsa_rawder.c +0 -96
  1000. package/runtime/third_party/bearssl/src/x509/skey_decoder.c +0 -653
  1001. package/runtime/third_party/bearssl/src/x509/skey_decoder.t0 +0 -376
  1002. package/runtime/third_party/bearssl/src/x509/x509_decoder.c +0 -776
  1003. package/runtime/third_party/bearssl/src/x509/x509_decoder.t0 +0 -324
  1004. package/runtime/third_party/bearssl/src/x509/x509_knownkey.c +0 -105
  1005. package/runtime/third_party/bearssl/src/x509/x509_minimal.c +0 -1722
  1006. package/runtime/third_party/bearssl/src/x509/x509_minimal.t0 +0 -1526
  1007. package/runtime/third_party/bearssl/src/x509/x509_minimal_full.c +0 -59
@@ -0,0 +1,3010 @@
1
+ // This file is generated from a similarly-named Perl script in the BoringSSL
2
+ // source tree. Do not edit by hand.
3
+
4
+ #include <openssl/asm_base.h>
5
+
6
+ #if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_AARCH64) && defined(__APPLE__)
7
+ .section __TEXT,__const
8
+
9
+ .align 7
10
+ chacha20_poly1305_constants:
11
+ Lchacha20_consts:
12
+ .byte 'e','x','p','a','n','d',' ','3','2','-','b','y','t','e',' ','k'
13
+ Linc:
14
+ .long 1,2,3,4
15
+ Lrol8:
16
+ .byte 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14
17
+ Lclamp:
18
+ .quad 0x0FFFFFFC0FFFFFFF, 0x0FFFFFFC0FFFFFFC
19
+
20
+ .text
21
+
22
+
23
+ .align 6
24
+ chacha20_poly1305_helpers:
25
+ Lpoly_hash_ad_internal:
26
+ .cfi_startproc
27
+ cbnz x4, Lpoly_hash_intro
28
+ ret
29
+
30
+ Lpoly_hash_intro:
31
+ cmp x4, #16
32
+ b.lt Lpoly_hash_ad_tail
33
+ ldp x11, x12, [x3], 16
34
+ adds x8, x8, x11
35
+ adcs x9, x9, x12
36
+ adc x10, x10, x15
37
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
38
+ umulh x12, x8, x16
39
+ mul x13, x9, x16
40
+ umulh x14, x9, x16
41
+ adds x12, x12, x13
42
+ mul x13, x10, x16
43
+ adc x13, x13, x14
44
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
45
+ umulh x8, x8, x17
46
+ adds x12, x12, x14
47
+ mul x14, x9, x17
48
+ umulh x9, x9, x17
49
+ adcs x14, x14, x8
50
+ mul x10, x10, x17
51
+ adc x10, x10, x9
52
+ adds x13, x13, x14
53
+ adc x14, x10, xzr
54
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
55
+ and x8, x13, #-4
56
+ extr x13, x14, x13, #2
57
+ adds x8, x8, x11
58
+ lsr x11, x14, #2
59
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
60
+ adds x8, x8, x13
61
+ adcs x9, x9, x12
62
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
63
+ sub x4, x4, #16
64
+ b Lpoly_hash_ad_internal
65
+
66
+ Lpoly_hash_ad_tail:
67
+ cbz x4, Lpoly_hash_ad_ret
68
+
69
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the AAD
70
+ sub x4, x4, #1
71
+
72
+ Lpoly_hash_tail_16_compose:
73
+ ext v20.16b, v20.16b, v20.16b, #15
74
+ ldrb w11, [x3, x4]
75
+ mov v20.b[0], w11
76
+ subs x4, x4, #1
77
+ b.ge Lpoly_hash_tail_16_compose
78
+ mov x11, v20.d[0]
79
+ mov x12, v20.d[1]
80
+ adds x8, x8, x11
81
+ adcs x9, x9, x12
82
+ adc x10, x10, x15
83
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
84
+ umulh x12, x8, x16
85
+ mul x13, x9, x16
86
+ umulh x14, x9, x16
87
+ adds x12, x12, x13
88
+ mul x13, x10, x16
89
+ adc x13, x13, x14
90
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
91
+ umulh x8, x8, x17
92
+ adds x12, x12, x14
93
+ mul x14, x9, x17
94
+ umulh x9, x9, x17
95
+ adcs x14, x14, x8
96
+ mul x10, x10, x17
97
+ adc x10, x10, x9
98
+ adds x13, x13, x14
99
+ adc x14, x10, xzr
100
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
101
+ and x8, x13, #-4
102
+ extr x13, x14, x13, #2
103
+ adds x8, x8, x11
104
+ lsr x11, x14, #2
105
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
106
+ adds x8, x8, x13
107
+ adcs x9, x9, x12
108
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
109
+
110
+ Lpoly_hash_ad_ret:
111
+ ret
112
+ .cfi_endproc
113
+
114
+
115
+ /////////////////////////////////
116
+ //
117
+ // void chacha20_poly1305_seal(uint8_t *pt, uint8_t *ct, size_t len_in, uint8_t *ad, size_t len_ad, union open_data *seal_data);
118
+ //
119
+ .globl _chacha20_poly1305_seal
120
+ .private_extern _chacha20_poly1305_seal
121
+
122
+ .align 6
123
+ .alt_entry _chacha20_poly1305_seal
124
+ _chacha20_poly1305_seal:
125
+ AARCH64_SIGN_LINK_REGISTER
126
+ .cfi_startproc
127
+ stp x29, x30, [sp, #-80]!
128
+ .cfi_def_cfa_offset 80
129
+ .cfi_offset w30, -72
130
+ .cfi_offset w29, -80
131
+ mov x29, sp
132
+ // We probably could do .cfi_def_cfa w29, 80 at this point, but since
133
+ // we don't actually use the frame pointer like that, it's probably not
134
+ // worth bothering.
135
+ stp d8, d9, [sp, #16]
136
+ stp d10, d11, [sp, #32]
137
+ stp d12, d13, [sp, #48]
138
+ stp d14, d15, [sp, #64]
139
+ .cfi_offset b15, -8
140
+ .cfi_offset b14, -16
141
+ .cfi_offset b13, -24
142
+ .cfi_offset b12, -32
143
+ .cfi_offset b11, -40
144
+ .cfi_offset b10, -48
145
+ .cfi_offset b9, -56
146
+ .cfi_offset b8, -64
147
+
148
+ adrp x11, Lchacha20_consts@PAGE
149
+ add x11, x11, Lchacha20_consts@PAGEOFF
150
+
151
+ ld1 {v24.16b - v27.16b}, [x11] // Load the CONSTS, INC, ROL8 and CLAMP values
152
+ ld1 {v28.16b - v30.16b}, [x5]
153
+
154
+ mov x15, #1 // Prepare the Poly1305 state
155
+ mov x8, #0
156
+ mov x9, #0
157
+ mov x10, #0
158
+
159
+ ldr x12, [x5, #56] // The total cipher text length includes extra_in_len
160
+ add x12, x12, x2
161
+ mov v31.d[0], x4 // Store the input and aad lengths
162
+ mov v31.d[1], x12
163
+
164
+ cmp x2, #128
165
+ b.le Lseal_128 // Optimization for smaller buffers
166
+
167
+ // Initially we prepare 5 ChaCha20 blocks. Four to encrypt up to 4 blocks (256 bytes) of plaintext,
168
+ // and one for the Poly1305 R and S keys. The first four blocks (A0-A3..D0-D3) are computed vertically,
169
+ // the fifth block (A4-D4) horizontally.
170
+ ld4r {v0.4s,v1.4s,v2.4s,v3.4s}, [x11]
171
+ mov v4.16b, v24.16b
172
+
173
+ ld4r {v5.4s,v6.4s,v7.4s,v8.4s}, [x5], #16
174
+ mov v9.16b, v28.16b
175
+
176
+ ld4r {v10.4s,v11.4s,v12.4s,v13.4s}, [x5], #16
177
+ mov v14.16b, v29.16b
178
+
179
+ ld4r {v15.4s,v16.4s,v17.4s,v18.4s}, [x5]
180
+ add v15.4s, v15.4s, v25.4s
181
+ mov v19.16b, v30.16b
182
+
183
+ sub x5, x5, #32
184
+
185
+ mov x6, #10
186
+
187
+ .align 5
188
+ Lseal_init_rounds:
189
+ add v0.4s, v0.4s, v5.4s
190
+ add v1.4s, v1.4s, v6.4s
191
+ add v2.4s, v2.4s, v7.4s
192
+ add v3.4s, v3.4s, v8.4s
193
+ add v4.4s, v4.4s, v9.4s
194
+
195
+ eor v15.16b, v15.16b, v0.16b
196
+ eor v16.16b, v16.16b, v1.16b
197
+ eor v17.16b, v17.16b, v2.16b
198
+ eor v18.16b, v18.16b, v3.16b
199
+ eor v19.16b, v19.16b, v4.16b
200
+
201
+ rev32 v15.8h, v15.8h
202
+ rev32 v16.8h, v16.8h
203
+ rev32 v17.8h, v17.8h
204
+ rev32 v18.8h, v18.8h
205
+ rev32 v19.8h, v19.8h
206
+
207
+ add v10.4s, v10.4s, v15.4s
208
+ add v11.4s, v11.4s, v16.4s
209
+ add v12.4s, v12.4s, v17.4s
210
+ add v13.4s, v13.4s, v18.4s
211
+ add v14.4s, v14.4s, v19.4s
212
+
213
+ eor v5.16b, v5.16b, v10.16b
214
+ eor v6.16b, v6.16b, v11.16b
215
+ eor v7.16b, v7.16b, v12.16b
216
+ eor v8.16b, v8.16b, v13.16b
217
+ eor v9.16b, v9.16b, v14.16b
218
+
219
+ ushr v20.4s, v5.4s, #20
220
+ sli v20.4s, v5.4s, #12
221
+ ushr v5.4s, v6.4s, #20
222
+ sli v5.4s, v6.4s, #12
223
+ ushr v6.4s, v7.4s, #20
224
+ sli v6.4s, v7.4s, #12
225
+ ushr v7.4s, v8.4s, #20
226
+ sli v7.4s, v8.4s, #12
227
+ ushr v8.4s, v9.4s, #20
228
+ sli v8.4s, v9.4s, #12
229
+
230
+ add v0.4s, v0.4s, v20.4s
231
+ add v1.4s, v1.4s, v5.4s
232
+ add v2.4s, v2.4s, v6.4s
233
+ add v3.4s, v3.4s, v7.4s
234
+ add v4.4s, v4.4s, v8.4s
235
+
236
+ eor v15.16b, v15.16b, v0.16b
237
+ eor v16.16b, v16.16b, v1.16b
238
+ eor v17.16b, v17.16b, v2.16b
239
+ eor v18.16b, v18.16b, v3.16b
240
+ eor v19.16b, v19.16b, v4.16b
241
+
242
+ tbl v15.16b, {v15.16b}, v26.16b
243
+ tbl v16.16b, {v16.16b}, v26.16b
244
+ tbl v17.16b, {v17.16b}, v26.16b
245
+ tbl v18.16b, {v18.16b}, v26.16b
246
+ tbl v19.16b, {v19.16b}, v26.16b
247
+
248
+ add v10.4s, v10.4s, v15.4s
249
+ add v11.4s, v11.4s, v16.4s
250
+ add v12.4s, v12.4s, v17.4s
251
+ add v13.4s, v13.4s, v18.4s
252
+ add v14.4s, v14.4s, v19.4s
253
+
254
+ eor v20.16b, v20.16b, v10.16b
255
+ eor v5.16b, v5.16b, v11.16b
256
+ eor v6.16b, v6.16b, v12.16b
257
+ eor v7.16b, v7.16b, v13.16b
258
+ eor v8.16b, v8.16b, v14.16b
259
+
260
+ ushr v9.4s, v8.4s, #25
261
+ sli v9.4s, v8.4s, #7
262
+ ushr v8.4s, v7.4s, #25
263
+ sli v8.4s, v7.4s, #7
264
+ ushr v7.4s, v6.4s, #25
265
+ sli v7.4s, v6.4s, #7
266
+ ushr v6.4s, v5.4s, #25
267
+ sli v6.4s, v5.4s, #7
268
+ ushr v5.4s, v20.4s, #25
269
+ sli v5.4s, v20.4s, #7
270
+
271
+ ext v9.16b, v9.16b, v9.16b, #4
272
+ ext v14.16b, v14.16b, v14.16b, #8
273
+ ext v19.16b, v19.16b, v19.16b, #12
274
+ add v0.4s, v0.4s, v6.4s
275
+ add v1.4s, v1.4s, v7.4s
276
+ add v2.4s, v2.4s, v8.4s
277
+ add v3.4s, v3.4s, v5.4s
278
+ add v4.4s, v4.4s, v9.4s
279
+
280
+ eor v18.16b, v18.16b, v0.16b
281
+ eor v15.16b, v15.16b, v1.16b
282
+ eor v16.16b, v16.16b, v2.16b
283
+ eor v17.16b, v17.16b, v3.16b
284
+ eor v19.16b, v19.16b, v4.16b
285
+
286
+ rev32 v18.8h, v18.8h
287
+ rev32 v15.8h, v15.8h
288
+ rev32 v16.8h, v16.8h
289
+ rev32 v17.8h, v17.8h
290
+ rev32 v19.8h, v19.8h
291
+
292
+ add v12.4s, v12.4s, v18.4s
293
+ add v13.4s, v13.4s, v15.4s
294
+ add v10.4s, v10.4s, v16.4s
295
+ add v11.4s, v11.4s, v17.4s
296
+ add v14.4s, v14.4s, v19.4s
297
+
298
+ eor v6.16b, v6.16b, v12.16b
299
+ eor v7.16b, v7.16b, v13.16b
300
+ eor v8.16b, v8.16b, v10.16b
301
+ eor v5.16b, v5.16b, v11.16b
302
+ eor v9.16b, v9.16b, v14.16b
303
+
304
+ ushr v20.4s, v6.4s, #20
305
+ sli v20.4s, v6.4s, #12
306
+ ushr v6.4s, v7.4s, #20
307
+ sli v6.4s, v7.4s, #12
308
+ ushr v7.4s, v8.4s, #20
309
+ sli v7.4s, v8.4s, #12
310
+ ushr v8.4s, v5.4s, #20
311
+ sli v8.4s, v5.4s, #12
312
+ ushr v5.4s, v9.4s, #20
313
+ sli v5.4s, v9.4s, #12
314
+
315
+ add v0.4s, v0.4s, v20.4s
316
+ add v1.4s, v1.4s, v6.4s
317
+ add v2.4s, v2.4s, v7.4s
318
+ add v3.4s, v3.4s, v8.4s
319
+ add v4.4s, v4.4s, v5.4s
320
+
321
+ eor v18.16b, v18.16b, v0.16b
322
+ eor v15.16b, v15.16b, v1.16b
323
+ eor v16.16b, v16.16b, v2.16b
324
+ eor v17.16b, v17.16b, v3.16b
325
+ eor v19.16b, v19.16b, v4.16b
326
+
327
+ tbl v18.16b, {v18.16b}, v26.16b
328
+ tbl v15.16b, {v15.16b}, v26.16b
329
+ tbl v16.16b, {v16.16b}, v26.16b
330
+ tbl v17.16b, {v17.16b}, v26.16b
331
+ tbl v19.16b, {v19.16b}, v26.16b
332
+
333
+ add v12.4s, v12.4s, v18.4s
334
+ add v13.4s, v13.4s, v15.4s
335
+ add v10.4s, v10.4s, v16.4s
336
+ add v11.4s, v11.4s, v17.4s
337
+ add v14.4s, v14.4s, v19.4s
338
+
339
+ eor v20.16b, v20.16b, v12.16b
340
+ eor v6.16b, v6.16b, v13.16b
341
+ eor v7.16b, v7.16b, v10.16b
342
+ eor v8.16b, v8.16b, v11.16b
343
+ eor v5.16b, v5.16b, v14.16b
344
+
345
+ ushr v9.4s, v5.4s, #25
346
+ sli v9.4s, v5.4s, #7
347
+ ushr v5.4s, v8.4s, #25
348
+ sli v5.4s, v8.4s, #7
349
+ ushr v8.4s, v7.4s, #25
350
+ sli v8.4s, v7.4s, #7
351
+ ushr v7.4s, v6.4s, #25
352
+ sli v7.4s, v6.4s, #7
353
+ ushr v6.4s, v20.4s, #25
354
+ sli v6.4s, v20.4s, #7
355
+
356
+ ext v9.16b, v9.16b, v9.16b, #12
357
+ ext v14.16b, v14.16b, v14.16b, #8
358
+ ext v19.16b, v19.16b, v19.16b, #4
359
+ subs x6, x6, #1
360
+ b.hi Lseal_init_rounds
361
+
362
+ add v15.4s, v15.4s, v25.4s
363
+ mov x11, #4
364
+ dup v20.4s, w11
365
+ add v25.4s, v25.4s, v20.4s
366
+
367
+ zip1 v20.4s, v0.4s, v1.4s
368
+ zip2 v21.4s, v0.4s, v1.4s
369
+ zip1 v22.4s, v2.4s, v3.4s
370
+ zip2 v23.4s, v2.4s, v3.4s
371
+
372
+ zip1 v0.2d, v20.2d, v22.2d
373
+ zip2 v1.2d, v20.2d, v22.2d
374
+ zip1 v2.2d, v21.2d, v23.2d
375
+ zip2 v3.2d, v21.2d, v23.2d
376
+
377
+ zip1 v20.4s, v5.4s, v6.4s
378
+ zip2 v21.4s, v5.4s, v6.4s
379
+ zip1 v22.4s, v7.4s, v8.4s
380
+ zip2 v23.4s, v7.4s, v8.4s
381
+
382
+ zip1 v5.2d, v20.2d, v22.2d
383
+ zip2 v6.2d, v20.2d, v22.2d
384
+ zip1 v7.2d, v21.2d, v23.2d
385
+ zip2 v8.2d, v21.2d, v23.2d
386
+
387
+ zip1 v20.4s, v10.4s, v11.4s
388
+ zip2 v21.4s, v10.4s, v11.4s
389
+ zip1 v22.4s, v12.4s, v13.4s
390
+ zip2 v23.4s, v12.4s, v13.4s
391
+
392
+ zip1 v10.2d, v20.2d, v22.2d
393
+ zip2 v11.2d, v20.2d, v22.2d
394
+ zip1 v12.2d, v21.2d, v23.2d
395
+ zip2 v13.2d, v21.2d, v23.2d
396
+
397
+ zip1 v20.4s, v15.4s, v16.4s
398
+ zip2 v21.4s, v15.4s, v16.4s
399
+ zip1 v22.4s, v17.4s, v18.4s
400
+ zip2 v23.4s, v17.4s, v18.4s
401
+
402
+ zip1 v15.2d, v20.2d, v22.2d
403
+ zip2 v16.2d, v20.2d, v22.2d
404
+ zip1 v17.2d, v21.2d, v23.2d
405
+ zip2 v18.2d, v21.2d, v23.2d
406
+
407
+ add v4.4s, v4.4s, v24.4s
408
+ add v9.4s, v9.4s, v28.4s
409
+ and v4.16b, v4.16b, v27.16b
410
+
411
+ add v0.4s, v0.4s, v24.4s
412
+ add v5.4s, v5.4s, v28.4s
413
+ add v10.4s, v10.4s, v29.4s
414
+ add v15.4s, v15.4s, v30.4s
415
+
416
+ add v1.4s, v1.4s, v24.4s
417
+ add v6.4s, v6.4s, v28.4s
418
+ add v11.4s, v11.4s, v29.4s
419
+ add v16.4s, v16.4s, v30.4s
420
+
421
+ add v2.4s, v2.4s, v24.4s
422
+ add v7.4s, v7.4s, v28.4s
423
+ add v12.4s, v12.4s, v29.4s
424
+ add v17.4s, v17.4s, v30.4s
425
+
426
+ add v3.4s, v3.4s, v24.4s
427
+ add v8.4s, v8.4s, v28.4s
428
+ add v13.4s, v13.4s, v29.4s
429
+ add v18.4s, v18.4s, v30.4s
430
+
431
+ mov x16, v4.d[0] // Move the R key to GPRs
432
+ mov x17, v4.d[1]
433
+ mov v27.16b, v9.16b // Store the S key
434
+
435
+ bl Lpoly_hash_ad_internal
436
+
437
+ mov x3, x0
438
+ cmp x2, #256
439
+ b.le Lseal_tail
440
+
441
+ ld1 {v20.16b - v23.16b}, [x1], #64
442
+ eor v20.16b, v20.16b, v0.16b
443
+ eor v21.16b, v21.16b, v5.16b
444
+ eor v22.16b, v22.16b, v10.16b
445
+ eor v23.16b, v23.16b, v15.16b
446
+ st1 {v20.16b - v23.16b}, [x0], #64
447
+
448
+ ld1 {v20.16b - v23.16b}, [x1], #64
449
+ eor v20.16b, v20.16b, v1.16b
450
+ eor v21.16b, v21.16b, v6.16b
451
+ eor v22.16b, v22.16b, v11.16b
452
+ eor v23.16b, v23.16b, v16.16b
453
+ st1 {v20.16b - v23.16b}, [x0], #64
454
+
455
+ ld1 {v20.16b - v23.16b}, [x1], #64
456
+ eor v20.16b, v20.16b, v2.16b
457
+ eor v21.16b, v21.16b, v7.16b
458
+ eor v22.16b, v22.16b, v12.16b
459
+ eor v23.16b, v23.16b, v17.16b
460
+ st1 {v20.16b - v23.16b}, [x0], #64
461
+
462
+ ld1 {v20.16b - v23.16b}, [x1], #64
463
+ eor v20.16b, v20.16b, v3.16b
464
+ eor v21.16b, v21.16b, v8.16b
465
+ eor v22.16b, v22.16b, v13.16b
466
+ eor v23.16b, v23.16b, v18.16b
467
+ st1 {v20.16b - v23.16b}, [x0], #64
468
+
469
+ sub x2, x2, #256
470
+
471
+ mov x6, #4 // In the first run of the loop we need to hash 256 bytes, therefore we hash one block for the first 4 rounds
472
+ mov x7, #6 // and two blocks for the remaining 6, for a total of (1 * 4 + 2 * 6) * 16 = 256
473
+
474
+ Lseal_main_loop:
475
+ adrp x11, Lchacha20_consts@PAGE
476
+ add x11, x11, Lchacha20_consts@PAGEOFF
477
+
478
+ ld4r {v0.4s,v1.4s,v2.4s,v3.4s}, [x11]
479
+ mov v4.16b, v24.16b
480
+
481
+ ld4r {v5.4s,v6.4s,v7.4s,v8.4s}, [x5], #16
482
+ mov v9.16b, v28.16b
483
+
484
+ ld4r {v10.4s,v11.4s,v12.4s,v13.4s}, [x5], #16
485
+ mov v14.16b, v29.16b
486
+
487
+ ld4r {v15.4s,v16.4s,v17.4s,v18.4s}, [x5]
488
+ add v15.4s, v15.4s, v25.4s
489
+ mov v19.16b, v30.16b
490
+
491
+ eor v20.16b, v20.16b, v20.16b //zero
492
+ not v21.16b, v20.16b // -1
493
+ sub v21.4s, v25.4s, v21.4s // Add +1
494
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
495
+ add v19.4s, v19.4s, v20.4s
496
+
497
+ sub x5, x5, #32
498
+ .align 5
499
+ Lseal_main_loop_rounds:
500
+ add v0.4s, v0.4s, v5.4s
501
+ add v1.4s, v1.4s, v6.4s
502
+ add v2.4s, v2.4s, v7.4s
503
+ add v3.4s, v3.4s, v8.4s
504
+ add v4.4s, v4.4s, v9.4s
505
+
506
+ eor v15.16b, v15.16b, v0.16b
507
+ eor v16.16b, v16.16b, v1.16b
508
+ eor v17.16b, v17.16b, v2.16b
509
+ eor v18.16b, v18.16b, v3.16b
510
+ eor v19.16b, v19.16b, v4.16b
511
+
512
+ rev32 v15.8h, v15.8h
513
+ rev32 v16.8h, v16.8h
514
+ rev32 v17.8h, v17.8h
515
+ rev32 v18.8h, v18.8h
516
+ rev32 v19.8h, v19.8h
517
+
518
+ add v10.4s, v10.4s, v15.4s
519
+ add v11.4s, v11.4s, v16.4s
520
+ add v12.4s, v12.4s, v17.4s
521
+ add v13.4s, v13.4s, v18.4s
522
+ add v14.4s, v14.4s, v19.4s
523
+
524
+ eor v5.16b, v5.16b, v10.16b
525
+ eor v6.16b, v6.16b, v11.16b
526
+ eor v7.16b, v7.16b, v12.16b
527
+ eor v8.16b, v8.16b, v13.16b
528
+ eor v9.16b, v9.16b, v14.16b
529
+
530
+ ushr v20.4s, v5.4s, #20
531
+ sli v20.4s, v5.4s, #12
532
+ ushr v5.4s, v6.4s, #20
533
+ sli v5.4s, v6.4s, #12
534
+ ushr v6.4s, v7.4s, #20
535
+ sli v6.4s, v7.4s, #12
536
+ ushr v7.4s, v8.4s, #20
537
+ sli v7.4s, v8.4s, #12
538
+ ushr v8.4s, v9.4s, #20
539
+ sli v8.4s, v9.4s, #12
540
+
541
+ add v0.4s, v0.4s, v20.4s
542
+ add v1.4s, v1.4s, v5.4s
543
+ add v2.4s, v2.4s, v6.4s
544
+ add v3.4s, v3.4s, v7.4s
545
+ add v4.4s, v4.4s, v8.4s
546
+
547
+ eor v15.16b, v15.16b, v0.16b
548
+ eor v16.16b, v16.16b, v1.16b
549
+ eor v17.16b, v17.16b, v2.16b
550
+ eor v18.16b, v18.16b, v3.16b
551
+ eor v19.16b, v19.16b, v4.16b
552
+
553
+ tbl v15.16b, {v15.16b}, v26.16b
554
+ tbl v16.16b, {v16.16b}, v26.16b
555
+ tbl v17.16b, {v17.16b}, v26.16b
556
+ tbl v18.16b, {v18.16b}, v26.16b
557
+ tbl v19.16b, {v19.16b}, v26.16b
558
+
559
+ add v10.4s, v10.4s, v15.4s
560
+ add v11.4s, v11.4s, v16.4s
561
+ add v12.4s, v12.4s, v17.4s
562
+ add v13.4s, v13.4s, v18.4s
563
+ add v14.4s, v14.4s, v19.4s
564
+
565
+ eor v20.16b, v20.16b, v10.16b
566
+ eor v5.16b, v5.16b, v11.16b
567
+ eor v6.16b, v6.16b, v12.16b
568
+ eor v7.16b, v7.16b, v13.16b
569
+ eor v8.16b, v8.16b, v14.16b
570
+
571
+ ushr v9.4s, v8.4s, #25
572
+ sli v9.4s, v8.4s, #7
573
+ ushr v8.4s, v7.4s, #25
574
+ sli v8.4s, v7.4s, #7
575
+ ushr v7.4s, v6.4s, #25
576
+ sli v7.4s, v6.4s, #7
577
+ ushr v6.4s, v5.4s, #25
578
+ sli v6.4s, v5.4s, #7
579
+ ushr v5.4s, v20.4s, #25
580
+ sli v5.4s, v20.4s, #7
581
+
582
+ ext v9.16b, v9.16b, v9.16b, #4
583
+ ext v14.16b, v14.16b, v14.16b, #8
584
+ ext v19.16b, v19.16b, v19.16b, #12
585
+ ldp x11, x12, [x3], 16
586
+ adds x8, x8, x11
587
+ adcs x9, x9, x12
588
+ adc x10, x10, x15
589
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
590
+ umulh x12, x8, x16
591
+ mul x13, x9, x16
592
+ umulh x14, x9, x16
593
+ adds x12, x12, x13
594
+ mul x13, x10, x16
595
+ adc x13, x13, x14
596
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
597
+ umulh x8, x8, x17
598
+ adds x12, x12, x14
599
+ mul x14, x9, x17
600
+ umulh x9, x9, x17
601
+ adcs x14, x14, x8
602
+ mul x10, x10, x17
603
+ adc x10, x10, x9
604
+ adds x13, x13, x14
605
+ adc x14, x10, xzr
606
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
607
+ and x8, x13, #-4
608
+ extr x13, x14, x13, #2
609
+ adds x8, x8, x11
610
+ lsr x11, x14, #2
611
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
612
+ adds x8, x8, x13
613
+ adcs x9, x9, x12
614
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
615
+ add v0.4s, v0.4s, v6.4s
616
+ add v1.4s, v1.4s, v7.4s
617
+ add v2.4s, v2.4s, v8.4s
618
+ add v3.4s, v3.4s, v5.4s
619
+ add v4.4s, v4.4s, v9.4s
620
+
621
+ eor v18.16b, v18.16b, v0.16b
622
+ eor v15.16b, v15.16b, v1.16b
623
+ eor v16.16b, v16.16b, v2.16b
624
+ eor v17.16b, v17.16b, v3.16b
625
+ eor v19.16b, v19.16b, v4.16b
626
+
627
+ rev32 v18.8h, v18.8h
628
+ rev32 v15.8h, v15.8h
629
+ rev32 v16.8h, v16.8h
630
+ rev32 v17.8h, v17.8h
631
+ rev32 v19.8h, v19.8h
632
+
633
+ add v12.4s, v12.4s, v18.4s
634
+ add v13.4s, v13.4s, v15.4s
635
+ add v10.4s, v10.4s, v16.4s
636
+ add v11.4s, v11.4s, v17.4s
637
+ add v14.4s, v14.4s, v19.4s
638
+
639
+ eor v6.16b, v6.16b, v12.16b
640
+ eor v7.16b, v7.16b, v13.16b
641
+ eor v8.16b, v8.16b, v10.16b
642
+ eor v5.16b, v5.16b, v11.16b
643
+ eor v9.16b, v9.16b, v14.16b
644
+
645
+ ushr v20.4s, v6.4s, #20
646
+ sli v20.4s, v6.4s, #12
647
+ ushr v6.4s, v7.4s, #20
648
+ sli v6.4s, v7.4s, #12
649
+ ushr v7.4s, v8.4s, #20
650
+ sli v7.4s, v8.4s, #12
651
+ ushr v8.4s, v5.4s, #20
652
+ sli v8.4s, v5.4s, #12
653
+ ushr v5.4s, v9.4s, #20
654
+ sli v5.4s, v9.4s, #12
655
+
656
+ add v0.4s, v0.4s, v20.4s
657
+ add v1.4s, v1.4s, v6.4s
658
+ add v2.4s, v2.4s, v7.4s
659
+ add v3.4s, v3.4s, v8.4s
660
+ add v4.4s, v4.4s, v5.4s
661
+
662
+ eor v18.16b, v18.16b, v0.16b
663
+ eor v15.16b, v15.16b, v1.16b
664
+ eor v16.16b, v16.16b, v2.16b
665
+ eor v17.16b, v17.16b, v3.16b
666
+ eor v19.16b, v19.16b, v4.16b
667
+
668
+ tbl v18.16b, {v18.16b}, v26.16b
669
+ tbl v15.16b, {v15.16b}, v26.16b
670
+ tbl v16.16b, {v16.16b}, v26.16b
671
+ tbl v17.16b, {v17.16b}, v26.16b
672
+ tbl v19.16b, {v19.16b}, v26.16b
673
+
674
+ add v12.4s, v12.4s, v18.4s
675
+ add v13.4s, v13.4s, v15.4s
676
+ add v10.4s, v10.4s, v16.4s
677
+ add v11.4s, v11.4s, v17.4s
678
+ add v14.4s, v14.4s, v19.4s
679
+
680
+ eor v20.16b, v20.16b, v12.16b
681
+ eor v6.16b, v6.16b, v13.16b
682
+ eor v7.16b, v7.16b, v10.16b
683
+ eor v8.16b, v8.16b, v11.16b
684
+ eor v5.16b, v5.16b, v14.16b
685
+
686
+ ushr v9.4s, v5.4s, #25
687
+ sli v9.4s, v5.4s, #7
688
+ ushr v5.4s, v8.4s, #25
689
+ sli v5.4s, v8.4s, #7
690
+ ushr v8.4s, v7.4s, #25
691
+ sli v8.4s, v7.4s, #7
692
+ ushr v7.4s, v6.4s, #25
693
+ sli v7.4s, v6.4s, #7
694
+ ushr v6.4s, v20.4s, #25
695
+ sli v6.4s, v20.4s, #7
696
+
697
+ ext v9.16b, v9.16b, v9.16b, #12
698
+ ext v14.16b, v14.16b, v14.16b, #8
699
+ ext v19.16b, v19.16b, v19.16b, #4
700
+ subs x6, x6, #1
701
+ b.ge Lseal_main_loop_rounds
702
+ ldp x11, x12, [x3], 16
703
+ adds x8, x8, x11
704
+ adcs x9, x9, x12
705
+ adc x10, x10, x15
706
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
707
+ umulh x12, x8, x16
708
+ mul x13, x9, x16
709
+ umulh x14, x9, x16
710
+ adds x12, x12, x13
711
+ mul x13, x10, x16
712
+ adc x13, x13, x14
713
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
714
+ umulh x8, x8, x17
715
+ adds x12, x12, x14
716
+ mul x14, x9, x17
717
+ umulh x9, x9, x17
718
+ adcs x14, x14, x8
719
+ mul x10, x10, x17
720
+ adc x10, x10, x9
721
+ adds x13, x13, x14
722
+ adc x14, x10, xzr
723
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
724
+ and x8, x13, #-4
725
+ extr x13, x14, x13, #2
726
+ adds x8, x8, x11
727
+ lsr x11, x14, #2
728
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
729
+ adds x8, x8, x13
730
+ adcs x9, x9, x12
731
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
732
+ subs x7, x7, #1
733
+ b.gt Lseal_main_loop_rounds
734
+
735
+ eor v20.16b, v20.16b, v20.16b //zero
736
+ not v21.16b, v20.16b // -1
737
+ sub v21.4s, v25.4s, v21.4s // Add +1
738
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
739
+ add v19.4s, v19.4s, v20.4s
740
+
741
+ add v15.4s, v15.4s, v25.4s
742
+ mov x11, #5
743
+ dup v20.4s, w11
744
+ add v25.4s, v25.4s, v20.4s
745
+
746
+ zip1 v20.4s, v0.4s, v1.4s
747
+ zip2 v21.4s, v0.4s, v1.4s
748
+ zip1 v22.4s, v2.4s, v3.4s
749
+ zip2 v23.4s, v2.4s, v3.4s
750
+
751
+ zip1 v0.2d, v20.2d, v22.2d
752
+ zip2 v1.2d, v20.2d, v22.2d
753
+ zip1 v2.2d, v21.2d, v23.2d
754
+ zip2 v3.2d, v21.2d, v23.2d
755
+
756
+ zip1 v20.4s, v5.4s, v6.4s
757
+ zip2 v21.4s, v5.4s, v6.4s
758
+ zip1 v22.4s, v7.4s, v8.4s
759
+ zip2 v23.4s, v7.4s, v8.4s
760
+
761
+ zip1 v5.2d, v20.2d, v22.2d
762
+ zip2 v6.2d, v20.2d, v22.2d
763
+ zip1 v7.2d, v21.2d, v23.2d
764
+ zip2 v8.2d, v21.2d, v23.2d
765
+
766
+ zip1 v20.4s, v10.4s, v11.4s
767
+ zip2 v21.4s, v10.4s, v11.4s
768
+ zip1 v22.4s, v12.4s, v13.4s
769
+ zip2 v23.4s, v12.4s, v13.4s
770
+
771
+ zip1 v10.2d, v20.2d, v22.2d
772
+ zip2 v11.2d, v20.2d, v22.2d
773
+ zip1 v12.2d, v21.2d, v23.2d
774
+ zip2 v13.2d, v21.2d, v23.2d
775
+
776
+ zip1 v20.4s, v15.4s, v16.4s
777
+ zip2 v21.4s, v15.4s, v16.4s
778
+ zip1 v22.4s, v17.4s, v18.4s
779
+ zip2 v23.4s, v17.4s, v18.4s
780
+
781
+ zip1 v15.2d, v20.2d, v22.2d
782
+ zip2 v16.2d, v20.2d, v22.2d
783
+ zip1 v17.2d, v21.2d, v23.2d
784
+ zip2 v18.2d, v21.2d, v23.2d
785
+
786
+ add v0.4s, v0.4s, v24.4s
787
+ add v5.4s, v5.4s, v28.4s
788
+ add v10.4s, v10.4s, v29.4s
789
+ add v15.4s, v15.4s, v30.4s
790
+
791
+ add v1.4s, v1.4s, v24.4s
792
+ add v6.4s, v6.4s, v28.4s
793
+ add v11.4s, v11.4s, v29.4s
794
+ add v16.4s, v16.4s, v30.4s
795
+
796
+ add v2.4s, v2.4s, v24.4s
797
+ add v7.4s, v7.4s, v28.4s
798
+ add v12.4s, v12.4s, v29.4s
799
+ add v17.4s, v17.4s, v30.4s
800
+
801
+ add v3.4s, v3.4s, v24.4s
802
+ add v8.4s, v8.4s, v28.4s
803
+ add v13.4s, v13.4s, v29.4s
804
+ add v18.4s, v18.4s, v30.4s
805
+
806
+ add v4.4s, v4.4s, v24.4s
807
+ add v9.4s, v9.4s, v28.4s
808
+ add v14.4s, v14.4s, v29.4s
809
+ add v19.4s, v19.4s, v30.4s
810
+
811
+ cmp x2, #320
812
+ b.le Lseal_tail
813
+
814
+ ld1 {v20.16b - v23.16b}, [x1], #64
815
+ eor v20.16b, v20.16b, v0.16b
816
+ eor v21.16b, v21.16b, v5.16b
817
+ eor v22.16b, v22.16b, v10.16b
818
+ eor v23.16b, v23.16b, v15.16b
819
+ st1 {v20.16b - v23.16b}, [x0], #64
820
+
821
+ ld1 {v20.16b - v23.16b}, [x1], #64
822
+ eor v20.16b, v20.16b, v1.16b
823
+ eor v21.16b, v21.16b, v6.16b
824
+ eor v22.16b, v22.16b, v11.16b
825
+ eor v23.16b, v23.16b, v16.16b
826
+ st1 {v20.16b - v23.16b}, [x0], #64
827
+
828
+ ld1 {v20.16b - v23.16b}, [x1], #64
829
+ eor v20.16b, v20.16b, v2.16b
830
+ eor v21.16b, v21.16b, v7.16b
831
+ eor v22.16b, v22.16b, v12.16b
832
+ eor v23.16b, v23.16b, v17.16b
833
+ st1 {v20.16b - v23.16b}, [x0], #64
834
+
835
+ ld1 {v20.16b - v23.16b}, [x1], #64
836
+ eor v20.16b, v20.16b, v3.16b
837
+ eor v21.16b, v21.16b, v8.16b
838
+ eor v22.16b, v22.16b, v13.16b
839
+ eor v23.16b, v23.16b, v18.16b
840
+ st1 {v20.16b - v23.16b}, [x0], #64
841
+
842
+ ld1 {v20.16b - v23.16b}, [x1], #64
843
+ eor v20.16b, v20.16b, v4.16b
844
+ eor v21.16b, v21.16b, v9.16b
845
+ eor v22.16b, v22.16b, v14.16b
846
+ eor v23.16b, v23.16b, v19.16b
847
+ st1 {v20.16b - v23.16b}, [x0], #64
848
+
849
+ sub x2, x2, #320
850
+
851
+ mov x6, #0
852
+ mov x7, #10 // For the remainder of the loop we always hash and encrypt 320 bytes per iteration
853
+
854
+ b Lseal_main_loop
855
+
856
+ Lseal_tail:
857
+ // This part of the function handles the storage and authentication of the last [0,320) bytes
858
+ // We assume A0-A4 ... D0-D4 hold at least inl (320 max) bytes of the stream data.
859
+ cmp x2, #64
860
+ b.lt Lseal_tail_64
861
+
862
+ // Store and authenticate 64B blocks per iteration
863
+ ld1 {v20.16b - v23.16b}, [x1], #64
864
+
865
+ eor v20.16b, v20.16b, v0.16b
866
+ eor v21.16b, v21.16b, v5.16b
867
+ eor v22.16b, v22.16b, v10.16b
868
+ eor v23.16b, v23.16b, v15.16b
869
+ mov x11, v20.d[0]
870
+ mov x12, v20.d[1]
871
+ adds x8, x8, x11
872
+ adcs x9, x9, x12
873
+ adc x10, x10, x15
874
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
875
+ umulh x12, x8, x16
876
+ mul x13, x9, x16
877
+ umulh x14, x9, x16
878
+ adds x12, x12, x13
879
+ mul x13, x10, x16
880
+ adc x13, x13, x14
881
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
882
+ umulh x8, x8, x17
883
+ adds x12, x12, x14
884
+ mul x14, x9, x17
885
+ umulh x9, x9, x17
886
+ adcs x14, x14, x8
887
+ mul x10, x10, x17
888
+ adc x10, x10, x9
889
+ adds x13, x13, x14
890
+ adc x14, x10, xzr
891
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
892
+ and x8, x13, #-4
893
+ extr x13, x14, x13, #2
894
+ adds x8, x8, x11
895
+ lsr x11, x14, #2
896
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
897
+ adds x8, x8, x13
898
+ adcs x9, x9, x12
899
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
900
+ mov x11, v21.d[0]
901
+ mov x12, v21.d[1]
902
+ adds x8, x8, x11
903
+ adcs x9, x9, x12
904
+ adc x10, x10, x15
905
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
906
+ umulh x12, x8, x16
907
+ mul x13, x9, x16
908
+ umulh x14, x9, x16
909
+ adds x12, x12, x13
910
+ mul x13, x10, x16
911
+ adc x13, x13, x14
912
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
913
+ umulh x8, x8, x17
914
+ adds x12, x12, x14
915
+ mul x14, x9, x17
916
+ umulh x9, x9, x17
917
+ adcs x14, x14, x8
918
+ mul x10, x10, x17
919
+ adc x10, x10, x9
920
+ adds x13, x13, x14
921
+ adc x14, x10, xzr
922
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
923
+ and x8, x13, #-4
924
+ extr x13, x14, x13, #2
925
+ adds x8, x8, x11
926
+ lsr x11, x14, #2
927
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
928
+ adds x8, x8, x13
929
+ adcs x9, x9, x12
930
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
931
+ mov x11, v22.d[0]
932
+ mov x12, v22.d[1]
933
+ adds x8, x8, x11
934
+ adcs x9, x9, x12
935
+ adc x10, x10, x15
936
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
937
+ umulh x12, x8, x16
938
+ mul x13, x9, x16
939
+ umulh x14, x9, x16
940
+ adds x12, x12, x13
941
+ mul x13, x10, x16
942
+ adc x13, x13, x14
943
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
944
+ umulh x8, x8, x17
945
+ adds x12, x12, x14
946
+ mul x14, x9, x17
947
+ umulh x9, x9, x17
948
+ adcs x14, x14, x8
949
+ mul x10, x10, x17
950
+ adc x10, x10, x9
951
+ adds x13, x13, x14
952
+ adc x14, x10, xzr
953
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
954
+ and x8, x13, #-4
955
+ extr x13, x14, x13, #2
956
+ adds x8, x8, x11
957
+ lsr x11, x14, #2
958
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
959
+ adds x8, x8, x13
960
+ adcs x9, x9, x12
961
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
962
+ mov x11, v23.d[0]
963
+ mov x12, v23.d[1]
964
+ adds x8, x8, x11
965
+ adcs x9, x9, x12
966
+ adc x10, x10, x15
967
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
968
+ umulh x12, x8, x16
969
+ mul x13, x9, x16
970
+ umulh x14, x9, x16
971
+ adds x12, x12, x13
972
+ mul x13, x10, x16
973
+ adc x13, x13, x14
974
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
975
+ umulh x8, x8, x17
976
+ adds x12, x12, x14
977
+ mul x14, x9, x17
978
+ umulh x9, x9, x17
979
+ adcs x14, x14, x8
980
+ mul x10, x10, x17
981
+ adc x10, x10, x9
982
+ adds x13, x13, x14
983
+ adc x14, x10, xzr
984
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
985
+ and x8, x13, #-4
986
+ extr x13, x14, x13, #2
987
+ adds x8, x8, x11
988
+ lsr x11, x14, #2
989
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
990
+ adds x8, x8, x13
991
+ adcs x9, x9, x12
992
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
993
+ st1 {v20.16b - v23.16b}, [x0], #64
994
+ sub x2, x2, #64
995
+
996
+ // Shift the state left by 64 bytes for the next iteration of the loop
997
+ mov v0.16b, v1.16b
998
+ mov v5.16b, v6.16b
999
+ mov v10.16b, v11.16b
1000
+ mov v15.16b, v16.16b
1001
+
1002
+ mov v1.16b, v2.16b
1003
+ mov v6.16b, v7.16b
1004
+ mov v11.16b, v12.16b
1005
+ mov v16.16b, v17.16b
1006
+
1007
+ mov v2.16b, v3.16b
1008
+ mov v7.16b, v8.16b
1009
+ mov v12.16b, v13.16b
1010
+ mov v17.16b, v18.16b
1011
+
1012
+ mov v3.16b, v4.16b
1013
+ mov v8.16b, v9.16b
1014
+ mov v13.16b, v14.16b
1015
+ mov v18.16b, v19.16b
1016
+
1017
+ b Lseal_tail
1018
+
1019
+ Lseal_tail_64:
1020
+ ldp x3, x4, [x5, #48] // extra_in_len and extra_in_ptr
1021
+
1022
+ // Here we handle the last [0,64) bytes of plaintext
1023
+ cmp x2, #16
1024
+ b.lt Lseal_tail_16
1025
+ // Each iteration encrypt and authenticate a 16B block
1026
+ ld1 {v20.16b}, [x1], #16
1027
+ eor v20.16b, v20.16b, v0.16b
1028
+ mov x11, v20.d[0]
1029
+ mov x12, v20.d[1]
1030
+ adds x8, x8, x11
1031
+ adcs x9, x9, x12
1032
+ adc x10, x10, x15
1033
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1034
+ umulh x12, x8, x16
1035
+ mul x13, x9, x16
1036
+ umulh x14, x9, x16
1037
+ adds x12, x12, x13
1038
+ mul x13, x10, x16
1039
+ adc x13, x13, x14
1040
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1041
+ umulh x8, x8, x17
1042
+ adds x12, x12, x14
1043
+ mul x14, x9, x17
1044
+ umulh x9, x9, x17
1045
+ adcs x14, x14, x8
1046
+ mul x10, x10, x17
1047
+ adc x10, x10, x9
1048
+ adds x13, x13, x14
1049
+ adc x14, x10, xzr
1050
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1051
+ and x8, x13, #-4
1052
+ extr x13, x14, x13, #2
1053
+ adds x8, x8, x11
1054
+ lsr x11, x14, #2
1055
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1056
+ adds x8, x8, x13
1057
+ adcs x9, x9, x12
1058
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1059
+ st1 {v20.16b}, [x0], #16
1060
+
1061
+ sub x2, x2, #16
1062
+
1063
+ // Shift the state left by 16 bytes for the next iteration of the loop
1064
+ mov v0.16b, v5.16b
1065
+ mov v5.16b, v10.16b
1066
+ mov v10.16b, v15.16b
1067
+
1068
+ b Lseal_tail_64
1069
+
1070
+ Lseal_tail_16:
1071
+ // Here we handle the last [0,16) bytes of ciphertext that require a padded block
1072
+ cbz x2, Lseal_hash_extra
1073
+
1074
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the plaintext/extra in
1075
+ eor v21.16b, v21.16b, v21.16b // Use T1 to generate an AND mask that will only mask the ciphertext bytes
1076
+ not v22.16b, v20.16b
1077
+
1078
+ mov x6, x2
1079
+ add x1, x1, x2
1080
+
1081
+ cbz x4, Lseal_tail_16_compose // No extra data to pad with, zero padding
1082
+
1083
+ mov x7, #16 // We need to load some extra_in first for padding
1084
+ sub x7, x7, x2
1085
+ cmp x4, x7
1086
+ csel x7, x4, x7, lt // Load the minimum of extra_in_len and the amount needed to fill the register
1087
+ mov x12, x7
1088
+ add x3, x3, x7
1089
+ sub x4, x4, x7
1090
+
1091
+ Lseal_tail16_compose_extra_in:
1092
+ ext v20.16b, v20.16b, v20.16b, #15
1093
+ ldrb w11, [x3, #-1]!
1094
+ mov v20.b[0], w11
1095
+ subs x7, x7, #1
1096
+ b.gt Lseal_tail16_compose_extra_in
1097
+
1098
+ add x3, x3, x12
1099
+
1100
+ Lseal_tail_16_compose:
1101
+ ext v20.16b, v20.16b, v20.16b, #15
1102
+ ldrb w11, [x1, #-1]!
1103
+ mov v20.b[0], w11
1104
+ ext v21.16b, v22.16b, v21.16b, #15
1105
+ subs x2, x2, #1
1106
+ b.gt Lseal_tail_16_compose
1107
+
1108
+ and v0.16b, v0.16b, v21.16b
1109
+ eor v20.16b, v20.16b, v0.16b
1110
+ mov v21.16b, v20.16b
1111
+
1112
+ Lseal_tail_16_store:
1113
+ umov w11, v20.b[0]
1114
+ strb w11, [x0], #1
1115
+ ext v20.16b, v20.16b, v20.16b, #1
1116
+ subs x6, x6, #1
1117
+ b.gt Lseal_tail_16_store
1118
+
1119
+ // Hash in the final ct block concatenated with extra_in
1120
+ mov x11, v21.d[0]
1121
+ mov x12, v21.d[1]
1122
+ adds x8, x8, x11
1123
+ adcs x9, x9, x12
1124
+ adc x10, x10, x15
1125
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1126
+ umulh x12, x8, x16
1127
+ mul x13, x9, x16
1128
+ umulh x14, x9, x16
1129
+ adds x12, x12, x13
1130
+ mul x13, x10, x16
1131
+ adc x13, x13, x14
1132
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1133
+ umulh x8, x8, x17
1134
+ adds x12, x12, x14
1135
+ mul x14, x9, x17
1136
+ umulh x9, x9, x17
1137
+ adcs x14, x14, x8
1138
+ mul x10, x10, x17
1139
+ adc x10, x10, x9
1140
+ adds x13, x13, x14
1141
+ adc x14, x10, xzr
1142
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1143
+ and x8, x13, #-4
1144
+ extr x13, x14, x13, #2
1145
+ adds x8, x8, x11
1146
+ lsr x11, x14, #2
1147
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1148
+ adds x8, x8, x13
1149
+ adcs x9, x9, x12
1150
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1151
+
1152
+ Lseal_hash_extra:
1153
+ cbz x4, Lseal_finalize
1154
+
1155
+ Lseal_hash_extra_loop:
1156
+ cmp x4, #16
1157
+ b.lt Lseal_hash_extra_tail
1158
+ ld1 {v20.16b}, [x3], #16
1159
+ mov x11, v20.d[0]
1160
+ mov x12, v20.d[1]
1161
+ adds x8, x8, x11
1162
+ adcs x9, x9, x12
1163
+ adc x10, x10, x15
1164
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1165
+ umulh x12, x8, x16
1166
+ mul x13, x9, x16
1167
+ umulh x14, x9, x16
1168
+ adds x12, x12, x13
1169
+ mul x13, x10, x16
1170
+ adc x13, x13, x14
1171
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1172
+ umulh x8, x8, x17
1173
+ adds x12, x12, x14
1174
+ mul x14, x9, x17
1175
+ umulh x9, x9, x17
1176
+ adcs x14, x14, x8
1177
+ mul x10, x10, x17
1178
+ adc x10, x10, x9
1179
+ adds x13, x13, x14
1180
+ adc x14, x10, xzr
1181
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1182
+ and x8, x13, #-4
1183
+ extr x13, x14, x13, #2
1184
+ adds x8, x8, x11
1185
+ lsr x11, x14, #2
1186
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1187
+ adds x8, x8, x13
1188
+ adcs x9, x9, x12
1189
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1190
+ sub x4, x4, #16
1191
+ b Lseal_hash_extra_loop
1192
+
1193
+ Lseal_hash_extra_tail:
1194
+ cbz x4, Lseal_finalize
1195
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the remaining extra ciphertext
1196
+ add x3, x3, x4
1197
+
1198
+ Lseal_hash_extra_load:
1199
+ ext v20.16b, v20.16b, v20.16b, #15
1200
+ ldrb w11, [x3, #-1]!
1201
+ mov v20.b[0], w11
1202
+ subs x4, x4, #1
1203
+ b.gt Lseal_hash_extra_load
1204
+
1205
+ // Hash in the final padded extra_in block
1206
+ mov x11, v20.d[0]
1207
+ mov x12, v20.d[1]
1208
+ adds x8, x8, x11
1209
+ adcs x9, x9, x12
1210
+ adc x10, x10, x15
1211
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1212
+ umulh x12, x8, x16
1213
+ mul x13, x9, x16
1214
+ umulh x14, x9, x16
1215
+ adds x12, x12, x13
1216
+ mul x13, x10, x16
1217
+ adc x13, x13, x14
1218
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1219
+ umulh x8, x8, x17
1220
+ adds x12, x12, x14
1221
+ mul x14, x9, x17
1222
+ umulh x9, x9, x17
1223
+ adcs x14, x14, x8
1224
+ mul x10, x10, x17
1225
+ adc x10, x10, x9
1226
+ adds x13, x13, x14
1227
+ adc x14, x10, xzr
1228
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1229
+ and x8, x13, #-4
1230
+ extr x13, x14, x13, #2
1231
+ adds x8, x8, x11
1232
+ lsr x11, x14, #2
1233
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1234
+ adds x8, x8, x13
1235
+ adcs x9, x9, x12
1236
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1237
+
1238
+ Lseal_finalize:
1239
+ mov x11, v31.d[0]
1240
+ mov x12, v31.d[1]
1241
+ adds x8, x8, x11
1242
+ adcs x9, x9, x12
1243
+ adc x10, x10, x15
1244
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1245
+ umulh x12, x8, x16
1246
+ mul x13, x9, x16
1247
+ umulh x14, x9, x16
1248
+ adds x12, x12, x13
1249
+ mul x13, x10, x16
1250
+ adc x13, x13, x14
1251
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1252
+ umulh x8, x8, x17
1253
+ adds x12, x12, x14
1254
+ mul x14, x9, x17
1255
+ umulh x9, x9, x17
1256
+ adcs x14, x14, x8
1257
+ mul x10, x10, x17
1258
+ adc x10, x10, x9
1259
+ adds x13, x13, x14
1260
+ adc x14, x10, xzr
1261
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1262
+ and x8, x13, #-4
1263
+ extr x13, x14, x13, #2
1264
+ adds x8, x8, x11
1265
+ lsr x11, x14, #2
1266
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1267
+ adds x8, x8, x13
1268
+ adcs x9, x9, x12
1269
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1270
+ // Final reduction step
1271
+ sub x12, xzr, x15
1272
+ orr x13, xzr, #3
1273
+ subs x11, x8, #-5
1274
+ sbcs x12, x9, x12
1275
+ sbcs x13, x10, x13
1276
+ csel x8, x11, x8, cs
1277
+ csel x9, x12, x9, cs
1278
+ csel x10, x13, x10, cs
1279
+ mov x11, v27.d[0]
1280
+ mov x12, v27.d[1]
1281
+ adds x8, x8, x11
1282
+ adcs x9, x9, x12
1283
+ adc x10, x10, x15
1284
+
1285
+ stp x8, x9, [x5]
1286
+
1287
+ ldp d8, d9, [sp, #16]
1288
+ ldp d10, d11, [sp, #32]
1289
+ ldp d12, d13, [sp, #48]
1290
+ ldp d14, d15, [sp, #64]
1291
+ .cfi_restore b15
1292
+ .cfi_restore b14
1293
+ .cfi_restore b13
1294
+ .cfi_restore b12
1295
+ .cfi_restore b11
1296
+ .cfi_restore b10
1297
+ .cfi_restore b9
1298
+ .cfi_restore b8
1299
+ ldp x29, x30, [sp], 80
1300
+ .cfi_restore w29
1301
+ .cfi_restore w30
1302
+ .cfi_def_cfa_offset 0
1303
+ AARCH64_VALIDATE_LINK_REGISTER
1304
+ ret
1305
+
1306
+ Lseal_128:
1307
+ // On some architectures preparing 5 blocks for small buffers is wasteful
1308
+ eor v25.16b, v25.16b, v25.16b
1309
+ mov x11, #1
1310
+ mov v25.s[0], w11
1311
+ mov v0.16b, v24.16b
1312
+ mov v1.16b, v24.16b
1313
+ mov v2.16b, v24.16b
1314
+ mov v5.16b, v28.16b
1315
+ mov v6.16b, v28.16b
1316
+ mov v7.16b, v28.16b
1317
+ mov v10.16b, v29.16b
1318
+ mov v11.16b, v29.16b
1319
+ mov v12.16b, v29.16b
1320
+ mov v17.16b, v30.16b
1321
+ add v15.4s, v17.4s, v25.4s
1322
+ add v16.4s, v15.4s, v25.4s
1323
+
1324
+ mov x6, #10
1325
+
1326
+ Lseal_128_rounds:
1327
+ add v0.4s, v0.4s, v5.4s
1328
+ add v1.4s, v1.4s, v6.4s
1329
+ add v2.4s, v2.4s, v7.4s
1330
+ eor v15.16b, v15.16b, v0.16b
1331
+ eor v16.16b, v16.16b, v1.16b
1332
+ eor v17.16b, v17.16b, v2.16b
1333
+ rev32 v15.8h, v15.8h
1334
+ rev32 v16.8h, v16.8h
1335
+ rev32 v17.8h, v17.8h
1336
+
1337
+ add v10.4s, v10.4s, v15.4s
1338
+ add v11.4s, v11.4s, v16.4s
1339
+ add v12.4s, v12.4s, v17.4s
1340
+ eor v5.16b, v5.16b, v10.16b
1341
+ eor v6.16b, v6.16b, v11.16b
1342
+ eor v7.16b, v7.16b, v12.16b
1343
+ ushr v20.4s, v5.4s, #20
1344
+ sli v20.4s, v5.4s, #12
1345
+ ushr v5.4s, v6.4s, #20
1346
+ sli v5.4s, v6.4s, #12
1347
+ ushr v6.4s, v7.4s, #20
1348
+ sli v6.4s, v7.4s, #12
1349
+
1350
+ add v0.4s, v0.4s, v20.4s
1351
+ add v1.4s, v1.4s, v5.4s
1352
+ add v2.4s, v2.4s, v6.4s
1353
+ eor v15.16b, v15.16b, v0.16b
1354
+ eor v16.16b, v16.16b, v1.16b
1355
+ eor v17.16b, v17.16b, v2.16b
1356
+ tbl v15.16b, {v15.16b}, v26.16b
1357
+ tbl v16.16b, {v16.16b}, v26.16b
1358
+ tbl v17.16b, {v17.16b}, v26.16b
1359
+
1360
+ add v10.4s, v10.4s, v15.4s
1361
+ add v11.4s, v11.4s, v16.4s
1362
+ add v12.4s, v12.4s, v17.4s
1363
+ eor v20.16b, v20.16b, v10.16b
1364
+ eor v5.16b, v5.16b, v11.16b
1365
+ eor v6.16b, v6.16b, v12.16b
1366
+ ushr v7.4s, v6.4s, #25
1367
+ sli v7.4s, v6.4s, #7
1368
+ ushr v6.4s, v5.4s, #25
1369
+ sli v6.4s, v5.4s, #7
1370
+ ushr v5.4s, v20.4s, #25
1371
+ sli v5.4s, v20.4s, #7
1372
+
1373
+ ext v5.16b, v5.16b, v5.16b, #4
1374
+ ext v6.16b, v6.16b, v6.16b, #4
1375
+ ext v7.16b, v7.16b, v7.16b, #4
1376
+
1377
+ ext v10.16b, v10.16b, v10.16b, #8
1378
+ ext v11.16b, v11.16b, v11.16b, #8
1379
+ ext v12.16b, v12.16b, v12.16b, #8
1380
+
1381
+ ext v15.16b, v15.16b, v15.16b, #12
1382
+ ext v16.16b, v16.16b, v16.16b, #12
1383
+ ext v17.16b, v17.16b, v17.16b, #12
1384
+ add v0.4s, v0.4s, v5.4s
1385
+ add v1.4s, v1.4s, v6.4s
1386
+ add v2.4s, v2.4s, v7.4s
1387
+ eor v15.16b, v15.16b, v0.16b
1388
+ eor v16.16b, v16.16b, v1.16b
1389
+ eor v17.16b, v17.16b, v2.16b
1390
+ rev32 v15.8h, v15.8h
1391
+ rev32 v16.8h, v16.8h
1392
+ rev32 v17.8h, v17.8h
1393
+
1394
+ add v10.4s, v10.4s, v15.4s
1395
+ add v11.4s, v11.4s, v16.4s
1396
+ add v12.4s, v12.4s, v17.4s
1397
+ eor v5.16b, v5.16b, v10.16b
1398
+ eor v6.16b, v6.16b, v11.16b
1399
+ eor v7.16b, v7.16b, v12.16b
1400
+ ushr v20.4s, v5.4s, #20
1401
+ sli v20.4s, v5.4s, #12
1402
+ ushr v5.4s, v6.4s, #20
1403
+ sli v5.4s, v6.4s, #12
1404
+ ushr v6.4s, v7.4s, #20
1405
+ sli v6.4s, v7.4s, #12
1406
+
1407
+ add v0.4s, v0.4s, v20.4s
1408
+ add v1.4s, v1.4s, v5.4s
1409
+ add v2.4s, v2.4s, v6.4s
1410
+ eor v15.16b, v15.16b, v0.16b
1411
+ eor v16.16b, v16.16b, v1.16b
1412
+ eor v17.16b, v17.16b, v2.16b
1413
+ tbl v15.16b, {v15.16b}, v26.16b
1414
+ tbl v16.16b, {v16.16b}, v26.16b
1415
+ tbl v17.16b, {v17.16b}, v26.16b
1416
+
1417
+ add v10.4s, v10.4s, v15.4s
1418
+ add v11.4s, v11.4s, v16.4s
1419
+ add v12.4s, v12.4s, v17.4s
1420
+ eor v20.16b, v20.16b, v10.16b
1421
+ eor v5.16b, v5.16b, v11.16b
1422
+ eor v6.16b, v6.16b, v12.16b
1423
+ ushr v7.4s, v6.4s, #25
1424
+ sli v7.4s, v6.4s, #7
1425
+ ushr v6.4s, v5.4s, #25
1426
+ sli v6.4s, v5.4s, #7
1427
+ ushr v5.4s, v20.4s, #25
1428
+ sli v5.4s, v20.4s, #7
1429
+
1430
+ ext v5.16b, v5.16b, v5.16b, #12
1431
+ ext v6.16b, v6.16b, v6.16b, #12
1432
+ ext v7.16b, v7.16b, v7.16b, #12
1433
+
1434
+ ext v10.16b, v10.16b, v10.16b, #8
1435
+ ext v11.16b, v11.16b, v11.16b, #8
1436
+ ext v12.16b, v12.16b, v12.16b, #8
1437
+
1438
+ ext v15.16b, v15.16b, v15.16b, #4
1439
+ ext v16.16b, v16.16b, v16.16b, #4
1440
+ ext v17.16b, v17.16b, v17.16b, #4
1441
+ subs x6, x6, #1
1442
+ b.hi Lseal_128_rounds
1443
+
1444
+ add v0.4s, v0.4s, v24.4s
1445
+ add v1.4s, v1.4s, v24.4s
1446
+ add v2.4s, v2.4s, v24.4s
1447
+
1448
+ add v5.4s, v5.4s, v28.4s
1449
+ add v6.4s, v6.4s, v28.4s
1450
+ add v7.4s, v7.4s, v28.4s
1451
+
1452
+ // Only the first 32 bytes of the third block (counter = 0) are needed,
1453
+ // so skip updating v12 and v17.
1454
+ add v10.4s, v10.4s, v29.4s
1455
+ add v11.4s, v11.4s, v29.4s
1456
+
1457
+ add v30.4s, v30.4s, v25.4s
1458
+ add v15.4s, v15.4s, v30.4s
1459
+ add v30.4s, v30.4s, v25.4s
1460
+ add v16.4s, v16.4s, v30.4s
1461
+
1462
+ and v2.16b, v2.16b, v27.16b
1463
+ mov x16, v2.d[0] // Move the R key to GPRs
1464
+ mov x17, v2.d[1]
1465
+ mov v27.16b, v7.16b // Store the S key
1466
+
1467
+ bl Lpoly_hash_ad_internal
1468
+ b Lseal_tail
1469
+ .cfi_endproc
1470
+
1471
+
1472
+ /////////////////////////////////
1473
+ //
1474
+ // void chacha20_poly1305_open(uint8_t *pt, uint8_t *ct, size_t len_in, uint8_t *ad, size_t len_ad, union open_data *aead_data);
1475
+ //
1476
+ .globl _chacha20_poly1305_open
1477
+ .private_extern _chacha20_poly1305_open
1478
+
1479
+ .align 6
1480
+ .alt_entry _chacha20_poly1305_open
1481
+ _chacha20_poly1305_open:
1482
+ AARCH64_SIGN_LINK_REGISTER
1483
+ .cfi_startproc
1484
+ stp x29, x30, [sp, #-80]!
1485
+ .cfi_def_cfa_offset 80
1486
+ .cfi_offset w30, -72
1487
+ .cfi_offset w29, -80
1488
+ mov x29, sp
1489
+ // We probably could do .cfi_def_cfa w29, 80 at this point, but since
1490
+ // we don't actually use the frame pointer like that, it's probably not
1491
+ // worth bothering.
1492
+ stp d8, d9, [sp, #16]
1493
+ stp d10, d11, [sp, #32]
1494
+ stp d12, d13, [sp, #48]
1495
+ stp d14, d15, [sp, #64]
1496
+ .cfi_offset b15, -8
1497
+ .cfi_offset b14, -16
1498
+ .cfi_offset b13, -24
1499
+ .cfi_offset b12, -32
1500
+ .cfi_offset b11, -40
1501
+ .cfi_offset b10, -48
1502
+ .cfi_offset b9, -56
1503
+ .cfi_offset b8, -64
1504
+
1505
+ adrp x11, Lchacha20_consts@PAGE
1506
+ add x11, x11, Lchacha20_consts@PAGEOFF
1507
+
1508
+ ld1 {v24.16b - v27.16b}, [x11] // Load the CONSTS, INC, ROL8 and CLAMP values
1509
+ ld1 {v28.16b - v30.16b}, [x5]
1510
+
1511
+ mov x15, #1 // Prepare the Poly1305 state
1512
+ mov x8, #0
1513
+ mov x9, #0
1514
+ mov x10, #0
1515
+
1516
+ mov v31.d[0], x4 // Store the input and aad lengths
1517
+ mov v31.d[1], x2
1518
+
1519
+ cmp x2, #128
1520
+ b.le Lopen_128 // Optimization for smaller buffers
1521
+
1522
+ // Initially we prepare a single ChaCha20 block for the Poly1305 R and S keys
1523
+ mov v0.16b, v24.16b
1524
+ mov v5.16b, v28.16b
1525
+ mov v10.16b, v29.16b
1526
+ mov v15.16b, v30.16b
1527
+
1528
+ mov x6, #10
1529
+
1530
+ .align 5
1531
+ Lopen_init_rounds:
1532
+ add v0.4s, v0.4s, v5.4s
1533
+ eor v15.16b, v15.16b, v0.16b
1534
+ rev32 v15.8h, v15.8h
1535
+
1536
+ add v10.4s, v10.4s, v15.4s
1537
+ eor v5.16b, v5.16b, v10.16b
1538
+ ushr v20.4s, v5.4s, #20
1539
+ sli v20.4s, v5.4s, #12
1540
+ add v0.4s, v0.4s, v20.4s
1541
+ eor v15.16b, v15.16b, v0.16b
1542
+ tbl v15.16b, {v15.16b}, v26.16b
1543
+
1544
+ add v10.4s, v10.4s, v15.4s
1545
+ eor v20.16b, v20.16b, v10.16b
1546
+ ushr v5.4s, v20.4s, #25
1547
+ sli v5.4s, v20.4s, #7
1548
+ ext v5.16b, v5.16b, v5.16b, #4
1549
+ ext v10.16b, v10.16b, v10.16b, #8
1550
+ ext v15.16b, v15.16b, v15.16b, #12
1551
+ add v0.4s, v0.4s, v5.4s
1552
+ eor v15.16b, v15.16b, v0.16b
1553
+ rev32 v15.8h, v15.8h
1554
+
1555
+ add v10.4s, v10.4s, v15.4s
1556
+ eor v5.16b, v5.16b, v10.16b
1557
+ ushr v20.4s, v5.4s, #20
1558
+ sli v20.4s, v5.4s, #12
1559
+ add v0.4s, v0.4s, v20.4s
1560
+ eor v15.16b, v15.16b, v0.16b
1561
+ tbl v15.16b, {v15.16b}, v26.16b
1562
+
1563
+ add v10.4s, v10.4s, v15.4s
1564
+ eor v20.16b, v20.16b, v10.16b
1565
+ ushr v5.4s, v20.4s, #25
1566
+ sli v5.4s, v20.4s, #7
1567
+ ext v5.16b, v5.16b, v5.16b, #12
1568
+ ext v10.16b, v10.16b, v10.16b, #8
1569
+ ext v15.16b, v15.16b, v15.16b, #4
1570
+ subs x6, x6, #1
1571
+ b.hi Lopen_init_rounds
1572
+
1573
+ add v0.4s, v0.4s, v24.4s
1574
+ add v5.4s, v5.4s, v28.4s
1575
+
1576
+ and v0.16b, v0.16b, v27.16b
1577
+ mov x16, v0.d[0] // Move the R key to GPRs
1578
+ mov x17, v0.d[1]
1579
+ mov v27.16b, v5.16b // Store the S key
1580
+
1581
+ bl Lpoly_hash_ad_internal
1582
+
1583
+ mov x3, x1
1584
+
1585
+ // Each iteration of the loop hash 320 bytes, and prepare stream for 320 bytes
1586
+ Lopen_main_loop:
1587
+
1588
+ cmp x2, #192
1589
+ b.lt Lopen_tail
1590
+
1591
+ adrp x11, Lchacha20_consts@PAGE
1592
+ add x11, x11, Lchacha20_consts@PAGEOFF
1593
+
1594
+ ld4r {v0.4s,v1.4s,v2.4s,v3.4s}, [x11]
1595
+ mov v4.16b, v24.16b
1596
+
1597
+ ld4r {v5.4s,v6.4s,v7.4s,v8.4s}, [x5], #16
1598
+ mov v9.16b, v28.16b
1599
+
1600
+ ld4r {v10.4s,v11.4s,v12.4s,v13.4s}, [x5], #16
1601
+ mov v14.16b, v29.16b
1602
+
1603
+ ld4r {v15.4s,v16.4s,v17.4s,v18.4s}, [x5]
1604
+ sub x5, x5, #32
1605
+ add v15.4s, v15.4s, v25.4s
1606
+ mov v19.16b, v30.16b
1607
+
1608
+ eor v20.16b, v20.16b, v20.16b //zero
1609
+ not v21.16b, v20.16b // -1
1610
+ sub v21.4s, v25.4s, v21.4s // Add +1
1611
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
1612
+ add v19.4s, v19.4s, v20.4s
1613
+
1614
+ lsr x4, x2, #4 // How many whole blocks we have to hash, will always be at least 12
1615
+ sub x4, x4, #10
1616
+
1617
+ mov x7, #10
1618
+ subs x6, x7, x4 // itr1 can be negative if we have more than 320 bytes to hash
1619
+ csel x7, x7, x4, le // if itr1 is zero or less, itr2 should be 10 to indicate all 10 rounds are full
1620
+
1621
+ cbz x7, Lopen_main_loop_rounds_short
1622
+
1623
+ .align 5
1624
+ Lopen_main_loop_rounds:
1625
+ ldp x11, x12, [x3], 16
1626
+ adds x8, x8, x11
1627
+ adcs x9, x9, x12
1628
+ adc x10, x10, x15
1629
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1630
+ umulh x12, x8, x16
1631
+ mul x13, x9, x16
1632
+ umulh x14, x9, x16
1633
+ adds x12, x12, x13
1634
+ mul x13, x10, x16
1635
+ adc x13, x13, x14
1636
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1637
+ umulh x8, x8, x17
1638
+ adds x12, x12, x14
1639
+ mul x14, x9, x17
1640
+ umulh x9, x9, x17
1641
+ adcs x14, x14, x8
1642
+ mul x10, x10, x17
1643
+ adc x10, x10, x9
1644
+ adds x13, x13, x14
1645
+ adc x14, x10, xzr
1646
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1647
+ and x8, x13, #-4
1648
+ extr x13, x14, x13, #2
1649
+ adds x8, x8, x11
1650
+ lsr x11, x14, #2
1651
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1652
+ adds x8, x8, x13
1653
+ adcs x9, x9, x12
1654
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1655
+ Lopen_main_loop_rounds_short:
1656
+ add v0.4s, v0.4s, v5.4s
1657
+ add v1.4s, v1.4s, v6.4s
1658
+ add v2.4s, v2.4s, v7.4s
1659
+ add v3.4s, v3.4s, v8.4s
1660
+ add v4.4s, v4.4s, v9.4s
1661
+
1662
+ eor v15.16b, v15.16b, v0.16b
1663
+ eor v16.16b, v16.16b, v1.16b
1664
+ eor v17.16b, v17.16b, v2.16b
1665
+ eor v18.16b, v18.16b, v3.16b
1666
+ eor v19.16b, v19.16b, v4.16b
1667
+
1668
+ rev32 v15.8h, v15.8h
1669
+ rev32 v16.8h, v16.8h
1670
+ rev32 v17.8h, v17.8h
1671
+ rev32 v18.8h, v18.8h
1672
+ rev32 v19.8h, v19.8h
1673
+
1674
+ add v10.4s, v10.4s, v15.4s
1675
+ add v11.4s, v11.4s, v16.4s
1676
+ add v12.4s, v12.4s, v17.4s
1677
+ add v13.4s, v13.4s, v18.4s
1678
+ add v14.4s, v14.4s, v19.4s
1679
+
1680
+ eor v5.16b, v5.16b, v10.16b
1681
+ eor v6.16b, v6.16b, v11.16b
1682
+ eor v7.16b, v7.16b, v12.16b
1683
+ eor v8.16b, v8.16b, v13.16b
1684
+ eor v9.16b, v9.16b, v14.16b
1685
+
1686
+ ushr v20.4s, v5.4s, #20
1687
+ sli v20.4s, v5.4s, #12
1688
+ ushr v5.4s, v6.4s, #20
1689
+ sli v5.4s, v6.4s, #12
1690
+ ushr v6.4s, v7.4s, #20
1691
+ sli v6.4s, v7.4s, #12
1692
+ ushr v7.4s, v8.4s, #20
1693
+ sli v7.4s, v8.4s, #12
1694
+ ushr v8.4s, v9.4s, #20
1695
+ sli v8.4s, v9.4s, #12
1696
+
1697
+ add v0.4s, v0.4s, v20.4s
1698
+ add v1.4s, v1.4s, v5.4s
1699
+ add v2.4s, v2.4s, v6.4s
1700
+ add v3.4s, v3.4s, v7.4s
1701
+ add v4.4s, v4.4s, v8.4s
1702
+
1703
+ eor v15.16b, v15.16b, v0.16b
1704
+ eor v16.16b, v16.16b, v1.16b
1705
+ eor v17.16b, v17.16b, v2.16b
1706
+ eor v18.16b, v18.16b, v3.16b
1707
+ eor v19.16b, v19.16b, v4.16b
1708
+
1709
+ tbl v15.16b, {v15.16b}, v26.16b
1710
+ tbl v16.16b, {v16.16b}, v26.16b
1711
+ tbl v17.16b, {v17.16b}, v26.16b
1712
+ tbl v18.16b, {v18.16b}, v26.16b
1713
+ tbl v19.16b, {v19.16b}, v26.16b
1714
+
1715
+ add v10.4s, v10.4s, v15.4s
1716
+ add v11.4s, v11.4s, v16.4s
1717
+ add v12.4s, v12.4s, v17.4s
1718
+ add v13.4s, v13.4s, v18.4s
1719
+ add v14.4s, v14.4s, v19.4s
1720
+
1721
+ eor v20.16b, v20.16b, v10.16b
1722
+ eor v5.16b, v5.16b, v11.16b
1723
+ eor v6.16b, v6.16b, v12.16b
1724
+ eor v7.16b, v7.16b, v13.16b
1725
+ eor v8.16b, v8.16b, v14.16b
1726
+
1727
+ ushr v9.4s, v8.4s, #25
1728
+ sli v9.4s, v8.4s, #7
1729
+ ushr v8.4s, v7.4s, #25
1730
+ sli v8.4s, v7.4s, #7
1731
+ ushr v7.4s, v6.4s, #25
1732
+ sli v7.4s, v6.4s, #7
1733
+ ushr v6.4s, v5.4s, #25
1734
+ sli v6.4s, v5.4s, #7
1735
+ ushr v5.4s, v20.4s, #25
1736
+ sli v5.4s, v20.4s, #7
1737
+
1738
+ ext v9.16b, v9.16b, v9.16b, #4
1739
+ ext v14.16b, v14.16b, v14.16b, #8
1740
+ ext v19.16b, v19.16b, v19.16b, #12
1741
+ ldp x11, x12, [x3], 16
1742
+ adds x8, x8, x11
1743
+ adcs x9, x9, x12
1744
+ adc x10, x10, x15
1745
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1746
+ umulh x12, x8, x16
1747
+ mul x13, x9, x16
1748
+ umulh x14, x9, x16
1749
+ adds x12, x12, x13
1750
+ mul x13, x10, x16
1751
+ adc x13, x13, x14
1752
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1753
+ umulh x8, x8, x17
1754
+ adds x12, x12, x14
1755
+ mul x14, x9, x17
1756
+ umulh x9, x9, x17
1757
+ adcs x14, x14, x8
1758
+ mul x10, x10, x17
1759
+ adc x10, x10, x9
1760
+ adds x13, x13, x14
1761
+ adc x14, x10, xzr
1762
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1763
+ and x8, x13, #-4
1764
+ extr x13, x14, x13, #2
1765
+ adds x8, x8, x11
1766
+ lsr x11, x14, #2
1767
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1768
+ adds x8, x8, x13
1769
+ adcs x9, x9, x12
1770
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1771
+ add v0.4s, v0.4s, v6.4s
1772
+ add v1.4s, v1.4s, v7.4s
1773
+ add v2.4s, v2.4s, v8.4s
1774
+ add v3.4s, v3.4s, v5.4s
1775
+ add v4.4s, v4.4s, v9.4s
1776
+
1777
+ eor v18.16b, v18.16b, v0.16b
1778
+ eor v15.16b, v15.16b, v1.16b
1779
+ eor v16.16b, v16.16b, v2.16b
1780
+ eor v17.16b, v17.16b, v3.16b
1781
+ eor v19.16b, v19.16b, v4.16b
1782
+
1783
+ rev32 v18.8h, v18.8h
1784
+ rev32 v15.8h, v15.8h
1785
+ rev32 v16.8h, v16.8h
1786
+ rev32 v17.8h, v17.8h
1787
+ rev32 v19.8h, v19.8h
1788
+
1789
+ add v12.4s, v12.4s, v18.4s
1790
+ add v13.4s, v13.4s, v15.4s
1791
+ add v10.4s, v10.4s, v16.4s
1792
+ add v11.4s, v11.4s, v17.4s
1793
+ add v14.4s, v14.4s, v19.4s
1794
+
1795
+ eor v6.16b, v6.16b, v12.16b
1796
+ eor v7.16b, v7.16b, v13.16b
1797
+ eor v8.16b, v8.16b, v10.16b
1798
+ eor v5.16b, v5.16b, v11.16b
1799
+ eor v9.16b, v9.16b, v14.16b
1800
+
1801
+ ushr v20.4s, v6.4s, #20
1802
+ sli v20.4s, v6.4s, #12
1803
+ ushr v6.4s, v7.4s, #20
1804
+ sli v6.4s, v7.4s, #12
1805
+ ushr v7.4s, v8.4s, #20
1806
+ sli v7.4s, v8.4s, #12
1807
+ ushr v8.4s, v5.4s, #20
1808
+ sli v8.4s, v5.4s, #12
1809
+ ushr v5.4s, v9.4s, #20
1810
+ sli v5.4s, v9.4s, #12
1811
+
1812
+ add v0.4s, v0.4s, v20.4s
1813
+ add v1.4s, v1.4s, v6.4s
1814
+ add v2.4s, v2.4s, v7.4s
1815
+ add v3.4s, v3.4s, v8.4s
1816
+ add v4.4s, v4.4s, v5.4s
1817
+
1818
+ eor v18.16b, v18.16b, v0.16b
1819
+ eor v15.16b, v15.16b, v1.16b
1820
+ eor v16.16b, v16.16b, v2.16b
1821
+ eor v17.16b, v17.16b, v3.16b
1822
+ eor v19.16b, v19.16b, v4.16b
1823
+
1824
+ tbl v18.16b, {v18.16b}, v26.16b
1825
+ tbl v15.16b, {v15.16b}, v26.16b
1826
+ tbl v16.16b, {v16.16b}, v26.16b
1827
+ tbl v17.16b, {v17.16b}, v26.16b
1828
+ tbl v19.16b, {v19.16b}, v26.16b
1829
+
1830
+ add v12.4s, v12.4s, v18.4s
1831
+ add v13.4s, v13.4s, v15.4s
1832
+ add v10.4s, v10.4s, v16.4s
1833
+ add v11.4s, v11.4s, v17.4s
1834
+ add v14.4s, v14.4s, v19.4s
1835
+
1836
+ eor v20.16b, v20.16b, v12.16b
1837
+ eor v6.16b, v6.16b, v13.16b
1838
+ eor v7.16b, v7.16b, v10.16b
1839
+ eor v8.16b, v8.16b, v11.16b
1840
+ eor v5.16b, v5.16b, v14.16b
1841
+
1842
+ ushr v9.4s, v5.4s, #25
1843
+ sli v9.4s, v5.4s, #7
1844
+ ushr v5.4s, v8.4s, #25
1845
+ sli v5.4s, v8.4s, #7
1846
+ ushr v8.4s, v7.4s, #25
1847
+ sli v8.4s, v7.4s, #7
1848
+ ushr v7.4s, v6.4s, #25
1849
+ sli v7.4s, v6.4s, #7
1850
+ ushr v6.4s, v20.4s, #25
1851
+ sli v6.4s, v20.4s, #7
1852
+
1853
+ ext v9.16b, v9.16b, v9.16b, #12
1854
+ ext v14.16b, v14.16b, v14.16b, #8
1855
+ ext v19.16b, v19.16b, v19.16b, #4
1856
+ subs x7, x7, #1
1857
+ b.gt Lopen_main_loop_rounds
1858
+ subs x6, x6, #1
1859
+ b.ge Lopen_main_loop_rounds_short
1860
+
1861
+ eor v20.16b, v20.16b, v20.16b //zero
1862
+ not v21.16b, v20.16b // -1
1863
+ sub v21.4s, v25.4s, v21.4s // Add +1
1864
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
1865
+ add v19.4s, v19.4s, v20.4s
1866
+
1867
+ add v15.4s, v15.4s, v25.4s
1868
+ mov x11, #5
1869
+ dup v20.4s, w11
1870
+ add v25.4s, v25.4s, v20.4s
1871
+
1872
+ zip1 v20.4s, v0.4s, v1.4s
1873
+ zip2 v21.4s, v0.4s, v1.4s
1874
+ zip1 v22.4s, v2.4s, v3.4s
1875
+ zip2 v23.4s, v2.4s, v3.4s
1876
+
1877
+ zip1 v0.2d, v20.2d, v22.2d
1878
+ zip2 v1.2d, v20.2d, v22.2d
1879
+ zip1 v2.2d, v21.2d, v23.2d
1880
+ zip2 v3.2d, v21.2d, v23.2d
1881
+
1882
+ zip1 v20.4s, v5.4s, v6.4s
1883
+ zip2 v21.4s, v5.4s, v6.4s
1884
+ zip1 v22.4s, v7.4s, v8.4s
1885
+ zip2 v23.4s, v7.4s, v8.4s
1886
+
1887
+ zip1 v5.2d, v20.2d, v22.2d
1888
+ zip2 v6.2d, v20.2d, v22.2d
1889
+ zip1 v7.2d, v21.2d, v23.2d
1890
+ zip2 v8.2d, v21.2d, v23.2d
1891
+
1892
+ zip1 v20.4s, v10.4s, v11.4s
1893
+ zip2 v21.4s, v10.4s, v11.4s
1894
+ zip1 v22.4s, v12.4s, v13.4s
1895
+ zip2 v23.4s, v12.4s, v13.4s
1896
+
1897
+ zip1 v10.2d, v20.2d, v22.2d
1898
+ zip2 v11.2d, v20.2d, v22.2d
1899
+ zip1 v12.2d, v21.2d, v23.2d
1900
+ zip2 v13.2d, v21.2d, v23.2d
1901
+
1902
+ zip1 v20.4s, v15.4s, v16.4s
1903
+ zip2 v21.4s, v15.4s, v16.4s
1904
+ zip1 v22.4s, v17.4s, v18.4s
1905
+ zip2 v23.4s, v17.4s, v18.4s
1906
+
1907
+ zip1 v15.2d, v20.2d, v22.2d
1908
+ zip2 v16.2d, v20.2d, v22.2d
1909
+ zip1 v17.2d, v21.2d, v23.2d
1910
+ zip2 v18.2d, v21.2d, v23.2d
1911
+
1912
+ add v0.4s, v0.4s, v24.4s
1913
+ add v5.4s, v5.4s, v28.4s
1914
+ add v10.4s, v10.4s, v29.4s
1915
+ add v15.4s, v15.4s, v30.4s
1916
+
1917
+ add v1.4s, v1.4s, v24.4s
1918
+ add v6.4s, v6.4s, v28.4s
1919
+ add v11.4s, v11.4s, v29.4s
1920
+ add v16.4s, v16.4s, v30.4s
1921
+
1922
+ add v2.4s, v2.4s, v24.4s
1923
+ add v7.4s, v7.4s, v28.4s
1924
+ add v12.4s, v12.4s, v29.4s
1925
+ add v17.4s, v17.4s, v30.4s
1926
+
1927
+ add v3.4s, v3.4s, v24.4s
1928
+ add v8.4s, v8.4s, v28.4s
1929
+ add v13.4s, v13.4s, v29.4s
1930
+ add v18.4s, v18.4s, v30.4s
1931
+
1932
+ add v4.4s, v4.4s, v24.4s
1933
+ add v9.4s, v9.4s, v28.4s
1934
+ add v14.4s, v14.4s, v29.4s
1935
+ add v19.4s, v19.4s, v30.4s
1936
+
1937
+ // We can always safely store 192 bytes
1938
+ ld1 {v20.16b - v23.16b}, [x1], #64
1939
+ eor v20.16b, v20.16b, v0.16b
1940
+ eor v21.16b, v21.16b, v5.16b
1941
+ eor v22.16b, v22.16b, v10.16b
1942
+ eor v23.16b, v23.16b, v15.16b
1943
+ st1 {v20.16b - v23.16b}, [x0], #64
1944
+
1945
+ ld1 {v20.16b - v23.16b}, [x1], #64
1946
+ eor v20.16b, v20.16b, v1.16b
1947
+ eor v21.16b, v21.16b, v6.16b
1948
+ eor v22.16b, v22.16b, v11.16b
1949
+ eor v23.16b, v23.16b, v16.16b
1950
+ st1 {v20.16b - v23.16b}, [x0], #64
1951
+
1952
+ ld1 {v20.16b - v23.16b}, [x1], #64
1953
+ eor v20.16b, v20.16b, v2.16b
1954
+ eor v21.16b, v21.16b, v7.16b
1955
+ eor v22.16b, v22.16b, v12.16b
1956
+ eor v23.16b, v23.16b, v17.16b
1957
+ st1 {v20.16b - v23.16b}, [x0], #64
1958
+
1959
+ sub x2, x2, #192
1960
+
1961
+ mov v0.16b, v3.16b
1962
+ mov v5.16b, v8.16b
1963
+ mov v10.16b, v13.16b
1964
+ mov v15.16b, v18.16b
1965
+
1966
+ cmp x2, #64
1967
+ b.lt Lopen_tail_64_store
1968
+
1969
+ ld1 {v20.16b - v23.16b}, [x1], #64
1970
+ eor v20.16b, v20.16b, v3.16b
1971
+ eor v21.16b, v21.16b, v8.16b
1972
+ eor v22.16b, v22.16b, v13.16b
1973
+ eor v23.16b, v23.16b, v18.16b
1974
+ st1 {v20.16b - v23.16b}, [x0], #64
1975
+
1976
+ sub x2, x2, #64
1977
+
1978
+ mov v0.16b, v4.16b
1979
+ mov v5.16b, v9.16b
1980
+ mov v10.16b, v14.16b
1981
+ mov v15.16b, v19.16b
1982
+
1983
+ cmp x2, #64
1984
+ b.lt Lopen_tail_64_store
1985
+
1986
+ ld1 {v20.16b - v23.16b}, [x1], #64
1987
+ eor v20.16b, v20.16b, v4.16b
1988
+ eor v21.16b, v21.16b, v9.16b
1989
+ eor v22.16b, v22.16b, v14.16b
1990
+ eor v23.16b, v23.16b, v19.16b
1991
+ st1 {v20.16b - v23.16b}, [x0], #64
1992
+
1993
+ sub x2, x2, #64
1994
+ b Lopen_main_loop
1995
+
1996
+ Lopen_tail:
1997
+
1998
+ cbz x2, Lopen_finalize
1999
+
2000
+ lsr x4, x2, #4 // How many whole blocks we have to hash
2001
+
2002
+ cmp x2, #64
2003
+ b.le Lopen_tail_64
2004
+ cmp x2, #128
2005
+ b.le Lopen_tail_128
2006
+
2007
+ Lopen_tail_192:
2008
+ // We need three more blocks
2009
+ mov v0.16b, v24.16b
2010
+ mov v1.16b, v24.16b
2011
+ mov v2.16b, v24.16b
2012
+ mov v5.16b, v28.16b
2013
+ mov v6.16b, v28.16b
2014
+ mov v7.16b, v28.16b
2015
+ mov v10.16b, v29.16b
2016
+ mov v11.16b, v29.16b
2017
+ mov v12.16b, v29.16b
2018
+ mov v15.16b, v30.16b
2019
+ mov v16.16b, v30.16b
2020
+ mov v17.16b, v30.16b
2021
+ eor v23.16b, v23.16b, v23.16b
2022
+ eor v21.16b, v21.16b, v21.16b
2023
+ ins v23.s[0], v25.s[0]
2024
+ ins v21.d[0], x15
2025
+
2026
+ add v22.4s, v23.4s, v21.4s
2027
+ add v21.4s, v22.4s, v21.4s
2028
+
2029
+ add v15.4s, v15.4s, v21.4s
2030
+ add v16.4s, v16.4s, v23.4s
2031
+ add v17.4s, v17.4s, v22.4s
2032
+
2033
+ mov x7, #10
2034
+ subs x6, x7, x4 // itr1 can be negative if we have more than 160 bytes to hash
2035
+ csel x7, x7, x4, le // if itr1 is zero or less, itr2 should be 10 to indicate all 10 rounds are hashing
2036
+ sub x4, x4, x7
2037
+
2038
+ cbz x7, Lopen_tail_192_rounds_no_hash
2039
+
2040
+ Lopen_tail_192_rounds:
2041
+ ldp x11, x12, [x3], 16
2042
+ adds x8, x8, x11
2043
+ adcs x9, x9, x12
2044
+ adc x10, x10, x15
2045
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2046
+ umulh x12, x8, x16
2047
+ mul x13, x9, x16
2048
+ umulh x14, x9, x16
2049
+ adds x12, x12, x13
2050
+ mul x13, x10, x16
2051
+ adc x13, x13, x14
2052
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2053
+ umulh x8, x8, x17
2054
+ adds x12, x12, x14
2055
+ mul x14, x9, x17
2056
+ umulh x9, x9, x17
2057
+ adcs x14, x14, x8
2058
+ mul x10, x10, x17
2059
+ adc x10, x10, x9
2060
+ adds x13, x13, x14
2061
+ adc x14, x10, xzr
2062
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2063
+ and x8, x13, #-4
2064
+ extr x13, x14, x13, #2
2065
+ adds x8, x8, x11
2066
+ lsr x11, x14, #2
2067
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2068
+ adds x8, x8, x13
2069
+ adcs x9, x9, x12
2070
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2071
+ Lopen_tail_192_rounds_no_hash:
2072
+ add v0.4s, v0.4s, v5.4s
2073
+ add v1.4s, v1.4s, v6.4s
2074
+ add v2.4s, v2.4s, v7.4s
2075
+ eor v15.16b, v15.16b, v0.16b
2076
+ eor v16.16b, v16.16b, v1.16b
2077
+ eor v17.16b, v17.16b, v2.16b
2078
+ rev32 v15.8h, v15.8h
2079
+ rev32 v16.8h, v16.8h
2080
+ rev32 v17.8h, v17.8h
2081
+
2082
+ add v10.4s, v10.4s, v15.4s
2083
+ add v11.4s, v11.4s, v16.4s
2084
+ add v12.4s, v12.4s, v17.4s
2085
+ eor v5.16b, v5.16b, v10.16b
2086
+ eor v6.16b, v6.16b, v11.16b
2087
+ eor v7.16b, v7.16b, v12.16b
2088
+ ushr v20.4s, v5.4s, #20
2089
+ sli v20.4s, v5.4s, #12
2090
+ ushr v5.4s, v6.4s, #20
2091
+ sli v5.4s, v6.4s, #12
2092
+ ushr v6.4s, v7.4s, #20
2093
+ sli v6.4s, v7.4s, #12
2094
+
2095
+ add v0.4s, v0.4s, v20.4s
2096
+ add v1.4s, v1.4s, v5.4s
2097
+ add v2.4s, v2.4s, v6.4s
2098
+ eor v15.16b, v15.16b, v0.16b
2099
+ eor v16.16b, v16.16b, v1.16b
2100
+ eor v17.16b, v17.16b, v2.16b
2101
+ tbl v15.16b, {v15.16b}, v26.16b
2102
+ tbl v16.16b, {v16.16b}, v26.16b
2103
+ tbl v17.16b, {v17.16b}, v26.16b
2104
+
2105
+ add v10.4s, v10.4s, v15.4s
2106
+ add v11.4s, v11.4s, v16.4s
2107
+ add v12.4s, v12.4s, v17.4s
2108
+ eor v20.16b, v20.16b, v10.16b
2109
+ eor v5.16b, v5.16b, v11.16b
2110
+ eor v6.16b, v6.16b, v12.16b
2111
+ ushr v7.4s, v6.4s, #25
2112
+ sli v7.4s, v6.4s, #7
2113
+ ushr v6.4s, v5.4s, #25
2114
+ sli v6.4s, v5.4s, #7
2115
+ ushr v5.4s, v20.4s, #25
2116
+ sli v5.4s, v20.4s, #7
2117
+
2118
+ ext v5.16b, v5.16b, v5.16b, #4
2119
+ ext v6.16b, v6.16b, v6.16b, #4
2120
+ ext v7.16b, v7.16b, v7.16b, #4
2121
+
2122
+ ext v10.16b, v10.16b, v10.16b, #8
2123
+ ext v11.16b, v11.16b, v11.16b, #8
2124
+ ext v12.16b, v12.16b, v12.16b, #8
2125
+
2126
+ ext v15.16b, v15.16b, v15.16b, #12
2127
+ ext v16.16b, v16.16b, v16.16b, #12
2128
+ ext v17.16b, v17.16b, v17.16b, #12
2129
+ add v0.4s, v0.4s, v5.4s
2130
+ add v1.4s, v1.4s, v6.4s
2131
+ add v2.4s, v2.4s, v7.4s
2132
+ eor v15.16b, v15.16b, v0.16b
2133
+ eor v16.16b, v16.16b, v1.16b
2134
+ eor v17.16b, v17.16b, v2.16b
2135
+ rev32 v15.8h, v15.8h
2136
+ rev32 v16.8h, v16.8h
2137
+ rev32 v17.8h, v17.8h
2138
+
2139
+ add v10.4s, v10.4s, v15.4s
2140
+ add v11.4s, v11.4s, v16.4s
2141
+ add v12.4s, v12.4s, v17.4s
2142
+ eor v5.16b, v5.16b, v10.16b
2143
+ eor v6.16b, v6.16b, v11.16b
2144
+ eor v7.16b, v7.16b, v12.16b
2145
+ ushr v20.4s, v5.4s, #20
2146
+ sli v20.4s, v5.4s, #12
2147
+ ushr v5.4s, v6.4s, #20
2148
+ sli v5.4s, v6.4s, #12
2149
+ ushr v6.4s, v7.4s, #20
2150
+ sli v6.4s, v7.4s, #12
2151
+
2152
+ add v0.4s, v0.4s, v20.4s
2153
+ add v1.4s, v1.4s, v5.4s
2154
+ add v2.4s, v2.4s, v6.4s
2155
+ eor v15.16b, v15.16b, v0.16b
2156
+ eor v16.16b, v16.16b, v1.16b
2157
+ eor v17.16b, v17.16b, v2.16b
2158
+ tbl v15.16b, {v15.16b}, v26.16b
2159
+ tbl v16.16b, {v16.16b}, v26.16b
2160
+ tbl v17.16b, {v17.16b}, v26.16b
2161
+
2162
+ add v10.4s, v10.4s, v15.4s
2163
+ add v11.4s, v11.4s, v16.4s
2164
+ add v12.4s, v12.4s, v17.4s
2165
+ eor v20.16b, v20.16b, v10.16b
2166
+ eor v5.16b, v5.16b, v11.16b
2167
+ eor v6.16b, v6.16b, v12.16b
2168
+ ushr v7.4s, v6.4s, #25
2169
+ sli v7.4s, v6.4s, #7
2170
+ ushr v6.4s, v5.4s, #25
2171
+ sli v6.4s, v5.4s, #7
2172
+ ushr v5.4s, v20.4s, #25
2173
+ sli v5.4s, v20.4s, #7
2174
+
2175
+ ext v5.16b, v5.16b, v5.16b, #12
2176
+ ext v6.16b, v6.16b, v6.16b, #12
2177
+ ext v7.16b, v7.16b, v7.16b, #12
2178
+
2179
+ ext v10.16b, v10.16b, v10.16b, #8
2180
+ ext v11.16b, v11.16b, v11.16b, #8
2181
+ ext v12.16b, v12.16b, v12.16b, #8
2182
+
2183
+ ext v15.16b, v15.16b, v15.16b, #4
2184
+ ext v16.16b, v16.16b, v16.16b, #4
2185
+ ext v17.16b, v17.16b, v17.16b, #4
2186
+ subs x7, x7, #1
2187
+ b.gt Lopen_tail_192_rounds
2188
+ subs x6, x6, #1
2189
+ b.ge Lopen_tail_192_rounds_no_hash
2190
+
2191
+ // We hashed 160 bytes at most, may still have 32 bytes left
2192
+ Lopen_tail_192_hash:
2193
+ cbz x4, Lopen_tail_192_hash_done
2194
+ ldp x11, x12, [x3], 16
2195
+ adds x8, x8, x11
2196
+ adcs x9, x9, x12
2197
+ adc x10, x10, x15
2198
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2199
+ umulh x12, x8, x16
2200
+ mul x13, x9, x16
2201
+ umulh x14, x9, x16
2202
+ adds x12, x12, x13
2203
+ mul x13, x10, x16
2204
+ adc x13, x13, x14
2205
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2206
+ umulh x8, x8, x17
2207
+ adds x12, x12, x14
2208
+ mul x14, x9, x17
2209
+ umulh x9, x9, x17
2210
+ adcs x14, x14, x8
2211
+ mul x10, x10, x17
2212
+ adc x10, x10, x9
2213
+ adds x13, x13, x14
2214
+ adc x14, x10, xzr
2215
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2216
+ and x8, x13, #-4
2217
+ extr x13, x14, x13, #2
2218
+ adds x8, x8, x11
2219
+ lsr x11, x14, #2
2220
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2221
+ adds x8, x8, x13
2222
+ adcs x9, x9, x12
2223
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2224
+ sub x4, x4, #1
2225
+ b Lopen_tail_192_hash
2226
+
2227
+ Lopen_tail_192_hash_done:
2228
+
2229
+ add v0.4s, v0.4s, v24.4s
2230
+ add v1.4s, v1.4s, v24.4s
2231
+ add v2.4s, v2.4s, v24.4s
2232
+ add v5.4s, v5.4s, v28.4s
2233
+ add v6.4s, v6.4s, v28.4s
2234
+ add v7.4s, v7.4s, v28.4s
2235
+ add v10.4s, v10.4s, v29.4s
2236
+ add v11.4s, v11.4s, v29.4s
2237
+ add v12.4s, v12.4s, v29.4s
2238
+ add v15.4s, v15.4s, v30.4s
2239
+ add v16.4s, v16.4s, v30.4s
2240
+ add v17.4s, v17.4s, v30.4s
2241
+
2242
+ add v15.4s, v15.4s, v21.4s
2243
+ add v16.4s, v16.4s, v23.4s
2244
+ add v17.4s, v17.4s, v22.4s
2245
+
2246
+ ld1 {v20.16b - v23.16b}, [x1], #64
2247
+
2248
+ eor v20.16b, v20.16b, v1.16b
2249
+ eor v21.16b, v21.16b, v6.16b
2250
+ eor v22.16b, v22.16b, v11.16b
2251
+ eor v23.16b, v23.16b, v16.16b
2252
+
2253
+ st1 {v20.16b - v23.16b}, [x0], #64
2254
+
2255
+ ld1 {v20.16b - v23.16b}, [x1], #64
2256
+
2257
+ eor v20.16b, v20.16b, v2.16b
2258
+ eor v21.16b, v21.16b, v7.16b
2259
+ eor v22.16b, v22.16b, v12.16b
2260
+ eor v23.16b, v23.16b, v17.16b
2261
+
2262
+ st1 {v20.16b - v23.16b}, [x0], #64
2263
+
2264
+ sub x2, x2, #128
2265
+ b Lopen_tail_64_store
2266
+
2267
+ Lopen_tail_128:
2268
+ // We need two more blocks
2269
+ mov v0.16b, v24.16b
2270
+ mov v1.16b, v24.16b
2271
+ mov v5.16b, v28.16b
2272
+ mov v6.16b, v28.16b
2273
+ mov v10.16b, v29.16b
2274
+ mov v11.16b, v29.16b
2275
+ mov v15.16b, v30.16b
2276
+ mov v16.16b, v30.16b
2277
+ eor v23.16b, v23.16b, v23.16b
2278
+ eor v22.16b, v22.16b, v22.16b
2279
+ ins v23.s[0], v25.s[0]
2280
+ ins v22.d[0], x15
2281
+ add v22.4s, v22.4s, v23.4s
2282
+
2283
+ add v15.4s, v15.4s, v22.4s
2284
+ add v16.4s, v16.4s, v23.4s
2285
+
2286
+ mov x6, #10
2287
+ sub x6, x6, x4
2288
+
2289
+ Lopen_tail_128_rounds:
2290
+ add v0.4s, v0.4s, v5.4s
2291
+ eor v15.16b, v15.16b, v0.16b
2292
+ rev32 v15.8h, v15.8h
2293
+
2294
+ add v10.4s, v10.4s, v15.4s
2295
+ eor v5.16b, v5.16b, v10.16b
2296
+ ushr v20.4s, v5.4s, #20
2297
+ sli v20.4s, v5.4s, #12
2298
+ add v0.4s, v0.4s, v20.4s
2299
+ eor v15.16b, v15.16b, v0.16b
2300
+ tbl v15.16b, {v15.16b}, v26.16b
2301
+
2302
+ add v10.4s, v10.4s, v15.4s
2303
+ eor v20.16b, v20.16b, v10.16b
2304
+ ushr v5.4s, v20.4s, #25
2305
+ sli v5.4s, v20.4s, #7
2306
+ ext v5.16b, v5.16b, v5.16b, #4
2307
+ ext v10.16b, v10.16b, v10.16b, #8
2308
+ ext v15.16b, v15.16b, v15.16b, #12
2309
+ add v1.4s, v1.4s, v6.4s
2310
+ eor v16.16b, v16.16b, v1.16b
2311
+ rev32 v16.8h, v16.8h
2312
+
2313
+ add v11.4s, v11.4s, v16.4s
2314
+ eor v6.16b, v6.16b, v11.16b
2315
+ ushr v20.4s, v6.4s, #20
2316
+ sli v20.4s, v6.4s, #12
2317
+ add v1.4s, v1.4s, v20.4s
2318
+ eor v16.16b, v16.16b, v1.16b
2319
+ tbl v16.16b, {v16.16b}, v26.16b
2320
+
2321
+ add v11.4s, v11.4s, v16.4s
2322
+ eor v20.16b, v20.16b, v11.16b
2323
+ ushr v6.4s, v20.4s, #25
2324
+ sli v6.4s, v20.4s, #7
2325
+ ext v6.16b, v6.16b, v6.16b, #4
2326
+ ext v11.16b, v11.16b, v11.16b, #8
2327
+ ext v16.16b, v16.16b, v16.16b, #12
2328
+ add v0.4s, v0.4s, v5.4s
2329
+ eor v15.16b, v15.16b, v0.16b
2330
+ rev32 v15.8h, v15.8h
2331
+
2332
+ add v10.4s, v10.4s, v15.4s
2333
+ eor v5.16b, v5.16b, v10.16b
2334
+ ushr v20.4s, v5.4s, #20
2335
+ sli v20.4s, v5.4s, #12
2336
+ add v0.4s, v0.4s, v20.4s
2337
+ eor v15.16b, v15.16b, v0.16b
2338
+ tbl v15.16b, {v15.16b}, v26.16b
2339
+
2340
+ add v10.4s, v10.4s, v15.4s
2341
+ eor v20.16b, v20.16b, v10.16b
2342
+ ushr v5.4s, v20.4s, #25
2343
+ sli v5.4s, v20.4s, #7
2344
+ ext v5.16b, v5.16b, v5.16b, #12
2345
+ ext v10.16b, v10.16b, v10.16b, #8
2346
+ ext v15.16b, v15.16b, v15.16b, #4
2347
+ add v1.4s, v1.4s, v6.4s
2348
+ eor v16.16b, v16.16b, v1.16b
2349
+ rev32 v16.8h, v16.8h
2350
+
2351
+ add v11.4s, v11.4s, v16.4s
2352
+ eor v6.16b, v6.16b, v11.16b
2353
+ ushr v20.4s, v6.4s, #20
2354
+ sli v20.4s, v6.4s, #12
2355
+ add v1.4s, v1.4s, v20.4s
2356
+ eor v16.16b, v16.16b, v1.16b
2357
+ tbl v16.16b, {v16.16b}, v26.16b
2358
+
2359
+ add v11.4s, v11.4s, v16.4s
2360
+ eor v20.16b, v20.16b, v11.16b
2361
+ ushr v6.4s, v20.4s, #25
2362
+ sli v6.4s, v20.4s, #7
2363
+ ext v6.16b, v6.16b, v6.16b, #12
2364
+ ext v11.16b, v11.16b, v11.16b, #8
2365
+ ext v16.16b, v16.16b, v16.16b, #4
2366
+ subs x6, x6, #1
2367
+ b.gt Lopen_tail_128_rounds
2368
+ cbz x4, Lopen_tail_128_rounds_done
2369
+ subs x4, x4, #1
2370
+ ldp x11, x12, [x3], 16
2371
+ adds x8, x8, x11
2372
+ adcs x9, x9, x12
2373
+ adc x10, x10, x15
2374
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2375
+ umulh x12, x8, x16
2376
+ mul x13, x9, x16
2377
+ umulh x14, x9, x16
2378
+ adds x12, x12, x13
2379
+ mul x13, x10, x16
2380
+ adc x13, x13, x14
2381
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2382
+ umulh x8, x8, x17
2383
+ adds x12, x12, x14
2384
+ mul x14, x9, x17
2385
+ umulh x9, x9, x17
2386
+ adcs x14, x14, x8
2387
+ mul x10, x10, x17
2388
+ adc x10, x10, x9
2389
+ adds x13, x13, x14
2390
+ adc x14, x10, xzr
2391
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2392
+ and x8, x13, #-4
2393
+ extr x13, x14, x13, #2
2394
+ adds x8, x8, x11
2395
+ lsr x11, x14, #2
2396
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2397
+ adds x8, x8, x13
2398
+ adcs x9, x9, x12
2399
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2400
+ b Lopen_tail_128_rounds
2401
+
2402
+ Lopen_tail_128_rounds_done:
2403
+ add v0.4s, v0.4s, v24.4s
2404
+ add v1.4s, v1.4s, v24.4s
2405
+ add v5.4s, v5.4s, v28.4s
2406
+ add v6.4s, v6.4s, v28.4s
2407
+ add v10.4s, v10.4s, v29.4s
2408
+ add v11.4s, v11.4s, v29.4s
2409
+ add v15.4s, v15.4s, v30.4s
2410
+ add v16.4s, v16.4s, v30.4s
2411
+ add v15.4s, v15.4s, v22.4s
2412
+ add v16.4s, v16.4s, v23.4s
2413
+
2414
+ ld1 {v20.16b - v23.16b}, [x1], #64
2415
+
2416
+ eor v20.16b, v20.16b, v1.16b
2417
+ eor v21.16b, v21.16b, v6.16b
2418
+ eor v22.16b, v22.16b, v11.16b
2419
+ eor v23.16b, v23.16b, v16.16b
2420
+
2421
+ st1 {v20.16b - v23.16b}, [x0], #64
2422
+ sub x2, x2, #64
2423
+
2424
+ b Lopen_tail_64_store
2425
+
2426
+ Lopen_tail_64:
2427
+ // We just need a single block
2428
+ mov v0.16b, v24.16b
2429
+ mov v5.16b, v28.16b
2430
+ mov v10.16b, v29.16b
2431
+ mov v15.16b, v30.16b
2432
+ eor v23.16b, v23.16b, v23.16b
2433
+ ins v23.s[0], v25.s[0]
2434
+ add v15.4s, v15.4s, v23.4s
2435
+
2436
+ mov x6, #10
2437
+ sub x6, x6, x4
2438
+
2439
+ Lopen_tail_64_rounds:
2440
+ add v0.4s, v0.4s, v5.4s
2441
+ eor v15.16b, v15.16b, v0.16b
2442
+ rev32 v15.8h, v15.8h
2443
+
2444
+ add v10.4s, v10.4s, v15.4s
2445
+ eor v5.16b, v5.16b, v10.16b
2446
+ ushr v20.4s, v5.4s, #20
2447
+ sli v20.4s, v5.4s, #12
2448
+ add v0.4s, v0.4s, v20.4s
2449
+ eor v15.16b, v15.16b, v0.16b
2450
+ tbl v15.16b, {v15.16b}, v26.16b
2451
+
2452
+ add v10.4s, v10.4s, v15.4s
2453
+ eor v20.16b, v20.16b, v10.16b
2454
+ ushr v5.4s, v20.4s, #25
2455
+ sli v5.4s, v20.4s, #7
2456
+ ext v5.16b, v5.16b, v5.16b, #4
2457
+ ext v10.16b, v10.16b, v10.16b, #8
2458
+ ext v15.16b, v15.16b, v15.16b, #12
2459
+ add v0.4s, v0.4s, v5.4s
2460
+ eor v15.16b, v15.16b, v0.16b
2461
+ rev32 v15.8h, v15.8h
2462
+
2463
+ add v10.4s, v10.4s, v15.4s
2464
+ eor v5.16b, v5.16b, v10.16b
2465
+ ushr v20.4s, v5.4s, #20
2466
+ sli v20.4s, v5.4s, #12
2467
+ add v0.4s, v0.4s, v20.4s
2468
+ eor v15.16b, v15.16b, v0.16b
2469
+ tbl v15.16b, {v15.16b}, v26.16b
2470
+
2471
+ add v10.4s, v10.4s, v15.4s
2472
+ eor v20.16b, v20.16b, v10.16b
2473
+ ushr v5.4s, v20.4s, #25
2474
+ sli v5.4s, v20.4s, #7
2475
+ ext v5.16b, v5.16b, v5.16b, #12
2476
+ ext v10.16b, v10.16b, v10.16b, #8
2477
+ ext v15.16b, v15.16b, v15.16b, #4
2478
+ subs x6, x6, #1
2479
+ b.gt Lopen_tail_64_rounds
2480
+ cbz x4, Lopen_tail_64_rounds_done
2481
+ subs x4, x4, #1
2482
+ ldp x11, x12, [x3], 16
2483
+ adds x8, x8, x11
2484
+ adcs x9, x9, x12
2485
+ adc x10, x10, x15
2486
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2487
+ umulh x12, x8, x16
2488
+ mul x13, x9, x16
2489
+ umulh x14, x9, x16
2490
+ adds x12, x12, x13
2491
+ mul x13, x10, x16
2492
+ adc x13, x13, x14
2493
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2494
+ umulh x8, x8, x17
2495
+ adds x12, x12, x14
2496
+ mul x14, x9, x17
2497
+ umulh x9, x9, x17
2498
+ adcs x14, x14, x8
2499
+ mul x10, x10, x17
2500
+ adc x10, x10, x9
2501
+ adds x13, x13, x14
2502
+ adc x14, x10, xzr
2503
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2504
+ and x8, x13, #-4
2505
+ extr x13, x14, x13, #2
2506
+ adds x8, x8, x11
2507
+ lsr x11, x14, #2
2508
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2509
+ adds x8, x8, x13
2510
+ adcs x9, x9, x12
2511
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2512
+ b Lopen_tail_64_rounds
2513
+
2514
+ Lopen_tail_64_rounds_done:
2515
+ add v0.4s, v0.4s, v24.4s
2516
+ add v5.4s, v5.4s, v28.4s
2517
+ add v10.4s, v10.4s, v29.4s
2518
+ add v15.4s, v15.4s, v30.4s
2519
+ add v15.4s, v15.4s, v23.4s
2520
+
2521
+ Lopen_tail_64_store:
2522
+ cmp x2, #16
2523
+ b.lt Lopen_tail_16
2524
+
2525
+ ld1 {v20.16b}, [x1], #16
2526
+ eor v20.16b, v20.16b, v0.16b
2527
+ st1 {v20.16b}, [x0], #16
2528
+ mov v0.16b, v5.16b
2529
+ mov v5.16b, v10.16b
2530
+ mov v10.16b, v15.16b
2531
+ sub x2, x2, #16
2532
+ b Lopen_tail_64_store
2533
+
2534
+ Lopen_tail_16:
2535
+ // Here we handle the last [0,16) bytes that require a padded block
2536
+ cbz x2, Lopen_finalize
2537
+
2538
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the ciphertext
2539
+ eor v21.16b, v21.16b, v21.16b // Use T1 to generate an AND mask
2540
+ not v22.16b, v20.16b
2541
+
2542
+ add x7, x1, x2
2543
+ mov x6, x2
2544
+
2545
+ Lopen_tail_16_compose:
2546
+ ext v20.16b, v20.16b, v20.16b, #15
2547
+ ldrb w11, [x7, #-1]!
2548
+ mov v20.b[0], w11
2549
+ ext v21.16b, v22.16b, v21.16b, #15
2550
+ subs x2, x2, #1
2551
+ b.gt Lopen_tail_16_compose
2552
+
2553
+ and v20.16b, v20.16b, v21.16b
2554
+ // Hash in the final padded block
2555
+ mov x11, v20.d[0]
2556
+ mov x12, v20.d[1]
2557
+ adds x8, x8, x11
2558
+ adcs x9, x9, x12
2559
+ adc x10, x10, x15
2560
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2561
+ umulh x12, x8, x16
2562
+ mul x13, x9, x16
2563
+ umulh x14, x9, x16
2564
+ adds x12, x12, x13
2565
+ mul x13, x10, x16
2566
+ adc x13, x13, x14
2567
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2568
+ umulh x8, x8, x17
2569
+ adds x12, x12, x14
2570
+ mul x14, x9, x17
2571
+ umulh x9, x9, x17
2572
+ adcs x14, x14, x8
2573
+ mul x10, x10, x17
2574
+ adc x10, x10, x9
2575
+ adds x13, x13, x14
2576
+ adc x14, x10, xzr
2577
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2578
+ and x8, x13, #-4
2579
+ extr x13, x14, x13, #2
2580
+ adds x8, x8, x11
2581
+ lsr x11, x14, #2
2582
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2583
+ adds x8, x8, x13
2584
+ adcs x9, x9, x12
2585
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2586
+ eor v20.16b, v20.16b, v0.16b
2587
+
2588
+ Lopen_tail_16_store:
2589
+ umov w11, v20.b[0]
2590
+ strb w11, [x0], #1
2591
+ ext v20.16b, v20.16b, v20.16b, #1
2592
+ subs x6, x6, #1
2593
+ b.gt Lopen_tail_16_store
2594
+
2595
+ Lopen_finalize:
2596
+ mov x11, v31.d[0]
2597
+ mov x12, v31.d[1]
2598
+ adds x8, x8, x11
2599
+ adcs x9, x9, x12
2600
+ adc x10, x10, x15
2601
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2602
+ umulh x12, x8, x16
2603
+ mul x13, x9, x16
2604
+ umulh x14, x9, x16
2605
+ adds x12, x12, x13
2606
+ mul x13, x10, x16
2607
+ adc x13, x13, x14
2608
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2609
+ umulh x8, x8, x17
2610
+ adds x12, x12, x14
2611
+ mul x14, x9, x17
2612
+ umulh x9, x9, x17
2613
+ adcs x14, x14, x8
2614
+ mul x10, x10, x17
2615
+ adc x10, x10, x9
2616
+ adds x13, x13, x14
2617
+ adc x14, x10, xzr
2618
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2619
+ and x8, x13, #-4
2620
+ extr x13, x14, x13, #2
2621
+ adds x8, x8, x11
2622
+ lsr x11, x14, #2
2623
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2624
+ adds x8, x8, x13
2625
+ adcs x9, x9, x12
2626
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2627
+ // Final reduction step
2628
+ sub x12, xzr, x15
2629
+ orr x13, xzr, #3
2630
+ subs x11, x8, #-5
2631
+ sbcs x12, x9, x12
2632
+ sbcs x13, x10, x13
2633
+ csel x8, x11, x8, cs
2634
+ csel x9, x12, x9, cs
2635
+ csel x10, x13, x10, cs
2636
+ mov x11, v27.d[0]
2637
+ mov x12, v27.d[1]
2638
+ adds x8, x8, x11
2639
+ adcs x9, x9, x12
2640
+ adc x10, x10, x15
2641
+
2642
+ stp x8, x9, [x5]
2643
+
2644
+ ldp d8, d9, [sp, #16]
2645
+ ldp d10, d11, [sp, #32]
2646
+ ldp d12, d13, [sp, #48]
2647
+ ldp d14, d15, [sp, #64]
2648
+ .cfi_restore b15
2649
+ .cfi_restore b14
2650
+ .cfi_restore b13
2651
+ .cfi_restore b12
2652
+ .cfi_restore b11
2653
+ .cfi_restore b10
2654
+ .cfi_restore b9
2655
+ .cfi_restore b8
2656
+ ldp x29, x30, [sp], 80
2657
+ .cfi_restore w29
2658
+ .cfi_restore w30
2659
+ .cfi_def_cfa_offset 0
2660
+ AARCH64_VALIDATE_LINK_REGISTER
2661
+ ret
2662
+
2663
+ Lopen_128:
2664
+ // On some architectures preparing 5 blocks for small buffers is wasteful
2665
+ eor v25.16b, v25.16b, v25.16b
2666
+ mov x11, #1
2667
+ mov v25.s[0], w11
2668
+ mov v0.16b, v24.16b
2669
+ mov v1.16b, v24.16b
2670
+ mov v2.16b, v24.16b
2671
+ mov v5.16b, v28.16b
2672
+ mov v6.16b, v28.16b
2673
+ mov v7.16b, v28.16b
2674
+ mov v10.16b, v29.16b
2675
+ mov v11.16b, v29.16b
2676
+ mov v12.16b, v29.16b
2677
+ mov v17.16b, v30.16b
2678
+ add v15.4s, v17.4s, v25.4s
2679
+ add v16.4s, v15.4s, v25.4s
2680
+
2681
+ mov x6, #10
2682
+
2683
+ Lopen_128_rounds:
2684
+ add v0.4s, v0.4s, v5.4s
2685
+ add v1.4s, v1.4s, v6.4s
2686
+ add v2.4s, v2.4s, v7.4s
2687
+ eor v15.16b, v15.16b, v0.16b
2688
+ eor v16.16b, v16.16b, v1.16b
2689
+ eor v17.16b, v17.16b, v2.16b
2690
+ rev32 v15.8h, v15.8h
2691
+ rev32 v16.8h, v16.8h
2692
+ rev32 v17.8h, v17.8h
2693
+
2694
+ add v10.4s, v10.4s, v15.4s
2695
+ add v11.4s, v11.4s, v16.4s
2696
+ add v12.4s, v12.4s, v17.4s
2697
+ eor v5.16b, v5.16b, v10.16b
2698
+ eor v6.16b, v6.16b, v11.16b
2699
+ eor v7.16b, v7.16b, v12.16b
2700
+ ushr v20.4s, v5.4s, #20
2701
+ sli v20.4s, v5.4s, #12
2702
+ ushr v5.4s, v6.4s, #20
2703
+ sli v5.4s, v6.4s, #12
2704
+ ushr v6.4s, v7.4s, #20
2705
+ sli v6.4s, v7.4s, #12
2706
+
2707
+ add v0.4s, v0.4s, v20.4s
2708
+ add v1.4s, v1.4s, v5.4s
2709
+ add v2.4s, v2.4s, v6.4s
2710
+ eor v15.16b, v15.16b, v0.16b
2711
+ eor v16.16b, v16.16b, v1.16b
2712
+ eor v17.16b, v17.16b, v2.16b
2713
+ tbl v15.16b, {v15.16b}, v26.16b
2714
+ tbl v16.16b, {v16.16b}, v26.16b
2715
+ tbl v17.16b, {v17.16b}, v26.16b
2716
+
2717
+ add v10.4s, v10.4s, v15.4s
2718
+ add v11.4s, v11.4s, v16.4s
2719
+ add v12.4s, v12.4s, v17.4s
2720
+ eor v20.16b, v20.16b, v10.16b
2721
+ eor v5.16b, v5.16b, v11.16b
2722
+ eor v6.16b, v6.16b, v12.16b
2723
+ ushr v7.4s, v6.4s, #25
2724
+ sli v7.4s, v6.4s, #7
2725
+ ushr v6.4s, v5.4s, #25
2726
+ sli v6.4s, v5.4s, #7
2727
+ ushr v5.4s, v20.4s, #25
2728
+ sli v5.4s, v20.4s, #7
2729
+
2730
+ ext v5.16b, v5.16b, v5.16b, #4
2731
+ ext v6.16b, v6.16b, v6.16b, #4
2732
+ ext v7.16b, v7.16b, v7.16b, #4
2733
+
2734
+ ext v10.16b, v10.16b, v10.16b, #8
2735
+ ext v11.16b, v11.16b, v11.16b, #8
2736
+ ext v12.16b, v12.16b, v12.16b, #8
2737
+
2738
+ ext v15.16b, v15.16b, v15.16b, #12
2739
+ ext v16.16b, v16.16b, v16.16b, #12
2740
+ ext v17.16b, v17.16b, v17.16b, #12
2741
+ add v0.4s, v0.4s, v5.4s
2742
+ add v1.4s, v1.4s, v6.4s
2743
+ add v2.4s, v2.4s, v7.4s
2744
+ eor v15.16b, v15.16b, v0.16b
2745
+ eor v16.16b, v16.16b, v1.16b
2746
+ eor v17.16b, v17.16b, v2.16b
2747
+ rev32 v15.8h, v15.8h
2748
+ rev32 v16.8h, v16.8h
2749
+ rev32 v17.8h, v17.8h
2750
+
2751
+ add v10.4s, v10.4s, v15.4s
2752
+ add v11.4s, v11.4s, v16.4s
2753
+ add v12.4s, v12.4s, v17.4s
2754
+ eor v5.16b, v5.16b, v10.16b
2755
+ eor v6.16b, v6.16b, v11.16b
2756
+ eor v7.16b, v7.16b, v12.16b
2757
+ ushr v20.4s, v5.4s, #20
2758
+ sli v20.4s, v5.4s, #12
2759
+ ushr v5.4s, v6.4s, #20
2760
+ sli v5.4s, v6.4s, #12
2761
+ ushr v6.4s, v7.4s, #20
2762
+ sli v6.4s, v7.4s, #12
2763
+
2764
+ add v0.4s, v0.4s, v20.4s
2765
+ add v1.4s, v1.4s, v5.4s
2766
+ add v2.4s, v2.4s, v6.4s
2767
+ eor v15.16b, v15.16b, v0.16b
2768
+ eor v16.16b, v16.16b, v1.16b
2769
+ eor v17.16b, v17.16b, v2.16b
2770
+ tbl v15.16b, {v15.16b}, v26.16b
2771
+ tbl v16.16b, {v16.16b}, v26.16b
2772
+ tbl v17.16b, {v17.16b}, v26.16b
2773
+
2774
+ add v10.4s, v10.4s, v15.4s
2775
+ add v11.4s, v11.4s, v16.4s
2776
+ add v12.4s, v12.4s, v17.4s
2777
+ eor v20.16b, v20.16b, v10.16b
2778
+ eor v5.16b, v5.16b, v11.16b
2779
+ eor v6.16b, v6.16b, v12.16b
2780
+ ushr v7.4s, v6.4s, #25
2781
+ sli v7.4s, v6.4s, #7
2782
+ ushr v6.4s, v5.4s, #25
2783
+ sli v6.4s, v5.4s, #7
2784
+ ushr v5.4s, v20.4s, #25
2785
+ sli v5.4s, v20.4s, #7
2786
+
2787
+ ext v5.16b, v5.16b, v5.16b, #12
2788
+ ext v6.16b, v6.16b, v6.16b, #12
2789
+ ext v7.16b, v7.16b, v7.16b, #12
2790
+
2791
+ ext v10.16b, v10.16b, v10.16b, #8
2792
+ ext v11.16b, v11.16b, v11.16b, #8
2793
+ ext v12.16b, v12.16b, v12.16b, #8
2794
+
2795
+ ext v15.16b, v15.16b, v15.16b, #4
2796
+ ext v16.16b, v16.16b, v16.16b, #4
2797
+ ext v17.16b, v17.16b, v17.16b, #4
2798
+ subs x6, x6, #1
2799
+ b.hi Lopen_128_rounds
2800
+
2801
+ add v0.4s, v0.4s, v24.4s
2802
+ add v1.4s, v1.4s, v24.4s
2803
+ add v2.4s, v2.4s, v24.4s
2804
+
2805
+ add v5.4s, v5.4s, v28.4s
2806
+ add v6.4s, v6.4s, v28.4s
2807
+ add v7.4s, v7.4s, v28.4s
2808
+
2809
+ add v10.4s, v10.4s, v29.4s
2810
+ add v11.4s, v11.4s, v29.4s
2811
+
2812
+ add v30.4s, v30.4s, v25.4s
2813
+ add v15.4s, v15.4s, v30.4s
2814
+ add v30.4s, v30.4s, v25.4s
2815
+ add v16.4s, v16.4s, v30.4s
2816
+
2817
+ and v2.16b, v2.16b, v27.16b
2818
+ mov x16, v2.d[0] // Move the R key to GPRs
2819
+ mov x17, v2.d[1]
2820
+ mov v27.16b, v7.16b // Store the S key
2821
+
2822
+ bl Lpoly_hash_ad_internal
2823
+
2824
+ Lopen_128_store:
2825
+ cmp x2, #64
2826
+ b.lt Lopen_128_store_64
2827
+
2828
+ ld1 {v20.16b - v23.16b}, [x1], #64
2829
+
2830
+ mov x11, v20.d[0]
2831
+ mov x12, v20.d[1]
2832
+ adds x8, x8, x11
2833
+ adcs x9, x9, x12
2834
+ adc x10, x10, x15
2835
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2836
+ umulh x12, x8, x16
2837
+ mul x13, x9, x16
2838
+ umulh x14, x9, x16
2839
+ adds x12, x12, x13
2840
+ mul x13, x10, x16
2841
+ adc x13, x13, x14
2842
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2843
+ umulh x8, x8, x17
2844
+ adds x12, x12, x14
2845
+ mul x14, x9, x17
2846
+ umulh x9, x9, x17
2847
+ adcs x14, x14, x8
2848
+ mul x10, x10, x17
2849
+ adc x10, x10, x9
2850
+ adds x13, x13, x14
2851
+ adc x14, x10, xzr
2852
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2853
+ and x8, x13, #-4
2854
+ extr x13, x14, x13, #2
2855
+ adds x8, x8, x11
2856
+ lsr x11, x14, #2
2857
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2858
+ adds x8, x8, x13
2859
+ adcs x9, x9, x12
2860
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2861
+ mov x11, v21.d[0]
2862
+ mov x12, v21.d[1]
2863
+ adds x8, x8, x11
2864
+ adcs x9, x9, x12
2865
+ adc x10, x10, x15
2866
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2867
+ umulh x12, x8, x16
2868
+ mul x13, x9, x16
2869
+ umulh x14, x9, x16
2870
+ adds x12, x12, x13
2871
+ mul x13, x10, x16
2872
+ adc x13, x13, x14
2873
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2874
+ umulh x8, x8, x17
2875
+ adds x12, x12, x14
2876
+ mul x14, x9, x17
2877
+ umulh x9, x9, x17
2878
+ adcs x14, x14, x8
2879
+ mul x10, x10, x17
2880
+ adc x10, x10, x9
2881
+ adds x13, x13, x14
2882
+ adc x14, x10, xzr
2883
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2884
+ and x8, x13, #-4
2885
+ extr x13, x14, x13, #2
2886
+ adds x8, x8, x11
2887
+ lsr x11, x14, #2
2888
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2889
+ adds x8, x8, x13
2890
+ adcs x9, x9, x12
2891
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2892
+ mov x11, v22.d[0]
2893
+ mov x12, v22.d[1]
2894
+ adds x8, x8, x11
2895
+ adcs x9, x9, x12
2896
+ adc x10, x10, x15
2897
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2898
+ umulh x12, x8, x16
2899
+ mul x13, x9, x16
2900
+ umulh x14, x9, x16
2901
+ adds x12, x12, x13
2902
+ mul x13, x10, x16
2903
+ adc x13, x13, x14
2904
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2905
+ umulh x8, x8, x17
2906
+ adds x12, x12, x14
2907
+ mul x14, x9, x17
2908
+ umulh x9, x9, x17
2909
+ adcs x14, x14, x8
2910
+ mul x10, x10, x17
2911
+ adc x10, x10, x9
2912
+ adds x13, x13, x14
2913
+ adc x14, x10, xzr
2914
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2915
+ and x8, x13, #-4
2916
+ extr x13, x14, x13, #2
2917
+ adds x8, x8, x11
2918
+ lsr x11, x14, #2
2919
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2920
+ adds x8, x8, x13
2921
+ adcs x9, x9, x12
2922
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2923
+ mov x11, v23.d[0]
2924
+ mov x12, v23.d[1]
2925
+ adds x8, x8, x11
2926
+ adcs x9, x9, x12
2927
+ adc x10, x10, x15
2928
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2929
+ umulh x12, x8, x16
2930
+ mul x13, x9, x16
2931
+ umulh x14, x9, x16
2932
+ adds x12, x12, x13
2933
+ mul x13, x10, x16
2934
+ adc x13, x13, x14
2935
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2936
+ umulh x8, x8, x17
2937
+ adds x12, x12, x14
2938
+ mul x14, x9, x17
2939
+ umulh x9, x9, x17
2940
+ adcs x14, x14, x8
2941
+ mul x10, x10, x17
2942
+ adc x10, x10, x9
2943
+ adds x13, x13, x14
2944
+ adc x14, x10, xzr
2945
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2946
+ and x8, x13, #-4
2947
+ extr x13, x14, x13, #2
2948
+ adds x8, x8, x11
2949
+ lsr x11, x14, #2
2950
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2951
+ adds x8, x8, x13
2952
+ adcs x9, x9, x12
2953
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2954
+
2955
+ eor v20.16b, v20.16b, v0.16b
2956
+ eor v21.16b, v21.16b, v5.16b
2957
+ eor v22.16b, v22.16b, v10.16b
2958
+ eor v23.16b, v23.16b, v15.16b
2959
+
2960
+ st1 {v20.16b - v23.16b}, [x0], #64
2961
+
2962
+ sub x2, x2, #64
2963
+
2964
+ mov v0.16b, v1.16b
2965
+ mov v5.16b, v6.16b
2966
+ mov v10.16b, v11.16b
2967
+ mov v15.16b, v16.16b
2968
+
2969
+ Lopen_128_store_64:
2970
+
2971
+ lsr x4, x2, #4
2972
+ mov x3, x1
2973
+
2974
+ Lopen_128_hash_64:
2975
+ cbz x4, Lopen_tail_64_store
2976
+ ldp x11, x12, [x3], 16
2977
+ adds x8, x8, x11
2978
+ adcs x9, x9, x12
2979
+ adc x10, x10, x15
2980
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2981
+ umulh x12, x8, x16
2982
+ mul x13, x9, x16
2983
+ umulh x14, x9, x16
2984
+ adds x12, x12, x13
2985
+ mul x13, x10, x16
2986
+ adc x13, x13, x14
2987
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2988
+ umulh x8, x8, x17
2989
+ adds x12, x12, x14
2990
+ mul x14, x9, x17
2991
+ umulh x9, x9, x17
2992
+ adcs x14, x14, x8
2993
+ mul x10, x10, x17
2994
+ adc x10, x10, x9
2995
+ adds x13, x13, x14
2996
+ adc x14, x10, xzr
2997
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2998
+ and x8, x13, #-4
2999
+ extr x13, x14, x13, #2
3000
+ adds x8, x8, x11
3001
+ lsr x11, x14, #2
3002
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
3003
+ adds x8, x8, x13
3004
+ adcs x9, x9, x12
3005
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
3006
+ sub x4, x4, #1
3007
+ b Lopen_128_hash_64
3008
+ .cfi_endproc
3009
+
3010
+ #endif // !OPENSSL_NO_ASM && defined(OPENSSL_AARCH64) && defined(__APPLE__)