react-native-quick-crypto 1.1.0 → 1.1.2

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 (815) hide show
  1. package/QuickCrypto.podspec +1 -0
  2. package/android/CMakeLists.txt +4 -0
  3. package/android/build.gradle +5 -1
  4. package/cpp/argon2/HybridArgon2.cpp +10 -3
  5. package/cpp/blake3/HybridBlake3.cpp +5 -3
  6. package/cpp/cipher/CCMCipher.cpp +35 -26
  7. package/cpp/cipher/CCMCipher.hpp +2 -4
  8. package/cpp/cipher/ChaCha20Cipher.cpp +19 -27
  9. package/cpp/cipher/ChaCha20Cipher.hpp +2 -4
  10. package/cpp/cipher/ChaCha20Poly1305Cipher.cpp +41 -36
  11. package/cpp/cipher/ChaCha20Poly1305Cipher.hpp +2 -4
  12. package/cpp/cipher/GCMCipher.cpp +17 -20
  13. package/cpp/cipher/HybridCipher.cpp +44 -47
  14. package/cpp/cipher/HybridCipher.hpp +17 -1
  15. package/cpp/cipher/HybridRsaCipher.cpp +93 -56
  16. package/cpp/cipher/OCBCipher.cpp +5 -5
  17. package/cpp/cipher/XChaCha20Poly1305Cipher.cpp +27 -32
  18. package/cpp/cipher/XSalsa20Cipher.cpp +78 -16
  19. package/cpp/cipher/XSalsa20Cipher.hpp +25 -3
  20. package/cpp/cipher/XSalsa20Poly1305Cipher.cpp +32 -41
  21. package/cpp/dh/HybridDiffieHellman.cpp +29 -0
  22. package/cpp/ec/HybridEcKeyPair.cpp +35 -33
  23. package/cpp/ec/HybridEcKeyPair.hpp +3 -7
  24. package/cpp/ecdh/HybridECDH.cpp +23 -0
  25. package/cpp/ed25519/HybridEdKeyPair.cpp +73 -117
  26. package/cpp/ed25519/HybridEdKeyPair.hpp +5 -9
  27. package/cpp/hash/HybridHash.cpp +5 -7
  28. package/cpp/hkdf/HybridHkdf.cpp +6 -4
  29. package/cpp/hmac/HybridHmac.cpp +4 -6
  30. package/cpp/keys/HybridKeyObjectHandle.cpp +630 -2
  31. package/cpp/keys/HybridKeyObjectHandle.hpp +21 -1
  32. package/cpp/kmac/HybridKmac.cpp +4 -4
  33. package/cpp/mldsa/HybridMlDsaKeyPair.cpp +37 -49
  34. package/cpp/mlkem/HybridMlKemKeyPair.cpp +39 -43
  35. package/cpp/pbkdf2/HybridPbkdf2.cpp +7 -8
  36. package/cpp/rsa/HybridRsaKeyPair.cpp +5 -8
  37. package/cpp/rsa/HybridRsaKeyPair.hpp +4 -7
  38. package/cpp/scrypt/HybridScrypt.cpp +6 -4
  39. package/cpp/sign/HybridSignHandle.cpp +47 -72
  40. package/cpp/sign/HybridVerifyHandle.cpp +47 -67
  41. package/cpp/slhdsa/HybridSlhDsaKeyPair.cpp +245 -0
  42. package/cpp/slhdsa/HybridSlhDsaKeyPair.hpp +48 -0
  43. package/cpp/turboshake/HybridTurboShake.cpp +379 -0
  44. package/cpp/turboshake/HybridTurboShake.hpp +28 -0
  45. package/cpp/utils/HybridUtils.cpp +195 -43
  46. package/cpp/utils/HybridUtils.hpp +9 -2
  47. package/cpp/utils/QuickCryptoUtils.hpp +72 -0
  48. package/deps/blake3/README.md +6 -7
  49. package/deps/blake3/c/blake3.c +3 -2
  50. package/deps/blake3/c/blake3.h +2 -2
  51. package/deps/blake3/c/blake3_dispatch.c +2 -2
  52. package/deps/blake3/c/blake3_impl.h +1 -1
  53. package/deps/blake3/c/blake3_neon.c +5 -4
  54. package/deps/ncrypto/include/ncrypto/version.h +2 -2
  55. package/deps/ncrypto/include/ncrypto.h +9 -2
  56. package/deps/ncrypto/src/ncrypto.cpp +130 -35
  57. package/lib/commonjs/argon2.js +51 -2
  58. package/lib/commonjs/argon2.js.map +1 -1
  59. package/lib/commonjs/cipher.js +109 -11
  60. package/lib/commonjs/cipher.js.map +1 -1
  61. package/lib/commonjs/dhKeyPair.js +3 -0
  62. package/lib/commonjs/dhKeyPair.js.map +1 -1
  63. package/lib/commonjs/dsa.js +11 -2
  64. package/lib/commonjs/dsa.js.map +1 -1
  65. package/lib/commonjs/ec.js +37 -30
  66. package/lib/commonjs/ec.js.map +1 -1
  67. package/lib/commonjs/ed.js +60 -6
  68. package/lib/commonjs/ed.js.map +1 -1
  69. package/lib/commonjs/hash.js +67 -10
  70. package/lib/commonjs/hash.js.map +1 -1
  71. package/lib/commonjs/hkdf.js +33 -6
  72. package/lib/commonjs/hkdf.js.map +1 -1
  73. package/lib/commonjs/hmac.js +15 -5
  74. package/lib/commonjs/hmac.js.map +1 -1
  75. package/lib/commonjs/keys/classes.js +33 -7
  76. package/lib/commonjs/keys/classes.js.map +1 -1
  77. package/lib/commonjs/keys/generateKeyPair.js +85 -4
  78. package/lib/commonjs/keys/generateKeyPair.js.map +1 -1
  79. package/lib/commonjs/keys/index.js +50 -2
  80. package/lib/commonjs/keys/index.js.map +1 -1
  81. package/lib/commonjs/keys/publicCipher.js +10 -4
  82. package/lib/commonjs/keys/publicCipher.js.map +1 -1
  83. package/lib/commonjs/keys/signVerify.js +9 -2
  84. package/lib/commonjs/keys/signVerify.js.map +1 -1
  85. package/lib/commonjs/keys/utils.js +59 -1
  86. package/lib/commonjs/keys/utils.js.map +1 -1
  87. package/lib/commonjs/random.js +74 -11
  88. package/lib/commonjs/random.js.map +1 -1
  89. package/lib/commonjs/rsa.js +15 -5
  90. package/lib/commonjs/rsa.js.map +1 -1
  91. package/lib/commonjs/scrypt.js +47 -6
  92. package/lib/commonjs/scrypt.js.map +1 -1
  93. package/lib/commonjs/slhdsa.js +70 -0
  94. package/lib/commonjs/slhdsa.js.map +1 -0
  95. package/lib/commonjs/specs/slhDsaKeyPair.nitro.js +6 -0
  96. package/lib/commonjs/specs/slhDsaKeyPair.nitro.js.map +1 -0
  97. package/lib/commonjs/specs/turboshake.nitro.js +6 -0
  98. package/lib/commonjs/specs/turboshake.nitro.js.map +1 -0
  99. package/lib/commonjs/subtle.js +975 -253
  100. package/lib/commonjs/subtle.js.map +1 -1
  101. package/lib/commonjs/utils/cipher.js +18 -7
  102. package/lib/commonjs/utils/cipher.js.map +1 -1
  103. package/lib/commonjs/utils/conversion.js +86 -28
  104. package/lib/commonjs/utils/conversion.js.map +1 -1
  105. package/lib/commonjs/utils/errors.js +63 -4
  106. package/lib/commonjs/utils/errors.js.map +1 -1
  107. package/lib/commonjs/utils/timingSafeEqual.js +7 -2
  108. package/lib/commonjs/utils/timingSafeEqual.js.map +1 -1
  109. package/lib/commonjs/utils/types.js.map +1 -1
  110. package/lib/commonjs/utils/validation.js +46 -0
  111. package/lib/commonjs/utils/validation.js.map +1 -1
  112. package/lib/commonjs/x509certificate.js +6 -6
  113. package/lib/commonjs/x509certificate.js.map +1 -1
  114. package/lib/module/argon2.js +51 -2
  115. package/lib/module/argon2.js.map +1 -1
  116. package/lib/module/cipher.js +109 -11
  117. package/lib/module/cipher.js.map +1 -1
  118. package/lib/module/dhKeyPair.js +3 -0
  119. package/lib/module/dhKeyPair.js.map +1 -1
  120. package/lib/module/dsa.js +11 -2
  121. package/lib/module/dsa.js.map +1 -1
  122. package/lib/module/ec.js +38 -31
  123. package/lib/module/ec.js.map +1 -1
  124. package/lib/module/ed.js +61 -7
  125. package/lib/module/ed.js.map +1 -1
  126. package/lib/module/hash.js +67 -10
  127. package/lib/module/hash.js.map +1 -1
  128. package/lib/module/hkdf.js +33 -6
  129. package/lib/module/hkdf.js.map +1 -1
  130. package/lib/module/hmac.js +15 -5
  131. package/lib/module/hmac.js.map +1 -1
  132. package/lib/module/keys/classes.js +31 -5
  133. package/lib/module/keys/classes.js.map +1 -1
  134. package/lib/module/keys/generateKeyPair.js +86 -5
  135. package/lib/module/keys/generateKeyPair.js.map +1 -1
  136. package/lib/module/keys/index.js +50 -2
  137. package/lib/module/keys/index.js.map +1 -1
  138. package/lib/module/keys/publicCipher.js +10 -4
  139. package/lib/module/keys/publicCipher.js.map +1 -1
  140. package/lib/module/keys/signVerify.js +9 -2
  141. package/lib/module/keys/signVerify.js.map +1 -1
  142. package/lib/module/keys/utils.js +57 -1
  143. package/lib/module/keys/utils.js.map +1 -1
  144. package/lib/module/random.js +74 -12
  145. package/lib/module/random.js.map +1 -1
  146. package/lib/module/rsa.js +14 -4
  147. package/lib/module/rsa.js.map +1 -1
  148. package/lib/module/scrypt.js +47 -6
  149. package/lib/module/scrypt.js.map +1 -1
  150. package/lib/module/slhdsa.js +64 -0
  151. package/lib/module/slhdsa.js.map +1 -0
  152. package/lib/module/specs/slhDsaKeyPair.nitro.js +4 -0
  153. package/lib/module/specs/slhDsaKeyPair.nitro.js.map +1 -0
  154. package/lib/module/specs/turboshake.nitro.js +4 -0
  155. package/lib/module/specs/turboshake.nitro.js.map +1 -0
  156. package/lib/module/subtle.js +976 -254
  157. package/lib/module/subtle.js.map +1 -1
  158. package/lib/module/utils/cipher.js +18 -7
  159. package/lib/module/utils/cipher.js.map +1 -1
  160. package/lib/module/utils/conversion.js +84 -28
  161. package/lib/module/utils/conversion.js.map +1 -1
  162. package/lib/module/utils/errors.js +61 -4
  163. package/lib/module/utils/errors.js.map +1 -1
  164. package/lib/module/utils/timingSafeEqual.js +8 -3
  165. package/lib/module/utils/timingSafeEqual.js.map +1 -1
  166. package/lib/module/utils/types.js.map +1 -1
  167. package/lib/module/utils/validation.js +44 -0
  168. package/lib/module/utils/validation.js.map +1 -1
  169. package/lib/module/x509certificate.js +6 -6
  170. package/lib/module/x509certificate.js.map +1 -1
  171. package/lib/typescript/argon2.d.ts.map +1 -1
  172. package/lib/typescript/cipher.d.ts +2 -2
  173. package/lib/typescript/cipher.d.ts.map +1 -1
  174. package/lib/typescript/dhKeyPair.d.ts.map +1 -1
  175. package/lib/typescript/dsa.d.ts.map +1 -1
  176. package/lib/typescript/ec.d.ts.map +1 -1
  177. package/lib/typescript/ed.d.ts.map +1 -1
  178. package/lib/typescript/hash.d.ts +2 -2
  179. package/lib/typescript/hash.d.ts.map +1 -1
  180. package/lib/typescript/hkdf.d.ts.map +1 -1
  181. package/lib/typescript/hmac.d.ts +2 -2
  182. package/lib/typescript/hmac.d.ts.map +1 -1
  183. package/lib/typescript/index.d.ts +13 -8
  184. package/lib/typescript/index.d.ts.map +1 -1
  185. package/lib/typescript/keys/classes.d.ts +10 -1
  186. package/lib/typescript/keys/classes.d.ts.map +1 -1
  187. package/lib/typescript/keys/generateKeyPair.d.ts +12 -1
  188. package/lib/typescript/keys/generateKeyPair.d.ts.map +1 -1
  189. package/lib/typescript/keys/index.d.ts +3 -1
  190. package/lib/typescript/keys/index.d.ts.map +1 -1
  191. package/lib/typescript/keys/publicCipher.d.ts.map +1 -1
  192. package/lib/typescript/keys/signVerify.d.ts.map +1 -1
  193. package/lib/typescript/keys/utils.d.ts +21 -4
  194. package/lib/typescript/keys/utils.d.ts.map +1 -1
  195. package/lib/typescript/random.d.ts +5 -1
  196. package/lib/typescript/random.d.ts.map +1 -1
  197. package/lib/typescript/rsa.d.ts.map +1 -1
  198. package/lib/typescript/scrypt.d.ts.map +1 -1
  199. package/lib/typescript/slhdsa.d.ts +19 -0
  200. package/lib/typescript/slhdsa.d.ts.map +1 -0
  201. package/lib/typescript/specs/keyObjectHandle.nitro.d.ts +9 -0
  202. package/lib/typescript/specs/keyObjectHandle.nitro.d.ts.map +1 -1
  203. package/lib/typescript/specs/slhDsaKeyPair.nitro.d.ts +16 -0
  204. package/lib/typescript/specs/slhDsaKeyPair.nitro.d.ts.map +1 -0
  205. package/lib/typescript/specs/turboshake.nitro.d.ts +11 -0
  206. package/lib/typescript/specs/turboshake.nitro.d.ts.map +1 -0
  207. package/lib/typescript/specs/utils.nitro.d.ts +0 -2
  208. package/lib/typescript/specs/utils.nitro.d.ts.map +1 -1
  209. package/lib/typescript/subtle.d.ts +3 -2
  210. package/lib/typescript/subtle.d.ts.map +1 -1
  211. package/lib/typescript/utils/cipher.d.ts +13 -1
  212. package/lib/typescript/utils/cipher.d.ts.map +1 -1
  213. package/lib/typescript/utils/conversion.d.ts +13 -9
  214. package/lib/typescript/utils/conversion.d.ts.map +1 -1
  215. package/lib/typescript/utils/errors.d.ts +12 -0
  216. package/lib/typescript/utils/errors.d.ts.map +1 -1
  217. package/lib/typescript/utils/timingSafeEqual.d.ts.map +1 -1
  218. package/lib/typescript/utils/types.d.ts +32 -15
  219. package/lib/typescript/utils/types.d.ts.map +1 -1
  220. package/lib/typescript/utils/validation.d.ts +3 -1
  221. package/lib/typescript/utils/validation.d.ts.map +1 -1
  222. package/lib/typescript/x509certificate.d.ts.map +1 -1
  223. package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +2 -0
  224. package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +20 -0
  225. package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +20 -0
  226. package/nitrogen/generated/shared/c++/AsymmetricKeyType.hpp +48 -0
  227. package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.cpp +9 -0
  228. package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.hpp +9 -0
  229. package/nitrogen/generated/shared/c++/HybridSlhDsaKeyPairSpec.cpp +29 -0
  230. package/nitrogen/generated/shared/c++/HybridSlhDsaKeyPairSpec.hpp +72 -0
  231. package/nitrogen/generated/shared/c++/HybridTurboShakeSpec.cpp +22 -0
  232. package/nitrogen/generated/shared/c++/HybridTurboShakeSpec.hpp +70 -0
  233. package/nitrogen/generated/shared/c++/HybridUtilsSpec.cpp +0 -2
  234. package/nitrogen/generated/shared/c++/HybridUtilsSpec.hpp +0 -3
  235. package/nitrogen/generated/shared/c++/JWK.hpp +9 -1
  236. package/nitrogen/generated/shared/c++/JWKkty.hpp +4 -0
  237. package/nitrogen/generated/shared/c++/KangarooTwelveVariant.hpp +76 -0
  238. package/nitrogen/generated/shared/c++/TurboShakeVariant.hpp +76 -0
  239. package/package.json +38 -7
  240. package/src/argon2.ts +80 -2
  241. package/src/cipher.ts +139 -15
  242. package/src/dhKeyPair.ts +8 -0
  243. package/src/dsa.ts +19 -2
  244. package/src/ec.ts +52 -29
  245. package/src/ed.ts +95 -16
  246. package/src/hash.ts +125 -12
  247. package/src/hkdf.ts +44 -6
  248. package/src/hmac.ts +17 -7
  249. package/src/keys/classes.ts +46 -5
  250. package/src/keys/generateKeyPair.ts +151 -5
  251. package/src/keys/index.ts +73 -3
  252. package/src/keys/publicCipher.ts +10 -4
  253. package/src/keys/signVerify.ts +13 -2
  254. package/src/keys/utils.ts +78 -5
  255. package/src/random.ts +104 -11
  256. package/src/rsa.ts +26 -4
  257. package/src/scrypt.ts +73 -6
  258. package/src/slhdsa.ts +146 -0
  259. package/src/specs/keyObjectHandle.nitro.ts +17 -0
  260. package/src/specs/slhDsaKeyPair.nitro.ts +29 -0
  261. package/src/specs/turboshake.nitro.ts +21 -0
  262. package/src/specs/utils.nitro.ts +0 -2
  263. package/src/subtle.ts +1246 -333
  264. package/src/utils/cipher.ts +30 -8
  265. package/src/utils/conversion.ts +129 -40
  266. package/src/utils/errors.ts +72 -4
  267. package/src/utils/timingSafeEqual.ts +8 -3
  268. package/src/utils/types.ts +80 -15
  269. package/src/utils/validation.ts +70 -1
  270. package/src/x509certificate.ts +5 -6
  271. package/deps/blake3/.cargo/config.toml +0 -2
  272. package/deps/blake3/.git-blame-ignore-revs +0 -2
  273. package/deps/blake3/.github/workflows/build_b3sum.py +0 -38
  274. package/deps/blake3/.github/workflows/ci.yml +0 -491
  275. package/deps/blake3/.github/workflows/tag.yml +0 -43
  276. package/deps/blake3/.github/workflows/upload_github_release_asset.py +0 -73
  277. package/deps/blake3/CONTRIBUTING.md +0 -31
  278. package/deps/blake3/Cargo.toml +0 -135
  279. package/deps/blake3/b3sum/Cargo.lock +0 -513
  280. package/deps/blake3/b3sum/Cargo.toml +0 -26
  281. package/deps/blake3/b3sum/README.md +0 -72
  282. package/deps/blake3/b3sum/src/main.rs +0 -564
  283. package/deps/blake3/b3sum/src/unit_tests.rs +0 -235
  284. package/deps/blake3/b3sum/tests/cli_tests.rs +0 -680
  285. package/deps/blake3/b3sum/what_does_check_do.md +0 -176
  286. package/deps/blake3/benches/bench.rs +0 -623
  287. package/deps/blake3/build.rs +0 -389
  288. package/deps/blake3/c/CMakeLists.txt +0 -383
  289. package/deps/blake3/c/CMakePresets.json +0 -73
  290. package/deps/blake3/c/Makefile.testing +0 -82
  291. package/deps/blake3/c/blake3-config.cmake.in +0 -14
  292. package/deps/blake3/c/blake3_avx2.c +0 -326
  293. package/deps/blake3/c/blake3_avx2_x86-64_unix.S +0 -1815
  294. package/deps/blake3/c/blake3_avx2_x86-64_windows_gnu.S +0 -1817
  295. package/deps/blake3/c/blake3_avx2_x86-64_windows_msvc.asm +0 -1828
  296. package/deps/blake3/c/blake3_avx512.c +0 -1388
  297. package/deps/blake3/c/blake3_avx512_x86-64_unix.S +0 -4824
  298. package/deps/blake3/c/blake3_avx512_x86-64_windows_gnu.S +0 -2615
  299. package/deps/blake3/c/blake3_avx512_x86-64_windows_msvc.asm +0 -2634
  300. package/deps/blake3/c/blake3_c_rust_bindings/Cargo.toml +0 -32
  301. package/deps/blake3/c/blake3_c_rust_bindings/README.md +0 -4
  302. package/deps/blake3/c/blake3_c_rust_bindings/benches/bench.rs +0 -477
  303. package/deps/blake3/c/blake3_c_rust_bindings/build.rs +0 -253
  304. package/deps/blake3/c/blake3_c_rust_bindings/cross_test.sh +0 -31
  305. package/deps/blake3/c/blake3_c_rust_bindings/src/lib.rs +0 -333
  306. package/deps/blake3/c/blake3_c_rust_bindings/src/test.rs +0 -696
  307. package/deps/blake3/c/blake3_sse2.c +0 -566
  308. package/deps/blake3/c/blake3_sse2_x86-64_unix.S +0 -2291
  309. package/deps/blake3/c/blake3_sse2_x86-64_windows_gnu.S +0 -2332
  310. package/deps/blake3/c/blake3_sse2_x86-64_windows_msvc.asm +0 -2350
  311. package/deps/blake3/c/blake3_sse41.c +0 -560
  312. package/deps/blake3/c/blake3_sse41_x86-64_unix.S +0 -2028
  313. package/deps/blake3/c/blake3_sse41_x86-64_windows_gnu.S +0 -2069
  314. package/deps/blake3/c/blake3_sse41_x86-64_windows_msvc.asm +0 -2089
  315. package/deps/blake3/c/blake3_tbb.cpp +0 -37
  316. package/deps/blake3/c/dependencies/CMakeLists.txt +0 -3
  317. package/deps/blake3/c/dependencies/tbb/CMakeLists.txt +0 -28
  318. package/deps/blake3/c/example.c +0 -36
  319. package/deps/blake3/c/example_tbb.c +0 -57
  320. package/deps/blake3/c/libblake3.pc.in +0 -12
  321. package/deps/blake3/c/main.c +0 -166
  322. package/deps/blake3/c/test.py +0 -97
  323. package/deps/blake3/media/B3.svg +0 -70
  324. package/deps/blake3/media/BLAKE3.svg +0 -85
  325. package/deps/blake3/media/speed.svg +0 -1474
  326. package/deps/blake3/reference_impl/Cargo.toml +0 -8
  327. package/deps/blake3/reference_impl/README.md +0 -14
  328. package/deps/blake3/reference_impl/reference_impl.rs +0 -374
  329. package/deps/blake3/src/ffi_avx2.rs +0 -65
  330. package/deps/blake3/src/ffi_avx512.rs +0 -169
  331. package/deps/blake3/src/ffi_neon.rs +0 -82
  332. package/deps/blake3/src/ffi_sse2.rs +0 -126
  333. package/deps/blake3/src/ffi_sse41.rs +0 -126
  334. package/deps/blake3/src/guts.rs +0 -60
  335. package/deps/blake3/src/hazmat.rs +0 -704
  336. package/deps/blake3/src/io.rs +0 -64
  337. package/deps/blake3/src/join.rs +0 -92
  338. package/deps/blake3/src/lib.rs +0 -1835
  339. package/deps/blake3/src/platform.rs +0 -587
  340. package/deps/blake3/src/portable.rs +0 -198
  341. package/deps/blake3/src/rust_avx2.rs +0 -474
  342. package/deps/blake3/src/rust_sse2.rs +0 -775
  343. package/deps/blake3/src/rust_sse41.rs +0 -766
  344. package/deps/blake3/src/test.rs +0 -1049
  345. package/deps/blake3/src/traits.rs +0 -227
  346. package/deps/blake3/src/wasm32_simd.rs +0 -794
  347. package/deps/blake3/test_vectors/Cargo.toml +0 -19
  348. package/deps/blake3/test_vectors/cross_test.sh +0 -25
  349. package/deps/blake3/test_vectors/src/bin/generate.rs +0 -4
  350. package/deps/blake3/test_vectors/src/lib.rs +0 -350
  351. package/deps/blake3/test_vectors/test_vectors.json +0 -217
  352. package/deps/blake3/tools/compiler_version/Cargo.toml +0 -7
  353. package/deps/blake3/tools/compiler_version/build.rs +0 -6
  354. package/deps/blake3/tools/compiler_version/src/main.rs +0 -27
  355. package/deps/blake3/tools/instruction_set_support/Cargo.toml +0 -6
  356. package/deps/blake3/tools/instruction_set_support/src/main.rs +0 -10
  357. package/deps/blake3/tools/release.md +0 -16
  358. package/deps/ncrypto/.bazelignore +0 -4
  359. package/deps/ncrypto/.bazelrc +0 -1
  360. package/deps/ncrypto/.bazelversion +0 -1
  361. package/deps/ncrypto/.clang-format +0 -111
  362. package/deps/ncrypto/.github/workflows/bazel.yml +0 -58
  363. package/deps/ncrypto/.github/workflows/commitlint.yml +0 -16
  364. package/deps/ncrypto/.github/workflows/linter.yml +0 -38
  365. package/deps/ncrypto/.github/workflows/macos.yml +0 -43
  366. package/deps/ncrypto/.github/workflows/release-please.yml +0 -16
  367. package/deps/ncrypto/.github/workflows/ubuntu.yml +0 -128
  368. package/deps/ncrypto/.github/workflows/visual-studio.yml +0 -49
  369. package/deps/ncrypto/.python-version +0 -1
  370. package/deps/ncrypto/.release-please-manifest.json +0 -3
  371. package/deps/ncrypto/BUILD.bazel +0 -44
  372. package/deps/ncrypto/CHANGELOG.md +0 -37
  373. package/deps/ncrypto/CMakeLists.txt +0 -79
  374. package/deps/ncrypto/MODULE.bazel +0 -16
  375. package/deps/ncrypto/MODULE.bazel.lock +0 -461
  376. package/deps/ncrypto/cmake/CPM.cmake +0 -1225
  377. package/deps/ncrypto/cmake/ncrypto-flags.cmake +0 -17
  378. package/deps/ncrypto/ncrypto.pc.in +0 -10
  379. package/deps/ncrypto/patches/0001-Expose-libdecrepit-so-NodeJS-can-use-it-for-ncrypto.patch +0 -28
  380. package/deps/ncrypto/pyproject.toml +0 -38
  381. package/deps/ncrypto/release-please-config.json +0 -11
  382. package/deps/ncrypto/src/CMakeLists.txt +0 -40
  383. package/deps/ncrypto/tests/BUILD.bazel +0 -11
  384. package/deps/ncrypto/tests/CMakeLists.txt +0 -7
  385. package/deps/ncrypto/tests/basic.cpp +0 -856
  386. package/deps/ncrypto/tools/run-clang-format.sh +0 -42
  387. package/deps/simdutf/.clang-format +0 -4
  388. package/deps/simdutf/.github/ISSUE_TEMPLATE/bug_report.md +0 -62
  389. package/deps/simdutf/.github/ISSUE_TEMPLATE/config.yml +0 -1
  390. package/deps/simdutf/.github/ISSUE_TEMPLATE/feature_request.md +0 -35
  391. package/deps/simdutf/.github/ISSUE_TEMPLATE/standard-issue-template.md +0 -29
  392. package/deps/simdutf/.github/pull_request_template.md +0 -51
  393. package/deps/simdutf/.github/workflows/aarch64.yml +0 -39
  394. package/deps/simdutf/.github/workflows/alpine.yml +0 -27
  395. package/deps/simdutf/.github/workflows/amalgamation_demos.yml +0 -34
  396. package/deps/simdutf/.github/workflows/armv7.yml +0 -32
  397. package/deps/simdutf/.github/workflows/atomic_fuzz.yml +0 -25
  398. package/deps/simdutf/.github/workflows/cifuzz.yml +0 -37
  399. package/deps/simdutf/.github/workflows/clangformat.yml +0 -36
  400. package/deps/simdutf/.github/workflows/debian-latestcxxstandards.yml +0 -40
  401. package/deps/simdutf/.github/workflows/debian.yml +0 -33
  402. package/deps/simdutf/.github/workflows/documentation.yml +0 -36
  403. package/deps/simdutf/.github/workflows/emscripten.yml +0 -19
  404. package/deps/simdutf/.github/workflows/loongarch64-gcc-14.2.yml +0 -39
  405. package/deps/simdutf/.github/workflows/macos-latest.yml +0 -29
  406. package/deps/simdutf/.github/workflows/msys2-clang.yml +0 -48
  407. package/deps/simdutf/.github/workflows/msys2.yml +0 -50
  408. package/deps/simdutf/.github/workflows/ppc64le.yml +0 -29
  409. package/deps/simdutf/.github/workflows/rvv-1024-clang-18.yml +0 -35
  410. package/deps/simdutf/.github/workflows/rvv-128-clang-17.yml +0 -35
  411. package/deps/simdutf/.github/workflows/rvv-256-gcc-14.yml +0 -31
  412. package/deps/simdutf/.github/workflows/s390x.yml +0 -29
  413. package/deps/simdutf/.github/workflows/selective-amalgamation.yml +0 -29
  414. package/deps/simdutf/.github/workflows/typos.yml +0 -19
  415. package/deps/simdutf/.github/workflows/ubuntu22-cxx20.yml +0 -30
  416. package/deps/simdutf/.github/workflows/ubuntu22.yml +0 -32
  417. package/deps/simdutf/.github/workflows/ubuntu22_gcc12.yml +0 -27
  418. package/deps/simdutf/.github/workflows/ubuntu22sani.yml +0 -29
  419. package/deps/simdutf/.github/workflows/ubuntu24-cxxstandards.yml +0 -34
  420. package/deps/simdutf/.github/workflows/ubuntu24-unsignedchar.yml +0 -34
  421. package/deps/simdutf/.github/workflows/ubuntu24.yml +0 -32
  422. package/deps/simdutf/.github/workflows/ubuntu24sani.yml +0 -36
  423. package/deps/simdutf/.github/workflows/ubuntu24sani_clang.yml +0 -29
  424. package/deps/simdutf/.github/workflows/vs17-arm-ci.yml +0 -21
  425. package/deps/simdutf/.github/workflows/vs17-ci-cxx20.yml +0 -41
  426. package/deps/simdutf/.github/workflows/vs17-ci.yml +0 -41
  427. package/deps/simdutf/.github/workflows/vs17-clang-ci.yml +0 -41
  428. package/deps/simdutf/.github/workflows/vs17-cxxstandards.yml +0 -36
  429. package/deps/simdutf/AI_USAGE_POLICY.md +0 -56
  430. package/deps/simdutf/AUTHORS +0 -6
  431. package/deps/simdutf/CMakeLists.txt +0 -231
  432. package/deps/simdutf/CONTRIBUTING.md +0 -214
  433. package/deps/simdutf/CONTRIBUTORS +0 -1
  434. package/deps/simdutf/Doxyfile +0 -2584
  435. package/deps/simdutf/Makefile.crosscompile +0 -54
  436. package/deps/simdutf/README-RVV.md +0 -16
  437. package/deps/simdutf/SECURITY.md +0 -8
  438. package/deps/simdutf/benchmarks/CMakeLists.txt +0 -101
  439. package/deps/simdutf/benchmarks/alignment.cpp +0 -150
  440. package/deps/simdutf/benchmarks/base64/CMakeLists.txt +0 -30
  441. package/deps/simdutf/benchmarks/base64/benchmark_base64.cpp +0 -875
  442. package/deps/simdutf/benchmarks/base64/libbase64_spaces.h +0 -49
  443. package/deps/simdutf/benchmarks/base64/node_base64.h +0 -227
  444. package/deps/simdutf/benchmarks/base64/openssl3_base64.h +0 -334
  445. package/deps/simdutf/benchmarks/benchmark.cpp +0 -65
  446. package/deps/simdutf/benchmarks/benchmark_to_well_formed_utf16.cpp +0 -347
  447. package/deps/simdutf/benchmarks/competition/.clang-format-ignore +0 -5
  448. package/deps/simdutf/benchmarks/competition/CppCon2018/utf_utils.cpp +0 -1276
  449. package/deps/simdutf/benchmarks/competition/CppCon2018/utf_utils.h +0 -595
  450. package/deps/simdutf/benchmarks/competition/README.md +0 -7
  451. package/deps/simdutf/benchmarks/competition/hoehrmann/hoehrmann.h +0 -91
  452. package/deps/simdutf/benchmarks/competition/inoue2008/inoue_utf8_to_utf16.h +0 -444
  453. package/deps/simdutf/benchmarks/competition/inoue2008/inoue_utf8_to_utf16_tables.h +0 -13183
  454. package/deps/simdutf/benchmarks/competition/inoue2008/script.py +0 -73
  455. package/deps/simdutf/benchmarks/competition/llvm/ConvertUTF.cpp +0 -738
  456. package/deps/simdutf/benchmarks/competition/llvm/ConvertUTF.h +0 -293
  457. package/deps/simdutf/benchmarks/competition/u8u16/COPYRIGHT +0 -8
  458. package/deps/simdutf/benchmarks/competition/u8u16/Makefile +0 -44
  459. package/deps/simdutf/benchmarks/competition/u8u16/OSL3.0.txt +0 -169
  460. package/deps/simdutf/benchmarks/competition/u8u16/Profiling/BOM_Profiler.h +0 -148
  461. package/deps/simdutf/benchmarks/competition/u8u16/Profiling/i386_timer.h +0 -45
  462. package/deps/simdutf/benchmarks/competition/u8u16/Profiling/ppc_timer.c +0 -34
  463. package/deps/simdutf/benchmarks/competition/u8u16/README +0 -56
  464. package/deps/simdutf/benchmarks/competition/u8u16/config/config_defs.h +0 -43
  465. package/deps/simdutf/benchmarks/competition/u8u16/config/g4_config.h +0 -27
  466. package/deps/simdutf/benchmarks/competition/u8u16/config/mmx_config.h +0 -16
  467. package/deps/simdutf/benchmarks/competition/u8u16/config/p4_config.h +0 -18
  468. package/deps/simdutf/benchmarks/competition/u8u16/config/p4_ideal_config.h +0 -16
  469. package/deps/simdutf/benchmarks/competition/u8u16/config/spu_config.h +0 -28
  470. package/deps/simdutf/benchmarks/competition/u8u16/config/ssse3_config.h +0 -20
  471. package/deps/simdutf/benchmarks/competition/u8u16/iconv_u8u16.c +0 -2
  472. package/deps/simdutf/benchmarks/competition/u8u16/lib/altivec_simd.h +0 -440
  473. package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_basic_ops.py +0 -121
  474. package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_half_operand_versions.py +0 -158
  475. package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_test.py +0 -270
  476. package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd.h +0 -141
  477. package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_basic.h +0 -216
  478. package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_built_in.h +0 -119
  479. package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_modified.h +0 -2430
  480. package/deps/simdutf/benchmarks/competition/u8u16/lib/outline.txt +0 -39
  481. package/deps/simdutf/benchmarks/competition/u8u16/lib/spu_simd.h +0 -421
  482. package/deps/simdutf/benchmarks/competition/u8u16/lib/sse_simd.h +0 -836
  483. package/deps/simdutf/benchmarks/competition/u8u16/lib/stdint.h +0 -222
  484. package/deps/simdutf/benchmarks/competition/u8u16/libu8u16_BE.c +0 -4
  485. package/deps/simdutf/benchmarks/competition/u8u16/libu8u16_LE.c +0 -5
  486. package/deps/simdutf/benchmarks/competition/u8u16/proto/u8u16.py +0 -390
  487. package/deps/simdutf/benchmarks/competition/u8u16/src/Makefile +0 -18
  488. package/deps/simdutf/benchmarks/competition/u8u16/src/bytelex.h +0 -448
  489. package/deps/simdutf/benchmarks/competition/u8u16/src/charsets/ASCII_EBCDIC.h +0 -284
  490. package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.c +0 -1975
  491. package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.pdf +0 -0
  492. package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.w +0 -2263
  493. package/deps/simdutf/benchmarks/competition/u8u16/src/multiliteral.h +0 -239
  494. package/deps/simdutf/benchmarks/competition/u8u16/src/u8u16.c +0 -232
  495. package/deps/simdutf/benchmarks/competition/u8u16/src/x8x16.c +0 -194
  496. package/deps/simdutf/benchmarks/competition/u8u16/src/xml_error.c +0 -193
  497. package/deps/simdutf/benchmarks/competition/u8u16/src/xml_error.h +0 -167
  498. package/deps/simdutf/benchmarks/competition/u8u16/src/xmldecl.c +0 -288
  499. package/deps/simdutf/benchmarks/competition/u8u16/src/xmldecl.h +0 -117
  500. package/deps/simdutf/benchmarks/competition/u8u16/u8u16_g4.c +0 -2
  501. package/deps/simdutf/benchmarks/competition/u8u16/u8u16_mmx.c +0 -2
  502. package/deps/simdutf/benchmarks/competition/u8u16/u8u16_p4.c +0 -3
  503. package/deps/simdutf/benchmarks/competition/u8u16/u8u16_p4_ideal.c +0 -2
  504. package/deps/simdutf/benchmarks/competition/u8u16/u8u16_spu.c +0 -2
  505. package/deps/simdutf/benchmarks/competition/u8u16/u8u16_ssse3.c +0 -3
  506. package/deps/simdutf/benchmarks/competition/u8u16/x8x16_p4.c +0 -2
  507. package/deps/simdutf/benchmarks/competition/utf8lut/LICENSE +0 -23
  508. package/deps/simdutf/benchmarks/competition/utf8lut/data/test_minimal.txt +0 -44
  509. package/deps/simdutf/benchmarks/competition/utf8lut/readme.md +0 -106
  510. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_clang_corr_tests.cmd +0 -11
  511. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_clang_corr_tests.sh +0 -13
  512. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_corr_tests.sh +0 -13
  513. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_example.sh +0 -13
  514. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_file_conv.sh +0 -14
  515. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_iconv_lib.sh +0 -11
  516. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_iconv_sample.sh +0 -8
  517. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_corr_tests.cmd +0 -12
  518. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_example.cmd +0 -13
  519. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_file_conv.cmd +0 -14
  520. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_iconv_lib.cmd +0 -11
  521. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_iconv_sample.cmd +0 -8
  522. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_corr_tests.cmd +0 -11
  523. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_example.cmd +0 -12
  524. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_file_conv.cmd +0 -13
  525. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_iconv_lib.cmd +0 -10
  526. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_iconv_sample.cmd +0 -9
  527. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/html_table.py +0 -25
  528. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/measure.py +0 -94
  529. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/resize.py +0 -20
  530. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/wipe_all.cmd +0 -2
  531. package/deps/simdutf/benchmarks/competition/utf8lut/scripts/wipe_interm.cmd +0 -1
  532. package/deps/simdutf/benchmarks/competition/utf8lut/src/base/CustomMemcpy.h +0 -75
  533. package/deps/simdutf/benchmarks/competition/utf8lut/src/base/PerfDefs.h +0 -47
  534. package/deps/simdutf/benchmarks/competition/utf8lut/src/base/Timing.cpp +0 -17
  535. package/deps/simdutf/benchmarks/competition/utf8lut/src/base/Timing.h +0 -76
  536. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/AllProcessors.cpp +0 -35
  537. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BaseBufferProcessor.cpp +0 -117
  538. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BaseBufferProcessor.h +0 -210
  539. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BufferDecoder.h +0 -158
  540. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BufferEncoder.h +0 -104
  541. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/ProcessorPlugins.h +0 -334
  542. package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/ProcessorSelector.h +0 -186
  543. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderLut.cpp +0 -140
  544. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderLut.h +0 -42
  545. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderProcess.h +0 -100
  546. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/Dfa.h +0 -57
  547. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderLut.cpp +0 -85
  548. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderLut.h +0 -27
  549. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderProcess.h +0 -126
  550. package/deps/simdutf/benchmarks/competition/utf8lut/src/core/ProcessTrivial.h +0 -108
  551. package/deps/simdutf/benchmarks/competition/utf8lut/src/iconv/iconv.cpp +0 -139
  552. package/deps/simdutf/benchmarks/competition/utf8lut/src/iconv/iconv.h +0 -74
  553. package/deps/simdutf/benchmarks/competition/utf8lut/src/message/MessageConverter.cpp +0 -65
  554. package/deps/simdutf/benchmarks/competition/utf8lut/src/message/MessageConverter.h +0 -91
  555. package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/CorrectnessTests.cpp +0 -772
  556. package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/Example.cpp +0 -12
  557. package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/FileConverter.cpp +0 -486
  558. package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/iconv_sample.c +0 -162
  559. package/deps/simdutf/benchmarks/competition/utf8lut/src/utf8lut.h +0 -15
  560. package/deps/simdutf/benchmarks/competition/utf8sse4/fromutf8-sse.cpp +0 -292
  561. package/deps/simdutf/benchmarks/competition/utfcpp/LICENSE +0 -23
  562. package/deps/simdutf/benchmarks/competition/utfcpp/README.md +0 -1503
  563. package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/checked.h +0 -335
  564. package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/core.h +0 -338
  565. package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/cpp11.h +0 -103
  566. package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/cpp17.h +0 -103
  567. package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/unchecked.h +0 -274
  568. package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8.h +0 -34
  569. package/deps/simdutf/benchmarks/dataset/README.md +0 -155
  570. package/deps/simdutf/benchmarks/dataset/emoji.txt +0 -204
  571. package/deps/simdutf/benchmarks/dataset/scripts/utf8type.py +0 -40
  572. package/deps/simdutf/benchmarks/dataset/wikipedia_mars/Makefile +0 -80
  573. package/deps/simdutf/benchmarks/dataset/wikipedia_mars/convert_to_utf6.py +0 -20
  574. package/deps/simdutf/benchmarks/find/CMakeLists.txt +0 -6
  575. package/deps/simdutf/benchmarks/find/findbenchmark.cpp +0 -63
  576. package/deps/simdutf/benchmarks/find/findbenchmarker.h +0 -46
  577. package/deps/simdutf/benchmarks/shortbench.cpp +0 -555
  578. package/deps/simdutf/benchmarks/src/CMakeLists.txt +0 -52
  579. package/deps/simdutf/benchmarks/src/apple_arm_events.h +0 -1104
  580. package/deps/simdutf/benchmarks/src/benchmark.cpp +0 -3899
  581. package/deps/simdutf/benchmarks/src/benchmark.h +0 -317
  582. package/deps/simdutf/benchmarks/src/benchmark_base.cpp +0 -144
  583. package/deps/simdutf/benchmarks/src/benchmark_base.h +0 -98
  584. package/deps/simdutf/benchmarks/src/cmdline.cpp +0 -176
  585. package/deps/simdutf/benchmarks/src/cmdline.h +0 -35
  586. package/deps/simdutf/benchmarks/src/event_counter.h +0 -162
  587. package/deps/simdutf/benchmarks/src/linux-perf-events.h +0 -104
  588. package/deps/simdutf/benchmarks/stream.cpp +0 -209
  589. package/deps/simdutf/benchmarks/threaded.cpp +0 -123
  590. package/deps/simdutf/cmake/CPM.cmake +0 -1363
  591. package/deps/simdutf/cmake/JoinPaths.cmake +0 -23
  592. package/deps/simdutf/cmake/add_cpp_test.cmake +0 -68
  593. package/deps/simdutf/cmake/simdutf-config.cmake.in +0 -2
  594. package/deps/simdutf/cmake/simdutf-flags.cmake +0 -26
  595. package/deps/simdutf/cmake/toolchains-ci/riscv64-linux-gnu.cmake +0 -4
  596. package/deps/simdutf/cmake/toolchains-dev/README.md +0 -32
  597. package/deps/simdutf/cmake/toolchains-dev/aarch64.cmake +0 -14
  598. package/deps/simdutf/cmake/toolchains-dev/loongarch64.cmake +0 -22
  599. package/deps/simdutf/cmake/toolchains-dev/powerpc64.cmake +0 -16
  600. package/deps/simdutf/cmake/toolchains-dev/powerpc64le.cmake +0 -16
  601. package/deps/simdutf/cmake/toolchains-dev/riscv64.cmake +0 -16
  602. package/deps/simdutf/cmake/toolchains-dev/rvv-spike.cmake +0 -38
  603. package/deps/simdutf/doc/avx512.png +0 -0
  604. package/deps/simdutf/doc/logo.png +0 -0
  605. package/deps/simdutf/doc/logo.svg +0 -165
  606. package/deps/simdutf/doc/node2023.png +0 -0
  607. package/deps/simdutf/doc/shortinput.md +0 -78
  608. package/deps/simdutf/doc/utf16utf8.png +0 -0
  609. package/deps/simdutf/doc/utf8utf16.png +0 -0
  610. package/deps/simdutf/doc/widelogo.png +0 -0
  611. package/deps/simdutf/doxygen.py +0 -50
  612. package/deps/simdutf/fuzz/.clang-format +0 -9
  613. package/deps/simdutf/fuzz/CMakeLists.txt +0 -45
  614. package/deps/simdutf/fuzz/README.md +0 -168
  615. package/deps/simdutf/fuzz/atomic_base64.cpp +0 -448
  616. package/deps/simdutf/fuzz/base64.cpp +0 -278
  617. package/deps/simdutf/fuzz/build.sh +0 -83
  618. package/deps/simdutf/fuzz/conversion.cpp +0 -669
  619. package/deps/simdutf/fuzz/helpers/.clang-format-ignore +0 -1
  620. package/deps/simdutf/fuzz/helpers/common.h +0 -135
  621. package/deps/simdutf/fuzz/helpers/nameof.hpp +0 -1258
  622. package/deps/simdutf/fuzz/main.cpp +0 -72
  623. package/deps/simdutf/fuzz/minimize_and_cleanse.sh +0 -87
  624. package/deps/simdutf/fuzz/misc.cpp +0 -216
  625. package/deps/simdutf/fuzz/random_fuzz.sh +0 -154
  626. package/deps/simdutf/fuzz/roundtrip.cpp +0 -588
  627. package/deps/simdutf/fuzz/safe_conversion.cpp +0 -104
  628. package/deps/simdutf/riscv/Dockerfile +0 -16
  629. package/deps/simdutf/riscv/README.md +0 -24
  630. package/deps/simdutf/riscv/remove-docker-station +0 -8
  631. package/deps/simdutf/riscv/run-docker-station +0 -31
  632. package/deps/simdutf/scripts/.flake8 +0 -2
  633. package/deps/simdutf/scripts/Makefile +0 -2
  634. package/deps/simdutf/scripts/README_ADD_FUNCTION.md +0 -49
  635. package/deps/simdutf/scripts/add_function.py +0 -330
  636. package/deps/simdutf/scripts/amalgamation_tests.py +0 -156
  637. package/deps/simdutf/scripts/base64/Makefile +0 -2
  638. package/deps/simdutf/scripts/base64/README.md +0 -2
  639. package/deps/simdutf/scripts/base64/avx512.py +0 -76
  640. package/deps/simdutf/scripts/base64/neon_decode.py +0 -143
  641. package/deps/simdutf/scripts/base64/neon_generate_lut.py +0 -101
  642. package/deps/simdutf/scripts/base64/sse.py +0 -252
  643. package/deps/simdutf/scripts/base64/sseregular.py +0 -160
  644. package/deps/simdutf/scripts/base64/sseurl.py +0 -283
  645. package/deps/simdutf/scripts/base64/table.py +0 -59
  646. package/deps/simdutf/scripts/base64bench_print.py +0 -145
  647. package/deps/simdutf/scripts/benchmark-all.py +0 -119
  648. package/deps/simdutf/scripts/benchmark_print.py +0 -324
  649. package/deps/simdutf/scripts/check_feature_macros.py +0 -156
  650. package/deps/simdutf/scripts/check_typos.sh +0 -13
  651. package/deps/simdutf/scripts/clang_format.sh +0 -35
  652. package/deps/simdutf/scripts/clang_format_docker.sh +0 -38
  653. package/deps/simdutf/scripts/common.py +0 -24
  654. package/deps/simdutf/scripts/compilation_benchmark.py +0 -55
  655. package/deps/simdutf/scripts/compile_many_variations.sh +0 -64
  656. package/deps/simdutf/scripts/create_latex_table.py +0 -62
  657. package/deps/simdutf/scripts/docker/Dockerfile +0 -14
  658. package/deps/simdutf/scripts/docker/Makefile +0 -9
  659. package/deps/simdutf/scripts/docker/README.md +0 -30
  660. package/deps/simdutf/scripts/docker/llvm.gpg +0 -0
  661. package/deps/simdutf/scripts/ppc64_convert_utf16_to_utf8.py +0 -155
  662. package/deps/simdutf/scripts/prepare_doxygen.sh +0 -21
  663. package/deps/simdutf/scripts/release.py +0 -197
  664. package/deps/simdutf/scripts/shortinputplots.py +0 -97
  665. package/deps/simdutf/scripts/sse_convert_utf16_to_utf8.py +0 -422
  666. package/deps/simdutf/scripts/sse_convert_utf32_to_utf16.py +0 -105
  667. package/deps/simdutf/scripts/sse_utf8_utf16_decode.py +0 -186
  668. package/deps/simdutf/scripts/sse_validate_utf16le_proof.py +0 -137
  669. package/deps/simdutf/scripts/sse_validate_utf16le_testcases.py +0 -129
  670. package/deps/simdutf/scripts/table.py +0 -207
  671. package/deps/simdutf/scripts/tests/new.txt +0 -33
  672. package/deps/simdutf/scripts/tests/old.txt +0 -33
  673. package/deps/simdutf/scripts/tests/results.txt +0 -272
  674. package/deps/simdutf/simdutf.pc.in +0 -11
  675. package/deps/simdutf/singleheader/.flake8 +0 -2
  676. package/deps/simdutf/singleheader/CMakeLists.txt +0 -64
  677. package/deps/simdutf/singleheader/README-dev.md +0 -81
  678. package/deps/simdutf/singleheader/README.md +0 -19
  679. package/deps/simdutf/singleheader/amalgamate.py +0 -513
  680. package/deps/simdutf/singleheader/amalgamation_demo.c +0 -59
  681. package/deps/simdutf/singleheader/amalgamation_demo.cpp +0 -54
  682. package/deps/simdutf/singleheader/test-features.py +0 -262
  683. package/deps/simdutf/src/CMakeLists.txt +0 -78
  684. package/deps/simdutf/tests/CMakeLists.txt +0 -483
  685. package/deps/simdutf/tests/atomic_base64_tests.cpp +0 -2845
  686. package/deps/simdutf/tests/base64_tests.cpp +0 -3617
  687. package/deps/simdutf/tests/basic_fuzzer.cpp +0 -805
  688. package/deps/simdutf/tests/bele_tests.cpp +0 -182
  689. package/deps/simdutf/tests/constexpr_base64_tests.cpp +0 -387
  690. package/deps/simdutf/tests/convert_latin1_to_utf16be_tests.cpp +0 -52
  691. package/deps/simdutf/tests/convert_latin1_to_utf16le_tests.cpp +0 -80
  692. package/deps/simdutf/tests/convert_latin1_to_utf32_tests.cpp +0 -66
  693. package/deps/simdutf/tests/convert_latin1_to_utf8_tests.cpp +0 -120
  694. package/deps/simdutf/tests/convert_utf16_to_utf8_safe_tests.cpp +0 -203
  695. package/deps/simdutf/tests/convert_utf16_to_utf8_with_replacement_tests.cpp +0 -276
  696. package/deps/simdutf/tests/convert_utf16be_to_latin1_tests.cpp +0 -109
  697. package/deps/simdutf/tests/convert_utf16be_to_latin1_tests_with_errors.cpp +0 -136
  698. package/deps/simdutf/tests/convert_utf16be_to_utf32_tests.cpp +0 -193
  699. package/deps/simdutf/tests/convert_utf16be_to_utf32_with_errors_tests.cpp +0 -381
  700. package/deps/simdutf/tests/convert_utf16be_to_utf8_tests.cpp +0 -259
  701. package/deps/simdutf/tests/convert_utf16be_to_utf8_with_errors_tests.cpp +0 -266
  702. package/deps/simdutf/tests/convert_utf16le_to_latin1_tests.cpp +0 -148
  703. package/deps/simdutf/tests/convert_utf16le_to_latin1_tests_with_errors.cpp +0 -176
  704. package/deps/simdutf/tests/convert_utf16le_to_utf32_tests.cpp +0 -213
  705. package/deps/simdutf/tests/convert_utf16le_to_utf32_with_errors_tests.cpp +0 -318
  706. package/deps/simdutf/tests/convert_utf16le_to_utf8_tests.cpp +0 -343
  707. package/deps/simdutf/tests/convert_utf16le_to_utf8_with_errors_tests.cpp +0 -271
  708. package/deps/simdutf/tests/convert_utf32_to_latin1_tests.cpp +0 -111
  709. package/deps/simdutf/tests/convert_utf32_to_latin1_with_errors_tests.cpp +0 -96
  710. package/deps/simdutf/tests/convert_utf32_to_utf16be_tests.cpp +0 -148
  711. package/deps/simdutf/tests/convert_utf32_to_utf16be_with_errors_tests.cpp +0 -192
  712. package/deps/simdutf/tests/convert_utf32_to_utf16le_tests.cpp +0 -166
  713. package/deps/simdutf/tests/convert_utf32_to_utf16le_with_errors_tests.cpp +0 -215
  714. package/deps/simdutf/tests/convert_utf32_to_utf8_tests.cpp +0 -181
  715. package/deps/simdutf/tests/convert_utf32_to_utf8_with_errors_tests.cpp +0 -261
  716. package/deps/simdutf/tests/convert_utf8_to_latin1_tests.cpp +0 -516
  717. package/deps/simdutf/tests/convert_utf8_to_latin1_with_errors_tests.cpp +0 -579
  718. package/deps/simdutf/tests/convert_utf8_to_utf16be_tests.cpp +0 -412
  719. package/deps/simdutf/tests/convert_utf8_to_utf16be_with_errors_tests.cpp +0 -480
  720. package/deps/simdutf/tests/convert_utf8_to_utf16le_tests.cpp +0 -671
  721. package/deps/simdutf/tests/convert_utf8_to_utf16le_with_errors_tests.cpp +0 -455
  722. package/deps/simdutf/tests/convert_utf8_to_utf32_tests.cpp +0 -1204
  723. package/deps/simdutf/tests/convert_utf8_to_utf32_with_errors_tests.cpp +0 -337
  724. package/deps/simdutf/tests/convert_valid_utf16be_to_latin1_tests.cpp +0 -37
  725. package/deps/simdutf/tests/convert_valid_utf16be_to_utf32_tests.cpp +0 -97
  726. package/deps/simdutf/tests/convert_valid_utf16be_to_utf8_tests.cpp +0 -126
  727. package/deps/simdutf/tests/convert_valid_utf16le_to_latin1_tests.cpp +0 -71
  728. package/deps/simdutf/tests/convert_valid_utf16le_to_utf32_tests.cpp +0 -122
  729. package/deps/simdutf/tests/convert_valid_utf16le_to_utf8_tests.cpp +0 -244
  730. package/deps/simdutf/tests/convert_valid_utf32_to_latin1_tests.cpp +0 -49
  731. package/deps/simdutf/tests/convert_valid_utf32_to_utf16be_tests.cpp +0 -92
  732. package/deps/simdutf/tests/convert_valid_utf32_to_utf16le_tests.cpp +0 -114
  733. package/deps/simdutf/tests/convert_valid_utf32_to_utf8_tests.cpp +0 -109
  734. package/deps/simdutf/tests/convert_valid_utf8_to_latin1_tests.cpp +0 -84
  735. package/deps/simdutf/tests/convert_valid_utf8_to_utf16be_tests.cpp +0 -124
  736. package/deps/simdutf/tests/convert_valid_utf8_to_utf16le_tests.cpp +0 -221
  737. package/deps/simdutf/tests/convert_valid_utf8_to_utf32_tests.cpp +0 -155
  738. package/deps/simdutf/tests/count_utf16be.cpp +0 -64
  739. package/deps/simdutf/tests/count_utf16le.cpp +0 -61
  740. package/deps/simdutf/tests/count_utf8.cpp +0 -87
  741. package/deps/simdutf/tests/detect_encodings_tests.cpp +0 -312
  742. package/deps/simdutf/tests/embed/valid_utf8.txt +0 -1
  743. package/deps/simdutf/tests/embed_tests.cpp +0 -22
  744. package/deps/simdutf/tests/find_tests.cpp +0 -77
  745. package/deps/simdutf/tests/fixed_string_tests.cpp +0 -153
  746. package/deps/simdutf/tests/helpers/CMakeLists.txt +0 -25
  747. package/deps/simdutf/tests/helpers/compiletime_conversions.h +0 -222
  748. package/deps/simdutf/tests/helpers/fixed_string.h +0 -267
  749. package/deps/simdutf/tests/helpers/random_int.cpp +0 -30
  750. package/deps/simdutf/tests/helpers/random_int.h +0 -39
  751. package/deps/simdutf/tests/helpers/random_utf16.cpp +0 -123
  752. package/deps/simdutf/tests/helpers/random_utf16.h +0 -52
  753. package/deps/simdutf/tests/helpers/random_utf32.cpp +0 -41
  754. package/deps/simdutf/tests/helpers/random_utf32.h +0 -40
  755. package/deps/simdutf/tests/helpers/random_utf8.cpp +0 -93
  756. package/deps/simdutf/tests/helpers/random_utf8.h +0 -36
  757. package/deps/simdutf/tests/helpers/test.cpp +0 -231
  758. package/deps/simdutf/tests/helpers/test.h +0 -193
  759. package/deps/simdutf/tests/helpers/transcode_test_base.cpp +0 -1257
  760. package/deps/simdutf/tests/helpers/transcode_test_base.h +0 -683
  761. package/deps/simdutf/tests/helpers/utf16.h +0 -27
  762. package/deps/simdutf/tests/installation_tests/find/CMakeLists.txt +0 -43
  763. package/deps/simdutf/tests/installation_tests/from_fetch/CMakeLists.txt +0 -47
  764. package/deps/simdutf/tests/internal_tests.cpp +0 -27
  765. package/deps/simdutf/tests/null_safety_tests.cpp +0 -94
  766. package/deps/simdutf/tests/random_fuzzer.cpp +0 -779
  767. package/deps/simdutf/tests/readme_tests.cpp +0 -274
  768. package/deps/simdutf/tests/reference/CMakeLists.txt +0 -23
  769. package/deps/simdutf/tests/reference/decode_utf16.h +0 -81
  770. package/deps/simdutf/tests/reference/decode_utf32.h +0 -47
  771. package/deps/simdutf/tests/reference/encode_latin1.cpp +0 -1
  772. package/deps/simdutf/tests/reference/encode_latin1.h +0 -32
  773. package/deps/simdutf/tests/reference/encode_utf16.cpp +0 -49
  774. package/deps/simdutf/tests/reference/encode_utf16.h +0 -20
  775. package/deps/simdutf/tests/reference/encode_utf32.cpp +0 -1
  776. package/deps/simdutf/tests/reference/encode_utf32.h +0 -36
  777. package/deps/simdutf/tests/reference/encode_utf8.cpp +0 -1
  778. package/deps/simdutf/tests/reference/encode_utf8.h +0 -40
  779. package/deps/simdutf/tests/reference/validate_utf16.cpp +0 -60
  780. package/deps/simdutf/tests/reference/validate_utf16.h +0 -14
  781. package/deps/simdutf/tests/reference/validate_utf16_to_latin1.cpp +0 -35
  782. package/deps/simdutf/tests/reference/validate_utf16_to_latin1.h +0 -13
  783. package/deps/simdutf/tests/reference/validate_utf32.cpp +0 -27
  784. package/deps/simdutf/tests/reference/validate_utf32.h +0 -12
  785. package/deps/simdutf/tests/reference/validate_utf32_to_latin1.cpp +0 -27
  786. package/deps/simdutf/tests/reference/validate_utf32_to_latin1.h +0 -12
  787. package/deps/simdutf/tests/reference/validate_utf8.cpp +0 -82
  788. package/deps/simdutf/tests/reference/validate_utf8.h +0 -11
  789. package/deps/simdutf/tests/reference/validate_utf8_to_latin1.cpp +0 -43
  790. package/deps/simdutf/tests/reference/validate_utf8_to_latin1.h +0 -12
  791. package/deps/simdutf/tests/select_implementation.cpp +0 -43
  792. package/deps/simdutf/tests/simdutf_c_tests.cpp +0 -244
  793. package/deps/simdutf/tests/span_tests.cpp +0 -401
  794. package/deps/simdutf/tests/special_tests.cpp +0 -559
  795. package/deps/simdutf/tests/straight_c_test.c +0 -187
  796. package/deps/simdutf/tests/text_encoding_tests.cpp +0 -77
  797. package/deps/simdutf/tests/to_well_formed_utf16_tests.cpp +0 -377
  798. package/deps/simdutf/tests/utf8_length_from_utf16_tests.cpp +0 -202
  799. package/deps/simdutf/tests/validate_ascii_basic_tests.cpp +0 -165
  800. package/deps/simdutf/tests/validate_ascii_with_errors_tests.cpp +0 -77
  801. package/deps/simdutf/tests/validate_utf16be_basic_tests.cpp +0 -175
  802. package/deps/simdutf/tests/validate_utf16be_with_errors_tests.cpp +0 -188
  803. package/deps/simdutf/tests/validate_utf16le_basic_tests.cpp +0 -268
  804. package/deps/simdutf/tests/validate_utf16le_with_errors_tests.cpp +0 -274
  805. package/deps/simdutf/tests/validate_utf32_basic_tests.cpp +0 -92
  806. package/deps/simdutf/tests/validate_utf32_with_errors_tests.cpp +0 -114
  807. package/deps/simdutf/tests/validate_utf8_basic_tests.cpp +0 -178
  808. package/deps/simdutf/tests/validate_utf8_brute_force_tests.cpp +0 -88
  809. package/deps/simdutf/tests/validate_utf8_puzzler_tests.cpp +0 -33
  810. package/deps/simdutf/tests/validate_utf8_with_errors_tests.cpp +0 -228
  811. package/deps/simdutf/tools/CMakeLists.txt +0 -85
  812. package/deps/simdutf/tools/fastbase64.cpp +0 -250
  813. package/deps/simdutf/tools/sutf.cpp +0 -556
  814. package/deps/simdutf/tools/sutf.h +0 -40
  815. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -1,856 +0,0 @@
