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,3008 @@
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(__ELF__)
7
+ .section .rodata
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
+ .type .Lpoly_hash_ad_internal,%function
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
+ .size .Lpoly_hash_ad_internal, .-.Lpoly_hash_ad_internal
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
+ .hidden chacha20_poly1305_seal
121
+ .type chacha20_poly1305_seal,%function
122
+ .align 6
123
+ chacha20_poly1305_seal:
124
+ AARCH64_SIGN_LINK_REGISTER
125
+ .cfi_startproc
126
+ stp x29, x30, [sp, #-80]!
127
+ .cfi_def_cfa_offset 80
128
+ .cfi_offset w30, -72
129
+ .cfi_offset w29, -80
130
+ mov x29, sp
131
+ // We probably could do .cfi_def_cfa w29, 80 at this point, but since
132
+ // we don't actually use the frame pointer like that, it's probably not
133
+ // worth bothering.
134
+ stp d8, d9, [sp, #16]
135
+ stp d10, d11, [sp, #32]
136
+ stp d12, d13, [sp, #48]
137
+ stp d14, d15, [sp, #64]
138
+ .cfi_offset b15, -8
139
+ .cfi_offset b14, -16
140
+ .cfi_offset b13, -24
141
+ .cfi_offset b12, -32
142
+ .cfi_offset b11, -40
143
+ .cfi_offset b10, -48
144
+ .cfi_offset b9, -56
145
+ .cfi_offset b8, -64
146
+
147
+ adrp x11, .Lchacha20_consts
148
+ add x11, x11, :lo12:.Lchacha20_consts
149
+
150
+ ld1 {v24.16b - v27.16b}, [x11] // .Load the CONSTS, INC, ROL8 and CLAMP values
151
+ ld1 {v28.16b - v30.16b}, [x5]
152
+
153
+ mov x15, #1 // Prepare the Poly1305 state
154
+ mov x8, #0
155
+ mov x9, #0
156
+ mov x10, #0
157
+
158
+ ldr x12, [x5, #56] // The total cipher text length includes extra_in_len
159
+ add x12, x12, x2
160
+ mov v31.d[0], x4 // Store the input and aad lengths
161
+ mov v31.d[1], x12
162
+
163
+ cmp x2, #128
164
+ b.le .Lseal_128 // Optimization for smaller buffers
165
+
166
+ // Initially we prepare 5 ChaCha20 blocks. Four to encrypt up to 4 blocks (256 bytes) of plaintext,
167
+ // and one for the Poly1305 R and S keys. The first four blocks (A0-A3..D0-D3) are computed vertically,
168
+ // the fifth block (A4-D4) horizontally.
169
+ ld4r {v0.4s,v1.4s,v2.4s,v3.4s}, [x11]
170
+ mov v4.16b, v24.16b
171
+
172
+ ld4r {v5.4s,v6.4s,v7.4s,v8.4s}, [x5], #16
173
+ mov v9.16b, v28.16b
174
+
175
+ ld4r {v10.4s,v11.4s,v12.4s,v13.4s}, [x5], #16
176
+ mov v14.16b, v29.16b
177
+
178
+ ld4r {v15.4s,v16.4s,v17.4s,v18.4s}, [x5]
179
+ add v15.4s, v15.4s, v25.4s
180
+ mov v19.16b, v30.16b
181
+
182
+ sub x5, x5, #32
183
+
184
+ mov x6, #10
185
+
186
+ .align 5
187
+ .Lseal_init_rounds:
188
+ add v0.4s, v0.4s, v5.4s
189
+ add v1.4s, v1.4s, v6.4s
190
+ add v2.4s, v2.4s, v7.4s
191
+ add v3.4s, v3.4s, v8.4s
192
+ add v4.4s, v4.4s, v9.4s
193
+
194
+ eor v15.16b, v15.16b, v0.16b
195
+ eor v16.16b, v16.16b, v1.16b
196
+ eor v17.16b, v17.16b, v2.16b
197
+ eor v18.16b, v18.16b, v3.16b
198
+ eor v19.16b, v19.16b, v4.16b
199
+
200
+ rev32 v15.8h, v15.8h
201
+ rev32 v16.8h, v16.8h
202
+ rev32 v17.8h, v17.8h
203
+ rev32 v18.8h, v18.8h
204
+ rev32 v19.8h, v19.8h
205
+
206
+ add v10.4s, v10.4s, v15.4s
207
+ add v11.4s, v11.4s, v16.4s
208
+ add v12.4s, v12.4s, v17.4s
209
+ add v13.4s, v13.4s, v18.4s
210
+ add v14.4s, v14.4s, v19.4s
211
+
212
+ eor v5.16b, v5.16b, v10.16b
213
+ eor v6.16b, v6.16b, v11.16b
214
+ eor v7.16b, v7.16b, v12.16b
215
+ eor v8.16b, v8.16b, v13.16b
216
+ eor v9.16b, v9.16b, v14.16b
217
+
218
+ ushr v20.4s, v5.4s, #20
219
+ sli v20.4s, v5.4s, #12
220
+ ushr v5.4s, v6.4s, #20
221
+ sli v5.4s, v6.4s, #12
222
+ ushr v6.4s, v7.4s, #20
223
+ sli v6.4s, v7.4s, #12
224
+ ushr v7.4s, v8.4s, #20
225
+ sli v7.4s, v8.4s, #12
226
+ ushr v8.4s, v9.4s, #20
227
+ sli v8.4s, v9.4s, #12
228
+
229
+ add v0.4s, v0.4s, v20.4s
230
+ add v1.4s, v1.4s, v5.4s
231
+ add v2.4s, v2.4s, v6.4s
232
+ add v3.4s, v3.4s, v7.4s
233
+ add v4.4s, v4.4s, v8.4s
234
+
235
+ eor v15.16b, v15.16b, v0.16b
236
+ eor v16.16b, v16.16b, v1.16b
237
+ eor v17.16b, v17.16b, v2.16b
238
+ eor v18.16b, v18.16b, v3.16b
239
+ eor v19.16b, v19.16b, v4.16b
240
+
241
+ tbl v15.16b, {v15.16b}, v26.16b
242
+ tbl v16.16b, {v16.16b}, v26.16b
243
+ tbl v17.16b, {v17.16b}, v26.16b
244
+ tbl v18.16b, {v18.16b}, v26.16b
245
+ tbl v19.16b, {v19.16b}, v26.16b
246
+
247
+ add v10.4s, v10.4s, v15.4s
248
+ add v11.4s, v11.4s, v16.4s
249
+ add v12.4s, v12.4s, v17.4s
250
+ add v13.4s, v13.4s, v18.4s
251
+ add v14.4s, v14.4s, v19.4s
252
+
253
+ eor v20.16b, v20.16b, v10.16b
254
+ eor v5.16b, v5.16b, v11.16b
255
+ eor v6.16b, v6.16b, v12.16b
256
+ eor v7.16b, v7.16b, v13.16b
257
+ eor v8.16b, v8.16b, v14.16b
258
+
259
+ ushr v9.4s, v8.4s, #25
260
+ sli v9.4s, v8.4s, #7
261
+ ushr v8.4s, v7.4s, #25
262
+ sli v8.4s, v7.4s, #7
263
+ ushr v7.4s, v6.4s, #25
264
+ sli v7.4s, v6.4s, #7
265
+ ushr v6.4s, v5.4s, #25
266
+ sli v6.4s, v5.4s, #7
267
+ ushr v5.4s, v20.4s, #25
268
+ sli v5.4s, v20.4s, #7
269
+
270
+ ext v9.16b, v9.16b, v9.16b, #4
271
+ ext v14.16b, v14.16b, v14.16b, #8
272
+ ext v19.16b, v19.16b, v19.16b, #12
273
+ add v0.4s, v0.4s, v6.4s
274
+ add v1.4s, v1.4s, v7.4s
275
+ add v2.4s, v2.4s, v8.4s
276
+ add v3.4s, v3.4s, v5.4s
277
+ add v4.4s, v4.4s, v9.4s
278
+
279
+ eor v18.16b, v18.16b, v0.16b
280
+ eor v15.16b, v15.16b, v1.16b
281
+ eor v16.16b, v16.16b, v2.16b
282
+ eor v17.16b, v17.16b, v3.16b
283
+ eor v19.16b, v19.16b, v4.16b
284
+
285
+ rev32 v18.8h, v18.8h
286
+ rev32 v15.8h, v15.8h
287
+ rev32 v16.8h, v16.8h
288
+ rev32 v17.8h, v17.8h
289
+ rev32 v19.8h, v19.8h
290
+
291
+ add v12.4s, v12.4s, v18.4s
292
+ add v13.4s, v13.4s, v15.4s
293
+ add v10.4s, v10.4s, v16.4s
294
+ add v11.4s, v11.4s, v17.4s
295
+ add v14.4s, v14.4s, v19.4s
296
+
297
+ eor v6.16b, v6.16b, v12.16b
298
+ eor v7.16b, v7.16b, v13.16b
299
+ eor v8.16b, v8.16b, v10.16b
300
+ eor v5.16b, v5.16b, v11.16b
301
+ eor v9.16b, v9.16b, v14.16b
302
+
303
+ ushr v20.4s, v6.4s, #20
304
+ sli v20.4s, v6.4s, #12
305
+ ushr v6.4s, v7.4s, #20
306
+ sli v6.4s, v7.4s, #12
307
+ ushr v7.4s, v8.4s, #20
308
+ sli v7.4s, v8.4s, #12
309
+ ushr v8.4s, v5.4s, #20
310
+ sli v8.4s, v5.4s, #12
311
+ ushr v5.4s, v9.4s, #20
312
+ sli v5.4s, v9.4s, #12
313
+
314
+ add v0.4s, v0.4s, v20.4s
315
+ add v1.4s, v1.4s, v6.4s
316
+ add v2.4s, v2.4s, v7.4s
317
+ add v3.4s, v3.4s, v8.4s
318
+ add v4.4s, v4.4s, v5.4s
319
+
320
+ eor v18.16b, v18.16b, v0.16b
321
+ eor v15.16b, v15.16b, v1.16b
322
+ eor v16.16b, v16.16b, v2.16b
323
+ eor v17.16b, v17.16b, v3.16b
324
+ eor v19.16b, v19.16b, v4.16b
325
+
326
+ tbl v18.16b, {v18.16b}, v26.16b
327
+ tbl v15.16b, {v15.16b}, v26.16b
328
+ tbl v16.16b, {v16.16b}, v26.16b
329
+ tbl v17.16b, {v17.16b}, v26.16b
330
+ tbl v19.16b, {v19.16b}, v26.16b
331
+
332
+ add v12.4s, v12.4s, v18.4s
333
+ add v13.4s, v13.4s, v15.4s
334
+ add v10.4s, v10.4s, v16.4s
335
+ add v11.4s, v11.4s, v17.4s
336
+ add v14.4s, v14.4s, v19.4s
337
+
338
+ eor v20.16b, v20.16b, v12.16b
339
+ eor v6.16b, v6.16b, v13.16b
340
+ eor v7.16b, v7.16b, v10.16b
341
+ eor v8.16b, v8.16b, v11.16b
342
+ eor v5.16b, v5.16b, v14.16b
343
+
344
+ ushr v9.4s, v5.4s, #25
345
+ sli v9.4s, v5.4s, #7
346
+ ushr v5.4s, v8.4s, #25
347
+ sli v5.4s, v8.4s, #7
348
+ ushr v8.4s, v7.4s, #25
349
+ sli v8.4s, v7.4s, #7
350
+ ushr v7.4s, v6.4s, #25
351
+ sli v7.4s, v6.4s, #7
352
+ ushr v6.4s, v20.4s, #25
353
+ sli v6.4s, v20.4s, #7
354
+
355
+ ext v9.16b, v9.16b, v9.16b, #12
356
+ ext v14.16b, v14.16b, v14.16b, #8
357
+ ext v19.16b, v19.16b, v19.16b, #4
358
+ subs x6, x6, #1
359
+ b.hi .Lseal_init_rounds
360
+
361
+ add v15.4s, v15.4s, v25.4s
362
+ mov x11, #4
363
+ dup v20.4s, w11
364
+ add v25.4s, v25.4s, v20.4s
365
+
366
+ zip1 v20.4s, v0.4s, v1.4s
367
+ zip2 v21.4s, v0.4s, v1.4s
368
+ zip1 v22.4s, v2.4s, v3.4s
369
+ zip2 v23.4s, v2.4s, v3.4s
370
+
371
+ zip1 v0.2d, v20.2d, v22.2d
372
+ zip2 v1.2d, v20.2d, v22.2d
373
+ zip1 v2.2d, v21.2d, v23.2d
374
+ zip2 v3.2d, v21.2d, v23.2d
375
+
376
+ zip1 v20.4s, v5.4s, v6.4s
377
+ zip2 v21.4s, v5.4s, v6.4s
378
+ zip1 v22.4s, v7.4s, v8.4s
379
+ zip2 v23.4s, v7.4s, v8.4s
380
+
381
+ zip1 v5.2d, v20.2d, v22.2d
382
+ zip2 v6.2d, v20.2d, v22.2d
383
+ zip1 v7.2d, v21.2d, v23.2d
384
+ zip2 v8.2d, v21.2d, v23.2d
385
+
386
+ zip1 v20.4s, v10.4s, v11.4s
387
+ zip2 v21.4s, v10.4s, v11.4s
388
+ zip1 v22.4s, v12.4s, v13.4s
389
+ zip2 v23.4s, v12.4s, v13.4s
390
+
391
+ zip1 v10.2d, v20.2d, v22.2d
392
+ zip2 v11.2d, v20.2d, v22.2d
393
+ zip1 v12.2d, v21.2d, v23.2d
394
+ zip2 v13.2d, v21.2d, v23.2d
395
+
396
+ zip1 v20.4s, v15.4s, v16.4s
397
+ zip2 v21.4s, v15.4s, v16.4s
398
+ zip1 v22.4s, v17.4s, v18.4s
399
+ zip2 v23.4s, v17.4s, v18.4s
400
+
401
+ zip1 v15.2d, v20.2d, v22.2d
402
+ zip2 v16.2d, v20.2d, v22.2d
403
+ zip1 v17.2d, v21.2d, v23.2d
404
+ zip2 v18.2d, v21.2d, v23.2d
405
+
406
+ add v4.4s, v4.4s, v24.4s
407
+ add v9.4s, v9.4s, v28.4s
408
+ and v4.16b, v4.16b, v27.16b
409
+
410
+ add v0.4s, v0.4s, v24.4s
411
+ add v5.4s, v5.4s, v28.4s
412
+ add v10.4s, v10.4s, v29.4s
413
+ add v15.4s, v15.4s, v30.4s
414
+
415
+ add v1.4s, v1.4s, v24.4s
416
+ add v6.4s, v6.4s, v28.4s
417
+ add v11.4s, v11.4s, v29.4s
418
+ add v16.4s, v16.4s, v30.4s
419
+
420
+ add v2.4s, v2.4s, v24.4s
421
+ add v7.4s, v7.4s, v28.4s
422
+ add v12.4s, v12.4s, v29.4s
423
+ add v17.4s, v17.4s, v30.4s
424
+
425
+ add v3.4s, v3.4s, v24.4s
426
+ add v8.4s, v8.4s, v28.4s
427
+ add v13.4s, v13.4s, v29.4s
428
+ add v18.4s, v18.4s, v30.4s
429
+
430
+ mov x16, v4.d[0] // Move the R key to GPRs
431
+ mov x17, v4.d[1]
432
+ mov v27.16b, v9.16b // Store the S key
433
+
434
+ bl .Lpoly_hash_ad_internal
435
+
436
+ mov x3, x0
437
+ cmp x2, #256
438
+ b.le .Lseal_tail
439
+
440
+ ld1 {v20.16b - v23.16b}, [x1], #64
441
+ eor v20.16b, v20.16b, v0.16b
442
+ eor v21.16b, v21.16b, v5.16b
443
+ eor v22.16b, v22.16b, v10.16b
444
+ eor v23.16b, v23.16b, v15.16b
445
+ st1 {v20.16b - v23.16b}, [x0], #64
446
+
447
+ ld1 {v20.16b - v23.16b}, [x1], #64
448
+ eor v20.16b, v20.16b, v1.16b
449
+ eor v21.16b, v21.16b, v6.16b
450
+ eor v22.16b, v22.16b, v11.16b
451
+ eor v23.16b, v23.16b, v16.16b
452
+ st1 {v20.16b - v23.16b}, [x0], #64
453
+
454
+ ld1 {v20.16b - v23.16b}, [x1], #64
455
+ eor v20.16b, v20.16b, v2.16b
456
+ eor v21.16b, v21.16b, v7.16b
457
+ eor v22.16b, v22.16b, v12.16b
458
+ eor v23.16b, v23.16b, v17.16b
459
+ st1 {v20.16b - v23.16b}, [x0], #64
460
+
461
+ ld1 {v20.16b - v23.16b}, [x1], #64
462
+ eor v20.16b, v20.16b, v3.16b
463
+ eor v21.16b, v21.16b, v8.16b
464
+ eor v22.16b, v22.16b, v13.16b
465
+ eor v23.16b, v23.16b, v18.16b
466
+ st1 {v20.16b - v23.16b}, [x0], #64
467
+
468
+ sub x2, x2, #256
469
+
470
+ 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
471
+ mov x7, #6 // and two blocks for the remaining 6, for a total of (1 * 4 + 2 * 6) * 16 = 256
472
+
473
+ .Lseal_main_loop:
474
+ adrp x11, .Lchacha20_consts
475
+ add x11, x11, :lo12:.Lchacha20_consts
476
+
477
+ ld4r {v0.4s,v1.4s,v2.4s,v3.4s}, [x11]
478
+ mov v4.16b, v24.16b
479
+
480
+ ld4r {v5.4s,v6.4s,v7.4s,v8.4s}, [x5], #16
481
+ mov v9.16b, v28.16b
482
+
483
+ ld4r {v10.4s,v11.4s,v12.4s,v13.4s}, [x5], #16
484
+ mov v14.16b, v29.16b
485
+
486
+ ld4r {v15.4s,v16.4s,v17.4s,v18.4s}, [x5]
487
+ add v15.4s, v15.4s, v25.4s
488
+ mov v19.16b, v30.16b
489
+
490
+ eor v20.16b, v20.16b, v20.16b //zero
491
+ not v21.16b, v20.16b // -1
492
+ sub v21.4s, v25.4s, v21.4s // Add +1
493
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
494
+ add v19.4s, v19.4s, v20.4s
495
+
496
+ sub x5, x5, #32
497
+ .align 5
498
+ .Lseal_main_loop_rounds:
499
+ add v0.4s, v0.4s, v5.4s
500
+ add v1.4s, v1.4s, v6.4s
501
+ add v2.4s, v2.4s, v7.4s
502
+ add v3.4s, v3.4s, v8.4s
503
+ add v4.4s, v4.4s, v9.4s
504
+
505
+ eor v15.16b, v15.16b, v0.16b
506
+ eor v16.16b, v16.16b, v1.16b
507
+ eor v17.16b, v17.16b, v2.16b
508
+ eor v18.16b, v18.16b, v3.16b
509
+ eor v19.16b, v19.16b, v4.16b
510
+
511
+ rev32 v15.8h, v15.8h
512
+ rev32 v16.8h, v16.8h
513
+ rev32 v17.8h, v17.8h
514
+ rev32 v18.8h, v18.8h
515
+ rev32 v19.8h, v19.8h
516
+
517
+ add v10.4s, v10.4s, v15.4s
518
+ add v11.4s, v11.4s, v16.4s
519
+ add v12.4s, v12.4s, v17.4s
520
+ add v13.4s, v13.4s, v18.4s
521
+ add v14.4s, v14.4s, v19.4s
522
+
523
+ eor v5.16b, v5.16b, v10.16b
524
+ eor v6.16b, v6.16b, v11.16b
525
+ eor v7.16b, v7.16b, v12.16b
526
+ eor v8.16b, v8.16b, v13.16b
527
+ eor v9.16b, v9.16b, v14.16b
528
+
529
+ ushr v20.4s, v5.4s, #20
530
+ sli v20.4s, v5.4s, #12
531
+ ushr v5.4s, v6.4s, #20
532
+ sli v5.4s, v6.4s, #12
533
+ ushr v6.4s, v7.4s, #20
534
+ sli v6.4s, v7.4s, #12
535
+ ushr v7.4s, v8.4s, #20
536
+ sli v7.4s, v8.4s, #12
537
+ ushr v8.4s, v9.4s, #20
538
+ sli v8.4s, v9.4s, #12
539
+
540
+ add v0.4s, v0.4s, v20.4s
541
+ add v1.4s, v1.4s, v5.4s
542
+ add v2.4s, v2.4s, v6.4s
543
+ add v3.4s, v3.4s, v7.4s
544
+ add v4.4s, v4.4s, v8.4s
545
+
546
+ eor v15.16b, v15.16b, v0.16b
547
+ eor v16.16b, v16.16b, v1.16b
548
+ eor v17.16b, v17.16b, v2.16b
549
+ eor v18.16b, v18.16b, v3.16b
550
+ eor v19.16b, v19.16b, v4.16b
551
+
552
+ tbl v15.16b, {v15.16b}, v26.16b
553
+ tbl v16.16b, {v16.16b}, v26.16b
554
+ tbl v17.16b, {v17.16b}, v26.16b
555
+ tbl v18.16b, {v18.16b}, v26.16b
556
+ tbl v19.16b, {v19.16b}, v26.16b
557
+
558
+ add v10.4s, v10.4s, v15.4s
559
+ add v11.4s, v11.4s, v16.4s
560
+ add v12.4s, v12.4s, v17.4s
561
+ add v13.4s, v13.4s, v18.4s
562
+ add v14.4s, v14.4s, v19.4s
563
+
564
+ eor v20.16b, v20.16b, v10.16b
565
+ eor v5.16b, v5.16b, v11.16b
566
+ eor v6.16b, v6.16b, v12.16b
567
+ eor v7.16b, v7.16b, v13.16b
568
+ eor v8.16b, v8.16b, v14.16b
569
+
570
+ ushr v9.4s, v8.4s, #25
571
+ sli v9.4s, v8.4s, #7
572
+ ushr v8.4s, v7.4s, #25
573
+ sli v8.4s, v7.4s, #7
574
+ ushr v7.4s, v6.4s, #25
575
+ sli v7.4s, v6.4s, #7
576
+ ushr v6.4s, v5.4s, #25
577
+ sli v6.4s, v5.4s, #7
578
+ ushr v5.4s, v20.4s, #25
579
+ sli v5.4s, v20.4s, #7
580
+
581
+ ext v9.16b, v9.16b, v9.16b, #4
582
+ ext v14.16b, v14.16b, v14.16b, #8
583
+ ext v19.16b, v19.16b, v19.16b, #12
584
+ ldp x11, x12, [x3], 16
585
+ adds x8, x8, x11
586
+ adcs x9, x9, x12
587
+ adc x10, x10, x15
588
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
589
+ umulh x12, x8, x16
590
+ mul x13, x9, x16
591
+ umulh x14, x9, x16
592
+ adds x12, x12, x13
593
+ mul x13, x10, x16
594
+ adc x13, x13, x14
595
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
596
+ umulh x8, x8, x17
597
+ adds x12, x12, x14
598
+ mul x14, x9, x17
599
+ umulh x9, x9, x17
600
+ adcs x14, x14, x8
601
+ mul x10, x10, x17
602
+ adc x10, x10, x9
603
+ adds x13, x13, x14
604
+ adc x14, x10, xzr
605
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
606
+ and x8, x13, #-4
607
+ extr x13, x14, x13, #2
608
+ adds x8, x8, x11
609
+ lsr x11, x14, #2
610
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
611
+ adds x8, x8, x13
612
+ adcs x9, x9, x12
613
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
614
+ add v0.4s, v0.4s, v6.4s
615
+ add v1.4s, v1.4s, v7.4s
616
+ add v2.4s, v2.4s, v8.4s
617
+ add v3.4s, v3.4s, v5.4s
618
+ add v4.4s, v4.4s, v9.4s
619
+
620
+ eor v18.16b, v18.16b, v0.16b
621
+ eor v15.16b, v15.16b, v1.16b
622
+ eor v16.16b, v16.16b, v2.16b
623
+ eor v17.16b, v17.16b, v3.16b
624
+ eor v19.16b, v19.16b, v4.16b
625
+
626
+ rev32 v18.8h, v18.8h
627
+ rev32 v15.8h, v15.8h
628
+ rev32 v16.8h, v16.8h
629
+ rev32 v17.8h, v17.8h
630
+ rev32 v19.8h, v19.8h
631
+
632
+ add v12.4s, v12.4s, v18.4s
633
+ add v13.4s, v13.4s, v15.4s
634
+ add v10.4s, v10.4s, v16.4s
635
+ add v11.4s, v11.4s, v17.4s
636
+ add v14.4s, v14.4s, v19.4s
637
+
638
+ eor v6.16b, v6.16b, v12.16b
639
+ eor v7.16b, v7.16b, v13.16b
640
+ eor v8.16b, v8.16b, v10.16b
641
+ eor v5.16b, v5.16b, v11.16b
642
+ eor v9.16b, v9.16b, v14.16b
643
+
644
+ ushr v20.4s, v6.4s, #20
645
+ sli v20.4s, v6.4s, #12
646
+ ushr v6.4s, v7.4s, #20
647
+ sli v6.4s, v7.4s, #12
648
+ ushr v7.4s, v8.4s, #20
649
+ sli v7.4s, v8.4s, #12
650
+ ushr v8.4s, v5.4s, #20
651
+ sli v8.4s, v5.4s, #12
652
+ ushr v5.4s, v9.4s, #20
653
+ sli v5.4s, v9.4s, #12
654
+
655
+ add v0.4s, v0.4s, v20.4s
656
+ add v1.4s, v1.4s, v6.4s
657
+ add v2.4s, v2.4s, v7.4s
658
+ add v3.4s, v3.4s, v8.4s
659
+ add v4.4s, v4.4s, v5.4s
660
+
661
+ eor v18.16b, v18.16b, v0.16b
662
+ eor v15.16b, v15.16b, v1.16b
663
+ eor v16.16b, v16.16b, v2.16b
664
+ eor v17.16b, v17.16b, v3.16b
665
+ eor v19.16b, v19.16b, v4.16b
666
+
667
+ tbl v18.16b, {v18.16b}, v26.16b
668
+ tbl v15.16b, {v15.16b}, v26.16b
669
+ tbl v16.16b, {v16.16b}, v26.16b
670
+ tbl v17.16b, {v17.16b}, v26.16b
671
+ tbl v19.16b, {v19.16b}, v26.16b
672
+
673
+ add v12.4s, v12.4s, v18.4s
674
+ add v13.4s, v13.4s, v15.4s
675
+ add v10.4s, v10.4s, v16.4s
676
+ add v11.4s, v11.4s, v17.4s
677
+ add v14.4s, v14.4s, v19.4s
678
+
679
+ eor v20.16b, v20.16b, v12.16b
680
+ eor v6.16b, v6.16b, v13.16b
681
+ eor v7.16b, v7.16b, v10.16b
682
+ eor v8.16b, v8.16b, v11.16b
683
+ eor v5.16b, v5.16b, v14.16b
684
+
685
+ ushr v9.4s, v5.4s, #25
686
+ sli v9.4s, v5.4s, #7
687
+ ushr v5.4s, v8.4s, #25
688
+ sli v5.4s, v8.4s, #7
689
+ ushr v8.4s, v7.4s, #25
690
+ sli v8.4s, v7.4s, #7
691
+ ushr v7.4s, v6.4s, #25
692
+ sli v7.4s, v6.4s, #7
693
+ ushr v6.4s, v20.4s, #25
694
+ sli v6.4s, v20.4s, #7
695
+
696
+ ext v9.16b, v9.16b, v9.16b, #12
697
+ ext v14.16b, v14.16b, v14.16b, #8
698
+ ext v19.16b, v19.16b, v19.16b, #4
699
+ subs x6, x6, #1
700
+ b.ge .Lseal_main_loop_rounds
701
+ ldp x11, x12, [x3], 16
702
+ adds x8, x8, x11
703
+ adcs x9, x9, x12
704
+ adc x10, x10, x15
705
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
706
+ umulh x12, x8, x16
707
+ mul x13, x9, x16
708
+ umulh x14, x9, x16
709
+ adds x12, x12, x13
710
+ mul x13, x10, x16
711
+ adc x13, x13, x14
712
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
713
+ umulh x8, x8, x17
714
+ adds x12, x12, x14
715
+ mul x14, x9, x17
716
+ umulh x9, x9, x17
717
+ adcs x14, x14, x8
718
+ mul x10, x10, x17
719
+ adc x10, x10, x9
720
+ adds x13, x13, x14
721
+ adc x14, x10, xzr
722
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
723
+ and x8, x13, #-4
724
+ extr x13, x14, x13, #2
725
+ adds x8, x8, x11
726
+ lsr x11, x14, #2
727
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
728
+ adds x8, x8, x13
729
+ adcs x9, x9, x12
730
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
731
+ subs x7, x7, #1
732
+ b.gt .Lseal_main_loop_rounds
733
+
734
+ eor v20.16b, v20.16b, v20.16b //zero
735
+ not v21.16b, v20.16b // -1
736
+ sub v21.4s, v25.4s, v21.4s // Add +1
737
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
738
+ add v19.4s, v19.4s, v20.4s
739
+
740
+ add v15.4s, v15.4s, v25.4s
741
+ mov x11, #5
742
+ dup v20.4s, w11
743
+ add v25.4s, v25.4s, v20.4s
744
+
745
+ zip1 v20.4s, v0.4s, v1.4s
746
+ zip2 v21.4s, v0.4s, v1.4s
747
+ zip1 v22.4s, v2.4s, v3.4s
748
+ zip2 v23.4s, v2.4s, v3.4s
749
+
750
+ zip1 v0.2d, v20.2d, v22.2d
751
+ zip2 v1.2d, v20.2d, v22.2d
752
+ zip1 v2.2d, v21.2d, v23.2d
753
+ zip2 v3.2d, v21.2d, v23.2d
754
+
755
+ zip1 v20.4s, v5.4s, v6.4s
756
+ zip2 v21.4s, v5.4s, v6.4s
757
+ zip1 v22.4s, v7.4s, v8.4s
758
+ zip2 v23.4s, v7.4s, v8.4s
759
+
760
+ zip1 v5.2d, v20.2d, v22.2d
761
+ zip2 v6.2d, v20.2d, v22.2d
762
+ zip1 v7.2d, v21.2d, v23.2d
763
+ zip2 v8.2d, v21.2d, v23.2d
764
+
765
+ zip1 v20.4s, v10.4s, v11.4s
766
+ zip2 v21.4s, v10.4s, v11.4s
767
+ zip1 v22.4s, v12.4s, v13.4s
768
+ zip2 v23.4s, v12.4s, v13.4s
769
+
770
+ zip1 v10.2d, v20.2d, v22.2d
771
+ zip2 v11.2d, v20.2d, v22.2d
772
+ zip1 v12.2d, v21.2d, v23.2d
773
+ zip2 v13.2d, v21.2d, v23.2d
774
+
775
+ zip1 v20.4s, v15.4s, v16.4s
776
+ zip2 v21.4s, v15.4s, v16.4s
777
+ zip1 v22.4s, v17.4s, v18.4s
778
+ zip2 v23.4s, v17.4s, v18.4s
779
+
780
+ zip1 v15.2d, v20.2d, v22.2d
781
+ zip2 v16.2d, v20.2d, v22.2d
782
+ zip1 v17.2d, v21.2d, v23.2d
783
+ zip2 v18.2d, v21.2d, v23.2d
784
+
785
+ add v0.4s, v0.4s, v24.4s
786
+ add v5.4s, v5.4s, v28.4s
787
+ add v10.4s, v10.4s, v29.4s
788
+ add v15.4s, v15.4s, v30.4s
789
+
790
+ add v1.4s, v1.4s, v24.4s
791
+ add v6.4s, v6.4s, v28.4s
792
+ add v11.4s, v11.4s, v29.4s
793
+ add v16.4s, v16.4s, v30.4s
794
+
795
+ add v2.4s, v2.4s, v24.4s
796
+ add v7.4s, v7.4s, v28.4s
797
+ add v12.4s, v12.4s, v29.4s
798
+ add v17.4s, v17.4s, v30.4s
799
+
800
+ add v3.4s, v3.4s, v24.4s
801
+ add v8.4s, v8.4s, v28.4s
802
+ add v13.4s, v13.4s, v29.4s
803
+ add v18.4s, v18.4s, v30.4s
804
+
805
+ add v4.4s, v4.4s, v24.4s
806
+ add v9.4s, v9.4s, v28.4s
807
+ add v14.4s, v14.4s, v29.4s
808
+ add v19.4s, v19.4s, v30.4s
809
+
810
+ cmp x2, #320
811
+ b.le .Lseal_tail
812
+
813
+ ld1 {v20.16b - v23.16b}, [x1], #64
814
+ eor v20.16b, v20.16b, v0.16b
815
+ eor v21.16b, v21.16b, v5.16b
816
+ eor v22.16b, v22.16b, v10.16b
817
+ eor v23.16b, v23.16b, v15.16b
818
+ st1 {v20.16b - v23.16b}, [x0], #64
819
+
820
+ ld1 {v20.16b - v23.16b}, [x1], #64
821
+ eor v20.16b, v20.16b, v1.16b
822
+ eor v21.16b, v21.16b, v6.16b
823
+ eor v22.16b, v22.16b, v11.16b
824
+ eor v23.16b, v23.16b, v16.16b
825
+ st1 {v20.16b - v23.16b}, [x0], #64
826
+
827
+ ld1 {v20.16b - v23.16b}, [x1], #64
828
+ eor v20.16b, v20.16b, v2.16b
829
+ eor v21.16b, v21.16b, v7.16b
830
+ eor v22.16b, v22.16b, v12.16b
831
+ eor v23.16b, v23.16b, v17.16b
832
+ st1 {v20.16b - v23.16b}, [x0], #64
833
+
834
+ ld1 {v20.16b - v23.16b}, [x1], #64
835
+ eor v20.16b, v20.16b, v3.16b
836
+ eor v21.16b, v21.16b, v8.16b
837
+ eor v22.16b, v22.16b, v13.16b
838
+ eor v23.16b, v23.16b, v18.16b
839
+ st1 {v20.16b - v23.16b}, [x0], #64
840
+
841
+ ld1 {v20.16b - v23.16b}, [x1], #64
842
+ eor v20.16b, v20.16b, v4.16b
843
+ eor v21.16b, v21.16b, v9.16b
844
+ eor v22.16b, v22.16b, v14.16b
845
+ eor v23.16b, v23.16b, v19.16b
846
+ st1 {v20.16b - v23.16b}, [x0], #64
847
+
848
+ sub x2, x2, #320
849
+
850
+ mov x6, #0
851
+ mov x7, #10 // For the remainder of the loop we always hash and encrypt 320 bytes per iteration
852
+
853
+ b .Lseal_main_loop
854
+
855
+ .Lseal_tail:
856
+ // This part of the function handles the storage and authentication of the last [0,320) bytes
857
+ // We assume A0-A4 ... D0-D4 hold at least inl (320 max) bytes of the stream data.
858
+ cmp x2, #64
859
+ b.lt .Lseal_tail_64
860
+
861
+ // Store and authenticate 64B blocks per iteration
862
+ ld1 {v20.16b - v23.16b}, [x1], #64
863
+
864
+ eor v20.16b, v20.16b, v0.16b
865
+ eor v21.16b, v21.16b, v5.16b
866
+ eor v22.16b, v22.16b, v10.16b
867
+ eor v23.16b, v23.16b, v15.16b
868
+ mov x11, v20.d[0]
869
+ mov x12, v20.d[1]
870
+ adds x8, x8, x11
871
+ adcs x9, x9, x12
872
+ adc x10, x10, x15
873
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
874
+ umulh x12, x8, x16
875
+ mul x13, x9, x16
876
+ umulh x14, x9, x16
877
+ adds x12, x12, x13
878
+ mul x13, x10, x16
879
+ adc x13, x13, x14
880
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
881
+ umulh x8, x8, x17
882
+ adds x12, x12, x14
883
+ mul x14, x9, x17
884
+ umulh x9, x9, x17
885
+ adcs x14, x14, x8
886
+ mul x10, x10, x17
887
+ adc x10, x10, x9
888
+ adds x13, x13, x14
889
+ adc x14, x10, xzr
890
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
891
+ and x8, x13, #-4
892
+ extr x13, x14, x13, #2
893
+ adds x8, x8, x11
894
+ lsr x11, x14, #2
895
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
896
+ adds x8, x8, x13
897
+ adcs x9, x9, x12
898
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
899
+ mov x11, v21.d[0]
900
+ mov x12, v21.d[1]
901
+ adds x8, x8, x11
902
+ adcs x9, x9, x12
903
+ adc x10, x10, x15
904
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
905
+ umulh x12, x8, x16
906
+ mul x13, x9, x16
907
+ umulh x14, x9, x16
908
+ adds x12, x12, x13
909
+ mul x13, x10, x16
910
+ adc x13, x13, x14
911
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
912
+ umulh x8, x8, x17
913
+ adds x12, x12, x14
914
+ mul x14, x9, x17
915
+ umulh x9, x9, x17
916
+ adcs x14, x14, x8
917
+ mul x10, x10, x17
918
+ adc x10, x10, x9
919
+ adds x13, x13, x14
920
+ adc x14, x10, xzr
921
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
922
+ and x8, x13, #-4
923
+ extr x13, x14, x13, #2
924
+ adds x8, x8, x11
925
+ lsr x11, x14, #2
926
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
927
+ adds x8, x8, x13
928
+ adcs x9, x9, x12
929
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
930
+ mov x11, v22.d[0]
931
+ mov x12, v22.d[1]
932
+ adds x8, x8, x11
933
+ adcs x9, x9, x12
934
+ adc x10, x10, x15
935
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
936
+ umulh x12, x8, x16
937
+ mul x13, x9, x16
938
+ umulh x14, x9, x16
939
+ adds x12, x12, x13
940
+ mul x13, x10, x16
941
+ adc x13, x13, x14
942
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
943
+ umulh x8, x8, x17
944
+ adds x12, x12, x14
945
+ mul x14, x9, x17
946
+ umulh x9, x9, x17
947
+ adcs x14, x14, x8
948
+ mul x10, x10, x17
949
+ adc x10, x10, x9
950
+ adds x13, x13, x14
951
+ adc x14, x10, xzr
952
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
953
+ and x8, x13, #-4
954
+ extr x13, x14, x13, #2
955
+ adds x8, x8, x11
956
+ lsr x11, x14, #2
957
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
958
+ adds x8, x8, x13
959
+ adcs x9, x9, x12
960
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
961
+ mov x11, v23.d[0]
962
+ mov x12, v23.d[1]
963
+ adds x8, x8, x11
964
+ adcs x9, x9, x12
965
+ adc x10, x10, x15
966
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
967
+ umulh x12, x8, x16
968
+ mul x13, x9, x16
969
+ umulh x14, x9, x16
970
+ adds x12, x12, x13
971
+ mul x13, x10, x16
972
+ adc x13, x13, x14
973
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
974
+ umulh x8, x8, x17
975
+ adds x12, x12, x14
976
+ mul x14, x9, x17
977
+ umulh x9, x9, x17
978
+ adcs x14, x14, x8
979
+ mul x10, x10, x17
980
+ adc x10, x10, x9
981
+ adds x13, x13, x14
982
+ adc x14, x10, xzr
983
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
984
+ and x8, x13, #-4
985
+ extr x13, x14, x13, #2
986
+ adds x8, x8, x11
987
+ lsr x11, x14, #2
988
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
989
+ adds x8, x8, x13
990
+ adcs x9, x9, x12
991
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
992
+ st1 {v20.16b - v23.16b}, [x0], #64
993
+ sub x2, x2, #64
994
+
995
+ // Shift the state left by 64 bytes for the next iteration of the loop
996
+ mov v0.16b, v1.16b
997
+ mov v5.16b, v6.16b
998
+ mov v10.16b, v11.16b
999
+ mov v15.16b, v16.16b
1000
+
1001
+ mov v1.16b, v2.16b
1002
+ mov v6.16b, v7.16b
1003
+ mov v11.16b, v12.16b
1004
+ mov v16.16b, v17.16b
1005
+
1006
+ mov v2.16b, v3.16b
1007
+ mov v7.16b, v8.16b
1008
+ mov v12.16b, v13.16b
1009
+ mov v17.16b, v18.16b
1010
+
1011
+ mov v3.16b, v4.16b
1012
+ mov v8.16b, v9.16b
1013
+ mov v13.16b, v14.16b
1014
+ mov v18.16b, v19.16b
1015
+
1016
+ b .Lseal_tail
1017
+
1018
+ .Lseal_tail_64:
1019
+ ldp x3, x4, [x5, #48] // extra_in_len and extra_in_ptr
1020
+
1021
+ // Here we handle the last [0,64) bytes of plaintext
1022
+ cmp x2, #16
1023
+ b.lt .Lseal_tail_16
1024
+ // Each iteration encrypt and authenticate a 16B block
1025
+ ld1 {v20.16b}, [x1], #16
1026
+ eor v20.16b, v20.16b, v0.16b
1027
+ mov x11, v20.d[0]
1028
+ mov x12, v20.d[1]
1029
+ adds x8, x8, x11
1030
+ adcs x9, x9, x12
1031
+ adc x10, x10, x15
1032
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1033
+ umulh x12, x8, x16
1034
+ mul x13, x9, x16
1035
+ umulh x14, x9, x16
1036
+ adds x12, x12, x13
1037
+ mul x13, x10, x16
1038
+ adc x13, x13, x14
1039
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1040
+ umulh x8, x8, x17
1041
+ adds x12, x12, x14
1042
+ mul x14, x9, x17
1043
+ umulh x9, x9, x17
1044
+ adcs x14, x14, x8
1045
+ mul x10, x10, x17
1046
+ adc x10, x10, x9
1047
+ adds x13, x13, x14
1048
+ adc x14, x10, xzr
1049
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1050
+ and x8, x13, #-4
1051
+ extr x13, x14, x13, #2
1052
+ adds x8, x8, x11
1053
+ lsr x11, x14, #2
1054
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1055
+ adds x8, x8, x13
1056
+ adcs x9, x9, x12
1057
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1058
+ st1 {v20.16b}, [x0], #16
1059
+
1060
+ sub x2, x2, #16
1061
+
1062
+ // Shift the state left by 16 bytes for the next iteration of the loop
1063
+ mov v0.16b, v5.16b
1064
+ mov v5.16b, v10.16b
1065
+ mov v10.16b, v15.16b
1066
+
1067
+ b .Lseal_tail_64
1068
+
1069
+ .Lseal_tail_16:
1070
+ // Here we handle the last [0,16) bytes of ciphertext that require a padded block
1071
+ cbz x2, .Lseal_hash_extra
1072
+
1073
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the plaintext/extra in
1074
+ eor v21.16b, v21.16b, v21.16b // Use T1 to generate an AND mask that will only mask the ciphertext bytes
1075
+ not v22.16b, v20.16b
1076
+
1077
+ mov x6, x2
1078
+ add x1, x1, x2
1079
+
1080
+ cbz x4, .Lseal_tail_16_compose // No extra data to pad with, zero padding
1081
+
1082
+ mov x7, #16 // We need to load some extra_in first for padding
1083
+ sub x7, x7, x2
1084
+ cmp x4, x7
1085
+ csel x7, x4, x7, lt // .Load the minimum of extra_in_len and the amount needed to fill the register
1086
+ mov x12, x7
1087
+ add x3, x3, x7
1088
+ sub x4, x4, x7
1089
+
1090
+ .Lseal_tail16_compose_extra_in:
1091
+ ext v20.16b, v20.16b, v20.16b, #15
1092
+ ldrb w11, [x3, #-1]!
1093
+ mov v20.b[0], w11
1094
+ subs x7, x7, #1
1095
+ b.gt .Lseal_tail16_compose_extra_in
1096
+
1097
+ add x3, x3, x12
1098
+
1099
+ .Lseal_tail_16_compose:
1100
+ ext v20.16b, v20.16b, v20.16b, #15
1101
+ ldrb w11, [x1, #-1]!
1102
+ mov v20.b[0], w11
1103
+ ext v21.16b, v22.16b, v21.16b, #15
1104
+ subs x2, x2, #1
1105
+ b.gt .Lseal_tail_16_compose
1106
+
1107
+ and v0.16b, v0.16b, v21.16b
1108
+ eor v20.16b, v20.16b, v0.16b
1109
+ mov v21.16b, v20.16b
1110
+
1111
+ .Lseal_tail_16_store:
1112
+ umov w11, v20.b[0]
1113
+ strb w11, [x0], #1
1114
+ ext v20.16b, v20.16b, v20.16b, #1
1115
+ subs x6, x6, #1
1116
+ b.gt .Lseal_tail_16_store
1117
+
1118
+ // Hash in the final ct block concatenated with extra_in
1119
+ mov x11, v21.d[0]
1120
+ mov x12, v21.d[1]
1121
+ adds x8, x8, x11
1122
+ adcs x9, x9, x12
1123
+ adc x10, x10, x15
1124
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1125
+ umulh x12, x8, x16
1126
+ mul x13, x9, x16
1127
+ umulh x14, x9, x16
1128
+ adds x12, x12, x13
1129
+ mul x13, x10, x16
1130
+ adc x13, x13, x14
1131
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1132
+ umulh x8, x8, x17
1133
+ adds x12, x12, x14
1134
+ mul x14, x9, x17
1135
+ umulh x9, x9, x17
1136
+ adcs x14, x14, x8
1137
+ mul x10, x10, x17
1138
+ adc x10, x10, x9
1139
+ adds x13, x13, x14
1140
+ adc x14, x10, xzr
1141
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1142
+ and x8, x13, #-4
1143
+ extr x13, x14, x13, #2
1144
+ adds x8, x8, x11
1145
+ lsr x11, x14, #2
1146
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1147
+ adds x8, x8, x13
1148
+ adcs x9, x9, x12
1149
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1150
+
1151
+ .Lseal_hash_extra:
1152
+ cbz x4, .Lseal_finalize
1153
+
1154
+ .Lseal_hash_extra_loop:
1155
+ cmp x4, #16
1156
+ b.lt .Lseal_hash_extra_tail
1157
+ ld1 {v20.16b}, [x3], #16
1158
+ mov x11, v20.d[0]
1159
+ mov x12, v20.d[1]
1160
+ adds x8, x8, x11
1161
+ adcs x9, x9, x12
1162
+ adc x10, x10, x15
1163
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1164
+ umulh x12, x8, x16
1165
+ mul x13, x9, x16
1166
+ umulh x14, x9, x16
1167
+ adds x12, x12, x13
1168
+ mul x13, x10, x16
1169
+ adc x13, x13, x14
1170
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1171
+ umulh x8, x8, x17
1172
+ adds x12, x12, x14
1173
+ mul x14, x9, x17
1174
+ umulh x9, x9, x17
1175
+ adcs x14, x14, x8
1176
+ mul x10, x10, x17
1177
+ adc x10, x10, x9
1178
+ adds x13, x13, x14
1179
+ adc x14, x10, xzr
1180
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1181
+ and x8, x13, #-4
1182
+ extr x13, x14, x13, #2
1183
+ adds x8, x8, x11
1184
+ lsr x11, x14, #2
1185
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1186
+ adds x8, x8, x13
1187
+ adcs x9, x9, x12
1188
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1189
+ sub x4, x4, #16
1190
+ b .Lseal_hash_extra_loop
1191
+
1192
+ .Lseal_hash_extra_tail:
1193
+ cbz x4, .Lseal_finalize
1194
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the remaining extra ciphertext
1195
+ add x3, x3, x4
1196
+
1197
+ .Lseal_hash_extra_load:
1198
+ ext v20.16b, v20.16b, v20.16b, #15
1199
+ ldrb w11, [x3, #-1]!
1200
+ mov v20.b[0], w11
1201
+ subs x4, x4, #1
1202
+ b.gt .Lseal_hash_extra_load
1203
+
1204
+ // Hash in the final padded extra_in block
1205
+ mov x11, v20.d[0]
1206
+ mov x12, v20.d[1]
1207
+ adds x8, x8, x11
1208
+ adcs x9, x9, x12
1209
+ adc x10, x10, x15
1210
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1211
+ umulh x12, x8, x16
1212
+ mul x13, x9, x16
1213
+ umulh x14, x9, x16
1214
+ adds x12, x12, x13
1215
+ mul x13, x10, x16
1216
+ adc x13, x13, x14
1217
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1218
+ umulh x8, x8, x17
1219
+ adds x12, x12, x14
1220
+ mul x14, x9, x17
1221
+ umulh x9, x9, x17
1222
+ adcs x14, x14, x8
1223
+ mul x10, x10, x17
1224
+ adc x10, x10, x9
1225
+ adds x13, x13, x14
1226
+ adc x14, x10, xzr
1227
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1228
+ and x8, x13, #-4
1229
+ extr x13, x14, x13, #2
1230
+ adds x8, x8, x11
1231
+ lsr x11, x14, #2
1232
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1233
+ adds x8, x8, x13
1234
+ adcs x9, x9, x12
1235
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1236
+
1237
+ .Lseal_finalize:
1238
+ mov x11, v31.d[0]
1239
+ mov x12, v31.d[1]
1240
+ adds x8, x8, x11
1241
+ adcs x9, x9, x12
1242
+ adc x10, x10, x15
1243
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1244
+ umulh x12, x8, x16
1245
+ mul x13, x9, x16
1246
+ umulh x14, x9, x16
1247
+ adds x12, x12, x13
1248
+ mul x13, x10, x16
1249
+ adc x13, x13, x14
1250
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1251
+ umulh x8, x8, x17
1252
+ adds x12, x12, x14
1253
+ mul x14, x9, x17
1254
+ umulh x9, x9, x17
1255
+ adcs x14, x14, x8
1256
+ mul x10, x10, x17
1257
+ adc x10, x10, x9
1258
+ adds x13, x13, x14
1259
+ adc x14, x10, xzr
1260
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1261
+ and x8, x13, #-4
1262
+ extr x13, x14, x13, #2
1263
+ adds x8, x8, x11
1264
+ lsr x11, x14, #2
1265
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1266
+ adds x8, x8, x13
1267
+ adcs x9, x9, x12
1268
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1269
+ // Final reduction step
1270
+ sub x12, xzr, x15
1271
+ orr x13, xzr, #3
1272
+ subs x11, x8, #-5
1273
+ sbcs x12, x9, x12
1274
+ sbcs x13, x10, x13
1275
+ csel x8, x11, x8, cs
1276
+ csel x9, x12, x9, cs
1277
+ csel x10, x13, x10, cs
1278
+ mov x11, v27.d[0]
1279
+ mov x12, v27.d[1]
1280
+ adds x8, x8, x11
1281
+ adcs x9, x9, x12
1282
+ adc x10, x10, x15
1283
+
1284
+ stp x8, x9, [x5]
1285
+
1286
+ ldp d8, d9, [sp, #16]
1287
+ ldp d10, d11, [sp, #32]
1288
+ ldp d12, d13, [sp, #48]
1289
+ ldp d14, d15, [sp, #64]
1290
+ .cfi_restore b15
1291
+ .cfi_restore b14
1292
+ .cfi_restore b13
1293
+ .cfi_restore b12
1294
+ .cfi_restore b11
1295
+ .cfi_restore b10
1296
+ .cfi_restore b9
1297
+ .cfi_restore b8
1298
+ ldp x29, x30, [sp], 80
1299
+ .cfi_restore w29
1300
+ .cfi_restore w30
1301
+ .cfi_def_cfa_offset 0
1302
+ AARCH64_VALIDATE_LINK_REGISTER
1303
+ ret
1304
+
1305
+ .Lseal_128:
1306
+ // On some architectures preparing 5 blocks for small buffers is wasteful
1307
+ eor v25.16b, v25.16b, v25.16b
1308
+ mov x11, #1
1309
+ mov v25.s[0], w11
1310
+ mov v0.16b, v24.16b
1311
+ mov v1.16b, v24.16b
1312
+ mov v2.16b, v24.16b
1313
+ mov v5.16b, v28.16b
1314
+ mov v6.16b, v28.16b
1315
+ mov v7.16b, v28.16b
1316
+ mov v10.16b, v29.16b
1317
+ mov v11.16b, v29.16b
1318
+ mov v12.16b, v29.16b
1319
+ mov v17.16b, v30.16b
1320
+ add v15.4s, v17.4s, v25.4s
1321
+ add v16.4s, v15.4s, v25.4s
1322
+
1323
+ mov x6, #10
1324
+
1325
+ .Lseal_128_rounds:
1326
+ add v0.4s, v0.4s, v5.4s
1327
+ add v1.4s, v1.4s, v6.4s
1328
+ add v2.4s, v2.4s, v7.4s
1329
+ eor v15.16b, v15.16b, v0.16b
1330
+ eor v16.16b, v16.16b, v1.16b
1331
+ eor v17.16b, v17.16b, v2.16b
1332
+ rev32 v15.8h, v15.8h
1333
+ rev32 v16.8h, v16.8h
1334
+ rev32 v17.8h, v17.8h
1335
+
1336
+ add v10.4s, v10.4s, v15.4s
1337
+ add v11.4s, v11.4s, v16.4s
1338
+ add v12.4s, v12.4s, v17.4s
1339
+ eor v5.16b, v5.16b, v10.16b
1340
+ eor v6.16b, v6.16b, v11.16b
1341
+ eor v7.16b, v7.16b, v12.16b
1342
+ ushr v20.4s, v5.4s, #20
1343
+ sli v20.4s, v5.4s, #12
1344
+ ushr v5.4s, v6.4s, #20
1345
+ sli v5.4s, v6.4s, #12
1346
+ ushr v6.4s, v7.4s, #20
1347
+ sli v6.4s, v7.4s, #12
1348
+
1349
+ add v0.4s, v0.4s, v20.4s
1350
+ add v1.4s, v1.4s, v5.4s
1351
+ add v2.4s, v2.4s, v6.4s
1352
+ eor v15.16b, v15.16b, v0.16b
1353
+ eor v16.16b, v16.16b, v1.16b
1354
+ eor v17.16b, v17.16b, v2.16b
1355
+ tbl v15.16b, {v15.16b}, v26.16b
1356
+ tbl v16.16b, {v16.16b}, v26.16b
1357
+ tbl v17.16b, {v17.16b}, v26.16b
1358
+
1359
+ add v10.4s, v10.4s, v15.4s
1360
+ add v11.4s, v11.4s, v16.4s
1361
+ add v12.4s, v12.4s, v17.4s
1362
+ eor v20.16b, v20.16b, v10.16b
1363
+ eor v5.16b, v5.16b, v11.16b
1364
+ eor v6.16b, v6.16b, v12.16b
1365
+ ushr v7.4s, v6.4s, #25
1366
+ sli v7.4s, v6.4s, #7
1367
+ ushr v6.4s, v5.4s, #25
1368
+ sli v6.4s, v5.4s, #7
1369
+ ushr v5.4s, v20.4s, #25
1370
+ sli v5.4s, v20.4s, #7
1371
+
1372
+ ext v5.16b, v5.16b, v5.16b, #4
1373
+ ext v6.16b, v6.16b, v6.16b, #4
1374
+ ext v7.16b, v7.16b, v7.16b, #4
1375
+
1376
+ ext v10.16b, v10.16b, v10.16b, #8
1377
+ ext v11.16b, v11.16b, v11.16b, #8
1378
+ ext v12.16b, v12.16b, v12.16b, #8
1379
+
1380
+ ext v15.16b, v15.16b, v15.16b, #12
1381
+ ext v16.16b, v16.16b, v16.16b, #12
1382
+ ext v17.16b, v17.16b, v17.16b, #12
1383
+ add v0.4s, v0.4s, v5.4s
1384
+ add v1.4s, v1.4s, v6.4s
1385
+ add v2.4s, v2.4s, v7.4s
1386
+ eor v15.16b, v15.16b, v0.16b
1387
+ eor v16.16b, v16.16b, v1.16b
1388
+ eor v17.16b, v17.16b, v2.16b
1389
+ rev32 v15.8h, v15.8h
1390
+ rev32 v16.8h, v16.8h
1391
+ rev32 v17.8h, v17.8h
1392
+
1393
+ add v10.4s, v10.4s, v15.4s
1394
+ add v11.4s, v11.4s, v16.4s
1395
+ add v12.4s, v12.4s, v17.4s
1396
+ eor v5.16b, v5.16b, v10.16b
1397
+ eor v6.16b, v6.16b, v11.16b
1398
+ eor v7.16b, v7.16b, v12.16b
1399
+ ushr v20.4s, v5.4s, #20
1400
+ sli v20.4s, v5.4s, #12
1401
+ ushr v5.4s, v6.4s, #20
1402
+ sli v5.4s, v6.4s, #12
1403
+ ushr v6.4s, v7.4s, #20
1404
+ sli v6.4s, v7.4s, #12
1405
+
1406
+ add v0.4s, v0.4s, v20.4s
1407
+ add v1.4s, v1.4s, v5.4s
1408
+ add v2.4s, v2.4s, v6.4s
1409
+ eor v15.16b, v15.16b, v0.16b
1410
+ eor v16.16b, v16.16b, v1.16b
1411
+ eor v17.16b, v17.16b, v2.16b
1412
+ tbl v15.16b, {v15.16b}, v26.16b
1413
+ tbl v16.16b, {v16.16b}, v26.16b
1414
+ tbl v17.16b, {v17.16b}, v26.16b
1415
+
1416
+ add v10.4s, v10.4s, v15.4s
1417
+ add v11.4s, v11.4s, v16.4s
1418
+ add v12.4s, v12.4s, v17.4s
1419
+ eor v20.16b, v20.16b, v10.16b
1420
+ eor v5.16b, v5.16b, v11.16b
1421
+ eor v6.16b, v6.16b, v12.16b
1422
+ ushr v7.4s, v6.4s, #25
1423
+ sli v7.4s, v6.4s, #7
1424
+ ushr v6.4s, v5.4s, #25
1425
+ sli v6.4s, v5.4s, #7
1426
+ ushr v5.4s, v20.4s, #25
1427
+ sli v5.4s, v20.4s, #7
1428
+
1429
+ ext v5.16b, v5.16b, v5.16b, #12
1430
+ ext v6.16b, v6.16b, v6.16b, #12
1431
+ ext v7.16b, v7.16b, v7.16b, #12
1432
+
1433
+ ext v10.16b, v10.16b, v10.16b, #8
1434
+ ext v11.16b, v11.16b, v11.16b, #8
1435
+ ext v12.16b, v12.16b, v12.16b, #8
1436
+
1437
+ ext v15.16b, v15.16b, v15.16b, #4
1438
+ ext v16.16b, v16.16b, v16.16b, #4
1439
+ ext v17.16b, v17.16b, v17.16b, #4
1440
+ subs x6, x6, #1
1441
+ b.hi .Lseal_128_rounds
1442
+
1443
+ add v0.4s, v0.4s, v24.4s
1444
+ add v1.4s, v1.4s, v24.4s
1445
+ add v2.4s, v2.4s, v24.4s
1446
+
1447
+ add v5.4s, v5.4s, v28.4s
1448
+ add v6.4s, v6.4s, v28.4s
1449
+ add v7.4s, v7.4s, v28.4s
1450
+
1451
+ // Only the first 32 bytes of the third block (counter = 0) are needed,
1452
+ // so skip updating v12 and v17.
1453
+ add v10.4s, v10.4s, v29.4s
1454
+ add v11.4s, v11.4s, v29.4s
1455
+
1456
+ add v30.4s, v30.4s, v25.4s
1457
+ add v15.4s, v15.4s, v30.4s
1458
+ add v30.4s, v30.4s, v25.4s
1459
+ add v16.4s, v16.4s, v30.4s
1460
+
1461
+ and v2.16b, v2.16b, v27.16b
1462
+ mov x16, v2.d[0] // Move the R key to GPRs
1463
+ mov x17, v2.d[1]
1464
+ mov v27.16b, v7.16b // Store the S key
1465
+
1466
+ bl .Lpoly_hash_ad_internal
1467
+ b .Lseal_tail
1468
+ .cfi_endproc
1469
+ .size chacha20_poly1305_seal,.-chacha20_poly1305_seal
1470
+
1471
+ /////////////////////////////////
1472
+ //
1473
+ // 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);
1474
+ //
1475
+ .globl chacha20_poly1305_open
1476
+ .hidden chacha20_poly1305_open
1477
+ .type chacha20_poly1305_open,%function
1478
+ .align 6
1479
+ chacha20_poly1305_open:
1480
+ AARCH64_SIGN_LINK_REGISTER
1481
+ .cfi_startproc
1482
+ stp x29, x30, [sp, #-80]!
1483
+ .cfi_def_cfa_offset 80
1484
+ .cfi_offset w30, -72
1485
+ .cfi_offset w29, -80
1486
+ mov x29, sp
1487
+ // We probably could do .cfi_def_cfa w29, 80 at this point, but since
1488
+ // we don't actually use the frame pointer like that, it's probably not
1489
+ // worth bothering.
1490
+ stp d8, d9, [sp, #16]
1491
+ stp d10, d11, [sp, #32]
1492
+ stp d12, d13, [sp, #48]
1493
+ stp d14, d15, [sp, #64]
1494
+ .cfi_offset b15, -8
1495
+ .cfi_offset b14, -16
1496
+ .cfi_offset b13, -24
1497
+ .cfi_offset b12, -32
1498
+ .cfi_offset b11, -40
1499
+ .cfi_offset b10, -48
1500
+ .cfi_offset b9, -56
1501
+ .cfi_offset b8, -64
1502
+
1503
+ adrp x11, .Lchacha20_consts
1504
+ add x11, x11, :lo12:.Lchacha20_consts
1505
+
1506
+ ld1 {v24.16b - v27.16b}, [x11] // .Load the CONSTS, INC, ROL8 and CLAMP values
1507
+ ld1 {v28.16b - v30.16b}, [x5]
1508
+
1509
+ mov x15, #1 // Prepare the Poly1305 state
1510
+ mov x8, #0
1511
+ mov x9, #0
1512
+ mov x10, #0
1513
+
1514
+ mov v31.d[0], x4 // Store the input and aad lengths
1515
+ mov v31.d[1], x2
1516
+
1517
+ cmp x2, #128
1518
+ b.le .Lopen_128 // Optimization for smaller buffers
1519
+
1520
+ // Initially we prepare a single ChaCha20 block for the Poly1305 R and S keys
1521
+ mov v0.16b, v24.16b
1522
+ mov v5.16b, v28.16b
1523
+ mov v10.16b, v29.16b
1524
+ mov v15.16b, v30.16b
1525
+
1526
+ mov x6, #10
1527
+
1528
+ .align 5
1529
+ .Lopen_init_rounds:
1530
+ add v0.4s, v0.4s, v5.4s
1531
+ eor v15.16b, v15.16b, v0.16b
1532
+ rev32 v15.8h, v15.8h
1533
+
1534
+ add v10.4s, v10.4s, v15.4s
1535
+ eor v5.16b, v5.16b, v10.16b
1536
+ ushr v20.4s, v5.4s, #20
1537
+ sli v20.4s, v5.4s, #12
1538
+ add v0.4s, v0.4s, v20.4s
1539
+ eor v15.16b, v15.16b, v0.16b
1540
+ tbl v15.16b, {v15.16b}, v26.16b
1541
+
1542
+ add v10.4s, v10.4s, v15.4s
1543
+ eor v20.16b, v20.16b, v10.16b
1544
+ ushr v5.4s, v20.4s, #25
1545
+ sli v5.4s, v20.4s, #7
1546
+ ext v5.16b, v5.16b, v5.16b, #4
1547
+ ext v10.16b, v10.16b, v10.16b, #8
1548
+ ext v15.16b, v15.16b, v15.16b, #12
1549
+ add v0.4s, v0.4s, v5.4s
1550
+ eor v15.16b, v15.16b, v0.16b
1551
+ rev32 v15.8h, v15.8h
1552
+
1553
+ add v10.4s, v10.4s, v15.4s
1554
+ eor v5.16b, v5.16b, v10.16b
1555
+ ushr v20.4s, v5.4s, #20
1556
+ sli v20.4s, v5.4s, #12
1557
+ add v0.4s, v0.4s, v20.4s
1558
+ eor v15.16b, v15.16b, v0.16b
1559
+ tbl v15.16b, {v15.16b}, v26.16b
1560
+
1561
+ add v10.4s, v10.4s, v15.4s
1562
+ eor v20.16b, v20.16b, v10.16b
1563
+ ushr v5.4s, v20.4s, #25
1564
+ sli v5.4s, v20.4s, #7
1565
+ ext v5.16b, v5.16b, v5.16b, #12
1566
+ ext v10.16b, v10.16b, v10.16b, #8
1567
+ ext v15.16b, v15.16b, v15.16b, #4
1568
+ subs x6, x6, #1
1569
+ b.hi .Lopen_init_rounds
1570
+
1571
+ add v0.4s, v0.4s, v24.4s
1572
+ add v5.4s, v5.4s, v28.4s
1573
+
1574
+ and v0.16b, v0.16b, v27.16b
1575
+ mov x16, v0.d[0] // Move the R key to GPRs
1576
+ mov x17, v0.d[1]
1577
+ mov v27.16b, v5.16b // Store the S key
1578
+
1579
+ bl .Lpoly_hash_ad_internal
1580
+
1581
+ mov x3, x1
1582
+
1583
+ // Each iteration of the loop hash 320 bytes, and prepare stream for 320 bytes
1584
+ .Lopen_main_loop:
1585
+
1586
+ cmp x2, #192
1587
+ b.lt .Lopen_tail
1588
+
1589
+ adrp x11, .Lchacha20_consts
1590
+ add x11, x11, :lo12:.Lchacha20_consts
1591
+
1592
+ ld4r {v0.4s,v1.4s,v2.4s,v3.4s}, [x11]
1593
+ mov v4.16b, v24.16b
1594
+
1595
+ ld4r {v5.4s,v6.4s,v7.4s,v8.4s}, [x5], #16
1596
+ mov v9.16b, v28.16b
1597
+
1598
+ ld4r {v10.4s,v11.4s,v12.4s,v13.4s}, [x5], #16
1599
+ mov v14.16b, v29.16b
1600
+
1601
+ ld4r {v15.4s,v16.4s,v17.4s,v18.4s}, [x5]
1602
+ sub x5, x5, #32
1603
+ add v15.4s, v15.4s, v25.4s
1604
+ mov v19.16b, v30.16b
1605
+
1606
+ eor v20.16b, v20.16b, v20.16b //zero
1607
+ not v21.16b, v20.16b // -1
1608
+ sub v21.4s, v25.4s, v21.4s // Add +1
1609
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
1610
+ add v19.4s, v19.4s, v20.4s
1611
+
1612
+ lsr x4, x2, #4 // How many whole blocks we have to hash, will always be at least 12
1613
+ sub x4, x4, #10
1614
+
1615
+ mov x7, #10
1616
+ subs x6, x7, x4 // itr1 can be negative if we have more than 320 bytes to hash
1617
+ csel x7, x7, x4, le // if itr1 is zero or less, itr2 should be 10 to indicate all 10 rounds are full
1618
+
1619
+ cbz x7, .Lopen_main_loop_rounds_short
1620
+
1621
+ .align 5
1622
+ .Lopen_main_loop_rounds:
1623
+ ldp x11, x12, [x3], 16
1624
+ adds x8, x8, x11
1625
+ adcs x9, x9, x12
1626
+ adc x10, x10, x15
1627
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1628
+ umulh x12, x8, x16
1629
+ mul x13, x9, x16
1630
+ umulh x14, x9, x16
1631
+ adds x12, x12, x13
1632
+ mul x13, x10, x16
1633
+ adc x13, x13, x14
1634
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1635
+ umulh x8, x8, x17
1636
+ adds x12, x12, x14
1637
+ mul x14, x9, x17
1638
+ umulh x9, x9, x17
1639
+ adcs x14, x14, x8
1640
+ mul x10, x10, x17
1641
+ adc x10, x10, x9
1642
+ adds x13, x13, x14
1643
+ adc x14, x10, xzr
1644
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1645
+ and x8, x13, #-4
1646
+ extr x13, x14, x13, #2
1647
+ adds x8, x8, x11
1648
+ lsr x11, x14, #2
1649
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1650
+ adds x8, x8, x13
1651
+ adcs x9, x9, x12
1652
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1653
+ .Lopen_main_loop_rounds_short:
1654
+ add v0.4s, v0.4s, v5.4s
1655
+ add v1.4s, v1.4s, v6.4s
1656
+ add v2.4s, v2.4s, v7.4s
1657
+ add v3.4s, v3.4s, v8.4s
1658
+ add v4.4s, v4.4s, v9.4s
1659
+
1660
+ eor v15.16b, v15.16b, v0.16b
1661
+ eor v16.16b, v16.16b, v1.16b
1662
+ eor v17.16b, v17.16b, v2.16b
1663
+ eor v18.16b, v18.16b, v3.16b
1664
+ eor v19.16b, v19.16b, v4.16b
1665
+
1666
+ rev32 v15.8h, v15.8h
1667
+ rev32 v16.8h, v16.8h
1668
+ rev32 v17.8h, v17.8h
1669
+ rev32 v18.8h, v18.8h
1670
+ rev32 v19.8h, v19.8h
1671
+
1672
+ add v10.4s, v10.4s, v15.4s
1673
+ add v11.4s, v11.4s, v16.4s
1674
+ add v12.4s, v12.4s, v17.4s
1675
+ add v13.4s, v13.4s, v18.4s
1676
+ add v14.4s, v14.4s, v19.4s
1677
+
1678
+ eor v5.16b, v5.16b, v10.16b
1679
+ eor v6.16b, v6.16b, v11.16b
1680
+ eor v7.16b, v7.16b, v12.16b
1681
+ eor v8.16b, v8.16b, v13.16b
1682
+ eor v9.16b, v9.16b, v14.16b
1683
+
1684
+ ushr v20.4s, v5.4s, #20
1685
+ sli v20.4s, v5.4s, #12
1686
+ ushr v5.4s, v6.4s, #20
1687
+ sli v5.4s, v6.4s, #12
1688
+ ushr v6.4s, v7.4s, #20
1689
+ sli v6.4s, v7.4s, #12
1690
+ ushr v7.4s, v8.4s, #20
1691
+ sli v7.4s, v8.4s, #12
1692
+ ushr v8.4s, v9.4s, #20
1693
+ sli v8.4s, v9.4s, #12
1694
+
1695
+ add v0.4s, v0.4s, v20.4s
1696
+ add v1.4s, v1.4s, v5.4s
1697
+ add v2.4s, v2.4s, v6.4s
1698
+ add v3.4s, v3.4s, v7.4s
1699
+ add v4.4s, v4.4s, v8.4s
1700
+
1701
+ eor v15.16b, v15.16b, v0.16b
1702
+ eor v16.16b, v16.16b, v1.16b
1703
+ eor v17.16b, v17.16b, v2.16b
1704
+ eor v18.16b, v18.16b, v3.16b
1705
+ eor v19.16b, v19.16b, v4.16b
1706
+
1707
+ tbl v15.16b, {v15.16b}, v26.16b
1708
+ tbl v16.16b, {v16.16b}, v26.16b
1709
+ tbl v17.16b, {v17.16b}, v26.16b
1710
+ tbl v18.16b, {v18.16b}, v26.16b
1711
+ tbl v19.16b, {v19.16b}, v26.16b
1712
+
1713
+ add v10.4s, v10.4s, v15.4s
1714
+ add v11.4s, v11.4s, v16.4s
1715
+ add v12.4s, v12.4s, v17.4s
1716
+ add v13.4s, v13.4s, v18.4s
1717
+ add v14.4s, v14.4s, v19.4s
1718
+
1719
+ eor v20.16b, v20.16b, v10.16b
1720
+ eor v5.16b, v5.16b, v11.16b
1721
+ eor v6.16b, v6.16b, v12.16b
1722
+ eor v7.16b, v7.16b, v13.16b
1723
+ eor v8.16b, v8.16b, v14.16b
1724
+
1725
+ ushr v9.4s, v8.4s, #25
1726
+ sli v9.4s, v8.4s, #7
1727
+ ushr v8.4s, v7.4s, #25
1728
+ sli v8.4s, v7.4s, #7
1729
+ ushr v7.4s, v6.4s, #25
1730
+ sli v7.4s, v6.4s, #7
1731
+ ushr v6.4s, v5.4s, #25
1732
+ sli v6.4s, v5.4s, #7
1733
+ ushr v5.4s, v20.4s, #25
1734
+ sli v5.4s, v20.4s, #7
1735
+
1736
+ ext v9.16b, v9.16b, v9.16b, #4
1737
+ ext v14.16b, v14.16b, v14.16b, #8
1738
+ ext v19.16b, v19.16b, v19.16b, #12
1739
+ ldp x11, x12, [x3], 16
1740
+ adds x8, x8, x11
1741
+ adcs x9, x9, x12
1742
+ adc x10, x10, x15
1743
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
1744
+ umulh x12, x8, x16
1745
+ mul x13, x9, x16
1746
+ umulh x14, x9, x16
1747
+ adds x12, x12, x13
1748
+ mul x13, x10, x16
1749
+ adc x13, x13, x14
1750
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
1751
+ umulh x8, x8, x17
1752
+ adds x12, x12, x14
1753
+ mul x14, x9, x17
1754
+ umulh x9, x9, x17
1755
+ adcs x14, x14, x8
1756
+ mul x10, x10, x17
1757
+ adc x10, x10, x9
1758
+ adds x13, x13, x14
1759
+ adc x14, x10, xzr
1760
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
1761
+ and x8, x13, #-4
1762
+ extr x13, x14, x13, #2
1763
+ adds x8, x8, x11
1764
+ lsr x11, x14, #2
1765
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
1766
+ adds x8, x8, x13
1767
+ adcs x9, x9, x12
1768
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
1769
+ add v0.4s, v0.4s, v6.4s
1770
+ add v1.4s, v1.4s, v7.4s
1771
+ add v2.4s, v2.4s, v8.4s
1772
+ add v3.4s, v3.4s, v5.4s
1773
+ add v4.4s, v4.4s, v9.4s
1774
+
1775
+ eor v18.16b, v18.16b, v0.16b
1776
+ eor v15.16b, v15.16b, v1.16b
1777
+ eor v16.16b, v16.16b, v2.16b
1778
+ eor v17.16b, v17.16b, v3.16b
1779
+ eor v19.16b, v19.16b, v4.16b
1780
+
1781
+ rev32 v18.8h, v18.8h
1782
+ rev32 v15.8h, v15.8h
1783
+ rev32 v16.8h, v16.8h
1784
+ rev32 v17.8h, v17.8h
1785
+ rev32 v19.8h, v19.8h
1786
+
1787
+ add v12.4s, v12.4s, v18.4s
1788
+ add v13.4s, v13.4s, v15.4s
1789
+ add v10.4s, v10.4s, v16.4s
1790
+ add v11.4s, v11.4s, v17.4s
1791
+ add v14.4s, v14.4s, v19.4s
1792
+
1793
+ eor v6.16b, v6.16b, v12.16b
1794
+ eor v7.16b, v7.16b, v13.16b
1795
+ eor v8.16b, v8.16b, v10.16b
1796
+ eor v5.16b, v5.16b, v11.16b
1797
+ eor v9.16b, v9.16b, v14.16b
1798
+
1799
+ ushr v20.4s, v6.4s, #20
1800
+ sli v20.4s, v6.4s, #12
1801
+ ushr v6.4s, v7.4s, #20
1802
+ sli v6.4s, v7.4s, #12
1803
+ ushr v7.4s, v8.4s, #20
1804
+ sli v7.4s, v8.4s, #12
1805
+ ushr v8.4s, v5.4s, #20
1806
+ sli v8.4s, v5.4s, #12
1807
+ ushr v5.4s, v9.4s, #20
1808
+ sli v5.4s, v9.4s, #12
1809
+
1810
+ add v0.4s, v0.4s, v20.4s
1811
+ add v1.4s, v1.4s, v6.4s
1812
+ add v2.4s, v2.4s, v7.4s
1813
+ add v3.4s, v3.4s, v8.4s
1814
+ add v4.4s, v4.4s, v5.4s
1815
+
1816
+ eor v18.16b, v18.16b, v0.16b
1817
+ eor v15.16b, v15.16b, v1.16b
1818
+ eor v16.16b, v16.16b, v2.16b
1819
+ eor v17.16b, v17.16b, v3.16b
1820
+ eor v19.16b, v19.16b, v4.16b
1821
+
1822
+ tbl v18.16b, {v18.16b}, v26.16b
1823
+ tbl v15.16b, {v15.16b}, v26.16b
1824
+ tbl v16.16b, {v16.16b}, v26.16b
1825
+ tbl v17.16b, {v17.16b}, v26.16b
1826
+ tbl v19.16b, {v19.16b}, v26.16b
1827
+
1828
+ add v12.4s, v12.4s, v18.4s
1829
+ add v13.4s, v13.4s, v15.4s
1830
+ add v10.4s, v10.4s, v16.4s
1831
+ add v11.4s, v11.4s, v17.4s
1832
+ add v14.4s, v14.4s, v19.4s
1833
+
1834
+ eor v20.16b, v20.16b, v12.16b
1835
+ eor v6.16b, v6.16b, v13.16b
1836
+ eor v7.16b, v7.16b, v10.16b
1837
+ eor v8.16b, v8.16b, v11.16b
1838
+ eor v5.16b, v5.16b, v14.16b
1839
+
1840
+ ushr v9.4s, v5.4s, #25
1841
+ sli v9.4s, v5.4s, #7
1842
+ ushr v5.4s, v8.4s, #25
1843
+ sli v5.4s, v8.4s, #7
1844
+ ushr v8.4s, v7.4s, #25
1845
+ sli v8.4s, v7.4s, #7
1846
+ ushr v7.4s, v6.4s, #25
1847
+ sli v7.4s, v6.4s, #7
1848
+ ushr v6.4s, v20.4s, #25
1849
+ sli v6.4s, v20.4s, #7
1850
+
1851
+ ext v9.16b, v9.16b, v9.16b, #12
1852
+ ext v14.16b, v14.16b, v14.16b, #8
1853
+ ext v19.16b, v19.16b, v19.16b, #4
1854
+ subs x7, x7, #1
1855
+ b.gt .Lopen_main_loop_rounds
1856
+ subs x6, x6, #1
1857
+ b.ge .Lopen_main_loop_rounds_short
1858
+
1859
+ eor v20.16b, v20.16b, v20.16b //zero
1860
+ not v21.16b, v20.16b // -1
1861
+ sub v21.4s, v25.4s, v21.4s // Add +1
1862
+ ext v20.16b, v21.16b, v20.16b, #12 // Get the last element (counter)
1863
+ add v19.4s, v19.4s, v20.4s
1864
+
1865
+ add v15.4s, v15.4s, v25.4s
1866
+ mov x11, #5
1867
+ dup v20.4s, w11
1868
+ add v25.4s, v25.4s, v20.4s
1869
+
1870
+ zip1 v20.4s, v0.4s, v1.4s
1871
+ zip2 v21.4s, v0.4s, v1.4s
1872
+ zip1 v22.4s, v2.4s, v3.4s
1873
+ zip2 v23.4s, v2.4s, v3.4s
1874
+
1875
+ zip1 v0.2d, v20.2d, v22.2d
1876
+ zip2 v1.2d, v20.2d, v22.2d
1877
+ zip1 v2.2d, v21.2d, v23.2d
1878
+ zip2 v3.2d, v21.2d, v23.2d
1879
+
1880
+ zip1 v20.4s, v5.4s, v6.4s
1881
+ zip2 v21.4s, v5.4s, v6.4s
1882
+ zip1 v22.4s, v7.4s, v8.4s
1883
+ zip2 v23.4s, v7.4s, v8.4s
1884
+
1885
+ zip1 v5.2d, v20.2d, v22.2d
1886
+ zip2 v6.2d, v20.2d, v22.2d
1887
+ zip1 v7.2d, v21.2d, v23.2d
1888
+ zip2 v8.2d, v21.2d, v23.2d
1889
+
1890
+ zip1 v20.4s, v10.4s, v11.4s
1891
+ zip2 v21.4s, v10.4s, v11.4s
1892
+ zip1 v22.4s, v12.4s, v13.4s
1893
+ zip2 v23.4s, v12.4s, v13.4s
1894
+
1895
+ zip1 v10.2d, v20.2d, v22.2d
1896
+ zip2 v11.2d, v20.2d, v22.2d
1897
+ zip1 v12.2d, v21.2d, v23.2d
1898
+ zip2 v13.2d, v21.2d, v23.2d
1899
+
1900
+ zip1 v20.4s, v15.4s, v16.4s
1901
+ zip2 v21.4s, v15.4s, v16.4s
1902
+ zip1 v22.4s, v17.4s, v18.4s
1903
+ zip2 v23.4s, v17.4s, v18.4s
1904
+
1905
+ zip1 v15.2d, v20.2d, v22.2d
1906
+ zip2 v16.2d, v20.2d, v22.2d
1907
+ zip1 v17.2d, v21.2d, v23.2d
1908
+ zip2 v18.2d, v21.2d, v23.2d
1909
+
1910
+ add v0.4s, v0.4s, v24.4s
1911
+ add v5.4s, v5.4s, v28.4s
1912
+ add v10.4s, v10.4s, v29.4s
1913
+ add v15.4s, v15.4s, v30.4s
1914
+
1915
+ add v1.4s, v1.4s, v24.4s
1916
+ add v6.4s, v6.4s, v28.4s
1917
+ add v11.4s, v11.4s, v29.4s
1918
+ add v16.4s, v16.4s, v30.4s
1919
+
1920
+ add v2.4s, v2.4s, v24.4s
1921
+ add v7.4s, v7.4s, v28.4s
1922
+ add v12.4s, v12.4s, v29.4s
1923
+ add v17.4s, v17.4s, v30.4s
1924
+
1925
+ add v3.4s, v3.4s, v24.4s
1926
+ add v8.4s, v8.4s, v28.4s
1927
+ add v13.4s, v13.4s, v29.4s
1928
+ add v18.4s, v18.4s, v30.4s
1929
+
1930
+ add v4.4s, v4.4s, v24.4s
1931
+ add v9.4s, v9.4s, v28.4s
1932
+ add v14.4s, v14.4s, v29.4s
1933
+ add v19.4s, v19.4s, v30.4s
1934
+
1935
+ // We can always safely store 192 bytes
1936
+ ld1 {v20.16b - v23.16b}, [x1], #64
1937
+ eor v20.16b, v20.16b, v0.16b
1938
+ eor v21.16b, v21.16b, v5.16b
1939
+ eor v22.16b, v22.16b, v10.16b
1940
+ eor v23.16b, v23.16b, v15.16b
1941
+ st1 {v20.16b - v23.16b}, [x0], #64
1942
+
1943
+ ld1 {v20.16b - v23.16b}, [x1], #64
1944
+ eor v20.16b, v20.16b, v1.16b
1945
+ eor v21.16b, v21.16b, v6.16b
1946
+ eor v22.16b, v22.16b, v11.16b
1947
+ eor v23.16b, v23.16b, v16.16b
1948
+ st1 {v20.16b - v23.16b}, [x0], #64
1949
+
1950
+ ld1 {v20.16b - v23.16b}, [x1], #64
1951
+ eor v20.16b, v20.16b, v2.16b
1952
+ eor v21.16b, v21.16b, v7.16b
1953
+ eor v22.16b, v22.16b, v12.16b
1954
+ eor v23.16b, v23.16b, v17.16b
1955
+ st1 {v20.16b - v23.16b}, [x0], #64
1956
+
1957
+ sub x2, x2, #192
1958
+
1959
+ mov v0.16b, v3.16b
1960
+ mov v5.16b, v8.16b
1961
+ mov v10.16b, v13.16b
1962
+ mov v15.16b, v18.16b
1963
+
1964
+ cmp x2, #64
1965
+ b.lt .Lopen_tail_64_store
1966
+
1967
+ ld1 {v20.16b - v23.16b}, [x1], #64
1968
+ eor v20.16b, v20.16b, v3.16b
1969
+ eor v21.16b, v21.16b, v8.16b
1970
+ eor v22.16b, v22.16b, v13.16b
1971
+ eor v23.16b, v23.16b, v18.16b
1972
+ st1 {v20.16b - v23.16b}, [x0], #64
1973
+
1974
+ sub x2, x2, #64
1975
+
1976
+ mov v0.16b, v4.16b
1977
+ mov v5.16b, v9.16b
1978
+ mov v10.16b, v14.16b
1979
+ mov v15.16b, v19.16b
1980
+
1981
+ cmp x2, #64
1982
+ b.lt .Lopen_tail_64_store
1983
+
1984
+ ld1 {v20.16b - v23.16b}, [x1], #64
1985
+ eor v20.16b, v20.16b, v4.16b
1986
+ eor v21.16b, v21.16b, v9.16b
1987
+ eor v22.16b, v22.16b, v14.16b
1988
+ eor v23.16b, v23.16b, v19.16b
1989
+ st1 {v20.16b - v23.16b}, [x0], #64
1990
+
1991
+ sub x2, x2, #64
1992
+ b .Lopen_main_loop
1993
+
1994
+ .Lopen_tail:
1995
+
1996
+ cbz x2, .Lopen_finalize
1997
+
1998
+ lsr x4, x2, #4 // How many whole blocks we have to hash
1999
+
2000
+ cmp x2, #64
2001
+ b.le .Lopen_tail_64
2002
+ cmp x2, #128
2003
+ b.le .Lopen_tail_128
2004
+
2005
+ .Lopen_tail_192:
2006
+ // We need three more blocks
2007
+ mov v0.16b, v24.16b
2008
+ mov v1.16b, v24.16b
2009
+ mov v2.16b, v24.16b
2010
+ mov v5.16b, v28.16b
2011
+ mov v6.16b, v28.16b
2012
+ mov v7.16b, v28.16b
2013
+ mov v10.16b, v29.16b
2014
+ mov v11.16b, v29.16b
2015
+ mov v12.16b, v29.16b
2016
+ mov v15.16b, v30.16b
2017
+ mov v16.16b, v30.16b
2018
+ mov v17.16b, v30.16b
2019
+ eor v23.16b, v23.16b, v23.16b
2020
+ eor v21.16b, v21.16b, v21.16b
2021
+ ins v23.s[0], v25.s[0]
2022
+ ins v21.d[0], x15
2023
+
2024
+ add v22.4s, v23.4s, v21.4s
2025
+ add v21.4s, v22.4s, v21.4s
2026
+
2027
+ add v15.4s, v15.4s, v21.4s
2028
+ add v16.4s, v16.4s, v23.4s
2029
+ add v17.4s, v17.4s, v22.4s
2030
+
2031
+ mov x7, #10
2032
+ subs x6, x7, x4 // itr1 can be negative if we have more than 160 bytes to hash
2033
+ csel x7, x7, x4, le // if itr1 is zero or less, itr2 should be 10 to indicate all 10 rounds are hashing
2034
+ sub x4, x4, x7
2035
+
2036
+ cbz x7, .Lopen_tail_192_rounds_no_hash
2037
+
2038
+ .Lopen_tail_192_rounds:
2039
+ ldp x11, x12, [x3], 16
2040
+ adds x8, x8, x11
2041
+ adcs x9, x9, x12
2042
+ adc x10, x10, x15
2043
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2044
+ umulh x12, x8, x16
2045
+ mul x13, x9, x16
2046
+ umulh x14, x9, x16
2047
+ adds x12, x12, x13
2048
+ mul x13, x10, x16
2049
+ adc x13, x13, x14
2050
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2051
+ umulh x8, x8, x17
2052
+ adds x12, x12, x14
2053
+ mul x14, x9, x17
2054
+ umulh x9, x9, x17
2055
+ adcs x14, x14, x8
2056
+ mul x10, x10, x17
2057
+ adc x10, x10, x9
2058
+ adds x13, x13, x14
2059
+ adc x14, x10, xzr
2060
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2061
+ and x8, x13, #-4
2062
+ extr x13, x14, x13, #2
2063
+ adds x8, x8, x11
2064
+ lsr x11, x14, #2
2065
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2066
+ adds x8, x8, x13
2067
+ adcs x9, x9, x12
2068
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2069
+ .Lopen_tail_192_rounds_no_hash:
2070
+ add v0.4s, v0.4s, v5.4s
2071
+ add v1.4s, v1.4s, v6.4s
2072
+ add v2.4s, v2.4s, v7.4s
2073
+ eor v15.16b, v15.16b, v0.16b
2074
+ eor v16.16b, v16.16b, v1.16b
2075
+ eor v17.16b, v17.16b, v2.16b
2076
+ rev32 v15.8h, v15.8h
2077
+ rev32 v16.8h, v16.8h
2078
+ rev32 v17.8h, v17.8h
2079
+
2080
+ add v10.4s, v10.4s, v15.4s
2081
+ add v11.4s, v11.4s, v16.4s
2082
+ add v12.4s, v12.4s, v17.4s
2083
+ eor v5.16b, v5.16b, v10.16b
2084
+ eor v6.16b, v6.16b, v11.16b
2085
+ eor v7.16b, v7.16b, v12.16b
2086
+ ushr v20.4s, v5.4s, #20
2087
+ sli v20.4s, v5.4s, #12
2088
+ ushr v5.4s, v6.4s, #20
2089
+ sli v5.4s, v6.4s, #12
2090
+ ushr v6.4s, v7.4s, #20
2091
+ sli v6.4s, v7.4s, #12
2092
+
2093
+ add v0.4s, v0.4s, v20.4s
2094
+ add v1.4s, v1.4s, v5.4s
2095
+ add v2.4s, v2.4s, v6.4s
2096
+ eor v15.16b, v15.16b, v0.16b
2097
+ eor v16.16b, v16.16b, v1.16b
2098
+ eor v17.16b, v17.16b, v2.16b
2099
+ tbl v15.16b, {v15.16b}, v26.16b
2100
+ tbl v16.16b, {v16.16b}, v26.16b
2101
+ tbl v17.16b, {v17.16b}, v26.16b
2102
+
2103
+ add v10.4s, v10.4s, v15.4s
2104
+ add v11.4s, v11.4s, v16.4s
2105
+ add v12.4s, v12.4s, v17.4s
2106
+ eor v20.16b, v20.16b, v10.16b
2107
+ eor v5.16b, v5.16b, v11.16b
2108
+ eor v6.16b, v6.16b, v12.16b
2109
+ ushr v7.4s, v6.4s, #25
2110
+ sli v7.4s, v6.4s, #7
2111
+ ushr v6.4s, v5.4s, #25
2112
+ sli v6.4s, v5.4s, #7
2113
+ ushr v5.4s, v20.4s, #25
2114
+ sli v5.4s, v20.4s, #7
2115
+
2116
+ ext v5.16b, v5.16b, v5.16b, #4
2117
+ ext v6.16b, v6.16b, v6.16b, #4
2118
+ ext v7.16b, v7.16b, v7.16b, #4
2119
+
2120
+ ext v10.16b, v10.16b, v10.16b, #8
2121
+ ext v11.16b, v11.16b, v11.16b, #8
2122
+ ext v12.16b, v12.16b, v12.16b, #8
2123
+
2124
+ ext v15.16b, v15.16b, v15.16b, #12
2125
+ ext v16.16b, v16.16b, v16.16b, #12
2126
+ ext v17.16b, v17.16b, v17.16b, #12
2127
+ add v0.4s, v0.4s, v5.4s
2128
+ add v1.4s, v1.4s, v6.4s
2129
+ add v2.4s, v2.4s, v7.4s
2130
+ eor v15.16b, v15.16b, v0.16b
2131
+ eor v16.16b, v16.16b, v1.16b
2132
+ eor v17.16b, v17.16b, v2.16b
2133
+ rev32 v15.8h, v15.8h
2134
+ rev32 v16.8h, v16.8h
2135
+ rev32 v17.8h, v17.8h
2136
+
2137
+ add v10.4s, v10.4s, v15.4s
2138
+ add v11.4s, v11.4s, v16.4s
2139
+ add v12.4s, v12.4s, v17.4s
2140
+ eor v5.16b, v5.16b, v10.16b
2141
+ eor v6.16b, v6.16b, v11.16b
2142
+ eor v7.16b, v7.16b, v12.16b
2143
+ ushr v20.4s, v5.4s, #20
2144
+ sli v20.4s, v5.4s, #12
2145
+ ushr v5.4s, v6.4s, #20
2146
+ sli v5.4s, v6.4s, #12
2147
+ ushr v6.4s, v7.4s, #20
2148
+ sli v6.4s, v7.4s, #12
2149
+
2150
+ add v0.4s, v0.4s, v20.4s
2151
+ add v1.4s, v1.4s, v5.4s
2152
+ add v2.4s, v2.4s, v6.4s
2153
+ eor v15.16b, v15.16b, v0.16b
2154
+ eor v16.16b, v16.16b, v1.16b
2155
+ eor v17.16b, v17.16b, v2.16b
2156
+ tbl v15.16b, {v15.16b}, v26.16b
2157
+ tbl v16.16b, {v16.16b}, v26.16b
2158
+ tbl v17.16b, {v17.16b}, v26.16b
2159
+
2160
+ add v10.4s, v10.4s, v15.4s
2161
+ add v11.4s, v11.4s, v16.4s
2162
+ add v12.4s, v12.4s, v17.4s
2163
+ eor v20.16b, v20.16b, v10.16b
2164
+ eor v5.16b, v5.16b, v11.16b
2165
+ eor v6.16b, v6.16b, v12.16b
2166
+ ushr v7.4s, v6.4s, #25
2167
+ sli v7.4s, v6.4s, #7
2168
+ ushr v6.4s, v5.4s, #25
2169
+ sli v6.4s, v5.4s, #7
2170
+ ushr v5.4s, v20.4s, #25
2171
+ sli v5.4s, v20.4s, #7
2172
+
2173
+ ext v5.16b, v5.16b, v5.16b, #12
2174
+ ext v6.16b, v6.16b, v6.16b, #12
2175
+ ext v7.16b, v7.16b, v7.16b, #12
2176
+
2177
+ ext v10.16b, v10.16b, v10.16b, #8
2178
+ ext v11.16b, v11.16b, v11.16b, #8
2179
+ ext v12.16b, v12.16b, v12.16b, #8
2180
+
2181
+ ext v15.16b, v15.16b, v15.16b, #4
2182
+ ext v16.16b, v16.16b, v16.16b, #4
2183
+ ext v17.16b, v17.16b, v17.16b, #4
2184
+ subs x7, x7, #1
2185
+ b.gt .Lopen_tail_192_rounds
2186
+ subs x6, x6, #1
2187
+ b.ge .Lopen_tail_192_rounds_no_hash
2188
+
2189
+ // We hashed 160 bytes at most, may still have 32 bytes left
2190
+ .Lopen_tail_192_hash:
2191
+ cbz x4, .Lopen_tail_192_hash_done
2192
+ ldp x11, x12, [x3], 16
2193
+ adds x8, x8, x11
2194
+ adcs x9, x9, x12
2195
+ adc x10, x10, x15
2196
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2197
+ umulh x12, x8, x16
2198
+ mul x13, x9, x16
2199
+ umulh x14, x9, x16
2200
+ adds x12, x12, x13
2201
+ mul x13, x10, x16
2202
+ adc x13, x13, x14
2203
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2204
+ umulh x8, x8, x17
2205
+ adds x12, x12, x14
2206
+ mul x14, x9, x17
2207
+ umulh x9, x9, x17
2208
+ adcs x14, x14, x8
2209
+ mul x10, x10, x17
2210
+ adc x10, x10, x9
2211
+ adds x13, x13, x14
2212
+ adc x14, x10, xzr
2213
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2214
+ and x8, x13, #-4
2215
+ extr x13, x14, x13, #2
2216
+ adds x8, x8, x11
2217
+ lsr x11, x14, #2
2218
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2219
+ adds x8, x8, x13
2220
+ adcs x9, x9, x12
2221
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2222
+ sub x4, x4, #1
2223
+ b .Lopen_tail_192_hash
2224
+
2225
+ .Lopen_tail_192_hash_done:
2226
+
2227
+ add v0.4s, v0.4s, v24.4s
2228
+ add v1.4s, v1.4s, v24.4s
2229
+ add v2.4s, v2.4s, v24.4s
2230
+ add v5.4s, v5.4s, v28.4s
2231
+ add v6.4s, v6.4s, v28.4s
2232
+ add v7.4s, v7.4s, v28.4s
2233
+ add v10.4s, v10.4s, v29.4s
2234
+ add v11.4s, v11.4s, v29.4s
2235
+ add v12.4s, v12.4s, v29.4s
2236
+ add v15.4s, v15.4s, v30.4s
2237
+ add v16.4s, v16.4s, v30.4s
2238
+ add v17.4s, v17.4s, v30.4s
2239
+
2240
+ add v15.4s, v15.4s, v21.4s
2241
+ add v16.4s, v16.4s, v23.4s
2242
+ add v17.4s, v17.4s, v22.4s
2243
+
2244
+ ld1 {v20.16b - v23.16b}, [x1], #64
2245
+
2246
+ eor v20.16b, v20.16b, v1.16b
2247
+ eor v21.16b, v21.16b, v6.16b
2248
+ eor v22.16b, v22.16b, v11.16b
2249
+ eor v23.16b, v23.16b, v16.16b
2250
+
2251
+ st1 {v20.16b - v23.16b}, [x0], #64
2252
+
2253
+ ld1 {v20.16b - v23.16b}, [x1], #64
2254
+
2255
+ eor v20.16b, v20.16b, v2.16b
2256
+ eor v21.16b, v21.16b, v7.16b
2257
+ eor v22.16b, v22.16b, v12.16b
2258
+ eor v23.16b, v23.16b, v17.16b
2259
+
2260
+ st1 {v20.16b - v23.16b}, [x0], #64
2261
+
2262
+ sub x2, x2, #128
2263
+ b .Lopen_tail_64_store
2264
+
2265
+ .Lopen_tail_128:
2266
+ // We need two more blocks
2267
+ mov v0.16b, v24.16b
2268
+ mov v1.16b, v24.16b
2269
+ mov v5.16b, v28.16b
2270
+ mov v6.16b, v28.16b
2271
+ mov v10.16b, v29.16b
2272
+ mov v11.16b, v29.16b
2273
+ mov v15.16b, v30.16b
2274
+ mov v16.16b, v30.16b
2275
+ eor v23.16b, v23.16b, v23.16b
2276
+ eor v22.16b, v22.16b, v22.16b
2277
+ ins v23.s[0], v25.s[0]
2278
+ ins v22.d[0], x15
2279
+ add v22.4s, v22.4s, v23.4s
2280
+
2281
+ add v15.4s, v15.4s, v22.4s
2282
+ add v16.4s, v16.4s, v23.4s
2283
+
2284
+ mov x6, #10
2285
+ sub x6, x6, x4
2286
+
2287
+ .Lopen_tail_128_rounds:
2288
+ add v0.4s, v0.4s, v5.4s
2289
+ eor v15.16b, v15.16b, v0.16b
2290
+ rev32 v15.8h, v15.8h
2291
+
2292
+ add v10.4s, v10.4s, v15.4s
2293
+ eor v5.16b, v5.16b, v10.16b
2294
+ ushr v20.4s, v5.4s, #20
2295
+ sli v20.4s, v5.4s, #12
2296
+ add v0.4s, v0.4s, v20.4s
2297
+ eor v15.16b, v15.16b, v0.16b
2298
+ tbl v15.16b, {v15.16b}, v26.16b
2299
+
2300
+ add v10.4s, v10.4s, v15.4s
2301
+ eor v20.16b, v20.16b, v10.16b
2302
+ ushr v5.4s, v20.4s, #25
2303
+ sli v5.4s, v20.4s, #7
2304
+ ext v5.16b, v5.16b, v5.16b, #4
2305
+ ext v10.16b, v10.16b, v10.16b, #8
2306
+ ext v15.16b, v15.16b, v15.16b, #12
2307
+ add v1.4s, v1.4s, v6.4s
2308
+ eor v16.16b, v16.16b, v1.16b
2309
+ rev32 v16.8h, v16.8h
2310
+
2311
+ add v11.4s, v11.4s, v16.4s
2312
+ eor v6.16b, v6.16b, v11.16b
2313
+ ushr v20.4s, v6.4s, #20
2314
+ sli v20.4s, v6.4s, #12
2315
+ add v1.4s, v1.4s, v20.4s
2316
+ eor v16.16b, v16.16b, v1.16b
2317
+ tbl v16.16b, {v16.16b}, v26.16b
2318
+
2319
+ add v11.4s, v11.4s, v16.4s
2320
+ eor v20.16b, v20.16b, v11.16b
2321
+ ushr v6.4s, v20.4s, #25
2322
+ sli v6.4s, v20.4s, #7
2323
+ ext v6.16b, v6.16b, v6.16b, #4
2324
+ ext v11.16b, v11.16b, v11.16b, #8
2325
+ ext v16.16b, v16.16b, v16.16b, #12
2326
+ add v0.4s, v0.4s, v5.4s
2327
+ eor v15.16b, v15.16b, v0.16b
2328
+ rev32 v15.8h, v15.8h
2329
+
2330
+ add v10.4s, v10.4s, v15.4s
2331
+ eor v5.16b, v5.16b, v10.16b
2332
+ ushr v20.4s, v5.4s, #20
2333
+ sli v20.4s, v5.4s, #12
2334
+ add v0.4s, v0.4s, v20.4s
2335
+ eor v15.16b, v15.16b, v0.16b
2336
+ tbl v15.16b, {v15.16b}, v26.16b
2337
+
2338
+ add v10.4s, v10.4s, v15.4s
2339
+ eor v20.16b, v20.16b, v10.16b
2340
+ ushr v5.4s, v20.4s, #25
2341
+ sli v5.4s, v20.4s, #7
2342
+ ext v5.16b, v5.16b, v5.16b, #12
2343
+ ext v10.16b, v10.16b, v10.16b, #8
2344
+ ext v15.16b, v15.16b, v15.16b, #4
2345
+ add v1.4s, v1.4s, v6.4s
2346
+ eor v16.16b, v16.16b, v1.16b
2347
+ rev32 v16.8h, v16.8h
2348
+
2349
+ add v11.4s, v11.4s, v16.4s
2350
+ eor v6.16b, v6.16b, v11.16b
2351
+ ushr v20.4s, v6.4s, #20
2352
+ sli v20.4s, v6.4s, #12
2353
+ add v1.4s, v1.4s, v20.4s
2354
+ eor v16.16b, v16.16b, v1.16b
2355
+ tbl v16.16b, {v16.16b}, v26.16b
2356
+
2357
+ add v11.4s, v11.4s, v16.4s
2358
+ eor v20.16b, v20.16b, v11.16b
2359
+ ushr v6.4s, v20.4s, #25
2360
+ sli v6.4s, v20.4s, #7
2361
+ ext v6.16b, v6.16b, v6.16b, #12
2362
+ ext v11.16b, v11.16b, v11.16b, #8
2363
+ ext v16.16b, v16.16b, v16.16b, #4
2364
+ subs x6, x6, #1
2365
+ b.gt .Lopen_tail_128_rounds
2366
+ cbz x4, .Lopen_tail_128_rounds_done
2367
+ subs x4, x4, #1
2368
+ ldp x11, x12, [x3], 16
2369
+ adds x8, x8, x11
2370
+ adcs x9, x9, x12
2371
+ adc x10, x10, x15
2372
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2373
+ umulh x12, x8, x16
2374
+ mul x13, x9, x16
2375
+ umulh x14, x9, x16
2376
+ adds x12, x12, x13
2377
+ mul x13, x10, x16
2378
+ adc x13, x13, x14
2379
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2380
+ umulh x8, x8, x17
2381
+ adds x12, x12, x14
2382
+ mul x14, x9, x17
2383
+ umulh x9, x9, x17
2384
+ adcs x14, x14, x8
2385
+ mul x10, x10, x17
2386
+ adc x10, x10, x9
2387
+ adds x13, x13, x14
2388
+ adc x14, x10, xzr
2389
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2390
+ and x8, x13, #-4
2391
+ extr x13, x14, x13, #2
2392
+ adds x8, x8, x11
2393
+ lsr x11, x14, #2
2394
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2395
+ adds x8, x8, x13
2396
+ adcs x9, x9, x12
2397
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2398
+ b .Lopen_tail_128_rounds
2399
+
2400
+ .Lopen_tail_128_rounds_done:
2401
+ add v0.4s, v0.4s, v24.4s
2402
+ add v1.4s, v1.4s, v24.4s
2403
+ add v5.4s, v5.4s, v28.4s
2404
+ add v6.4s, v6.4s, v28.4s
2405
+ add v10.4s, v10.4s, v29.4s
2406
+ add v11.4s, v11.4s, v29.4s
2407
+ add v15.4s, v15.4s, v30.4s
2408
+ add v16.4s, v16.4s, v30.4s
2409
+ add v15.4s, v15.4s, v22.4s
2410
+ add v16.4s, v16.4s, v23.4s
2411
+
2412
+ ld1 {v20.16b - v23.16b}, [x1], #64
2413
+
2414
+ eor v20.16b, v20.16b, v1.16b
2415
+ eor v21.16b, v21.16b, v6.16b
2416
+ eor v22.16b, v22.16b, v11.16b
2417
+ eor v23.16b, v23.16b, v16.16b
2418
+
2419
+ st1 {v20.16b - v23.16b}, [x0], #64
2420
+ sub x2, x2, #64
2421
+
2422
+ b .Lopen_tail_64_store
2423
+
2424
+ .Lopen_tail_64:
2425
+ // We just need a single block
2426
+ mov v0.16b, v24.16b
2427
+ mov v5.16b, v28.16b
2428
+ mov v10.16b, v29.16b
2429
+ mov v15.16b, v30.16b
2430
+ eor v23.16b, v23.16b, v23.16b
2431
+ ins v23.s[0], v25.s[0]
2432
+ add v15.4s, v15.4s, v23.4s
2433
+
2434
+ mov x6, #10
2435
+ sub x6, x6, x4
2436
+
2437
+ .Lopen_tail_64_rounds:
2438
+ add v0.4s, v0.4s, v5.4s
2439
+ eor v15.16b, v15.16b, v0.16b
2440
+ rev32 v15.8h, v15.8h
2441
+
2442
+ add v10.4s, v10.4s, v15.4s
2443
+ eor v5.16b, v5.16b, v10.16b
2444
+ ushr v20.4s, v5.4s, #20
2445
+ sli v20.4s, v5.4s, #12
2446
+ add v0.4s, v0.4s, v20.4s
2447
+ eor v15.16b, v15.16b, v0.16b
2448
+ tbl v15.16b, {v15.16b}, v26.16b
2449
+
2450
+ add v10.4s, v10.4s, v15.4s
2451
+ eor v20.16b, v20.16b, v10.16b
2452
+ ushr v5.4s, v20.4s, #25
2453
+ sli v5.4s, v20.4s, #7
2454
+ ext v5.16b, v5.16b, v5.16b, #4
2455
+ ext v10.16b, v10.16b, v10.16b, #8
2456
+ ext v15.16b, v15.16b, v15.16b, #12
2457
+ add v0.4s, v0.4s, v5.4s
2458
+ eor v15.16b, v15.16b, v0.16b
2459
+ rev32 v15.8h, v15.8h
2460
+
2461
+ add v10.4s, v10.4s, v15.4s
2462
+ eor v5.16b, v5.16b, v10.16b
2463
+ ushr v20.4s, v5.4s, #20
2464
+ sli v20.4s, v5.4s, #12
2465
+ add v0.4s, v0.4s, v20.4s
2466
+ eor v15.16b, v15.16b, v0.16b
2467
+ tbl v15.16b, {v15.16b}, v26.16b
2468
+
2469
+ add v10.4s, v10.4s, v15.4s
2470
+ eor v20.16b, v20.16b, v10.16b
2471
+ ushr v5.4s, v20.4s, #25
2472
+ sli v5.4s, v20.4s, #7
2473
+ ext v5.16b, v5.16b, v5.16b, #12
2474
+ ext v10.16b, v10.16b, v10.16b, #8
2475
+ ext v15.16b, v15.16b, v15.16b, #4
2476
+ subs x6, x6, #1
2477
+ b.gt .Lopen_tail_64_rounds
2478
+ cbz x4, .Lopen_tail_64_rounds_done
2479
+ subs x4, x4, #1
2480
+ ldp x11, x12, [x3], 16
2481
+ adds x8, x8, x11
2482
+ adcs x9, x9, x12
2483
+ adc x10, x10, x15
2484
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2485
+ umulh x12, x8, x16
2486
+ mul x13, x9, x16
2487
+ umulh x14, x9, x16
2488
+ adds x12, x12, x13
2489
+ mul x13, x10, x16
2490
+ adc x13, x13, x14
2491
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2492
+ umulh x8, x8, x17
2493
+ adds x12, x12, x14
2494
+ mul x14, x9, x17
2495
+ umulh x9, x9, x17
2496
+ adcs x14, x14, x8
2497
+ mul x10, x10, x17
2498
+ adc x10, x10, x9
2499
+ adds x13, x13, x14
2500
+ adc x14, x10, xzr
2501
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2502
+ and x8, x13, #-4
2503
+ extr x13, x14, x13, #2
2504
+ adds x8, x8, x11
2505
+ lsr x11, x14, #2
2506
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2507
+ adds x8, x8, x13
2508
+ adcs x9, x9, x12
2509
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2510
+ b .Lopen_tail_64_rounds
2511
+
2512
+ .Lopen_tail_64_rounds_done:
2513
+ add v0.4s, v0.4s, v24.4s
2514
+ add v5.4s, v5.4s, v28.4s
2515
+ add v10.4s, v10.4s, v29.4s
2516
+ add v15.4s, v15.4s, v30.4s
2517
+ add v15.4s, v15.4s, v23.4s
2518
+
2519
+ .Lopen_tail_64_store:
2520
+ cmp x2, #16
2521
+ b.lt .Lopen_tail_16
2522
+
2523
+ ld1 {v20.16b}, [x1], #16
2524
+ eor v20.16b, v20.16b, v0.16b
2525
+ st1 {v20.16b}, [x0], #16
2526
+ mov v0.16b, v5.16b
2527
+ mov v5.16b, v10.16b
2528
+ mov v10.16b, v15.16b
2529
+ sub x2, x2, #16
2530
+ b .Lopen_tail_64_store
2531
+
2532
+ .Lopen_tail_16:
2533
+ // Here we handle the last [0,16) bytes that require a padded block
2534
+ cbz x2, .Lopen_finalize
2535
+
2536
+ eor v20.16b, v20.16b, v20.16b // Use T0 to load the ciphertext
2537
+ eor v21.16b, v21.16b, v21.16b // Use T1 to generate an AND mask
2538
+ not v22.16b, v20.16b
2539
+
2540
+ add x7, x1, x2
2541
+ mov x6, x2
2542
+
2543
+ .Lopen_tail_16_compose:
2544
+ ext v20.16b, v20.16b, v20.16b, #15
2545
+ ldrb w11, [x7, #-1]!
2546
+ mov v20.b[0], w11
2547
+ ext v21.16b, v22.16b, v21.16b, #15
2548
+ subs x2, x2, #1
2549
+ b.gt .Lopen_tail_16_compose
2550
+
2551
+ and v20.16b, v20.16b, v21.16b
2552
+ // Hash in the final padded block
2553
+ mov x11, v20.d[0]
2554
+ mov x12, v20.d[1]
2555
+ adds x8, x8, x11
2556
+ adcs x9, x9, x12
2557
+ adc x10, x10, x15
2558
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2559
+ umulh x12, x8, x16
2560
+ mul x13, x9, x16
2561
+ umulh x14, x9, x16
2562
+ adds x12, x12, x13
2563
+ mul x13, x10, x16
2564
+ adc x13, x13, x14
2565
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2566
+ umulh x8, x8, x17
2567
+ adds x12, x12, x14
2568
+ mul x14, x9, x17
2569
+ umulh x9, x9, x17
2570
+ adcs x14, x14, x8
2571
+ mul x10, x10, x17
2572
+ adc x10, x10, x9
2573
+ adds x13, x13, x14
2574
+ adc x14, x10, xzr
2575
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2576
+ and x8, x13, #-4
2577
+ extr x13, x14, x13, #2
2578
+ adds x8, x8, x11
2579
+ lsr x11, x14, #2
2580
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2581
+ adds x8, x8, x13
2582
+ adcs x9, x9, x12
2583
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2584
+ eor v20.16b, v20.16b, v0.16b
2585
+
2586
+ .Lopen_tail_16_store:
2587
+ umov w11, v20.b[0]
2588
+ strb w11, [x0], #1
2589
+ ext v20.16b, v20.16b, v20.16b, #1
2590
+ subs x6, x6, #1
2591
+ b.gt .Lopen_tail_16_store
2592
+
2593
+ .Lopen_finalize:
2594
+ mov x11, v31.d[0]
2595
+ mov x12, v31.d[1]
2596
+ adds x8, x8, x11
2597
+ adcs x9, x9, x12
2598
+ adc x10, x10, x15
2599
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2600
+ umulh x12, x8, x16
2601
+ mul x13, x9, x16
2602
+ umulh x14, x9, x16
2603
+ adds x12, x12, x13
2604
+ mul x13, x10, x16
2605
+ adc x13, x13, x14
2606
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2607
+ umulh x8, x8, x17
2608
+ adds x12, x12, x14
2609
+ mul x14, x9, x17
2610
+ umulh x9, x9, x17
2611
+ adcs x14, x14, x8
2612
+ mul x10, x10, x17
2613
+ adc x10, x10, x9
2614
+ adds x13, x13, x14
2615
+ adc x14, x10, xzr
2616
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2617
+ and x8, x13, #-4
2618
+ extr x13, x14, x13, #2
2619
+ adds x8, x8, x11
2620
+ lsr x11, x14, #2
2621
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2622
+ adds x8, x8, x13
2623
+ adcs x9, x9, x12
2624
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2625
+ // Final reduction step
2626
+ sub x12, xzr, x15
2627
+ orr x13, xzr, #3
2628
+ subs x11, x8, #-5
2629
+ sbcs x12, x9, x12
2630
+ sbcs x13, x10, x13
2631
+ csel x8, x11, x8, cs
2632
+ csel x9, x12, x9, cs
2633
+ csel x10, x13, x10, cs
2634
+ mov x11, v27.d[0]
2635
+ mov x12, v27.d[1]
2636
+ adds x8, x8, x11
2637
+ adcs x9, x9, x12
2638
+ adc x10, x10, x15
2639
+
2640
+ stp x8, x9, [x5]
2641
+
2642
+ ldp d8, d9, [sp, #16]
2643
+ ldp d10, d11, [sp, #32]
2644
+ ldp d12, d13, [sp, #48]
2645
+ ldp d14, d15, [sp, #64]
2646
+ .cfi_restore b15
2647
+ .cfi_restore b14
2648
+ .cfi_restore b13
2649
+ .cfi_restore b12
2650
+ .cfi_restore b11
2651
+ .cfi_restore b10
2652
+ .cfi_restore b9
2653
+ .cfi_restore b8
2654
+ ldp x29, x30, [sp], 80
2655
+ .cfi_restore w29
2656
+ .cfi_restore w30
2657
+ .cfi_def_cfa_offset 0
2658
+ AARCH64_VALIDATE_LINK_REGISTER
2659
+ ret
2660
+
2661
+ .Lopen_128:
2662
+ // On some architectures preparing 5 blocks for small buffers is wasteful
2663
+ eor v25.16b, v25.16b, v25.16b
2664
+ mov x11, #1
2665
+ mov v25.s[0], w11
2666
+ mov v0.16b, v24.16b
2667
+ mov v1.16b, v24.16b
2668
+ mov v2.16b, v24.16b
2669
+ mov v5.16b, v28.16b
2670
+ mov v6.16b, v28.16b
2671
+ mov v7.16b, v28.16b
2672
+ mov v10.16b, v29.16b
2673
+ mov v11.16b, v29.16b
2674
+ mov v12.16b, v29.16b
2675
+ mov v17.16b, v30.16b
2676
+ add v15.4s, v17.4s, v25.4s
2677
+ add v16.4s, v15.4s, v25.4s
2678
+
2679
+ mov x6, #10
2680
+
2681
+ .Lopen_128_rounds:
2682
+ add v0.4s, v0.4s, v5.4s
2683
+ add v1.4s, v1.4s, v6.4s
2684
+ add v2.4s, v2.4s, v7.4s
2685
+ eor v15.16b, v15.16b, v0.16b
2686
+ eor v16.16b, v16.16b, v1.16b
2687
+ eor v17.16b, v17.16b, v2.16b
2688
+ rev32 v15.8h, v15.8h
2689
+ rev32 v16.8h, v16.8h
2690
+ rev32 v17.8h, v17.8h
2691
+
2692
+ add v10.4s, v10.4s, v15.4s
2693
+ add v11.4s, v11.4s, v16.4s
2694
+ add v12.4s, v12.4s, v17.4s
2695
+ eor v5.16b, v5.16b, v10.16b
2696
+ eor v6.16b, v6.16b, v11.16b
2697
+ eor v7.16b, v7.16b, v12.16b
2698
+ ushr v20.4s, v5.4s, #20
2699
+ sli v20.4s, v5.4s, #12
2700
+ ushr v5.4s, v6.4s, #20
2701
+ sli v5.4s, v6.4s, #12
2702
+ ushr v6.4s, v7.4s, #20
2703
+ sli v6.4s, v7.4s, #12
2704
+
2705
+ add v0.4s, v0.4s, v20.4s
2706
+ add v1.4s, v1.4s, v5.4s
2707
+ add v2.4s, v2.4s, v6.4s
2708
+ eor v15.16b, v15.16b, v0.16b
2709
+ eor v16.16b, v16.16b, v1.16b
2710
+ eor v17.16b, v17.16b, v2.16b
2711
+ tbl v15.16b, {v15.16b}, v26.16b
2712
+ tbl v16.16b, {v16.16b}, v26.16b
2713
+ tbl v17.16b, {v17.16b}, v26.16b
2714
+
2715
+ add v10.4s, v10.4s, v15.4s
2716
+ add v11.4s, v11.4s, v16.4s
2717
+ add v12.4s, v12.4s, v17.4s
2718
+ eor v20.16b, v20.16b, v10.16b
2719
+ eor v5.16b, v5.16b, v11.16b
2720
+ eor v6.16b, v6.16b, v12.16b
2721
+ ushr v7.4s, v6.4s, #25
2722
+ sli v7.4s, v6.4s, #7
2723
+ ushr v6.4s, v5.4s, #25
2724
+ sli v6.4s, v5.4s, #7
2725
+ ushr v5.4s, v20.4s, #25
2726
+ sli v5.4s, v20.4s, #7
2727
+
2728
+ ext v5.16b, v5.16b, v5.16b, #4
2729
+ ext v6.16b, v6.16b, v6.16b, #4
2730
+ ext v7.16b, v7.16b, v7.16b, #4
2731
+
2732
+ ext v10.16b, v10.16b, v10.16b, #8
2733
+ ext v11.16b, v11.16b, v11.16b, #8
2734
+ ext v12.16b, v12.16b, v12.16b, #8
2735
+
2736
+ ext v15.16b, v15.16b, v15.16b, #12
2737
+ ext v16.16b, v16.16b, v16.16b, #12
2738
+ ext v17.16b, v17.16b, v17.16b, #12
2739
+ add v0.4s, v0.4s, v5.4s
2740
+ add v1.4s, v1.4s, v6.4s
2741
+ add v2.4s, v2.4s, v7.4s
2742
+ eor v15.16b, v15.16b, v0.16b
2743
+ eor v16.16b, v16.16b, v1.16b
2744
+ eor v17.16b, v17.16b, v2.16b
2745
+ rev32 v15.8h, v15.8h
2746
+ rev32 v16.8h, v16.8h
2747
+ rev32 v17.8h, v17.8h
2748
+
2749
+ add v10.4s, v10.4s, v15.4s
2750
+ add v11.4s, v11.4s, v16.4s
2751
+ add v12.4s, v12.4s, v17.4s
2752
+ eor v5.16b, v5.16b, v10.16b
2753
+ eor v6.16b, v6.16b, v11.16b
2754
+ eor v7.16b, v7.16b, v12.16b
2755
+ ushr v20.4s, v5.4s, #20
2756
+ sli v20.4s, v5.4s, #12
2757
+ ushr v5.4s, v6.4s, #20
2758
+ sli v5.4s, v6.4s, #12
2759
+ ushr v6.4s, v7.4s, #20
2760
+ sli v6.4s, v7.4s, #12
2761
+
2762
+ add v0.4s, v0.4s, v20.4s
2763
+ add v1.4s, v1.4s, v5.4s
2764
+ add v2.4s, v2.4s, v6.4s
2765
+ eor v15.16b, v15.16b, v0.16b
2766
+ eor v16.16b, v16.16b, v1.16b
2767
+ eor v17.16b, v17.16b, v2.16b
2768
+ tbl v15.16b, {v15.16b}, v26.16b
2769
+ tbl v16.16b, {v16.16b}, v26.16b
2770
+ tbl v17.16b, {v17.16b}, v26.16b
2771
+
2772
+ add v10.4s, v10.4s, v15.4s
2773
+ add v11.4s, v11.4s, v16.4s
2774
+ add v12.4s, v12.4s, v17.4s
2775
+ eor v20.16b, v20.16b, v10.16b
2776
+ eor v5.16b, v5.16b, v11.16b
2777
+ eor v6.16b, v6.16b, v12.16b
2778
+ ushr v7.4s, v6.4s, #25
2779
+ sli v7.4s, v6.4s, #7
2780
+ ushr v6.4s, v5.4s, #25
2781
+ sli v6.4s, v5.4s, #7
2782
+ ushr v5.4s, v20.4s, #25
2783
+ sli v5.4s, v20.4s, #7
2784
+
2785
+ ext v5.16b, v5.16b, v5.16b, #12
2786
+ ext v6.16b, v6.16b, v6.16b, #12
2787
+ ext v7.16b, v7.16b, v7.16b, #12
2788
+
2789
+ ext v10.16b, v10.16b, v10.16b, #8
2790
+ ext v11.16b, v11.16b, v11.16b, #8
2791
+ ext v12.16b, v12.16b, v12.16b, #8
2792
+
2793
+ ext v15.16b, v15.16b, v15.16b, #4
2794
+ ext v16.16b, v16.16b, v16.16b, #4
2795
+ ext v17.16b, v17.16b, v17.16b, #4
2796
+ subs x6, x6, #1
2797
+ b.hi .Lopen_128_rounds
2798
+
2799
+ add v0.4s, v0.4s, v24.4s
2800
+ add v1.4s, v1.4s, v24.4s
2801
+ add v2.4s, v2.4s, v24.4s
2802
+
2803
+ add v5.4s, v5.4s, v28.4s
2804
+ add v6.4s, v6.4s, v28.4s
2805
+ add v7.4s, v7.4s, v28.4s
2806
+
2807
+ add v10.4s, v10.4s, v29.4s
2808
+ add v11.4s, v11.4s, v29.4s
2809
+
2810
+ add v30.4s, v30.4s, v25.4s
2811
+ add v15.4s, v15.4s, v30.4s
2812
+ add v30.4s, v30.4s, v25.4s
2813
+ add v16.4s, v16.4s, v30.4s
2814
+
2815
+ and v2.16b, v2.16b, v27.16b
2816
+ mov x16, v2.d[0] // Move the R key to GPRs
2817
+ mov x17, v2.d[1]
2818
+ mov v27.16b, v7.16b // Store the S key
2819
+
2820
+ bl .Lpoly_hash_ad_internal
2821
+
2822
+ .Lopen_128_store:
2823
+ cmp x2, #64
2824
+ b.lt .Lopen_128_store_64
2825
+
2826
+ ld1 {v20.16b - v23.16b}, [x1], #64
2827
+
2828
+ mov x11, v20.d[0]
2829
+ mov x12, v20.d[1]
2830
+ adds x8, x8, x11
2831
+ adcs x9, x9, x12
2832
+ adc x10, x10, x15
2833
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2834
+ umulh x12, x8, x16
2835
+ mul x13, x9, x16
2836
+ umulh x14, x9, x16
2837
+ adds x12, x12, x13
2838
+ mul x13, x10, x16
2839
+ adc x13, x13, x14
2840
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2841
+ umulh x8, x8, x17
2842
+ adds x12, x12, x14
2843
+ mul x14, x9, x17
2844
+ umulh x9, x9, x17
2845
+ adcs x14, x14, x8
2846
+ mul x10, x10, x17
2847
+ adc x10, x10, x9
2848
+ adds x13, x13, x14
2849
+ adc x14, x10, xzr
2850
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2851
+ and x8, x13, #-4
2852
+ extr x13, x14, x13, #2
2853
+ adds x8, x8, x11
2854
+ lsr x11, x14, #2
2855
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2856
+ adds x8, x8, x13
2857
+ adcs x9, x9, x12
2858
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2859
+ mov x11, v21.d[0]
2860
+ mov x12, v21.d[1]
2861
+ adds x8, x8, x11
2862
+ adcs x9, x9, x12
2863
+ adc x10, x10, x15
2864
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2865
+ umulh x12, x8, x16
2866
+ mul x13, x9, x16
2867
+ umulh x14, x9, x16
2868
+ adds x12, x12, x13
2869
+ mul x13, x10, x16
2870
+ adc x13, x13, x14
2871
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2872
+ umulh x8, x8, x17
2873
+ adds x12, x12, x14
2874
+ mul x14, x9, x17
2875
+ umulh x9, x9, x17
2876
+ adcs x14, x14, x8
2877
+ mul x10, x10, x17
2878
+ adc x10, x10, x9
2879
+ adds x13, x13, x14
2880
+ adc x14, x10, xzr
2881
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2882
+ and x8, x13, #-4
2883
+ extr x13, x14, x13, #2
2884
+ adds x8, x8, x11
2885
+ lsr x11, x14, #2
2886
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2887
+ adds x8, x8, x13
2888
+ adcs x9, x9, x12
2889
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2890
+ mov x11, v22.d[0]
2891
+ mov x12, v22.d[1]
2892
+ adds x8, x8, x11
2893
+ adcs x9, x9, x12
2894
+ adc x10, x10, x15
2895
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2896
+ umulh x12, x8, x16
2897
+ mul x13, x9, x16
2898
+ umulh x14, x9, x16
2899
+ adds x12, x12, x13
2900
+ mul x13, x10, x16
2901
+ adc x13, x13, x14
2902
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2903
+ umulh x8, x8, x17
2904
+ adds x12, x12, x14
2905
+ mul x14, x9, x17
2906
+ umulh x9, x9, x17
2907
+ adcs x14, x14, x8
2908
+ mul x10, x10, x17
2909
+ adc x10, x10, x9
2910
+ adds x13, x13, x14
2911
+ adc x14, x10, xzr
2912
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2913
+ and x8, x13, #-4
2914
+ extr x13, x14, x13, #2
2915
+ adds x8, x8, x11
2916
+ lsr x11, x14, #2
2917
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2918
+ adds x8, x8, x13
2919
+ adcs x9, x9, x12
2920
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2921
+ mov x11, v23.d[0]
2922
+ mov x12, v23.d[1]
2923
+ adds x8, x8, x11
2924
+ adcs x9, x9, x12
2925
+ adc x10, x10, x15
2926
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2927
+ umulh x12, x8, x16
2928
+ mul x13, x9, x16
2929
+ umulh x14, x9, x16
2930
+ adds x12, x12, x13
2931
+ mul x13, x10, x16
2932
+ adc x13, x13, x14
2933
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2934
+ umulh x8, x8, x17
2935
+ adds x12, x12, x14
2936
+ mul x14, x9, x17
2937
+ umulh x9, x9, x17
2938
+ adcs x14, x14, x8
2939
+ mul x10, x10, x17
2940
+ adc x10, x10, x9
2941
+ adds x13, x13, x14
2942
+ adc x14, x10, xzr
2943
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2944
+ and x8, x13, #-4
2945
+ extr x13, x14, x13, #2
2946
+ adds x8, x8, x11
2947
+ lsr x11, x14, #2
2948
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
2949
+ adds x8, x8, x13
2950
+ adcs x9, x9, x12
2951
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
2952
+
2953
+ eor v20.16b, v20.16b, v0.16b
2954
+ eor v21.16b, v21.16b, v5.16b
2955
+ eor v22.16b, v22.16b, v10.16b
2956
+ eor v23.16b, v23.16b, v15.16b
2957
+
2958
+ st1 {v20.16b - v23.16b}, [x0], #64
2959
+
2960
+ sub x2, x2, #64
2961
+
2962
+ mov v0.16b, v1.16b
2963
+ mov v5.16b, v6.16b
2964
+ mov v10.16b, v11.16b
2965
+ mov v15.16b, v16.16b
2966
+
2967
+ .Lopen_128_store_64:
2968
+
2969
+ lsr x4, x2, #4
2970
+ mov x3, x1
2971
+
2972
+ .Lopen_128_hash_64:
2973
+ cbz x4, .Lopen_tail_64_store
2974
+ ldp x11, x12, [x3], 16
2975
+ adds x8, x8, x11
2976
+ adcs x9, x9, x12
2977
+ adc x10, x10, x15
2978
+ mul x11, x8, x16 // [t2:t1:t0] = [acc2:acc1:acc0] * r0
2979
+ umulh x12, x8, x16
2980
+ mul x13, x9, x16
2981
+ umulh x14, x9, x16
2982
+ adds x12, x12, x13
2983
+ mul x13, x10, x16
2984
+ adc x13, x13, x14
2985
+ mul x14, x8, x17 // [t3:t2:t1:t0] = [acc2:acc1:acc0] * [r1:r0]
2986
+ umulh x8, x8, x17
2987
+ adds x12, x12, x14
2988
+ mul x14, x9, x17
2989
+ umulh x9, x9, x17
2990
+ adcs x14, x14, x8
2991
+ mul x10, x10, x17
2992
+ adc x10, x10, x9
2993
+ adds x13, x13, x14
2994
+ adc x14, x10, xzr
2995
+ and x10, x13, #3 // At this point acc2 is 2 bits at most (value of 3)
2996
+ and x8, x13, #-4
2997
+ extr x13, x14, x13, #2
2998
+ adds x8, x8, x11
2999
+ lsr x11, x14, #2
3000
+ adc x9, x14, x11 // No carry out since t0 is 61 bits and t3 is 63 bits
3001
+ adds x8, x8, x13
3002
+ adcs x9, x9, x12
3003
+ adc x10, x10, xzr // At this point acc2 has the value of 4 at most
3004
+ sub x4, x4, #1
3005
+ b .Lopen_128_hash_64
3006
+ .cfi_endproc
3007
+ .size chacha20_poly1305_open,.-chacha20_poly1305_open
3008
+ #endif // !OPENSSL_NO_ASM && defined(OPENSSL_AARCH64) && defined(__ELF__)