1
- #include <ncrypto.h>
2
- #include <ncrypto/aead.h>
3
-
4
- #include <gtest/gtest.h>
5
- #include <string>
6
-
7
- using namespace ncrypto;
8
-
9
- // Convenience class for creating buffers in tests
10
- struct TestBuf : public std::string {
11
- TestBuf(const std::string& constStr)
12
- : std::string(constStr),
13
- buf{reinterpret_cast<unsigned char*>(data()), size()} {}
14
- TestBuf(size_t n) : TestBuf(std::string(n, 0)) {}
15
-
16
- operator Buffer<unsigned char>&() { return buf; }
17
-
18
- Buffer<const unsigned char> asConst() const {
19
- return Buffer<const unsigned char>{
20
- .data = reinterpret_cast<const unsigned char*>(data()), .len = size()};
21
- }
22
-
23
- private:
24
- Buffer<unsigned char> buf;
25
- };
26
-
27
- #include <string>
28
- #include <unordered_set>
29
-
30
- using namespace ncrypto;
31
-
32
- TEST(basic, cipher_foreach) {
33
- std::unordered_set<std::string> foundCiphers;
34
-
35
- Cipher::ForEach([&](const char* name) { foundCiphers.insert(name); });
36
-
37
- // When testing Cipher::ForEach, we cannot expect a particular list of ciphers
38
- // as that depends on openssl vs boringssl, versions, configuration, etc.
39
- // Instead, we look for a couple of very common ciphers that should always be
40
- // present.
41
- ASSERT_TRUE(foundCiphers.count("aes-128-ctr") ||
42
- foundCiphers.count("AES-128-CTR"));
43
- ASSERT_TRUE(foundCiphers.count("aes-256-cbc") ||
44
- foundCiphers.count("AES-256-CBC"));
45
- }
46
-
47
- TEST(BignumPointer, bitLength) {
48
- // Test empty/null BignumPointer
49
- BignumPointer empty;
50
- ASSERT_EQ(empty.bitLength(), 0);
51
-
52
- // Test zero value
53
- auto zero = BignumPointer::New();
54
- ASSERT_TRUE(zero);
55
- ASSERT_TRUE(zero.setWord(0));
56
- ASSERT_EQ(zero.bitLength(), 0);
57
-
58
- // Test value 1 (1 bit)
59
- auto one = BignumPointer::New();
60
- ASSERT_TRUE(one);
61
- ASSERT_TRUE(one.setWord(1));
62
- ASSERT_EQ(one.bitLength(), 1);
63
-
64
- // Test value 2 (2 bits: 10 in binary)
65
- auto two = BignumPointer::New();
66
- ASSERT_TRUE(two);
67
- ASSERT_TRUE(two.setWord(2));
68
- ASSERT_EQ(two.bitLength(), 2);
69
-
70
- // Test value 255 (8 bits: 11111111 in binary)
71
- auto byte = BignumPointer::New();
72
- ASSERT_TRUE(byte);
73
- ASSERT_TRUE(byte.setWord(255));
74
- ASSERT_EQ(byte.bitLength(), 8);
75
-
76
- // Test value 256 (9 bits: 100000000 in binary)
77
- auto nineBits = BignumPointer::New();
78
- ASSERT_TRUE(nineBits);
79
- ASSERT_TRUE(nineBits.setWord(256));
80
- ASSERT_EQ(nineBits.bitLength(), 9);
81
-
82
- // Test larger value (0xFFFFFFFF = 32 bits)
83
- auto thirtyTwoBits = BignumPointer::New();
84
- ASSERT_TRUE(thirtyTwoBits);
85
- ASSERT_TRUE(thirtyTwoBits.setWord(0xFFFFFFFF));
86
- ASSERT_EQ(thirtyTwoBits.bitLength(), 32);
87
- }
88
-
89
- TEST(BignumPointer, byteLength) {
90
- // Test empty/null BignumPointer
91
- BignumPointer empty;
92
- ASSERT_EQ(empty.byteLength(), 0);
93
-
94
- // Test zero value
95
- auto zero = BignumPointer::New();
96
- ASSERT_TRUE(zero);
97
- ASSERT_TRUE(zero.setWord(0));
98
- ASSERT_EQ(zero.byteLength(), 0);
99
-
100
- // Test value 1 (1 byte)
101
- auto one = BignumPointer::New();
102
- ASSERT_TRUE(one);
103
- ASSERT_TRUE(one.setWord(1));
104
- ASSERT_EQ(one.byteLength(), 1);
105
-
106
- // Test value 255 (1 byte)
107
- auto byte = BignumPointer::New();
108
- ASSERT_TRUE(byte);
109
- ASSERT_TRUE(byte.setWord(255));
110
- ASSERT_EQ(byte.byteLength(), 1);
111
-
112
- // Test value 256 (2 bytes)
113
- auto twoBytes = BignumPointer::New();
114
- ASSERT_TRUE(twoBytes);
115
- ASSERT_TRUE(twoBytes.setWord(256));
116
- ASSERT_EQ(twoBytes.byteLength(), 2);
117
-
118
- // Test larger value (0xFFFFFFFF = 4 bytes)
119
- auto fourBytes = BignumPointer::New();
120
- ASSERT_TRUE(fourBytes);
121
- ASSERT_TRUE(fourBytes.setWord(0xFFFFFFFF));
122
- ASSERT_EQ(fourBytes.byteLength(), 4);
123
- }
124
-
125
- // ============================================================================
126
- // Ec class tests
127
-
128
- // Helper to create an EC key for testing
129
- static ECKeyPointer createTestEcKey() {
130
- // NID_X9_62_prime256v1 is P-256
131
- auto key = ECKeyPointer::NewByCurveName(NID_X9_62_prime256v1);
132
- if (key && EC_KEY_generate_key(key.get())) {
133
- return key;
134
- }
135
- return {};
136
- }
137
-
138
- TEST(Ec, getDegree) {
139
- auto ecKey = createTestEcKey();
140
- ASSERT_TRUE(ecKey);
141
-
142
- Ec ec(ecKey.get());
143
- ASSERT_TRUE(ec);
144
-
145
- // P-256 has degree 256
146
- ASSERT_EQ(ec.getDegree(), 256u);
147
- }
148
-
149
- TEST(Ec, getCurveName) {
150
- auto ecKey = createTestEcKey();
151
- ASSERT_TRUE(ecKey);
152
-
153
- Ec ec(ecKey.get());
154
- ASSERT_TRUE(ec);
155
-
156
- // P-256 is also known as prime256v1
157
- std::string name = ec.getCurveName();
158
- ASSERT_TRUE(name == "prime256v1" || name == "P-256");
159
- }
160
-
161
- TEST(Ec, getPublicKey) {
162
- auto ecKey = createTestEcKey();
163
- ASSERT_TRUE(ecKey);
164
-
165
- Ec ec(ecKey.get());
166
- ASSERT_TRUE(ec);
167
-
168
- // Public key should exist
169
- const EC_POINT* pubKey = ec.getPublicKey();
170
- ASSERT_NE(pubKey, nullptr);
171
- }
172
-
173
- TEST(Ec, getPrivateKey) {
174
- auto ecKey = createTestEcKey();
175
- ASSERT_TRUE(ecKey);
176
-
177
- Ec ec(ecKey.get());
178
- ASSERT_TRUE(ec);
179
-
180
- // Private key should exist for a generated key
181
- const BIGNUM* privKey = ec.getPrivateKey();
182
- ASSERT_NE(privKey, nullptr);
183
- }
184
-
185
- TEST(Ec, getXYCoordinates) {
186
- auto ecKey = createTestEcKey();
187
- ASSERT_TRUE(ecKey);
188
-
189
- Ec ec(ecKey.get());
190
- ASSERT_TRUE(ec);
191
-
192
- // X and Y coordinates should be populated
193
- const BignumPointer& x = ec.getX();
194
- const BignumPointer& y = ec.getY();
195
-
196
- ASSERT_TRUE(x);
197
- ASSERT_TRUE(y);
198
-
199
- // For P-256, coordinates should be 256 bits (32 bytes)
200
- ASSERT_GT(x.byteLength(), 0u);
201
- ASSERT_LE(x.byteLength(), 32u);
202
- ASSERT_GT(y.byteLength(), 0u);
203
- ASSERT_LE(y.byteLength(), 32u);
204
- }
205
-
206
- TEST(Ec, getCurve) {
207
- auto ecKey = createTestEcKey();
208
- ASSERT_TRUE(ecKey);
209
-
210
- Ec ec(ecKey.get());
211
- ASSERT_TRUE(ec);
212
-
213
- // getCurve should return the NID for P-256
214
- int curve = ec.getCurve();
215
- ASSERT_EQ(curve, NID_X9_62_prime256v1);
216
- }
217
-
218
- TEST(Ec, GetCurves) {
219
- std::vector<std::string> curves;
220
-
221
- bool result = Ec::GetCurves([&](const char* name) {
222
- curves.push_back(name);
223
- return true;
224
- });
225
-
226
- ASSERT_TRUE(result);
227
- // Should have at least some built-in curves
228
- ASSERT_GT(curves.size(), 0u);
229
-
230
- // Check that common curves are present
231
- bool hasP256 = false;
232
- bool hasP384 = false;
233
- for (const auto& curve : curves) {
234
- if (curve == "prime256v1" || curve == "P-256") hasP256 = true;
235
- if (curve == "secp384r1" || curve == "P-384") hasP384 = true;
236
- }
237
- ASSERT_TRUE(hasP256);
238
- ASSERT_TRUE(hasP384);
239
- }
240
-
241
- TEST(Ec, GetCurves_early_exit) {
242
- int count = 0;
243
-
244
- // Test that returning false stops iteration
245
- bool result = Ec::GetCurves([&](const char* name) {
246
- count++;
247
- return count < 3; // Stop after 2 curves
248
- });
249
-
250
- ASSERT_FALSE(result);
251
- ASSERT_EQ(count, 3);
252
- }
253
-
254
- // ============================================================================
255
- // EVPKeyPointer tests
256
-
257
- TEST(EVPKeyPointer, operatorEc) {
258
- auto ecKey = createTestEcKey();
259
- ASSERT_TRUE(ecKey);
260
-
261
- // Create EVPKeyPointer from EC_KEY
262
- EVPKeyPointer key(EVP_PKEY_new());
263
- ASSERT_TRUE(key);
264
- ASSERT_TRUE(EVP_PKEY_set1_EC_KEY(key.get(), ecKey.get()));
265
-
266
- // Convert to Ec
267
- Ec ec = key;
268
- ASSERT_TRUE(ec);
269
- ASSERT_EQ(ec.getDegree(), 256u);
270
- }
271
-
272
- TEST(EVPKeyPointer, clone) {
273
- auto ecKey = createTestEcKey();
274
- ASSERT_TRUE(ecKey);
275
-
276
- // Create EVPKeyPointer from EC_KEY
277
- EVPKeyPointer key(EVP_PKEY_new());
278
- ASSERT_TRUE(key);
279
- ASSERT_TRUE(EVP_PKEY_set1_EC_KEY(key.get(), ecKey.get()));
280
-
281
- // Clone the key
282
- auto cloned = key.clone();
283
- ASSERT_TRUE(cloned);
284
-
285
- // Both should be valid
286
- ASSERT_TRUE(key);
287
- ASSERT_TRUE(cloned);
288
-
289
- // Both should have the same key type
290
- ASSERT_EQ(key.id(), cloned.id());
291
- }
292
-
293
- TEST(EVPKeyPointer, cloneEmpty) {
294
- EVPKeyPointer empty;
295
- ASSERT_FALSE(empty);
296
-
297
- // Clone of empty should be empty
298
- auto cloned = empty.clone();
299
- ASSERT_FALSE(cloned);
300
- }
301
-
302
- // ============================================================================
303
- // KDF tests
304
-
305
- TEST(KDF, pbkdf2Into) {
306
- const char* password = "password";
307
- const unsigned char salt[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
308
- const size_t length = 32;
309
-
310
- Buffer<const char> passBuf{password, strlen(password)};
311
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
312
-
313
- unsigned char output[32];
314
- Buffer<unsigned char> outBuf{output, length};
315
-
316
- Digest md(EVP_sha256());
317
- ASSERT_TRUE(md);
318
-
319
- bool result = pbkdf2Into(md, passBuf, saltBuf, 1000, length, &outBuf);
320
- ASSERT_TRUE(result);
321
-
322
- // Verify output is not all zeros
323
- bool allZeros = true;
324
- for (size_t i = 0; i < length; i++) {
325
- if (output[i] != 0) {
326
- allZeros = false;
327
- break;
328
- }
329
- }
330
- ASSERT_FALSE(allZeros);
331
- }
332
-
333
- TEST(KDF, pbkdf2) {
334
- const char* password = "password";
335
- const unsigned char salt[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
336
- const size_t length = 32;
337
-
338
- Buffer<const char> passBuf{password, strlen(password)};
339
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
340
-
341
- Digest md(EVP_sha256());
342
- ASSERT_TRUE(md);
343
-
344
- auto result = pbkdf2(md, passBuf, saltBuf, 1000, length);
345
- ASSERT_TRUE(result);
346
- ASSERT_EQ(result.size(), length);
347
- }
348
-
349
- TEST(KDF, scryptInto) {
350
- const char* password = "password";
351
- const unsigned char salt[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
352
- const size_t length = 32;
353
-
354
- Buffer<const char> passBuf{password, strlen(password)};
355
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
356
-
357
- unsigned char output[32];
358
- Buffer<unsigned char> outBuf{output, length};
359
-
360
- // Use small parameters for testing
361
- bool result = scryptInto(passBuf, saltBuf, 16, 1, 1, 0, length, &outBuf);
362
- ASSERT_TRUE(result);
363
-
364
- // Verify output is not all zeros
365
- bool allZeros = true;
366
- for (size_t i = 0; i < length; i++) {
367
- if (output[i] != 0) {
368
- allZeros = false;
369
- break;
370
- }
371
- }
372
- ASSERT_FALSE(allZeros);
373
- }
374
-
375
- TEST(KDF, scrypt) {
376
- const char* password = "password";
377
- const unsigned char salt[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
378
- const size_t length = 32;
379
-
380
- Buffer<const char> passBuf{password, strlen(password)};
381
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
382
-
383
- // Use small parameters for testing
384
- auto result = scrypt(passBuf, saltBuf, 16, 1, 1, 0, length);
385
- ASSERT_TRUE(result);
386
- ASSERT_EQ(result.size(), length);
387
- }
388
-
389
- TEST(KDF, hkdfInfo) {
390
- const unsigned char key[] = {0x0b,
391
- 0x0b,
392
- 0x0b,
393
- 0x0b,
394
- 0x0b,
395
- 0x0b,
396
- 0x0b,
397
- 0x0b,
398
- 0x0b,
399
- 0x0b,
400
- 0x0b,
401
- 0x0b,
402
- 0x0b,
403
- 0x0b,
404
- 0x0b,
405
- 0x0b};
406
- const unsigned char salt[] = {
407
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09};
408
- const unsigned char info[] = {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7};
409
- const size_t length = 42;
410
-
411
- Buffer<const unsigned char> keyBuf{key, sizeof(key)};
412
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
413
- Buffer<const unsigned char> infoBuf{info, sizeof(info)};
414
-
415
- unsigned char output[42];
416
- Buffer<unsigned char> outBuf{output, length};
417
-
418
- Digest md(EVP_sha256());
419
- ASSERT_TRUE(md);
420
-
421
- bool result = hkdfInfo(md, keyBuf, infoBuf, saltBuf, length, &outBuf);
422
- ASSERT_TRUE(result);
423
-
424
- // Verify output is not all zeros
425
- bool allZeros = true;
426
- for (size_t i = 0; i < length; i++) {
427
- if (output[i] != 0) {
428
- allZeros = false;
429
- break;
430
- }
431
- }
432
- ASSERT_FALSE(allZeros);
433
- }
434
-
435
- TEST(KDF, hkdf) {
436
- const unsigned char key[] = {0x0b,
437
- 0x0b,
438
- 0x0b,
439
- 0x0b,
440
- 0x0b,
441
- 0x0b,
442
- 0x0b,
443
- 0x0b,
444
- 0x0b,
445
- 0x0b,
446
- 0x0b,
447
- 0x0b,
448
- 0x0b,
449
- 0x0b,
450
- 0x0b,
451
- 0x0b};
452
- const unsigned char salt[] = {
453
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09};
454
- const unsigned char info[] = {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7};
455
- const size_t length = 42;
456
-
457
- Buffer<const unsigned char> keyBuf{key, sizeof(key)};
458
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
459
- Buffer<const unsigned char> infoBuf{info, sizeof(info)};
460
-
461
- Digest md(EVP_sha256());
462
- ASSERT_TRUE(md);
463
-
464
- auto result = hkdf(md, keyBuf, infoBuf, saltBuf, length);
465
- ASSERT_TRUE(result);
466
- ASSERT_EQ(result.size(), length);
467
- }
468
-
469
- // ============================================================================
470
- // SPKAC tests
471
-
472
- TEST(SPKAC, VerifySpkacBuffer) {
473
- // A valid SPKAC string (base64 encoded)
474
- // This is a test SPKAC - in real use, you'd have a properly generated one
475
- const char* spkac =
476
- "MIIBQDCBqjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2L3lR6VHBxKBZGnr"
477
- "5R9AmJwcQPePMHl7X1tj0n5PKMXwXHLqD/xHtqWFN9aSWfZhCYVOYMPLsIEZvtsJ"
478
- "qFCJzJXB7lYlLqcLLVJ5sDlT0fM8QiJR6CnBlWgaXEozL5XdKJdQ7UVlL1qqoLJP"
479
- "8wLJ0PhXFaNvlNBaXx1lAx0CAwEAARYAMA0GCSqGSIb3DQEBBQUAA4GBAKMzhfqX"
480
- "MvWRBfL+VNVX/3rE9IahSMPl/Dz0P4UO0MtDgYFR4N0tPPqg1EMH7HJRxPJQDUlf"
481
- "M9TsMI8e8KfJX0VdPmmjvNy3LcboJqmqQ8TViV2U0K0mTgg3kEWdKl25QcleVQry"
482
- "CqU2ThYNnK3QEbFwuTS4MHk4MHk2WHJoYzlk";
483
-
484
- Buffer<const char> buf{spkac, strlen(spkac)};
485
-
486
- // Note: This specific SPKAC may not verify correctly due to signature issues,
487
- // but we're testing that the function runs without crashing and accepts the
488
- // buffer interface
489
- bool result = VerifySpkac(buf);
490
- // The result depends on the validity of the SPKAC
491
- (void)result;
492
- }
493
-
494
- TEST(SPKAC, ExportPublicKeyBuffer) {
495
- const char* spkac =
496
- "MIIBQDCBqjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2L3lR6VHBxKBZGnr"
497
- "5R9AmJwcQPePMHl7X1tj0n5PKMXwXHLqD/xHtqWFN9aSWfZhCYVOYMPLsIEZvtsJ"
498
- "qFCJzJXB7lYlLqcLLVJ5sDlT0fM8QiJR6CnBlWgaXEozL5XdKJdQ7UVlL1qqoLJP"
499
- "8wLJ0PhXFaNvlNBaXx1lAx0CAwEAARYAMA0GCSqGSIb3DQEBBQUAA4GBAKMzhfqX"
500
- "MvWRBfL+VNVX/3rE9IahSMPl/Dz0P4UO0MtDgYFR4N0tPPqg1EMH7HJRxPJQDUlf"
501
- "M9TsMI8e8KfJX0VdPmmjvNy3LcboJqmqQ8TViV2U0K0mTgg3kEWdKl25QcleVQry"
502
- "CqU2ThYNnK3QEbFwuTS4MHk4MHk2WHJoYzlk";
503
-
504
- Buffer<const char> buf{spkac, strlen(spkac)};
505
-
506
- // Test that the buffer version works
507
- auto bio = ExportPublicKey(buf);
508
- // Result depends on SPKAC validity
509
- (void)bio;
510
- }
511
-
512
- TEST(SPKAC, ExportChallengeBuffer) {
513
- const char* spkac =
514
- "MIIBQDCBqjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2L3lR6VHBxKBZGnr"
515
- "5R9AmJwcQPePMHl7X1tj0n5PKMXwXHLqD/xHtqWFN9aSWfZhCYVOYMPLsIEZvtsJ"
516
- "qFCJzJXB7lYlLqcLLVJ5sDlT0fM8QiJR6CnBlWgaXEozL5XdKJdQ7UVlL1qqoLJP"
517
- "8wLJ0PhXFaNvlNBaXx1lAx0CAwEAARYAMA0GCSqGSIb3DQEBBQUAA4GBAKMzhfqX"
518
- "MvWRBfL+VNVX/3rE9IahSMPl/Dz0P4UO0MtDgYFR4N0tPPqg1EMH7HJRxPJQDUlf"
519
- "M9TsMI8e8KfJX0VdPmmjvNy3LcboJqmqQ8TViV2U0K0mTgg3kEWdKl25QcleVQry"
520
- "CqU2ThYNnK3QEbFwuTS4MHk4MHk2WHJoYzlk";
521
-
522
- Buffer<const char> buf{spkac, strlen(spkac)};
523
-
524
- // Test that the buffer version works and returns DataPointer
525
- auto challenge = ExportChallenge(buf);
526
- // Result depends on SPKAC validity
527
- (void)challenge;
528
- }
529
-
530
- #ifdef OPENSSL_IS_BORINGSSL
531
- TEST(basic, chacha20_poly1305) {
532
- unsigned char key[] = {0xde, 0xad, 0xbe, 0xef, 0x00, 0x01, 0x02, 0x03,
533
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
534
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
535
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7};
536
-
537
- auto aead = Aead::CHACHA20_POLY1305;
538
- auto encryptCtx = AeadCtxPointer::New(aead, true, key, aead.getKeyLength());
539
-
540
- TestBuf input("Hello world");
541
- TestBuf tag(aead.getMaxTagLength());
542
- TestBuf nonce(aead.getNonceLength());
543
- TestBuf aad("I dunno man");
544
- TestBuf encryptOutput(input.size());
545
-
546
- auto encryptOk = encryptCtx.encrypt(
547
- input.asConst(), encryptOutput, tag, nonce.asConst(), aad.asConst());
548
- ASSERT_TRUE(encryptOk);
549
- ASSERT_NE(input, encryptOutput);
550
-
551
- auto decryptCtx = AeadCtxPointer::New(aead, false, key, aead.getKeyLength());
552
-
553
- TestBuf decryptOutput(encryptOutput.size());
554
-
555
- auto decryptOk = decryptCtx.decrypt(encryptOutput.asConst(),
556
- decryptOutput,
557
- tag.asConst(),
558
- nonce.asConst(),
559
- aad.asConst());
560
- ASSERT_TRUE(decryptOk);
561
- ASSERT_EQ(input, decryptOutput);
562
- }
563
-
564
- TEST(basic, aead_info) {
565
- auto aead = Aead::FromName("aEs-256-gcM"); // spongebob does encryption
566
- ASSERT_EQ(aead.getName(), "aes-256-gcm");
567
- ASSERT_EQ(aead.getModeLabel(), "gcm");
568
- ASSERT_EQ(aead.getBlockSize(), 1);
569
- ASSERT_EQ(aead.getNonceLength(), 12);
570
- ASSERT_EQ(aead.getMaxTagLength(), 16);
571
- }
572
- #endif
573
-
574
- // ============================================================================
575
- // Argon2 KDF tests (OpenSSL 3.2.0+ only)
576
-
577
- #if OPENSSL_VERSION_NUMBER >= 0x30200000L
578
- #ifndef OPENSSL_NO_ARGON2
579
-
580
- TEST(KDF, argon2i) {
581
- const char* password = "password";
582
- const unsigned char salt[] = {0x01,
583
- 0x02,
584
- 0x03,
585
- 0x04,
586
- 0x05,
587
- 0x06,
588
- 0x07,
589
- 0x08,
590
- 0x09,
591
- 0x0a,
592
- 0x0b,
593
- 0x0c,
594
- 0x0d,
595
- 0x0e,
596
- 0x0f,
597
- 0x10};
598
- const size_t length = 32;
599
-
600
- Buffer<const char> passBuf{password, strlen(password)};
601
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
602
- Buffer<const unsigned char> secret{nullptr, 0};
603
- Buffer<const unsigned char> ad{nullptr, 0};
604
-
605
- // Use small parameters for testing
606
- // lanes=1, memcost=16 (KB), iter=3, version=0x13 (1.3)
607
- auto result = argon2(passBuf,
608
- saltBuf,
609
- 1,
610
- length,
611
- 16,
612
- 3,
613
- 0x13,
614
- secret,
615
- ad,
616
- Argon2Type::ARGON2I);
617
- ASSERT_TRUE(result);
618
- ASSERT_EQ(result.size(), length);
619
-
620
- // Verify output is not all zeros
621
- bool allZeros = true;
622
- for (size_t i = 0; i < length; i++) {
623
- if (reinterpret_cast<unsigned char*>(result.get())[i] != 0) {
624
- allZeros = false;
625
- break;
626
- }
627
- }
628
- ASSERT_FALSE(allZeros);
629
- }
630
-
631
- TEST(KDF, argon2d) {
632
- const char* password = "password";
633
- const unsigned char salt[] = {0x01,
634
- 0x02,
635
- 0x03,
636
- 0x04,
637
- 0x05,
638
- 0x06,
639
- 0x07,
640
- 0x08,
641
- 0x09,
642
- 0x0a,
643
- 0x0b,
644
- 0x0c,
645
- 0x0d,
646
- 0x0e,
647
- 0x0f,
648
- 0x10};
649
- const size_t length = 32;
650
-
651
- Buffer<const char> passBuf{password, strlen(password)};
652
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
653
- Buffer<const unsigned char> secret{nullptr, 0};
654
- Buffer<const unsigned char> ad{nullptr, 0};
655
-
656
- auto result = argon2(passBuf,
657
- saltBuf,
658
- 1,
659
- length,
660
- 16,
661
- 3,
662
- 0x13,
663
- secret,
664
- ad,
665
- Argon2Type::ARGON2D);
666
- ASSERT_TRUE(result);
667
- ASSERT_EQ(result.size(), length);
668
- }
669
-
670
- TEST(KDF, argon2id) {
671
- const char* password = "password";
672
- const unsigned char salt[] = {0x01,
673
- 0x02,
674
- 0x03,
675
- 0x04,
676
- 0x05,
677
- 0x06,
678
- 0x07,
679
- 0x08,
680
- 0x09,
681
- 0x0a,
682
- 0x0b,
683
- 0x0c,
684
- 0x0d,
685
- 0x0e,
686
- 0x0f,
687
- 0x10};
688
- const size_t length = 32;
689
-
690
- Buffer<const char> passBuf{password, strlen(password)};
691
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
692
- Buffer<const unsigned char> secret{nullptr, 0};
693
- Buffer<const unsigned char> ad{nullptr, 0};
694
-
695
- auto result = argon2(passBuf,
696
- saltBuf,
697
- 1,
698
- length,
699
- 16,
700
- 3,
701
- 0x13,
702
- secret,
703
- ad,
704
- Argon2Type::ARGON2ID);
705
- ASSERT_TRUE(result);
706
- ASSERT_EQ(result.size(), length);
707
- }
708
-
709
- TEST(KDF, argon2_with_secret_and_ad) {
710
- const char* password = "password";
711
- const unsigned char salt[] = {0x01,
712
- 0x02,
713
- 0x03,
714
- 0x04,
715
- 0x05,
716
- 0x06,
717
- 0x07,
718
- 0x08,
719
- 0x09,
720
- 0x0a,
721
- 0x0b,
722
- 0x0c,
723
- 0x0d,
724
- 0x0e,
725
- 0x0f,
726
- 0x10};
727
- const unsigned char secretData[] = {0xaa, 0xbb, 0xcc, 0xdd};
728
- const unsigned char adData[] = {0x11, 0x22, 0x33, 0x44, 0x55};
729
- const size_t length = 32;
730
-
731
- Buffer<const char> passBuf{password, strlen(password)};
732
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
733
- Buffer<const unsigned char> secret{secretData, sizeof(secretData)};
734
- Buffer<const unsigned char> ad{adData, sizeof(adData)};
735
-
736
- auto result = argon2(passBuf,
737
- saltBuf,
738
- 1,
739
- length,
740
- 16,
741
- 3,
742
- 0x13,
743
- secret,
744
- ad,
745
- Argon2Type::ARGON2ID);
746
- ASSERT_TRUE(result);
747
- ASSERT_EQ(result.size(), length);
748
- }
749
-
750
- TEST(KDF, argon2_empty_password) {
751
- const unsigned char salt[] = {0x01,
752
- 0x02,
753
- 0x03,
754
- 0x04,
755
- 0x05,
756
- 0x06,
757
- 0x07,
758
- 0x08,
759
- 0x09,
760
- 0x0a,
761
- 0x0b,
762
- 0x0c,
763
- 0x0d,
764
- 0x0e,
765
- 0x0f,
766
- 0x10};
767
- const size_t length = 32;
768
-
769
- Buffer<const char> passBuf{"", 0};
770
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
771
- Buffer<const unsigned char> secret{nullptr, 0};
772
- Buffer<const unsigned char> ad{nullptr, 0};
773
-
774
- // Empty password should still work
775
- auto result = argon2(passBuf,
776
- saltBuf,
777
- 1,
778
- length,
779
- 16,
780
- 3,
781
- 0x13,
782
- secret,
783
- ad,
784
- Argon2Type::ARGON2ID);
785
- ASSERT_TRUE(result);
786
- ASSERT_EQ(result.size(), length);
787
- }
788
-
789
- TEST(KDF, argon2_different_types_produce_different_output) {
790
- const char* password = "password";
791
- const unsigned char salt[] = {0x01,
792
- 0x02,
793
- 0x03,
794
- 0x04,
795
- 0x05,
796
- 0x06,
797
- 0x07,
798
- 0x08,
799
- 0x09,
800
- 0x0a,
801
- 0x0b,
802
- 0x0c,
803
- 0x0d,
804
- 0x0e,
805
- 0x0f,
806
- 0x10};
807
- const size_t length = 32;
808
-
809
- Buffer<const char> passBuf{password, strlen(password)};
810
- Buffer<const unsigned char> saltBuf{salt, sizeof(salt)};
811
- Buffer<const unsigned char> secret{nullptr, 0};
812
- Buffer<const unsigned char> ad{nullptr, 0};
813
-
814
- auto resultI = argon2(passBuf,
815
- saltBuf,
816
- 1,
817
- length,
818
- 16,
819
- 3,
820
- 0x13,
821
- secret,
822
- ad,
823
- Argon2Type::ARGON2I);
824
- auto resultD = argon2(passBuf,
825
- saltBuf,
826
- 1,
827
- length,
828
- 16,
829
- 3,
830
- 0x13,
831
- secret,
832
- ad,
833
- Argon2Type::ARGON2D);
834
- auto resultID = argon2(passBuf,
835
- saltBuf,
836
- 1,
837
- length,
838
- 16,
839
- 3,
840
- 0x13,
841
- secret,
842
- ad,
843
- Argon2Type::ARGON2ID);
844
-
845
- ASSERT_TRUE(resultI);
846
- ASSERT_TRUE(resultD);
847
- ASSERT_TRUE(resultID);
848
-
849
- // All three types should produce different outputs
850
- ASSERT_NE(memcmp(resultI.get(), resultD.get(), length), 0);
851
- ASSERT_NE(memcmp(resultI.get(), resultID.get(), length), 0);
852
- ASSERT_NE(memcmp(resultD.get(), resultID.get(), length), 0);
853
- }
854
-
855
- #endif // OPENSSL_NO_ARGON2
856
- #endif // OPENSSL_VERSION_NUMBER >= 0x30200000L