@hxa-rn/react-native-quick-crypto 1.1.0-beta.1

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 (1236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +171 -0
  3. package/dist/commonjs/argon2.js +39 -0
  4. package/dist/commonjs/argon2.js.map +1 -0
  5. package/dist/commonjs/blake3.js +106 -0
  6. package/dist/commonjs/blake3.js.map +1 -0
  7. package/dist/commonjs/certificate.js +35 -0
  8. package/dist/commonjs/certificate.js.map +1 -0
  9. package/dist/commonjs/cipher.js +202 -0
  10. package/dist/commonjs/cipher.js.map +1 -0
  11. package/dist/commonjs/constants.js +32 -0
  12. package/dist/commonjs/constants.js.map +1 -0
  13. package/dist/commonjs/dh-groups.js +29 -0
  14. package/dist/commonjs/dh-groups.js.map +1 -0
  15. package/dist/commonjs/dhKeyPair.js +113 -0
  16. package/dist/commonjs/dhKeyPair.js.map +1 -0
  17. package/dist/commonjs/diffie-hellman.js +155 -0
  18. package/dist/commonjs/diffie-hellman.js.map +1 -0
  19. package/dist/commonjs/dsa.js +96 -0
  20. package/dist/commonjs/dsa.js.map +1 -0
  21. package/dist/commonjs/ec.js +368 -0
  22. package/dist/commonjs/ec.js.map +1 -0
  23. package/dist/commonjs/ecdh.js +114 -0
  24. package/dist/commonjs/ecdh.js.map +1 -0
  25. package/dist/commonjs/ed.js +395 -0
  26. package/dist/commonjs/ed.js.map +1 -0
  27. package/dist/commonjs/expo-plugin/@types.js +2 -0
  28. package/dist/commonjs/expo-plugin/@types.js.map +1 -0
  29. package/dist/commonjs/expo-plugin/withRNQC.js +25 -0
  30. package/dist/commonjs/expo-plugin/withRNQC.js.map +1 -0
  31. package/dist/commonjs/expo-plugin/withSodiumAndroid.js +25 -0
  32. package/dist/commonjs/expo-plugin/withSodiumAndroid.js.map +1 -0
  33. package/dist/commonjs/expo-plugin/withSodiumIos.js +23 -0
  34. package/dist/commonjs/expo-plugin/withSodiumIos.js.map +1 -0
  35. package/dist/commonjs/expo-plugin/withXCode.js +51 -0
  36. package/dist/commonjs/expo-plugin/withXCode.js.map +1 -0
  37. package/dist/commonjs/hash.js +241 -0
  38. package/dist/commonjs/hash.js.map +1 -0
  39. package/dist/commonjs/hkdf.js +81 -0
  40. package/dist/commonjs/hkdf.js.map +1 -0
  41. package/dist/commonjs/hmac.js +121 -0
  42. package/dist/commonjs/hmac.js.map +1 -0
  43. package/dist/commonjs/index.js +358 -0
  44. package/dist/commonjs/index.js.map +1 -0
  45. package/dist/commonjs/keys/classes.js +272 -0
  46. package/dist/commonjs/keys/classes.js.map +1 -0
  47. package/dist/commonjs/keys/generateKeyPair.js +156 -0
  48. package/dist/commonjs/keys/generateKeyPair.js.map +1 -0
  49. package/dist/commonjs/keys/index.js +327 -0
  50. package/dist/commonjs/keys/index.js.map +1 -0
  51. package/dist/commonjs/keys/publicCipher.js +165 -0
  52. package/dist/commonjs/keys/publicCipher.js.map +1 -0
  53. package/dist/commonjs/keys/signVerify.js +225 -0
  54. package/dist/commonjs/keys/signVerify.js.map +1 -0
  55. package/dist/commonjs/keys/utils.js +123 -0
  56. package/dist/commonjs/keys/utils.js.map +1 -0
  57. package/dist/commonjs/mldsa.js +74 -0
  58. package/dist/commonjs/mldsa.js.map +1 -0
  59. package/dist/commonjs/mlkem.js +224 -0
  60. package/dist/commonjs/mlkem.js.map +1 -0
  61. package/dist/commonjs/pbkdf2.js +106 -0
  62. package/dist/commonjs/pbkdf2.js.map +1 -0
  63. package/dist/commonjs/prime.js +96 -0
  64. package/dist/commonjs/prime.js.map +1 -0
  65. package/dist/commonjs/random.js +233 -0
  66. package/dist/commonjs/random.js.map +1 -0
  67. package/dist/commonjs/rsa.js +207 -0
  68. package/dist/commonjs/rsa.js.map +1 -0
  69. package/dist/commonjs/scrypt.js +98 -0
  70. package/dist/commonjs/scrypt.js.map +1 -0
  71. package/dist/commonjs/specs/v1/NativeQuickCrypto.js +17 -0
  72. package/dist/commonjs/specs/v1/NativeQuickCrypto.js.map +1 -0
  73. package/dist/commonjs/specs/v1/argon2.nitro.js +6 -0
  74. package/dist/commonjs/specs/v1/argon2.nitro.js.map +1 -0
  75. package/dist/commonjs/specs/v1/blake3.nitro.js +6 -0
  76. package/dist/commonjs/specs/v1/blake3.nitro.js.map +1 -0
  77. package/dist/commonjs/specs/v1/certificate.nitro.js +6 -0
  78. package/dist/commonjs/specs/v1/certificate.nitro.js.map +1 -0
  79. package/dist/commonjs/specs/v1/cipher.nitro.js +6 -0
  80. package/dist/commonjs/specs/v1/cipher.nitro.js.map +1 -0
  81. package/dist/commonjs/specs/v1/dhKeyPair.nitro.js +6 -0
  82. package/dist/commonjs/specs/v1/dhKeyPair.nitro.js.map +1 -0
  83. package/dist/commonjs/specs/v1/diffie-hellman.nitro.js +6 -0
  84. package/dist/commonjs/specs/v1/diffie-hellman.nitro.js.map +1 -0
  85. package/dist/commonjs/specs/v1/dsaKeyPair.nitro.js +6 -0
  86. package/dist/commonjs/specs/v1/dsaKeyPair.nitro.js.map +1 -0
  87. package/dist/commonjs/specs/v1/ecKeyPair.nitro.js +6 -0
  88. package/dist/commonjs/specs/v1/ecKeyPair.nitro.js.map +1 -0
  89. package/dist/commonjs/specs/v1/ecdh.nitro.js +6 -0
  90. package/dist/commonjs/specs/v1/ecdh.nitro.js.map +1 -0
  91. package/dist/commonjs/specs/v1/edKeyPair.nitro.js +6 -0
  92. package/dist/commonjs/specs/v1/edKeyPair.nitro.js.map +1 -0
  93. package/dist/commonjs/specs/v1/hash.nitro.js +6 -0
  94. package/dist/commonjs/specs/v1/hash.nitro.js.map +1 -0
  95. package/dist/commonjs/specs/v1/hkdf.nitro.js +6 -0
  96. package/dist/commonjs/specs/v1/hkdf.nitro.js.map +1 -0
  97. package/dist/commonjs/specs/v1/hmac.nitro.js +6 -0
  98. package/dist/commonjs/specs/v1/hmac.nitro.js.map +1 -0
  99. package/dist/commonjs/specs/v1/keyObjectHandle.nitro.js +6 -0
  100. package/dist/commonjs/specs/v1/keyObjectHandle.nitro.js.map +1 -0
  101. package/dist/commonjs/specs/v1/kmac.nitro.js +6 -0
  102. package/dist/commonjs/specs/v1/kmac.nitro.js.map +1 -0
  103. package/dist/commonjs/specs/v1/mlDsaKeyPair.nitro.js +6 -0
  104. package/dist/commonjs/specs/v1/mlDsaKeyPair.nitro.js.map +1 -0
  105. package/dist/commonjs/specs/v1/mlKemKeyPair.nitro.js +6 -0
  106. package/dist/commonjs/specs/v1/mlKemKeyPair.nitro.js.map +1 -0
  107. package/dist/commonjs/specs/v1/pbkdf2.nitro.js +6 -0
  108. package/dist/commonjs/specs/v1/pbkdf2.nitro.js.map +1 -0
  109. package/dist/commonjs/specs/v1/prime.nitro.js +6 -0
  110. package/dist/commonjs/specs/v1/prime.nitro.js.map +1 -0
  111. package/dist/commonjs/specs/v1/random.nitro.js +6 -0
  112. package/dist/commonjs/specs/v1/random.nitro.js.map +1 -0
  113. package/dist/commonjs/specs/v1/rsaCipher.nitro.js +6 -0
  114. package/dist/commonjs/specs/v1/rsaCipher.nitro.js.map +1 -0
  115. package/dist/commonjs/specs/v1/rsaKeyPair.nitro.js +6 -0
  116. package/dist/commonjs/specs/v1/rsaKeyPair.nitro.js.map +1 -0
  117. package/dist/commonjs/specs/v1/scrypt.nitro.js +6 -0
  118. package/dist/commonjs/specs/v1/scrypt.nitro.js.map +1 -0
  119. package/dist/commonjs/specs/v1/sign.nitro.js +6 -0
  120. package/dist/commonjs/specs/v1/sign.nitro.js.map +1 -0
  121. package/dist/commonjs/specs/v1/utils.nitro.js +6 -0
  122. package/dist/commonjs/specs/v1/utils.nitro.js.map +1 -0
  123. package/dist/commonjs/specs/v1/x509certificate.nitro.js +6 -0
  124. package/dist/commonjs/specs/v1/x509certificate.nitro.js.map +1 -0
  125. package/dist/commonjs/subtle.js +1811 -0
  126. package/dist/commonjs/subtle.js.map +1 -0
  127. package/dist/commonjs/utils/cipher.js +64 -0
  128. package/dist/commonjs/utils/cipher.js.map +1 -0
  129. package/dist/commonjs/utils/conversion.js +181 -0
  130. package/dist/commonjs/utils/conversion.js.map +1 -0
  131. package/dist/commonjs/utils/errors.js +14 -0
  132. package/dist/commonjs/utils/errors.js.map +1 -0
  133. package/dist/commonjs/utils/hashnames.js +122 -0
  134. package/dist/commonjs/utils/hashnames.js.map +1 -0
  135. package/dist/commonjs/utils/index.js +83 -0
  136. package/dist/commonjs/utils/index.js.map +1 -0
  137. package/dist/commonjs/utils/noble.js +82 -0
  138. package/dist/commonjs/utils/noble.js.map +1 -0
  139. package/dist/commonjs/utils/timingSafeEqual.js +24 -0
  140. package/dist/commonjs/utils/timingSafeEqual.js.map +1 -0
  141. package/dist/commonjs/utils/types.js +55 -0
  142. package/dist/commonjs/utils/types.js.map +1 -0
  143. package/dist/commonjs/utils/validation.js +98 -0
  144. package/dist/commonjs/utils/validation.js.map +1 -0
  145. package/dist/commonjs/x509certificate.js +193 -0
  146. package/dist/commonjs/x509certificate.js.map +1 -0
  147. package/dist/module/argon2.js +32 -0
  148. package/dist/module/argon2.js.map +1 -0
  149. package/dist/module/blake3.js +96 -0
  150. package/dist/module/blake3.js.map +1 -0
  151. package/dist/module/certificate.js +28 -0
  152. package/dist/module/certificate.js.map +1 -0
  153. package/dist/module/cipher.js +194 -0
  154. package/dist/module/cipher.js.map +1 -0
  155. package/dist/module/constants.js +26 -0
  156. package/dist/module/constants.js.map +1 -0
  157. package/dist/module/dh-groups.js +23 -0
  158. package/dist/module/dh-groups.js.map +1 -0
  159. package/dist/module/dhKeyPair.js +104 -0
  160. package/dist/module/dhKeyPair.js.map +1 -0
  161. package/dist/module/diffie-hellman.js +147 -0
  162. package/dist/module/diffie-hellman.js.map +1 -0
  163. package/dist/module/dsa.js +87 -0
  164. package/dist/module/dsa.js.map +1 -0
  165. package/dist/module/ec.js +354 -0
  166. package/dist/module/ec.js.map +1 -0
  167. package/dist/module/ecdh.js +106 -0
  168. package/dist/module/ecdh.js.map +1 -0
  169. package/dist/module/ed.js +383 -0
  170. package/dist/module/ed.js.map +1 -0
  171. package/dist/module/expo-plugin/@types.js +2 -0
  172. package/dist/module/expo-plugin/@types.js.map +1 -0
  173. package/dist/module/expo-plugin/withRNQC.js +19 -0
  174. package/dist/module/expo-plugin/withRNQC.js.map +1 -0
  175. package/dist/module/expo-plugin/withSodiumAndroid.js +18 -0
  176. package/dist/module/expo-plugin/withSodiumAndroid.js.map +1 -0
  177. package/dist/module/expo-plugin/withSodiumIos.js +15 -0
  178. package/dist/module/expo-plugin/withSodiumIos.js.map +1 -0
  179. package/dist/module/expo-plugin/withXCode.js +44 -0
  180. package/dist/module/expo-plugin/withXCode.js.map +1 -0
  181. package/dist/module/hash.js +230 -0
  182. package/dist/module/hash.js.map +1 -0
  183. package/dist/module/hkdf.js +73 -0
  184. package/dist/module/hkdf.js.map +1 -0
  185. package/dist/module/hmac.js +114 -0
  186. package/dist/module/hmac.js.map +1 -0
  187. package/dist/module/index.js +134 -0
  188. package/dist/module/index.js.map +1 -0
  189. package/dist/module/keys/classes.js +261 -0
  190. package/dist/module/keys/classes.js.map +1 -0
  191. package/dist/module/keys/generateKeyPair.js +148 -0
  192. package/dist/module/keys/generateKeyPair.js.map +1 -0
  193. package/dist/module/keys/index.js +190 -0
  194. package/dist/module/keys/index.js.map +1 -0
  195. package/dist/module/keys/publicCipher.js +156 -0
  196. package/dist/module/keys/publicCipher.js.map +1 -0
  197. package/dist/module/keys/signVerify.js +213 -0
  198. package/dist/module/keys/signVerify.js.map +1 -0
  199. package/dist/module/keys/utils.js +112 -0
  200. package/dist/module/keys/utils.js.map +1 -0
  201. package/dist/module/mldsa.js +66 -0
  202. package/dist/module/mldsa.js.map +1 -0
  203. package/dist/module/mlkem.js +214 -0
  204. package/dist/module/mlkem.js.map +1 -0
  205. package/dist/module/pbkdf2.js +98 -0
  206. package/dist/module/pbkdf2.js.map +1 -0
  207. package/dist/module/prime.js +87 -0
  208. package/dist/module/prime.js.map +1 -0
  209. package/dist/module/random.js +220 -0
  210. package/dist/module/random.js.map +1 -0
  211. package/dist/module/rsa.js +197 -0
  212. package/dist/module/rsa.js.map +1 -0
  213. package/dist/module/scrypt.js +91 -0
  214. package/dist/module/scrypt.js.map +1 -0
  215. package/dist/module/specs/v1/NativeQuickCrypto.js +13 -0
  216. package/dist/module/specs/v1/NativeQuickCrypto.js.map +1 -0
  217. package/dist/module/specs/v1/argon2.nitro.js +2 -0
  218. package/dist/module/specs/v1/argon2.nitro.js.map +1 -0
  219. package/dist/module/specs/v1/blake3.nitro.js +2 -0
  220. package/dist/module/specs/v1/blake3.nitro.js.map +1 -0
  221. package/dist/module/specs/v1/certificate.nitro.js +2 -0
  222. package/dist/module/specs/v1/certificate.nitro.js.map +1 -0
  223. package/dist/module/specs/v1/cipher.nitro.js +2 -0
  224. package/dist/module/specs/v1/cipher.nitro.js.map +1 -0
  225. package/dist/module/specs/v1/dhKeyPair.nitro.js +2 -0
  226. package/dist/module/specs/v1/dhKeyPair.nitro.js.map +1 -0
  227. package/dist/module/specs/v1/diffie-hellman.nitro.js +2 -0
  228. package/dist/module/specs/v1/diffie-hellman.nitro.js.map +1 -0
  229. package/dist/module/specs/v1/dsaKeyPair.nitro.js +2 -0
  230. package/dist/module/specs/v1/dsaKeyPair.nitro.js.map +1 -0
  231. package/dist/module/specs/v1/ecKeyPair.nitro.js +2 -0
  232. package/dist/module/specs/v1/ecKeyPair.nitro.js.map +1 -0
  233. package/dist/module/specs/v1/ecdh.nitro.js +2 -0
  234. package/dist/module/specs/v1/ecdh.nitro.js.map +1 -0
  235. package/dist/module/specs/v1/edKeyPair.nitro.js +2 -0
  236. package/dist/module/specs/v1/edKeyPair.nitro.js.map +1 -0
  237. package/dist/module/specs/v1/hash.nitro.js +2 -0
  238. package/dist/module/specs/v1/hash.nitro.js.map +1 -0
  239. package/dist/module/specs/v1/hkdf.nitro.js +2 -0
  240. package/dist/module/specs/v1/hkdf.nitro.js.map +1 -0
  241. package/dist/module/specs/v1/hmac.nitro.js +2 -0
  242. package/dist/module/specs/v1/hmac.nitro.js.map +1 -0
  243. package/dist/module/specs/v1/keyObjectHandle.nitro.js +2 -0
  244. package/dist/module/specs/v1/keyObjectHandle.nitro.js.map +1 -0
  245. package/dist/module/specs/v1/kmac.nitro.js +2 -0
  246. package/dist/module/specs/v1/kmac.nitro.js.map +1 -0
  247. package/dist/module/specs/v1/mlDsaKeyPair.nitro.js +2 -0
  248. package/dist/module/specs/v1/mlDsaKeyPair.nitro.js.map +1 -0
  249. package/dist/module/specs/v1/mlKemKeyPair.nitro.js +2 -0
  250. package/dist/module/specs/v1/mlKemKeyPair.nitro.js.map +1 -0
  251. package/dist/module/specs/v1/pbkdf2.nitro.js +2 -0
  252. package/dist/module/specs/v1/pbkdf2.nitro.js.map +1 -0
  253. package/dist/module/specs/v1/prime.nitro.js +2 -0
  254. package/dist/module/specs/v1/prime.nitro.js.map +1 -0
  255. package/dist/module/specs/v1/random.nitro.js +2 -0
  256. package/dist/module/specs/v1/random.nitro.js.map +1 -0
  257. package/dist/module/specs/v1/rsaCipher.nitro.js +2 -0
  258. package/dist/module/specs/v1/rsaCipher.nitro.js.map +1 -0
  259. package/dist/module/specs/v1/rsaKeyPair.nitro.js +2 -0
  260. package/dist/module/specs/v1/rsaKeyPair.nitro.js.map +1 -0
  261. package/dist/module/specs/v1/scrypt.nitro.js +2 -0
  262. package/dist/module/specs/v1/scrypt.nitro.js.map +1 -0
  263. package/dist/module/specs/v1/sign.nitro.js +2 -0
  264. package/dist/module/specs/v1/sign.nitro.js.map +1 -0
  265. package/dist/module/specs/v1/utils.nitro.js +2 -0
  266. package/dist/module/specs/v1/utils.nitro.js.map +1 -0
  267. package/dist/module/specs/v1/x509certificate.nitro.js +2 -0
  268. package/dist/module/specs/v1/x509certificate.nitro.js.map +1 -0
  269. package/dist/module/subtle.js +1803 -0
  270. package/dist/module/subtle.js.map +1 -0
  271. package/dist/module/utils/cipher.js +54 -0
  272. package/dist/module/utils/cipher.js.map +1 -0
  273. package/dist/module/utils/conversion.js +146 -0
  274. package/dist/module/utils/conversion.js.map +1 -0
  275. package/dist/module/utils/errors.js +8 -0
  276. package/dist/module/utils/errors.js.map +1 -0
  277. package/dist/module/utils/hashnames.js +118 -0
  278. package/dist/module/utils/hashnames.js.map +1 -0
  279. package/dist/module/utils/index.js +8 -0
  280. package/dist/module/utils/index.js.map +1 -0
  281. package/dist/module/utils/noble.js +74 -0
  282. package/dist/module/utils/noble.js.map +1 -0
  283. package/dist/module/utils/timingSafeEqual.js +18 -0
  284. package/dist/module/utils/timingSafeEqual.js.map +1 -0
  285. package/dist/module/utils/types.js +55 -0
  286. package/dist/module/utils/types.js.map +1 -0
  287. package/dist/module/utils/validation.js +85 -0
  288. package/dist/module/utils/validation.js.map +1 -0
  289. package/dist/module/x509certificate.js +186 -0
  290. package/dist/module/x509certificate.js.map +1 -0
  291. package/dist/typescript/argon2.d.ts +15 -0
  292. package/dist/typescript/blake3.d.ts +32 -0
  293. package/dist/typescript/certificate.d.ts +7 -0
  294. package/dist/typescript/cipher.d.ts +74 -0
  295. package/dist/typescript/constants.d.ts +20 -0
  296. package/dist/typescript/dh-groups.d.ts +4 -0
  297. package/dist/typescript/dhKeyPair.d.ts +18 -0
  298. package/dist/typescript/diffie-hellman.d.ts +17 -0
  299. package/dist/typescript/dsa.d.ts +18 -0
  300. package/dist/typescript/ec.d.ts +23 -0
  301. package/dist/typescript/ecdh.d.ts +18 -0
  302. package/dist/typescript/ed.d.ts +46 -0
  303. package/dist/typescript/hash.d.ts +125 -0
  304. package/dist/typescript/hkdf.d.ts +21 -0
  305. package/dist/typescript/hmac.d.ts +65 -0
  306. package/dist/typescript/index.d.ts +224 -0
  307. package/dist/typescript/keys/classes.d.ts +85 -0
  308. package/dist/typescript/keys/generateKeyPair.d.ts +5 -0
  309. package/dist/typescript/keys/index.d.ts +23 -0
  310. package/dist/typescript/keys/publicCipher.d.ts +22 -0
  311. package/dist/typescript/keys/signVerify.d.ts +34 -0
  312. package/dist/typescript/keys/utils.d.ts +33 -0
  313. package/dist/typescript/mldsa.d.ts +17 -0
  314. package/dist/typescript/mlkem.d.ts +29 -0
  315. package/dist/typescript/pbkdf2.d.ts +11 -0
  316. package/dist/typescript/prime.d.ts +18 -0
  317. package/dist/typescript/random.d.ts +26 -0
  318. package/dist/typescript/rsa.d.ts +19 -0
  319. package/dist/typescript/scrypt.d.ts +17 -0
  320. package/dist/typescript/specs/v1/NativeQuickCrypto.d.ts +17 -0
  321. package/dist/typescript/specs/v1/argon2.nitro.d.ts +8 -0
  322. package/dist/typescript/specs/v1/blake3.nitro.d.ts +14 -0
  323. package/dist/typescript/specs/v1/certificate.nitro.d.ts +9 -0
  324. package/dist/typescript/specs/v1/cipher.nitro.d.ts +37 -0
  325. package/dist/typescript/specs/v1/dhKeyPair.nitro.d.ts +13 -0
  326. package/dist/typescript/specs/v1/diffie-hellman.nitro.d.ts +17 -0
  327. package/dist/typescript/specs/v1/dsaKeyPair.nitro.d.ts +12 -0
  328. package/dist/typescript/specs/v1/ecKeyPair.nitro.d.ts +20 -0
  329. package/dist/typescript/specs/v1/ecdh.nitro.d.ts +14 -0
  330. package/dist/typescript/specs/v1/edKeyPair.nitro.d.ts +16 -0
  331. package/dist/typescript/specs/v1/hash.nitro.d.ts +12 -0
  332. package/dist/typescript/specs/v1/hkdf.nitro.d.ts +8 -0
  333. package/dist/typescript/specs/v1/hmac.nitro.d.ts +9 -0
  334. package/dist/typescript/specs/v1/keyObjectHandle.nitro.d.ts +17 -0
  335. package/dist/typescript/specs/v1/kmac.nitro.d.ts +9 -0
  336. package/dist/typescript/specs/v1/mlDsaKeyPair.nitro.d.ts +15 -0
  337. package/dist/typescript/specs/v1/mlKemKeyPair.nitro.d.ts +17 -0
  338. package/dist/typescript/specs/v1/pbkdf2.nitro.d.ts +8 -0
  339. package/dist/typescript/specs/v1/prime.nitro.d.ts +10 -0
  340. package/dist/typescript/specs/v1/random.nitro.d.ts +8 -0
  341. package/dist/typescript/specs/v1/rsaCipher.nitro.d.ts +53 -0
  342. package/dist/typescript/specs/v1/rsaKeyPair.nitro.d.ts +19 -0
  343. package/dist/typescript/specs/v1/scrypt.nitro.d.ts +8 -0
  344. package/dist/typescript/specs/v1/sign.nitro.d.ts +18 -0
  345. package/dist/typescript/specs/v1/utils.nitro.d.ts +9 -0
  346. package/dist/typescript/specs/v1/x509certificate.nitro.d.ts +33 -0
  347. package/dist/typescript/subtle.d.ts +31 -0
  348. package/dist/typescript/utils/cipher.d.ts +6 -0
  349. package/dist/typescript/utils/conversion.d.ts +29 -0
  350. package/dist/typescript/utils/errors.d.ts +6 -0
  351. package/dist/typescript/utils/hashnames.d.ts +12 -0
  352. package/dist/typescript/utils/index.d.ts +7 -0
  353. package/dist/typescript/utils/noble.d.ts +18 -0
  354. package/dist/typescript/utils/timingSafeEqual.d.ts +2 -0
  355. package/dist/typescript/utils/types.d.ts +294 -0
  356. package/dist/typescript/utils/validation.d.ts +12 -0
  357. package/dist/typescript/x509certificate.d.ts +63 -0
  358. package/harmony/quick_crypto/LICENSE +21 -0
  359. package/harmony/quick_crypto/NOTICE +33 -0
  360. package/harmony/quick_crypto/OAT.xml +38 -0
  361. package/harmony/quick_crypto/build-profile.json5 +16 -0
  362. package/harmony/quick_crypto/deps/blake3/blake3.c +650 -0
  363. package/harmony/quick_crypto/deps/blake3/blake3.h +86 -0
  364. package/harmony/quick_crypto/deps/blake3/blake3_avx2.c +326 -0
  365. package/harmony/quick_crypto/deps/blake3/blake3_avx512.c +1388 -0
  366. package/harmony/quick_crypto/deps/blake3/blake3_dispatch.c +332 -0
  367. package/harmony/quick_crypto/deps/blake3/blake3_impl.h +333 -0
  368. package/harmony/quick_crypto/deps/blake3/blake3_neon.c +366 -0
  369. package/harmony/quick_crypto/deps/blake3/blake3_portable.c +160 -0
  370. package/harmony/quick_crypto/deps/blake3/blake3_sse2.c +566 -0
  371. package/harmony/quick_crypto/deps/blake3/blake3_sse41.c +560 -0
  372. package/harmony/quick_crypto/deps/blake3/example.c +36 -0
  373. package/harmony/quick_crypto/deps/blake3/example_tbb.c +57 -0
  374. package/harmony/quick_crypto/deps/blake3/main.c +166 -0
  375. package/harmony/quick_crypto/deps/fastpbkdf2/fastpbkdf2.c +356 -0
  376. package/harmony/quick_crypto/deps/fastpbkdf2/fastpbkdf2.h +68 -0
  377. package/harmony/quick_crypto/deps/ncrypto/include/dh-primes.h +67 -0
  378. package/harmony/quick_crypto/deps/ncrypto/include/ncrypto/aead.h +137 -0
  379. package/harmony/quick_crypto/deps/ncrypto/include/ncrypto/version.h +14 -0
  380. package/harmony/quick_crypto/deps/ncrypto/include/ncrypto.h +1752 -0
  381. package/harmony/quick_crypto/deps/ncrypto/src/aead.cpp +302 -0
  382. package/harmony/quick_crypto/deps/ncrypto/src/engine.cpp +93 -0
  383. package/harmony/quick_crypto/deps/ncrypto/src/ncrypto.cpp +5331 -0
  384. package/harmony/quick_crypto/deps/simdutf/include/simdutf/avx512.h +79 -0
  385. package/harmony/quick_crypto/deps/simdutf/include/simdutf/base64_implementation.h +158 -0
  386. package/harmony/quick_crypto/deps/simdutf/include/simdutf/base64_tables.h +887 -0
  387. package/harmony/quick_crypto/deps/simdutf/include/simdutf/common_defs.h +186 -0
  388. package/harmony/quick_crypto/deps/simdutf/include/simdutf/compiler_check.h +50 -0
  389. package/harmony/quick_crypto/deps/simdutf/include/simdutf/constexpr_ptr.h +138 -0
  390. package/harmony/quick_crypto/deps/simdutf/include/simdutf/encoding_types.h +189 -0
  391. package/harmony/quick_crypto/deps/simdutf/include/simdutf/error.h +126 -0
  392. package/harmony/quick_crypto/deps/simdutf/include/simdutf/implementation.h +7081 -0
  393. package/harmony/quick_crypto/deps/simdutf/include/simdutf/internal/isadetection.h +325 -0
  394. package/harmony/quick_crypto/deps/simdutf/include/simdutf/portability.h +285 -0
  395. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/ascii.h +86 -0
  396. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/atomic_util.h +105 -0
  397. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/base64.h +911 -0
  398. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1.h +26 -0
  399. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1_to_utf16/latin1_to_utf16.h +52 -0
  400. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1_to_utf32/latin1_to_utf32.h +27 -0
  401. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1_to_utf8/latin1_to_utf8.h +191 -0
  402. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/swap_bytes.h +35 -0
  403. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16.h +226 -0
  404. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/utf16_to_latin1.h +108 -0
  405. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/valid_utf16_to_latin1.h +40 -0
  406. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/utf16_to_utf32.h +86 -0
  407. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/valid_utf16_to_utf32.h +44 -0
  408. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/utf16_to_utf8.h +295 -0
  409. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/valid_utf16_to_utf8.h +91 -0
  410. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32.h +82 -0
  411. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/utf32_to_latin1.h +68 -0
  412. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/valid_utf32_to_latin1.h +67 -0
  413. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/utf32_to_utf16.h +84 -0
  414. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/valid_utf32_to_utf16.h +44 -0
  415. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/utf32_to_utf8.h +142 -0
  416. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/valid_utf32_to_utf8.h +72 -0
  417. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8.h +326 -0
  418. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/utf8_to_latin1.h +225 -0
  419. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/valid_utf8_to_latin1.h +87 -0
  420. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/utf8_to_utf16.h +342 -0
  421. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/valid_utf8_to_utf16.h +106 -0
  422. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/utf8_to_utf32.h +299 -0
  423. package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/valid_utf8_to_utf32.h +83 -0
  424. package/harmony/quick_crypto/deps/simdutf/include/simdutf/simdutf_version.h +26 -0
  425. package/harmony/quick_crypto/deps/simdutf/include/simdutf.h +26 -0
  426. package/harmony/quick_crypto/deps/simdutf/include/simdutf_c.h +342 -0
  427. package/harmony/quick_crypto/deps/simdutf/src/CMakeLists.txt +78 -0
  428. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_base64.cpp +791 -0
  429. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_latin1_to_utf16.cpp +24 -0
  430. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_latin1_to_utf32.cpp +24 -0
  431. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_latin1_to_utf8.cpp +70 -0
  432. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf16_to_latin1.cpp +61 -0
  433. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf16_to_utf32.cpp +185 -0
  434. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf16_to_utf8.cpp +780 -0
  435. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf32_to_latin1.cpp +60 -0
  436. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf32_to_utf16.cpp +208 -0
  437. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf32_to_utf8.cpp +505 -0
  438. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf8_to_latin1.cpp +69 -0
  439. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf8_to_utf16.cpp +313 -0
  440. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf8_to_utf32.cpp +179 -0
  441. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_find.cpp +199 -0
  442. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_utf16fix.cpp +185 -0
  443. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_validate_utf16.cpp +165 -0
  444. package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_validate_utf32le.cpp +65 -0
  445. package/harmony/quick_crypto/deps/simdutf/src/arm64/implementation.cpp +1442 -0
  446. package/harmony/quick_crypto/deps/simdutf/src/encoding_types.cpp +67 -0
  447. package/harmony/quick_crypto/deps/simdutf/src/error.cpp +3 -0
  448. package/harmony/quick_crypto/deps/simdutf/src/fallback/implementation.cpp +589 -0
  449. package/harmony/quick_crypto/deps/simdutf/src/generic/ascii_validation.h +50 -0
  450. package/harmony/quick_crypto/deps/simdutf/src/generic/base64.h +233 -0
  451. package/harmony/quick_crypto/deps/simdutf/src/generic/base64lengths.h +63 -0
  452. package/harmony/quick_crypto/deps/simdutf/src/generic/buf_block_reader.h +109 -0
  453. package/harmony/quick_crypto/deps/simdutf/src/generic/find.h +75 -0
  454. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/change_endianness.h +24 -0
  455. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/count_code_points_bytemask.h +58 -0
  456. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/to_well_formed.h +93 -0
  457. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/utf32_length_from_utf16.h +15 -0
  458. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/utf8_length_from_utf16.h +35 -0
  459. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/utf8_length_from_utf16_bytemask.h +199 -0
  460. package/harmony/quick_crypto/deps/simdutf/src/generic/utf16.h +73 -0
  461. package/harmony/quick_crypto/deps/simdutf/src/generic/utf32.h +136 -0
  462. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8/utf16_length_from_utf8_bytemask.h +53 -0
  463. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8.h +92 -0
  464. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_latin1/utf8_to_latin1.h +316 -0
  465. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_latin1/valid_utf8_to_latin1.h +78 -0
  466. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf16/utf8_to_utf16.h +332 -0
  467. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf16/valid_utf8_to_utf16.h +74 -0
  468. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf32/utf8_to_utf32.h +318 -0
  469. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf32/valid_utf8_to_utf32.h +42 -0
  470. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_validation/utf8_lookup4_algorithm.h +223 -0
  471. package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_validation/utf8_validator.h +84 -0
  472. package/harmony/quick_crypto/deps/simdutf/src/generic/validate_utf16.h +164 -0
  473. package/harmony/quick_crypto/deps/simdutf/src/generic/validate_utf32.h +99 -0
  474. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_base64.cpp +837 -0
  475. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf16.cpp +28 -0
  476. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf32.cpp +20 -0
  477. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf8.cpp +83 -0
  478. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf16_to_latin1.cpp +83 -0
  479. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf32.cpp +210 -0
  480. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf8.cpp +602 -0
  481. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf32_to_latin1.cpp +116 -0
  482. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf16.cpp +164 -0
  483. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf8.cpp +569 -0
  484. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf8_to_latin1.cpp +60 -0
  485. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf16.cpp +195 -0
  486. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf32.cpp +135 -0
  487. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_utf16fix.cpp +173 -0
  488. package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_validate_utf16.cpp +17 -0
  489. package/harmony/quick_crypto/deps/simdutf/src/haswell/implementation.cpp +1447 -0
  490. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_ascii_validation.inl.cpp +19 -0
  491. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_base64.inl.cpp +630 -0
  492. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_common.inl.cpp +37 -0
  493. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf16.inl.cpp +36 -0
  494. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf32.inl.cpp +23 -0
  495. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf8.inl.cpp +107 -0
  496. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf16_to_latin1.inl.cpp +103 -0
  497. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf32.inl.cpp +136 -0
  498. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf8.inl.cpp +206 -0
  499. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf32_to_latin1.inl.cpp +74 -0
  500. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf16.inl.cpp +338 -0
  501. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf8.inl.cpp +574 -0
  502. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf8_to_latin1.inl.cpp +104 -0
  503. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf8_to_utf16.inl.cpp +75 -0
  504. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_valid_utf8_to_latin1.inl.cpp +69 -0
  505. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_find.inl.cpp +146 -0
  506. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_from_utf8.inl.cpp +266 -0
  507. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_from_valid_utf8.inl.cpp +136 -0
  508. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_macros.inl.cpp +143 -0
  509. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf16fix.cpp +138 -0
  510. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf32_validation.inl.cpp +63 -0
  511. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf8_common.inl.cpp +753 -0
  512. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf8_length_from_utf16.inl.cpp +269 -0
  513. package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf8_validation.inl.cpp +116 -0
  514. package/harmony/quick_crypto/deps/simdutf/src/icelake/implementation.cpp +1903 -0
  515. package/harmony/quick_crypto/deps/simdutf/src/implementation.cpp +2526 -0
  516. package/harmony/quick_crypto/deps/simdutf/src/lasx/implementation.cpp +1531 -0
  517. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_base64.cpp +695 -0
  518. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf16.cpp +76 -0
  519. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf32.cpp +55 -0
  520. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf8.cpp +65 -0
  521. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf16_to_latin1.cpp +64 -0
  522. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf32.cpp +183 -0
  523. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf8.cpp +550 -0
  524. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf32_to_latin1.cpp +73 -0
  525. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf16.cpp +218 -0
  526. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf8.cpp +589 -0
  527. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf8_to_latin1.cpp +72 -0
  528. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf16.cpp +296 -0
  529. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf32.cpp +190 -0
  530. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_find.cpp +64 -0
  531. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_validate_utf16.cpp +13 -0
  532. package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_validate_utf32le.cpp +84 -0
  533. package/harmony/quick_crypto/deps/simdutf/src/lsx/implementation.cpp +1417 -0
  534. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_base64.cpp +675 -0
  535. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf16.cpp +39 -0
  536. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf32.cpp +27 -0
  537. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf8.cpp +56 -0
  538. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf16_to_latin1.cpp +64 -0
  539. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf32.cpp +133 -0
  540. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf8.cpp +518 -0
  541. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf32_to_latin1.cpp +66 -0
  542. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf16.cpp +155 -0
  543. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp +459 -0
  544. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf8_to_latin1.cpp +75 -0
  545. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf16.cpp +291 -0
  546. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf32.cpp +179 -0
  547. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_find.cpp +60 -0
  548. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_validate_utf16.cpp +13 -0
  549. package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_validate_utf32le.cpp +68 -0
  550. package/harmony/quick_crypto/deps/simdutf/src/ppc64/implementation.cpp +992 -0
  551. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_base64.cpp +480 -0
  552. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_base64_internal_tests.cpp +401 -0
  553. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf16.cpp +12 -0
  554. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf32.cpp +12 -0
  555. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf8.cpp +149 -0
  556. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_latin1.cpp +67 -0
  557. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf32.cpp +87 -0
  558. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf8.cpp +296 -0
  559. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_latin1.cpp +57 -0
  560. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf16.cpp +117 -0
  561. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf8.cpp +166 -0
  562. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_latin1.cpp +69 -0
  563. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf16.cpp +211 -0
  564. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf32.cpp +153 -0
  565. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_utf16_to_utf8_tables.h +1011 -0
  566. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_utf8_length_from_latin1.cpp +37 -0
  567. package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_validate_utf16.cpp +19 -0
  568. package/harmony/quick_crypto/deps/simdutf/src/ppc64/templates.cpp +91 -0
  569. package/harmony/quick_crypto/deps/simdutf/src/rvv/implementation.cpp +138 -0
  570. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_find.cpp +27 -0
  571. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_helpers.inl.cpp +23 -0
  572. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_latin1_to.inl.cpp +71 -0
  573. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_length_from.inl.cpp +164 -0
  574. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf16_to.inl.cpp +399 -0
  575. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf16fix.cpp +110 -0
  576. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf32_to.inl.cpp +307 -0
  577. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf8_to.inl.cpp +435 -0
  578. package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_validate.inl.cpp +275 -0
  579. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/begin.h +2 -0
  580. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/bitmanipulation.h +34 -0
  581. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/end.h +2 -0
  582. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/implementation.h +307 -0
  583. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/intrinsics.h +10 -0
  584. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd.h +547 -0
  585. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd16-inl.h +403 -0
  586. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd32-inl.h +129 -0
  587. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd64-inl.h +28 -0
  588. package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64.h +43 -0
  589. package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/begin.h +1 -0
  590. package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/bitmanipulation.h +13 -0
  591. package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/end.h +1 -0
  592. package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/implementation.h +331 -0
  593. package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback.h +42 -0
  594. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/begin.h +15 -0
  595. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/bitmanipulation.h +35 -0
  596. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/end.h +13 -0
  597. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/implementation.h +338 -0
  598. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/intrinsics.h +67 -0
  599. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd.h +363 -0
  600. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd16-inl.h +261 -0
  601. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd32-inl.h +111 -0
  602. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd64-inl.h +34 -0
  603. package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell.h +63 -0
  604. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/begin.h +14 -0
  605. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/bitmanipulation.h +44 -0
  606. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/end.h +12 -0
  607. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/implementation.h +346 -0
  608. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/intrinsics.h +138 -0
  609. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/simd.h +17 -0
  610. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/simd16-inl.h +90 -0
  611. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/simd32-inl.h +47 -0
  612. package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake.h +81 -0
  613. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/begin.h +8 -0
  614. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/bitmanipulation.h +25 -0
  615. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/end.h +8 -0
  616. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/implementation.h +310 -0
  617. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/intrinsics.h +319 -0
  618. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd.h +551 -0
  619. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd16-inl.h +234 -0
  620. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd32-inl.h +74 -0
  621. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd64-inl.h +52 -0
  622. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx.h +49 -0
  623. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/begin.h +2 -0
  624. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/bitmanipulation.h +25 -0
  625. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/end.h +2 -0
  626. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/implementation.h +309 -0
  627. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/intrinsics.h +196 -0
  628. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd.h +421 -0
  629. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd16-inl.h +242 -0
  630. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd32-inl.h +69 -0
  631. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd64-inl.h +50 -0
  632. package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx.h +52 -0
  633. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/begin.h +1 -0
  634. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/bitmanipulation.h +29 -0
  635. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/end.h +1 -0
  636. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/implementation.h +348 -0
  637. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/intrinsics.h +19 -0
  638. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd.h +177 -0
  639. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd16-inl.h +327 -0
  640. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd32-inl.h +247 -0
  641. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd8-inl.h +618 -0
  642. package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64.h +40 -0
  643. package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/begin.h +7 -0
  644. package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/end.h +7 -0
  645. package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/implementation.h +321 -0
  646. package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/intrinsics.h +131 -0
  647. package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv.h +41 -0
  648. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/begin.h +8 -0
  649. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/bitmanipulation.h +37 -0
  650. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/end.h +8 -0
  651. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/implementation.h +338 -0
  652. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/intrinsics.h +38 -0
  653. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd.h +379 -0
  654. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd16-inl.h +242 -0
  655. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd32-inl.h +151 -0
  656. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd64-inl.h +33 -0
  657. package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere.h +59 -0
  658. package/harmony/quick_crypto/deps/simdutf/src/simdutf.cpp +152 -0
  659. package/harmony/quick_crypto/deps/simdutf/src/simdutf_c.cpp +525 -0
  660. package/harmony/quick_crypto/deps/simdutf/src/tables/utf16_to_utf8_tables.h +768 -0
  661. package/harmony/quick_crypto/deps/simdutf/src/tables/utf32_to_utf16_tables.h +53 -0
  662. package/harmony/quick_crypto/deps/simdutf/src/tables/utf8_to_utf16_tables.h +826 -0
  663. package/harmony/quick_crypto/deps/simdutf/src/westmere/implementation.cpp +1479 -0
  664. package/harmony/quick_crypto/deps/simdutf/src/westmere/internal/loader.cpp +7 -0
  665. package/harmony/quick_crypto/deps/simdutf/src/westmere/internal/write_v_u16_11bits_to_utf8.cpp +66 -0
  666. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_base64.cpp +672 -0
  667. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_latin1_to_utf16.cpp +21 -0
  668. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_latin1_to_utf32.cpp +31 -0
  669. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_latin1_to_utf8.cpp +71 -0
  670. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf16_to_latin1.cpp +70 -0
  671. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf16_to_utf32.cpp +206 -0
  672. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf16_to_utf8.cpp +504 -0
  673. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf32_to_latin1.cpp +82 -0
  674. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf32_to_utf16.cpp +209 -0
  675. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf32_to_utf8.cpp +589 -0
  676. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf8_to_latin1.cpp +58 -0
  677. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf8_to_utf16.cpp +197 -0
  678. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf8_to_utf32.cpp +141 -0
  679. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_utf16fix.cpp +82 -0
  680. package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_validate_utf16.cpp +17 -0
  681. package/harmony/quick_crypto/hvigorfile.ts +2 -0
  682. package/harmony/quick_crypto/index.ets +1 -0
  683. package/harmony/quick_crypto/oh-package.json5 +14 -0
  684. package/harmony/quick_crypto/src/main/cpp/CMakeLists.txt +296 -0
  685. package/harmony/quick_crypto/src/main/cpp/QuickCryptoOnLoad.cpp +211 -0
  686. package/harmony/quick_crypto/src/main/cpp/QuickCryptoOnLoad.hpp +16 -0
  687. package/harmony/quick_crypto/src/main/cpp/QuickCryptoPackage.h +50 -0
  688. package/harmony/quick_crypto/src/main/cpp/cpp/argon2/HybridArgon2.cpp +103 -0
  689. package/harmony/quick_crypto/src/main/cpp/cpp/argon2/HybridArgon2.hpp +32 -0
  690. package/harmony/quick_crypto/src/main/cpp/cpp/blake3/HybridBlake3.cpp +118 -0
  691. package/harmony/quick_crypto/src/main/cpp/cpp/blake3/HybridBlake3.hpp +35 -0
  692. package/harmony/quick_crypto/src/main/cpp/cpp/certificate/HybridCertificate.cpp +42 -0
  693. package/harmony/quick_crypto/src/main/cpp/cpp/certificate/HybridCertificate.hpp +16 -0
  694. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/CCMCipher.cpp +202 -0
  695. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/CCMCipher.hpp +26 -0
  696. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Cipher.cpp +99 -0
  697. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Cipher.hpp +25 -0
  698. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Poly1305Cipher.cpp +170 -0
  699. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Poly1305Cipher.hpp +29 -0
  700. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/GCMCipher.cpp +68 -0
  701. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/GCMCipher.hpp +14 -0
  702. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridCipher.cpp +415 -0
  703. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridCipher.hpp +74 -0
  704. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridCipherFactory.hpp +119 -0
  705. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridRsaCipher.cpp +440 -0
  706. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridRsaCipher.hpp +33 -0
  707. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/OCBCipher.cpp +55 -0
  708. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/OCBCipher.hpp +19 -0
  709. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XChaCha20Poly1305Cipher.cpp +163 -0
  710. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XChaCha20Poly1305Cipher.hpp +42 -0
  711. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Cipher.cpp +65 -0
  712. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Cipher.hpp +33 -0
  713. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Poly1305Cipher.cpp +147 -0
  714. package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Poly1305Cipher.hpp +41 -0
  715. package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDhKeyPair.cpp +179 -0
  716. package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDhKeyPair.hpp +37 -0
  717. package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDiffieHellman.cpp +501 -0
  718. package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDiffieHellman.hpp +42 -0
  719. package/harmony/quick_crypto/src/main/cpp/cpp/dsa/HybridDsaKeyPair.cpp +128 -0
  720. package/harmony/quick_crypto/src/main/cpp/cpp/dsa/HybridDsaKeyPair.hpp +32 -0
  721. package/harmony/quick_crypto/src/main/cpp/cpp/ec/HybridEcKeyPair.cpp +479 -0
  722. package/harmony/quick_crypto/src/main/cpp/cpp/ec/HybridEcKeyPair.hpp +49 -0
  723. package/harmony/quick_crypto/src/main/cpp/cpp/ecdh/HybridECDH.cpp +228 -0
  724. package/harmony/quick_crypto/src/main/cpp/cpp/ecdh/HybridECDH.hpp +43 -0
  725. package/harmony/quick_crypto/src/main/cpp/cpp/ed25519/HybridEdKeyPair.cpp +404 -0
  726. package/harmony/quick_crypto/src/main/cpp/cpp/ed25519/HybridEdKeyPair.hpp +71 -0
  727. package/harmony/quick_crypto/src/main/cpp/cpp/hash/HybridHash.cpp +207 -0
  728. package/harmony/quick_crypto/src/main/cpp/cpp/hash/HybridHash.hpp +43 -0
  729. package/harmony/quick_crypto/src/main/cpp/cpp/hkdf/HybridHkdf.cpp +96 -0
  730. package/harmony/quick_crypto/src/main/cpp/cpp/hkdf/HybridHkdf.hpp +28 -0
  731. package/harmony/quick_crypto/src/main/cpp/cpp/hmac/HybridHmac.cpp +104 -0
  732. package/harmony/quick_crypto/src/main/cpp/cpp/hmac/HybridHmac.hpp +32 -0
  733. package/harmony/quick_crypto/src/main/cpp/cpp/keys/HybridKeyObjectHandle.cpp +891 -0
  734. package/harmony/quick_crypto/src/main/cpp/cpp/keys/HybridKeyObjectHandle.hpp +58 -0
  735. package/harmony/quick_crypto/src/main/cpp/cpp/keys/KeyObjectData.cpp +284 -0
  736. package/harmony/quick_crypto/src/main/cpp/cpp/keys/KeyObjectData.hpp +73 -0
  737. package/harmony/quick_crypto/src/main/cpp/cpp/keys/node.h +5 -0
  738. package/harmony/quick_crypto/src/main/cpp/cpp/kmac/HybridKmac.cpp +83 -0
  739. package/harmony/quick_crypto/src/main/cpp/cpp/kmac/HybridKmac.hpp +31 -0
  740. package/harmony/quick_crypto/src/main/cpp/cpp/mldsa/HybridMlDsaKeyPair.cpp +255 -0
  741. package/harmony/quick_crypto/src/main/cpp/cpp/mldsa/HybridMlDsaKeyPair.hpp +49 -0
  742. package/harmony/quick_crypto/src/main/cpp/cpp/mlkem/HybridMlKemKeyPair.cpp +319 -0
  743. package/harmony/quick_crypto/src/main/cpp/cpp/mlkem/HybridMlKemKeyPair.hpp +48 -0
  744. package/harmony/quick_crypto/src/main/cpp/cpp/pbkdf2/HybridPbkdf2.cpp +51 -0
  745. package/harmony/quick_crypto/src/main/cpp/cpp/pbkdf2/HybridPbkdf2.hpp +24 -0
  746. package/harmony/quick_crypto/src/main/cpp/cpp/prime/HybridPrime.cpp +81 -0
  747. package/harmony/quick_crypto/src/main/cpp/cpp/prime/HybridPrime.hpp +20 -0
  748. package/harmony/quick_crypto/src/main/cpp/cpp/random/HybridRandom.cpp +48 -0
  749. package/harmony/quick_crypto/src/main/cpp/cpp/random/HybridRandom.hpp +32 -0
  750. package/harmony/quick_crypto/src/main/cpp/cpp/rsa/HybridRsaKeyPair.cpp +154 -0
  751. package/harmony/quick_crypto/src/main/cpp/cpp/rsa/HybridRsaKeyPair.hpp +43 -0
  752. package/harmony/quick_crypto/src/main/cpp/cpp/scrypt/HybridScrypt.cpp +62 -0
  753. package/harmony/quick_crypto/src/main/cpp/cpp/scrypt/HybridScrypt.hpp +28 -0
  754. package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridSignHandle.cpp +266 -0
  755. package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridSignHandle.hpp +36 -0
  756. package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridVerifyHandle.cpp +227 -0
  757. package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridVerifyHandle.hpp +36 -0
  758. package/harmony/quick_crypto/src/main/cpp/cpp/sign/SignUtils.hpp +91 -0
  759. package/harmony/quick_crypto/src/main/cpp/cpp/utils/HybridUtils.cpp +197 -0
  760. package/harmony/quick_crypto/src/main/cpp/cpp/utils/HybridUtils.hpp +17 -0
  761. package/harmony/quick_crypto/src/main/cpp/cpp/utils/Macros.hpp +68 -0
  762. package/harmony/quick_crypto/src/main/cpp/cpp/utils/QuickCryptoUtils.cpp +44 -0
  763. package/harmony/quick_crypto/src/main/cpp/cpp/utils/QuickCryptoUtils.hpp +114 -0
  764. package/harmony/quick_crypto/src/main/cpp/cpp/utils/base64.h +309 -0
  765. package/harmony/quick_crypto/src/main/cpp/cpp/x509/HybridX509Certificate.cpp +174 -0
  766. package/harmony/quick_crypto/src/main/cpp/cpp/x509/HybridX509Certificate.hpp +51 -0
  767. package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/BaseQuickCryptoPackage.h +72 -0
  768. package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/dummy.cpp +2 -0
  769. package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/turbo_modules/QuickCrypto.cpp +16 -0
  770. package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/turbo_modules/QuickCrypto.h +16 -0
  771. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/ComponentDescriptors.h +24 -0
  772. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/EventEmitters.cpp +16 -0
  773. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/EventEmitters.h +17 -0
  774. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/Props.cpp +19 -0
  775. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/Props.h +18 -0
  776. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/ShadowNodes.cpp +17 -0
  777. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/ShadowNodes.h +23 -0
  778. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/States.cpp +16 -0
  779. package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/States.h +19 -0
  780. package/harmony/quick_crypto/src/main/cpp/nitro/HarmonyDispatcher.h +84 -0
  781. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/AnyMap.hpp +216 -0
  782. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ArrayBuffer.hpp +157 -0
  783. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/AssertPromiseState.hpp +34 -0
  784. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/BorrowingReference.hpp +223 -0
  785. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/BoxedHybridObject.hpp +36 -0
  786. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/CachedProp.hpp +44 -0
  787. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/CallInvokerDispatcher.hpp +38 -0
  788. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/CountTrailingOptionals.hpp +64 -0
  789. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Dispatcher.hpp +83 -0
  790. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/FastVectorCopy.hpp +45 -0
  791. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/FutureType.hpp +28 -0
  792. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridFunction.hpp +269 -0
  793. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridNitroModulesProxy.hpp +52 -0
  794. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridObject.hpp +152 -0
  795. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridObjectPrototype.hpp +93 -0
  796. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridObjectRegistry.hpp +53 -0
  797. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/InstallNitro.hpp +41 -0
  798. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/InstanceMethod.hpp +23 -0
  799. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/IsSharedPtrTo.hpp +27 -0
  800. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSCallback.hpp +132 -0
  801. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSICache.hpp +123 -0
  802. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+AnyMap.hpp +86 -0
  803. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+ArrayBuffer.hpp +96 -0
  804. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Date.hpp +83 -0
  805. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Exception.hpp +59 -0
  806. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Function.hpp +92 -0
  807. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+HostObject.hpp +73 -0
  808. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+NativeState.hpp +93 -0
  809. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Null.hpp +38 -0
  810. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Optional.hpp +50 -0
  811. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Promise.hpp +112 -0
  812. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Tuple.hpp +93 -0
  813. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+UnorderedMap.hpp +70 -0
  814. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Variant.hpp +67 -0
  815. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Vector.hpp +69 -0
  816. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter.hpp +197 -0
  817. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIHelpers.hpp +52 -0
  818. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroDefines.hpp +73 -0
  819. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroHash.hpp +61 -0
  820. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroLogger.hpp +69 -0
  821. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroTypeInfo.hpp +66 -0
  822. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Null.hpp +42 -0
  823. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ObjectUtils.hpp +94 -0
  824. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Promise.hpp +324 -0
  825. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/PromiseType.hpp +44 -0
  826. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/PropNameIDCache.hpp +24 -0
  827. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Prototype.hpp +182 -0
  828. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/PrototypeChain.hpp +78 -0
  829. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ReferenceState.hpp +40 -0
  830. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ThreadPool.hpp +66 -0
  831. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ThreadUtils.hpp +31 -0
  832. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/TypeIndex.hpp +29 -0
  833. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/WeakReference+Owning.hpp +33 -0
  834. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/WeakReference.hpp +102 -0
  835. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModulesTurboModule.cpp +92 -0
  836. package/harmony/quick_crypto/src/main/cpp/nitro/NitroModulesTurboModule.h +74 -0
  837. package/harmony/quick_crypto/src/main/cpp/nitro/platform/ThreadUtils.cpp +60 -0
  838. package/harmony/quick_crypto/src/main/cpp/nitro/shared/AnyMap.cpp +202 -0
  839. package/harmony/quick_crypto/src/main/cpp/nitro/shared/AnyMap.hpp +216 -0
  840. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ArrayBuffer.cpp +125 -0
  841. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ArrayBuffer.hpp +157 -0
  842. package/harmony/quick_crypto/src/main/cpp/nitro/shared/AssertPromiseState.hpp +34 -0
  843. package/harmony/quick_crypto/src/main/cpp/nitro/shared/BorrowingReference.hpp +223 -0
  844. package/harmony/quick_crypto/src/main/cpp/nitro/shared/BoxedHybridObject.cpp +30 -0
  845. package/harmony/quick_crypto/src/main/cpp/nitro/shared/BoxedHybridObject.hpp +36 -0
  846. package/harmony/quick_crypto/src/main/cpp/nitro/shared/CachedProp.hpp +44 -0
  847. package/harmony/quick_crypto/src/main/cpp/nitro/shared/CallInvokerDispatcher.hpp +38 -0
  848. package/harmony/quick_crypto/src/main/cpp/nitro/shared/CountTrailingOptionals.hpp +64 -0
  849. package/harmony/quick_crypto/src/main/cpp/nitro/shared/Dispatcher.cpp +71 -0
  850. package/harmony/quick_crypto/src/main/cpp/nitro/shared/Dispatcher.hpp +83 -0
  851. package/harmony/quick_crypto/src/main/cpp/nitro/shared/FastVectorCopy.hpp +45 -0
  852. package/harmony/quick_crypto/src/main/cpp/nitro/shared/FutureType.hpp +28 -0
  853. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridFunction.hpp +269 -0
  854. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridNitroModulesProxy.cpp +92 -0
  855. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridNitroModulesProxy.hpp +52 -0
  856. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObject.cpp +107 -0
  857. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObject.hpp +152 -0
  858. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectPrototype.cpp +113 -0
  859. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectPrototype.hpp +93 -0
  860. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectRegistry.cpp +105 -0
  861. package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectRegistry.hpp +53 -0
  862. package/harmony/quick_crypto/src/main/cpp/nitro/shared/InstallNitro.cpp +29 -0
  863. package/harmony/quick_crypto/src/main/cpp/nitro/shared/InstallNitro.hpp +41 -0
  864. package/harmony/quick_crypto/src/main/cpp/nitro/shared/InstanceMethod.hpp +23 -0
  865. package/harmony/quick_crypto/src/main/cpp/nitro/shared/IsSharedPtrTo.hpp +27 -0
  866. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSCallback.hpp +132 -0
  867. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSICache.cpp +66 -0
  868. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSICache.hpp +123 -0
  869. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+AnyMap.hpp +86 -0
  870. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+ArrayBuffer.hpp +96 -0
  871. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Date.hpp +83 -0
  872. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Exception.hpp +59 -0
  873. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Function.hpp +92 -0
  874. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+HostObject.hpp +73 -0
  875. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+NativeState.hpp +93 -0
  876. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Null.hpp +38 -0
  877. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Optional.hpp +50 -0
  878. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Promise.hpp +112 -0
  879. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Tuple.hpp +93 -0
  880. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+UnorderedMap.hpp +70 -0
  881. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Variant.hpp +67 -0
  882. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Vector.hpp +69 -0
  883. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter.hpp +197 -0
  884. package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIHelpers.hpp +52 -0
  885. package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroDefines.hpp +73 -0
  886. package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroHash.hpp +61 -0
  887. package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroLogger.hpp +69 -0
  888. package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroTypeInfo.cpp +80 -0
  889. package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroTypeInfo.hpp +66 -0
  890. package/harmony/quick_crypto/src/main/cpp/nitro/shared/Null.hpp +42 -0
  891. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ObjectUtils.cpp +172 -0
  892. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ObjectUtils.hpp +94 -0
  893. package/harmony/quick_crypto/src/main/cpp/nitro/shared/Promise.cpp +136 -0
  894. package/harmony/quick_crypto/src/main/cpp/nitro/shared/Promise.hpp +324 -0
  895. package/harmony/quick_crypto/src/main/cpp/nitro/shared/PromiseType.hpp +44 -0
  896. package/harmony/quick_crypto/src/main/cpp/nitro/shared/Prototype.hpp +182 -0
  897. package/harmony/quick_crypto/src/main/cpp/nitro/shared/PrototypeChain.hpp +78 -0
  898. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ReferenceState.hpp +40 -0
  899. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ThreadPool.cpp +99 -0
  900. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ThreadPool.hpp +66 -0
  901. package/harmony/quick_crypto/src/main/cpp/nitro/shared/ThreadUtils.hpp +31 -0
  902. package/harmony/quick_crypto/src/main/cpp/nitro/shared/TypeIndex.hpp +29 -0
  903. package/harmony/quick_crypto/src/main/cpp/nitro/shared/WeakReference+Owning.hpp +33 -0
  904. package/harmony/quick_crypto/src/main/cpp/nitro/shared/WeakReference.hpp +102 -0
  905. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/AsymmetricKeyType.hpp +128 -0
  906. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/CipherArgs.hpp +101 -0
  907. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/CipherInfo.hpp +104 -0
  908. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridArgon2Spec.cpp +22 -0
  909. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridArgon2Spec.hpp +66 -0
  910. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridBlake3Spec.cpp +28 -0
  911. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridBlake3Spec.hpp +74 -0
  912. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCertificateSpec.cpp +23 -0
  913. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCertificateSpec.hpp +64 -0
  914. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherFactorySpec.cpp +21 -0
  915. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherFactorySpec.hpp +67 -0
  916. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherSpec.cpp +29 -0
  917. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherSpec.hpp +78 -0
  918. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDhKeyPairSpec.cpp +27 -0
  919. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDhKeyPairSpec.hpp +69 -0
  920. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDiffieHellmanSpec.cpp +31 -0
  921. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDiffieHellmanSpec.hpp +72 -0
  922. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDsaKeyPairSpec.cpp +26 -0
  923. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDsaKeyPairSpec.hpp +68 -0
  924. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridECDHSpec.cpp +28 -0
  925. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridECDHSpec.hpp +70 -0
  926. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEcKeyPairSpec.cpp +30 -0
  927. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEcKeyPairSpec.hpp +76 -0
  928. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEdKeyPairSpec.cpp +30 -0
  929. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEdKeyPairSpec.hpp +74 -0
  930. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHashSpec.cpp +26 -0
  931. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHashSpec.hpp +74 -0
  932. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHkdfSpec.cpp +22 -0
  933. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHkdfSpec.hpp +65 -0
  934. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHmacSpec.cpp +23 -0
  935. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHmacSpec.hpp +66 -0
  936. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKeyObjectHandleSpec.cpp +30 -0
  937. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKeyObjectHandleSpec.hpp +98 -0
  938. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKmacSpec.cpp +23 -0
  939. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKmacSpec.hpp +66 -0
  940. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlDsaKeyPairSpec.cpp +29 -0
  941. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlDsaKeyPairSpec.hpp +72 -0
  942. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlKemKeyPairSpec.cpp +31 -0
  943. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlKemKeyPairSpec.hpp +74 -0
  944. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPbkdf2Spec.cpp +22 -0
  945. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPbkdf2Spec.hpp +65 -0
  946. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPrimeSpec.cpp +24 -0
  947. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPrimeSpec.hpp +67 -0
  948. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRandomSpec.cpp +22 -0
  949. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRandomSpec.hpp +64 -0
  950. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaCipherSpec.cpp +25 -0
  951. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaCipherSpec.hpp +71 -0
  952. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaKeyPairSpec.cpp +29 -0
  953. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaKeyPairSpec.hpp +75 -0
  954. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridScryptSpec.cpp +22 -0
  955. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridScryptSpec.hpp +64 -0
  956. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridSignHandleSpec.cpp +23 -0
  957. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridSignHandleSpec.hpp +69 -0
  958. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridUtilsSpec.cpp +23 -0
  959. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridUtilsSpec.hpp +65 -0
  960. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridVerifyHandleSpec.cpp +23 -0
  961. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridVerifyHandleSpec.hpp +69 -0
  962. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridX509CertificateHandleSpec.cpp +46 -0
  963. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridX509CertificateHandleSpec.hpp +96 -0
  964. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/JWK.hpp +177 -0
  965. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/JWKkty.hpp +88 -0
  966. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/JWKuse.hpp +76 -0
  967. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KFormatType.hpp +63 -0
  968. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyDetail.hpp +108 -0
  969. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyEncoding.hpp +64 -0
  970. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyObject.hpp +83 -0
  971. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyType.hpp +63 -0
  972. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyUsage.hpp +116 -0
  973. package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/NamedCurve.hpp +80 -0
  974. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/README.md +11 -0
  975. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H +22 -0
  976. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H +26 -0
  977. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/aes.h +111 -0
  978. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1.h +1134 -0
  979. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1.h.in +967 -0
  980. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1err.h +142 -0
  981. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1t.h +946 -0
  982. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1t.h.in +923 -0
  983. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/async.h +104 -0
  984. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asyncerr.h +29 -0
  985. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bio.h +1022 -0
  986. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bio.h.in +999 -0
  987. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bioerr.h +72 -0
  988. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/blowfish.h +78 -0
  989. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bn.h +590 -0
  990. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bnerr.h +47 -0
  991. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/buffer.h +62 -0
  992. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/buffererr.h +25 -0
  993. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/byteorder.h +339 -0
  994. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/camellia.h +117 -0
  995. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cast.h +71 -0
  996. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmac.h +52 -0
  997. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmp.h +727 -0
  998. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmp.h.in +584 -0
  999. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmp_util.h +56 -0
  1000. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmperr.h +134 -0
  1001. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cms.h +520 -0
  1002. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cms.h.in +422 -0
  1003. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmserr.h +129 -0
  1004. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/comp.h +98 -0
  1005. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/comp.h.in +76 -0
  1006. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/comperr.h +38 -0
  1007. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conf.h +214 -0
  1008. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conf.h.in +177 -0
  1009. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conf_api.h +46 -0
  1010. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conferr.h +52 -0
  1011. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/configuration.h +224 -0
  1012. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/configuration.h.in +75 -0
  1013. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conftypes.h +44 -0
  1014. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core.h +236 -0
  1015. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_dispatch.h +1156 -0
  1016. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_names.h +584 -0
  1017. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_names.h.in +129 -0
  1018. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_object.h +41 -0
  1019. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crmf.h +278 -0
  1020. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crmf.h.in +207 -0
  1021. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crmferr.h +57 -0
  1022. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crypto.h +614 -0
  1023. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crypto.h.in +591 -0
  1024. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cryptoerr.h +56 -0
  1025. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cryptoerr_legacy.h +1466 -0
  1026. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ct.h +573 -0
  1027. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ct.h.in +525 -0
  1028. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cterr.h +45 -0
  1029. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/decoder.h +133 -0
  1030. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/decodererr.h +28 -0
  1031. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/des.h +211 -0
  1032. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dh.h +339 -0
  1033. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dherr.h +59 -0
  1034. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dsa.h +280 -0
  1035. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dsaerr.h +44 -0
  1036. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dtls1.h +57 -0
  1037. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/e_os2.h +310 -0
  1038. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/e_ostime.h +38 -0
  1039. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ebcdic.h +39 -0
  1040. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ec.h +1588 -0
  1041. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ecdh.h +10 -0
  1042. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ecdsa.h +10 -0
  1043. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ecerr.h +104 -0
  1044. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/encoder.h +124 -0
  1045. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/encodererr.h +28 -0
  1046. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/engine.h +833 -0
  1047. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/engineerr.h +63 -0
  1048. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/err.h +512 -0
  1049. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/err.h.in +501 -0
  1050. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ess.h +128 -0
  1051. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ess.h.in +81 -0
  1052. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/esserr.h +32 -0
  1053. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/evp.h +2345 -0
  1054. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/evperr.h +148 -0
  1055. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/fips_names.h +50 -0
  1056. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/fipskey.h +41 -0
  1057. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/fipskey.h.in +40 -0
  1058. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/hmac.h +62 -0
  1059. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/hpke.h +169 -0
  1060. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/http.h +119 -0
  1061. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/httperr.h +56 -0
  1062. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/idea.h +82 -0
  1063. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/indicator.h +31 -0
  1064. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/kdf.h +142 -0
  1065. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/kdferr.h +16 -0
  1066. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/lhash.h +398 -0
  1067. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/lhash.h.in +373 -0
  1068. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/macros.h +361 -0
  1069. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/md2.h +56 -0
  1070. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/md4.h +63 -0
  1071. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/md5.h +62 -0
  1072. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/mdc2.h +55 -0
  1073. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ml_kem.h +31 -0
  1074. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/modes.h +219 -0
  1075. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/obj_mac.h +6695 -0
  1076. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/objects.h +184 -0
  1077. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/objectserr.h +28 -0
  1078. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ocsp.h +483 -0
  1079. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ocsp.h.in +387 -0
  1080. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ocsperr.h +53 -0
  1081. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/opensslconf.h +17 -0
  1082. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/opensslv.h +109 -0
  1083. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/opensslv.h.in +108 -0
  1084. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ossl_typ.h +16 -0
  1085. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/param_build.h +63 -0
  1086. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/params.h +166 -0
  1087. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pem.h +548 -0
  1088. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pem2.h +19 -0
  1089. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pemerr.h +59 -0
  1090. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs12.h +372 -0
  1091. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs12.h.in +349 -0
  1092. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs12err.h +46 -0
  1093. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs7.h +430 -0
  1094. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs7.h.in +359 -0
  1095. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs7err.h +63 -0
  1096. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/prov_ssl.h +38 -0
  1097. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/proverr.h +171 -0
  1098. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/provider.h +94 -0
  1099. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/quic.h +75 -0
  1100. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rand.h +131 -0
  1101. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/randerr.h +70 -0
  1102. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rc2.h +68 -0
  1103. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rc4.h +47 -0
  1104. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rc5.h +79 -0
  1105. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ripemd.h +59 -0
  1106. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rsa.h +615 -0
  1107. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rsaerr.h +107 -0
  1108. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/safestack.h +320 -0
  1109. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/safestack.h.in +250 -0
  1110. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/seed.h +113 -0
  1111. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/self_test.h +116 -0
  1112. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/sha.h +139 -0
  1113. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/srp.h +285 -0
  1114. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/srp.h.in +214 -0
  1115. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/srtp.h +68 -0
  1116. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl.h +2940 -0
  1117. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl.h.in +2893 -0
  1118. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl2.h +30 -0
  1119. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl3.h +358 -0
  1120. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/sslerr.h +382 -0
  1121. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/sslerr_legacy.h +467 -0
  1122. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/stack.h +92 -0
  1123. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/store.h +379 -0
  1124. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/storeerr.h +49 -0
  1125. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/symhacks.h +39 -0
  1126. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/thread.h +31 -0
  1127. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/tls1.h +1226 -0
  1128. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/trace.h +321 -0
  1129. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ts.h +522 -0
  1130. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/tserr.h +67 -0
  1131. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/txt_db.h +63 -0
  1132. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/types.h +248 -0
  1133. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ui.h +407 -0
  1134. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ui.h.in +384 -0
  1135. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/uierr.h +38 -0
  1136. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/whrlpool.h +62 -0
  1137. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509.h +1304 -0
  1138. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509.h.in +1110 -0
  1139. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_acert.h +294 -0
  1140. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_acert.h.in +199 -0
  1141. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_vfy.h +921 -0
  1142. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_vfy.h.in +824 -0
  1143. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509err.h +70 -0
  1144. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509v3.h +1968 -0
  1145. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509v3.h.in +1367 -0
  1146. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509v3err.h +97 -0
  1147. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/lib/libcrypto.a +0 -0
  1148. package/harmony/quick_crypto/src/main/cpp/third_party/openssl/lib/libssl.a +0 -0
  1149. package/harmony/quick_crypto/src/main/ets/QuickCryptoTurboModule.ts +14 -0
  1150. package/harmony/quick_crypto/src/main/ets/QuickCryptoTurboModulesFactory.ets +26 -0
  1151. package/harmony/quick_crypto/src/main/ets/generated/index.ets +5 -0
  1152. package/harmony/quick_crypto/src/main/ets/generated/ts.ts +5 -0
  1153. package/harmony/quick_crypto/src/main/ets/generated/turboModules/QuickCrypto.ts +14 -0
  1154. package/harmony/quick_crypto/src/main/ets/generated/turboModules/ts.ts +5 -0
  1155. package/harmony/quick_crypto/src/main/ets/nitro/Logger.ts +58 -0
  1156. package/harmony/quick_crypto/src/main/ets/nitro/NitroModulesModule.ts +134 -0
  1157. package/harmony/quick_crypto/src/main/module.json5 +13 -0
  1158. package/harmony/quick_crypto/src/main/resources/base/element/string.json +8 -0
  1159. package/harmony/quick_crypto/src/main/resources/en_US/element/string.json +8 -0
  1160. package/harmony/quick_crypto/src/main/resources/zh_CN/element/string.json +8 -0
  1161. package/harmony/quick_crypto.har +0 -0
  1162. package/package.json +87 -0
  1163. package/src/argon2.ts +83 -0
  1164. package/src/blake3.ts +124 -0
  1165. package/src/certificate.ts +41 -0
  1166. package/src/cipher.ts +373 -0
  1167. package/src/constants.ts +32 -0
  1168. package/src/dh-groups.ts +27 -0
  1169. package/src/dhKeyPair.ts +156 -0
  1170. package/src/diffie-hellman.ts +195 -0
  1171. package/src/dsa.ts +129 -0
  1172. package/src/ec.ts +557 -0
  1173. package/src/ecdh.ts +132 -0
  1174. package/src/ed.ts +526 -0
  1175. package/src/expo-plugin/@types.ts +7 -0
  1176. package/src/expo-plugin/withRNQC.ts +23 -0
  1177. package/src/expo-plugin/withSodiumAndroid.ts +24 -0
  1178. package/src/expo-plugin/withSodiumIos.ts +25 -0
  1179. package/src/expo-plugin/withXCode.ts +55 -0
  1180. package/src/hash.ts +320 -0
  1181. package/src/hkdf.ts +147 -0
  1182. package/src/hmac.ts +140 -0
  1183. package/src/index.ts +144 -0
  1184. package/src/keys/classes.ts +332 -0
  1185. package/src/keys/generateKeyPair.ts +212 -0
  1186. package/src/keys/index.ts +298 -0
  1187. package/src/keys/publicCipher.ts +250 -0
  1188. package/src/keys/signVerify.ts +318 -0
  1189. package/src/keys/utils.ts +190 -0
  1190. package/src/mldsa.ts +125 -0
  1191. package/src/mlkem.ts +350 -0
  1192. package/src/pbkdf2.ts +183 -0
  1193. package/src/prime.ts +134 -0
  1194. package/src/random.ts +334 -0
  1195. package/src/rsa.ts +311 -0
  1196. package/src/scrypt.ts +134 -0
  1197. package/src/specs/v1/.gitkeep +1 -0
  1198. package/src/specs/v1/NativeQuickCrypto.ts +19 -0
  1199. package/src/specs/v1/argon2.nitro.ts +29 -0
  1200. package/src/specs/v1/blake3.nitro.ts +12 -0
  1201. package/src/specs/v1/certificate.nitro.ts +8 -0
  1202. package/src/specs/v1/cipher.nitro.ts +39 -0
  1203. package/src/specs/v1/dhKeyPair.nitro.ts +14 -0
  1204. package/src/specs/v1/diffie-hellman.nitro.ts +16 -0
  1205. package/src/specs/v1/dsaKeyPair.nitro.ts +13 -0
  1206. package/src/specs/v1/ecKeyPair.nitro.ts +40 -0
  1207. package/src/specs/v1/ecdh.nitro.ts +12 -0
  1208. package/src/specs/v1/edKeyPair.nitro.ts +43 -0
  1209. package/src/specs/v1/hash.nitro.ts +10 -0
  1210. package/src/specs/v1/hkdf.nitro.ts +19 -0
  1211. package/src/specs/v1/hmac.nitro.ts +7 -0
  1212. package/src/specs/v1/keyObjectHandle.nitro.ts +39 -0
  1213. package/src/specs/v1/kmac.nitro.ts +12 -0
  1214. package/src/specs/v1/mlDsaKeyPair.nitro.ts +29 -0
  1215. package/src/specs/v1/mlKemKeyPair.nitro.ts +32 -0
  1216. package/src/specs/v1/pbkdf2.nitro.ts +18 -0
  1217. package/src/specs/v1/prime.nitro.ts +18 -0
  1218. package/src/specs/v1/random.nitro.ts +14 -0
  1219. package/src/specs/v1/rsaCipher.nitro.ts +82 -0
  1220. package/src/specs/v1/rsaKeyPair.nitro.ts +33 -0
  1221. package/src/specs/v1/scrypt.nitro.ts +23 -0
  1222. package/src/specs/v1/sign.nitro.ts +31 -0
  1223. package/src/specs/v1/utils.nitro.ts +7 -0
  1224. package/src/specs/v1/x509certificate.nitro.ts +38 -0
  1225. package/src/specs/v2/.gitkeep +1 -0
  1226. package/src/subtle.ts +2922 -0
  1227. package/src/utils/cipher.ts +60 -0
  1228. package/src/utils/conversion.ts +194 -0
  1229. package/src/utils/errors.ts +15 -0
  1230. package/src/utils/hashnames.ts +129 -0
  1231. package/src/utils/index.ts +7 -0
  1232. package/src/utils/noble.ts +85 -0
  1233. package/src/utils/timingSafeEqual.ts +23 -0
  1234. package/src/utils/types.ts +547 -0
  1235. package/src/utils/validation.ts +130 -0
  1236. package/src/x509certificate.ts +277 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["KFormatType","exports","KeyType","KeyEncoding","KeyFormat","kNamedCurveAliases","KeyVariant"],"sources":["types.ts"],"sourcesContent":["import type { Buffer as CraftzdogBuffer } from '@craftzdog/react-native-buffer';\r\nimport type { Buffer } from 'buffer';\r\nimport type { CipherKey } from 'node:crypto'; // @types/node\r\nimport type { Buffer as SafeBuffer } from 'safe-buffer';\r\nimport type { KeyObjectHandle as KeyObjectHandleType } from '../specs/v1/keyObjectHandle.nitro';\r\nimport type { KeyObject, CryptoKey } from '../keys';\r\n\r\nexport type ABV = TypedArray | DataView | ArrayBufferLike | CraftzdogBuffer;\r\n\r\nexport type TypedArray =\r\n | Uint8Array\r\n | Uint8ClampedArray\r\n | Uint16Array\r\n | Uint32Array\r\n | Int8Array\r\n | Int16Array\r\n | Int32Array\r\n | Float32Array\r\n | Float64Array;\r\n\r\nexport type RandomCallback<T> = (err: Error | null, value: T) => void;\r\n\r\nexport type BufferLike =\r\n | ArrayBuffer\r\n | ArrayBufferLike\r\n | CraftzdogBuffer\r\n | SafeBuffer\r\n | ArrayBufferView;\r\n\r\nexport type BinaryLike =\r\n | string\r\n | Buffer\r\n | ArrayBuffer\r\n | ArrayBufferLike\r\n | ArrayBufferView\r\n | CraftzdogBuffer\r\n | SafeBuffer\r\n | TypedArray\r\n | DataView;\r\n\r\nexport type BinaryLikeNode = CipherKey | BinaryLike | KeyObject;\r\n\r\nexport type DigestAlgorithm =\r\n | 'SHA-1'\r\n | 'SHA-256'\r\n | 'SHA-384'\r\n | 'SHA-512'\r\n | 'SHA3-256'\r\n | 'SHA3-384'\r\n | 'SHA3-512'\r\n | 'cSHAKE128'\r\n | 'cSHAKE256';\r\n\r\nexport type HashAlgorithm = DigestAlgorithm | 'SHA-224' | 'RIPEMD-160';\r\n\r\nexport type RSAKeyPairAlgorithm = 'RSASSA-PKCS1-v1_5' | 'RSA-PSS' | 'RSA-OAEP';\r\n\r\nexport interface RsaHashedKeyGenParams {\r\n name: RSAKeyPairAlgorithm;\r\n modulusLength: number;\r\n publicExponent: Uint8Array;\r\n hash: string | { name: string };\r\n}\r\n\r\nexport interface RsaKeyAlgorithm {\r\n name: RSAKeyPairAlgorithm;\r\n modulusLength: number;\r\n publicExponent: Uint8Array;\r\n hash: { name: string };\r\n}\r\n\r\nexport type ECKeyPairAlgorithm = 'ECDSA' | 'ECDH';\r\n\r\nexport type CFRGKeyPairAlgorithm = 'Ed25519' | 'Ed448' | 'X25519' | 'X448';\r\nexport type CFRGKeyPairType = 'ed25519' | 'ed448' | 'x25519' | 'x448';\r\n\r\nexport type PQCKeyPairAlgorithm =\r\n | 'ML-DSA-44'\r\n | 'ML-DSA-65'\r\n | 'ML-DSA-87'\r\n | 'ML-KEM-512'\r\n | 'ML-KEM-768'\r\n | 'ML-KEM-1024';\r\nexport type PQCKeyPairType =\r\n | 'ml-dsa-44'\r\n | 'ml-dsa-65'\r\n | 'ml-dsa-87'\r\n | 'ml-kem-512'\r\n | 'ml-kem-768'\r\n | 'ml-kem-1024';\r\n\r\nexport type MlKemAlgorithm = 'ML-KEM-512' | 'ML-KEM-768' | 'ML-KEM-1024';\r\n\r\nexport interface EncapsulateResult {\r\n sharedKey: ArrayBuffer;\r\n ciphertext: ArrayBuffer;\r\n}\r\n\r\n// Node.js style key pair types (lowercase)\r\nexport type RSAKeyPairType = 'rsa' | 'rsa-pss';\r\nexport type ECKeyPairType = 'ec';\r\nexport type DSAKeyPairType = 'dsa';\r\nexport type DHKeyPairType = 'dh';\r\n\r\nexport type KeyPairAlgorithm =\r\n | RSAKeyPairAlgorithm\r\n | ECKeyPairAlgorithm\r\n | CFRGKeyPairAlgorithm\r\n | PQCKeyPairAlgorithm;\r\n\r\nexport type AESAlgorithm =\r\n | 'AES-CTR'\r\n | 'AES-CBC'\r\n | 'AES-GCM'\r\n | 'AES-KW'\r\n | 'AES-OCB';\r\n\r\nexport type SecretKeyAlgorithm = 'HMAC' | AESAlgorithm;\r\n\r\nexport type SignVerifyAlgorithm =\r\n | 'RSASSA-PKCS1-v1_5'\r\n | 'RSA-PSS'\r\n | 'ECDSA'\r\n | 'HMAC'\r\n | 'KMAC128'\r\n | 'KMAC256'\r\n | 'Ed25519'\r\n | 'Ed448'\r\n | 'ML-DSA-44'\r\n | 'ML-DSA-65'\r\n | 'ML-DSA-87';\r\n\r\nexport type Argon2Algorithm = 'Argon2d' | 'Argon2i' | 'Argon2id';\r\n\r\nexport type DeriveBitsAlgorithm =\r\n | 'PBKDF2'\r\n | 'HKDF'\r\n | 'ECDH'\r\n | 'X25519'\r\n | 'X448'\r\n | Argon2Algorithm;\r\n\r\nexport type EncryptDecryptAlgorithm =\r\n | 'RSA-OAEP'\r\n | 'AES-CTR'\r\n | 'AES-CBC'\r\n | 'AES-GCM'\r\n | 'AES-KW'\r\n | 'AES-OCB'\r\n | 'ChaCha20-Poly1305';\r\n\r\nexport type RsaOaepParams = {\r\n name: 'RSA-OAEP';\r\n label?: BufferLike;\r\n};\r\n\r\nexport type AesCbcParams = {\r\n name: 'AES-CBC';\r\n iv: BufferLike;\r\n};\r\n\r\nexport type AesCtrParams = {\r\n name: 'AES-CTR';\r\n counter: TypedArray;\r\n length: number;\r\n};\r\n\r\nexport type AesGcmParams = {\r\n name: 'AES-GCM';\r\n iv: BufferLike;\r\n tagLength?: TagLength;\r\n additionalData?: BufferLike;\r\n};\r\n\r\nexport type ChaCha20Poly1305Params = {\r\n name: 'ChaCha20-Poly1305';\r\n iv: BufferLike;\r\n tagLength?: 128;\r\n additionalData?: BufferLike;\r\n};\r\n\r\nexport type AesOcbParams = {\r\n name: 'AES-OCB';\r\n iv: BufferLike;\r\n tagLength?: 64 | 96 | 128;\r\n additionalData?: BufferLike;\r\n};\r\n\r\nexport type AesKwParams = {\r\n name: 'AES-KW';\r\n wrappingKey?: BufferLike;\r\n};\r\n\r\nexport type AesKeyGenParams = {\r\n length: AESLength;\r\n name?: AESAlgorithm;\r\n};\r\n\r\nexport type TagLength = 32 | 64 | 96 | 104 | 112 | 120 | 128;\r\n\r\nexport type AESLength = 128 | 192 | 256;\r\n\r\nexport type EncryptDecryptParams =\r\n | AesCbcParams\r\n | AesCtrParams\r\n | AesGcmParams\r\n | AesOcbParams\r\n | AesKwParams\r\n | RsaOaepParams\r\n | ChaCha20Poly1305Params;\r\n\r\nexport type AnyAlgorithm =\r\n | DigestAlgorithm\r\n | HashAlgorithm\r\n | KeyPairAlgorithm\r\n | SecretKeyAlgorithm\r\n | SignVerifyAlgorithm\r\n | DeriveBitsAlgorithm\r\n | EncryptDecryptAlgorithm\r\n | AESAlgorithm\r\n | 'PBKDF2'\r\n | 'HKDF'\r\n | 'unknown';\r\n\r\nexport type NamedCurve = 'P-256' | 'P-384' | 'P-521';\r\n\r\nexport type SubtleAlgorithm = {\r\n name: AnyAlgorithm;\r\n salt?: string | BufferLike;\r\n iterations?: number;\r\n hash?: HashAlgorithm | string | { name: string };\r\n namedCurve?: NamedCurve;\r\n length?: number;\r\n modulusLength?: number;\r\n publicExponent?: number | Uint8Array;\r\n saltLength?: number;\r\n public?: CryptoKey;\r\n info?: BufferLike;\r\n // Argon2 parameters\r\n nonce?: BufferLike;\r\n parallelism?: number;\r\n tagLength?: number;\r\n memory?: number;\r\n passes?: number;\r\n secretValue?: BufferLike;\r\n associatedData?: BufferLike;\r\n version?: number;\r\n // KMAC parameters\r\n customization?: BufferLike;\r\n};\r\n\r\nexport type KeyPairType =\r\n | CFRGKeyPairType\r\n | RSAKeyPairType\r\n | ECKeyPairType\r\n | DSAKeyPairType\r\n | DHKeyPairType;\r\n\r\nexport type KeyUsage =\r\n | 'encrypt'\r\n | 'decrypt'\r\n | 'sign'\r\n | 'verify'\r\n | 'deriveKey'\r\n | 'deriveBits'\r\n | 'encapsulateBits'\r\n | 'decapsulateBits'\r\n | 'encapsulateKey'\r\n | 'decapsulateKey'\r\n | 'wrapKey'\r\n | 'unwrapKey';\r\n\r\n// TODO: These enums need to be defined on the native side\r\nexport enum KFormatType {\r\n DER,\r\n PEM,\r\n JWK,\r\n}\r\n\r\nexport enum KeyType {\r\n SECRET,\r\n PUBLIC,\r\n PRIVATE,\r\n}\r\n\r\nexport enum KeyEncoding {\r\n PKCS1,\r\n PKCS8,\r\n SPKI,\r\n SEC1,\r\n}\r\n\r\nexport enum KeyFormat {\r\n RAW,\r\n PKCS8,\r\n SPKI,\r\n JWK,\r\n}\r\n\r\nexport type KeyData = BufferLike | BinaryLike | JWK;\r\n\r\nexport const kNamedCurveAliases = {\r\n 'P-256': 'prime256v1',\r\n 'P-384': 'secp384r1',\r\n 'P-521': 'secp521r1',\r\n} as const;\r\n// end TODO\r\n\r\nexport type KeyPairGenConfig = {\r\n publicFormat?: KFormatType | -1;\r\n publicType?: KeyEncoding;\r\n privateFormat?: KFormatType | -1;\r\n privateType?: KeyEncoding;\r\n cipher?: string;\r\n passphrase?: ArrayBuffer;\r\n};\r\n\r\nexport type AsymmetricKeyType =\r\n | 'rsa'\r\n | 'rsa-pss'\r\n | 'dsa'\r\n | 'ec'\r\n | 'dh'\r\n | CFRGKeyPairType\r\n | PQCKeyPairType;\r\n\r\ntype JWKkty = 'AES' | 'RSA' | 'EC' | 'oct' | 'OKP';\r\ntype JWKuse = 'sig' | 'enc';\r\n\r\nexport interface JWK {\r\n kty?: JWKkty;\r\n use?: JWKuse;\r\n key_ops?: KeyUsage[];\r\n alg?: string; // TODO: enumerate these (RFC-7517)\r\n crv?: string;\r\n kid?: string;\r\n x5u?: string;\r\n x5c?: string[];\r\n x5t?: string;\r\n 'x5t#256'?: string;\r\n n?: string;\r\n e?: string;\r\n d?: string;\r\n p?: string;\r\n q?: string;\r\n x?: string;\r\n y?: string;\r\n k?: string;\r\n dp?: string;\r\n dq?: string;\r\n qi?: string;\r\n ext?: boolean;\r\n}\r\n\r\nexport type KTypePrivate = 'pkcs1' | 'pkcs8' | 'sec1';\r\nexport type KTypePublic = 'pkcs1' | 'spki';\r\nexport type KType = KTypePrivate | KTypePublic;\r\n\r\nexport type KFormat = 'der' | 'pem' | 'jwk';\r\n\r\nexport type DSAEncoding = 'der' | 'ieee-p1363';\r\n\r\nexport type EncodingOptions = {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n key?: any;\r\n type?: KType;\r\n encoding?: string;\r\n dsaEncoding?: DSAEncoding;\r\n format?: KFormat;\r\n padding?: number;\r\n cipher?: string;\r\n passphrase?: BinaryLike;\r\n saltLength?: number;\r\n oaepHash?: string;\r\n oaepLabel?: BinaryLike;\r\n};\r\n\r\nexport interface KeyDetail {\r\n length?: number;\r\n publicExponent?: number;\r\n modulusLength?: number;\r\n hashAlgorithm?: string;\r\n mgf1HashAlgorithm?: string;\r\n saltLength?: number;\r\n namedCurve?: string;\r\n}\r\n\r\nexport type GenerateKeyPairOptions = {\r\n modulusLength?: number; // Key size in bits (RSA, DSA).\r\n publicExponent?: number; // Public exponent (RSA). Default: 0x10001.\r\n hashAlgorithm?: string; // Name of the message digest (RSA-PSS).\r\n mgf1HashAlgorithm?: string; // string Name of the message digest used by MGF1 (RSA-PSS).\r\n saltLength?: number; // Minimal salt length in bytes (RSA-PSS).\r\n divisorLength?: number; // Size of q in bits (DSA).\r\n namedCurve?: string; // Name of the curve to use (EC).\r\n prime?: CraftzdogBuffer; // The prime parameter (DH).\r\n primeLength?: number; // Prime length in bits (DH).\r\n generator?: number; // Custom generator (DH). Default: 2.\r\n groupName?: string; // Diffie-Hellman group name (DH). See crypto.getDiffieHellman().\r\n publicKeyEncoding?: EncodingOptions; // See keyObject.export().\r\n privateKeyEncoding?: EncodingOptions; // See keyObject.export().\r\n paramEncoding?: string;\r\n hash?: string;\r\n mgf1Hash?: string;\r\n};\r\n\r\nexport type KeyPairKey =\r\n | ArrayBuffer\r\n | Buffer\r\n | string\r\n | KeyObject\r\n | KeyObjectHandle\r\n | CryptoKey\r\n | undefined;\r\n\r\nexport type GenerateKeyPairReturn = [\r\n error?: Error,\r\n privateKey?: KeyPairKey,\r\n publicKey?: KeyPairKey,\r\n];\r\n\r\nexport type GenerateKeyPairCallback = (\r\n error?: Error,\r\n publicKey?: KeyPairKey,\r\n privateKey?: KeyPairKey,\r\n) => GenerateKeyPairReturn | void;\r\n\r\nexport type KeyPair = {\r\n publicKey?: KeyPairKey;\r\n privateKey?: KeyPairKey;\r\n};\r\n\r\nexport type GenerateKeyPairPromiseReturn = [error?: Error, keypair?: KeyPair];\r\n\r\nexport type CryptoKeyPair = {\r\n publicKey: KeyPairKey;\r\n privateKey: KeyPairKey;\r\n};\r\n\r\nexport type WebCryptoKeyPair = {\r\n publicKey: CryptoKey;\r\n privateKey: CryptoKey;\r\n};\r\n\r\nexport enum KeyVariant {\r\n RSA_SSA_PKCS1_v1_5,\r\n RSA_PSS,\r\n RSA_OAEP,\r\n DSA,\r\n EC,\r\n NID,\r\n DH,\r\n}\r\n\r\nexport type SignCallback = (err: Error | null, signature?: ArrayBuffer) => void;\r\n\r\nexport type VerifyCallback = (err: Error | null, valid?: boolean) => void;\r\n\r\nexport type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary';\r\nexport type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';\r\nexport type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';\r\nexport type Encoding =\r\n | BinaryToTextEncoding\r\n | CharacterEncoding\r\n | LegacyCharacterEncoding\r\n | 'buffer';\r\n\r\n// These are for shortcomings in @types/node\r\n// Here we use \"*Type\" instead of \"*Types\" like node does.\r\n// export type CipherCBCType = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc';\r\nexport type CipherCFBType =\r\n | 'aes-128-cfb'\r\n | 'aes-192-cfb'\r\n | 'aes-256-cfb'\r\n | 'aes-128-cfb1'\r\n | 'aes-192-cfb1'\r\n | 'aes-256-cfb1'\r\n | 'aes-128-cfb8'\r\n | 'aes-192-cfb8'\r\n | 'aes-256-cfb8';\r\nexport type CipherCTRType = 'aes-128-ctr' | 'aes-192-ctr' | 'aes-256-ctr';\r\nexport type CipherDESType =\r\n | 'des'\r\n | 'des3'\r\n | 'des-cbc'\r\n | 'des-ecb'\r\n | 'des-ede'\r\n | 'des-ede-cbc'\r\n | 'des-ede3'\r\n | 'des-ede3-cbc';\r\nexport type CipherECBType = 'aes-128-ecb' | 'aes-192-ecb' | 'aes-256-ecb';\r\nexport type CipherGCMType = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';\r\nexport type CipherOFBType = 'aes-128-ofb' | 'aes-192-ofb' | 'aes-256-ofb';\r\n\r\nexport type KeyObjectHandle = KeyObjectHandleType;\r\n\r\nexport type DiffieHellmanOptions = {\r\n privateKey: KeyObject;\r\n publicKey: KeyObject;\r\n};\r\n\r\nexport type DiffieHellmanCallback = (\r\n err: Error | null,\r\n secret?: CraftzdogBuffer,\r\n) => CraftzdogBuffer | void;\r\n\r\n// from @paulmillr/noble-curves\r\nexport type Hex = string | Uint8Array;\r\n\r\nexport type ImportFormat =\r\n | 'raw'\r\n | 'raw-public'\r\n | 'raw-secret'\r\n | 'raw-seed'\r\n | 'pkcs8'\r\n | 'spki'\r\n | 'jwk';\r\n\r\nexport type Operation =\r\n | 'encrypt'\r\n | 'decrypt'\r\n | 'sign'\r\n | 'verify'\r\n | 'generateKey'\r\n | 'importKey'\r\n | 'exportKey'\r\n | 'deriveBits'\r\n | 'wrapKey'\r\n | 'unwrapKey'\r\n | 'encapsulateBits'\r\n | 'decapsulateBits'\r\n | 'encapsulateKey'\r\n | 'decapsulateKey';\r\n\r\nexport interface KeyPairOptions {\r\n namedCurve: string;\r\n publicKeyEncoding?: {\r\n type: 'spki';\r\n format: 'pem' | 'der';\r\n };\r\n privateKeyEncoding?: {\r\n type: 'pkcs8';\r\n format: 'pem' | 'der';\r\n cipher?: string;\r\n passphrase?: string;\r\n };\r\n}\r\n"],"mappings":";;;;;;AAE8C;AAgG9C;AA8KA;AAAA,IACYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAA,IAMXE,OAAO,GAAAD,OAAA,CAAAC,OAAA,0BAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;AAAA,IAMPC,WAAW,GAAAF,OAAA,CAAAE,WAAA,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAA,IAOXC,SAAS,GAAAH,OAAA,CAAAG,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AASd,MAAMC,kBAAkB,GAAAJ,OAAA,CAAAI,kBAAA,GAAG;EAChC,OAAO,EAAE,YAAY;EACrB,OAAO,EAAE,WAAW;EACpB,OAAO,EAAE;AACX,CAAU;AACV;AAAA,IA0IYC,UAAU,GAAAL,OAAA,CAAAK,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA,OAuBtB;AACA;AACA;AAqCA","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getUsagesUnion = void 0;
7
+ exports.hasAnyNotIn = hasAnyNotIn;
8
+ exports.isStringOrBuffer = isStringOrBuffer;
9
+ exports.validateFunction = validateFunction;
10
+ exports.validateMaxBufferLength = exports.validateKeyOps = void 0;
11
+ exports.validateObject = validateObject;
12
+ var _safeBuffer = require("safe-buffer");
13
+ var _errors = require("./errors");
14
+ // The maximum buffer size that we'll support in the WebCrypto impl
15
+ const kMaxBufferLength = 2 ** 31 - 1;
16
+ function validateFunction(f) {
17
+ return f !== null && typeof f === 'function';
18
+ }
19
+ function isStringOrBuffer(val) {
20
+ return typeof val === 'string' || ArrayBuffer.isView(val) || val instanceof ArrayBuffer;
21
+ }
22
+ function validateObject(value, name, options) {
23
+ const useDefaultOptions = options == null;
24
+ const allowArray = useDefaultOptions ? false : options.allowArray;
25
+ const allowFunction = useDefaultOptions ? false : options.allowFunction;
26
+ const nullable = useDefaultOptions ? false : options.nullable;
27
+ if (!nullable && value === null || !allowArray && Array.isArray(value) || typeof value !== 'object' && (!allowFunction || typeof value !== 'function')) {
28
+ throw new Error(`${name} is not a valid object ${value}`);
29
+ }
30
+ return true;
31
+ }
32
+ const validateMaxBufferLength = (data, name) => {
33
+ const length = typeof data === 'string' || data instanceof _safeBuffer.Buffer ? data.length : data.byteLength;
34
+ if (length > kMaxBufferLength) {
35
+ throw (0, _errors.lazyDOMException)(`${name} must be less than ${kMaxBufferLength + 1} bits`, 'OperationError');
36
+ }
37
+ };
38
+ exports.validateMaxBufferLength = validateMaxBufferLength;
39
+ const getUsagesUnion = (usageSet, ...usages) => {
40
+ const newset = [];
41
+ for (let n = 0; n < usages.length; n++) {
42
+ if (!usages[n] || usages[n] === undefined) continue;
43
+ if (usageSet.includes(usages[n])) newset.push(usages[n]);
44
+ }
45
+ return newset;
46
+ };
47
+ exports.getUsagesUnion = getUsagesUnion;
48
+ const kKeyOps = {
49
+ sign: 1,
50
+ verify: 2,
51
+ encrypt: 3,
52
+ decrypt: 4,
53
+ wrapKey: 5,
54
+ unwrapKey: 6,
55
+ deriveKey: 7,
56
+ deriveBits: 8,
57
+ encapsulateBits: 9,
58
+ decapsulateBits: 10,
59
+ encapsulateKey: 11,
60
+ decapsulateKey: 12
61
+ };
62
+ const validateKeyOps = (keyOps, usagesSet) => {
63
+ if (keyOps === undefined) return;
64
+ if (!Array.isArray(keyOps)) {
65
+ throw (0, _errors.lazyDOMException)('keyData.key_ops', 'InvalidArgument');
66
+ }
67
+ let flags = 0;
68
+ for (let n = 0; n < keyOps.length; n++) {
69
+ const op = keyOps[n];
70
+ const op_flag = kKeyOps[op];
71
+ // Skipping unknown key ops
72
+ if (op_flag === undefined) continue;
73
+ // Have we seen it already? if so, error
74
+ if (flags & 1 << op_flag) throw (0, _errors.lazyDOMException)('Duplicate key operation', 'DataError');
75
+ flags |= 1 << op_flag;
76
+
77
+ // TODO(@jasnell): RFC7517 section 4.3 strong recommends validating
78
+ // key usage combinations. Specifically, it says that unrelated key
79
+ // ops SHOULD NOT be used together. We're not yet validating that here.
80
+ }
81
+ if (usagesSet !== undefined) {
82
+ for (const use of usagesSet) {
83
+ if (!keyOps.includes(use)) {
84
+ throw (0, _errors.lazyDOMException)('Key operations and usage mismatch', 'DataError');
85
+ }
86
+ }
87
+ }
88
+ };
89
+ exports.validateKeyOps = validateKeyOps;
90
+ function hasAnyNotIn(set, checks) {
91
+ for (const s of set) {
92
+ if (!checks.includes(s)) {
93
+ return true;
94
+ }
95
+ }
96
+ return false;
97
+ }
98
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_safeBuffer","require","_errors","kMaxBufferLength","validateFunction","f","isStringOrBuffer","val","ArrayBuffer","isView","validateObject","value","name","options","useDefaultOptions","allowArray","allowFunction","nullable","Array","isArray","Error","validateMaxBufferLength","data","length","SBuffer","byteLength","lazyDOMException","exports","getUsagesUnion","usageSet","usages","newset","n","undefined","includes","push","kKeyOps","sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits","encapsulateBits","decapsulateBits","encapsulateKey","decapsulateKey","validateKeyOps","keyOps","usagesSet","flags","op","op_flag","use","hasAnyNotIn","set","checks","s"],"sources":["validation.ts"],"sourcesContent":["import { Buffer as SBuffer } from 'safe-buffer';\r\nimport type { BinaryLike, BufferLike, KeyUsage } from './types';\r\nimport { lazyDOMException } from './errors';\r\n\r\n// The maximum buffer size that we'll support in the WebCrypto impl\r\nconst kMaxBufferLength = 2 ** 31 - 1;\r\n\r\nexport function validateFunction(f: unknown): boolean {\r\n return f !== null && typeof f === 'function';\r\n}\r\n\r\nexport function isStringOrBuffer(val: unknown): val is string | ArrayBuffer {\r\n return (\r\n typeof val === 'string' ||\r\n ArrayBuffer.isView(val) ||\r\n val instanceof ArrayBuffer\r\n );\r\n}\r\n\r\nexport function validateObject<T>(\r\n value: unknown,\r\n name: string,\r\n options?: {\r\n allowArray: boolean;\r\n allowFunction: boolean;\r\n nullable: boolean;\r\n } | null,\r\n): value is T {\r\n const useDefaultOptions = options == null;\r\n const allowArray = useDefaultOptions ? false : options.allowArray;\r\n const allowFunction = useDefaultOptions ? false : options.allowFunction;\r\n const nullable = useDefaultOptions ? false : options.nullable;\r\n if (\r\n (!nullable && value === null) ||\r\n (!allowArray && Array.isArray(value)) ||\r\n (typeof value !== 'object' &&\r\n (!allowFunction || typeof value !== 'function'))\r\n ) {\r\n throw new Error(`${name} is not a valid object ${value}`);\r\n }\r\n return true;\r\n}\r\n\r\nexport const validateMaxBufferLength = (\r\n data: BinaryLike | BufferLike,\r\n name: string,\r\n): void => {\r\n const length =\r\n typeof data === 'string' || data instanceof SBuffer\r\n ? data.length\r\n : data.byteLength;\r\n if (length > kMaxBufferLength) {\r\n throw lazyDOMException(\r\n `${name} must be less than ${kMaxBufferLength + 1} bits`,\r\n 'OperationError',\r\n );\r\n }\r\n};\r\n\r\nexport const getUsagesUnion = (usageSet: KeyUsage[], ...usages: KeyUsage[]) => {\r\n const newset: KeyUsage[] = [];\r\n for (let n = 0; n < usages.length; n++) {\r\n if (!usages[n] || usages[n] === undefined) continue;\r\n if (usageSet.includes(usages[n] as KeyUsage))\r\n newset.push(usages[n] as KeyUsage);\r\n }\r\n return newset;\r\n};\r\n\r\nconst kKeyOps: {\r\n [key in KeyUsage]: number;\r\n} = {\r\n sign: 1,\r\n verify: 2,\r\n encrypt: 3,\r\n decrypt: 4,\r\n wrapKey: 5,\r\n unwrapKey: 6,\r\n deriveKey: 7,\r\n deriveBits: 8,\r\n encapsulateBits: 9,\r\n decapsulateBits: 10,\r\n encapsulateKey: 11,\r\n decapsulateKey: 12,\r\n};\r\n\r\nexport const validateKeyOps = (\r\n keyOps: KeyUsage[] | undefined,\r\n usagesSet: KeyUsage[],\r\n) => {\r\n if (keyOps === undefined) return;\r\n if (!Array.isArray(keyOps)) {\r\n throw lazyDOMException('keyData.key_ops', 'InvalidArgument');\r\n }\r\n let flags = 0;\r\n for (let n = 0; n < keyOps.length; n++) {\r\n const op: KeyUsage = keyOps[n] as KeyUsage;\r\n const op_flag = kKeyOps[op];\r\n // Skipping unknown key ops\r\n if (op_flag === undefined) continue;\r\n // Have we seen it already? if so, error\r\n if (flags & (1 << op_flag))\r\n throw lazyDOMException('Duplicate key operation', 'DataError');\r\n flags |= 1 << op_flag;\r\n\r\n // TODO(@jasnell): RFC7517 section 4.3 strong recommends validating\r\n // key usage combinations. Specifically, it says that unrelated key\r\n // ops SHOULD NOT be used together. We're not yet validating that here.\r\n }\r\n\r\n if (usagesSet !== undefined) {\r\n for (const use of usagesSet) {\r\n if (!keyOps.includes(use)) {\r\n throw lazyDOMException(\r\n 'Key operations and usage mismatch',\r\n 'DataError',\r\n );\r\n }\r\n }\r\n }\r\n};\r\n\r\nexport function hasAnyNotIn(set: string[], checks: string[]) {\r\n for (const s of set) {\r\n if (!checks.includes(s)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.X509Certificate = void 0;
7
+ var _reactNativeNitroModules = require("react-native-nitro-modules");
8
+ var _reactNativeBuffer = require("@craftzdog/react-native-buffer");
9
+ var _keys = require("./keys");
10
+ var _utils = require("./utils");
11
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ const X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT = 0x1;
15
+ const X509_CHECK_FLAG_NO_WILDCARDS = 0x2;
16
+ const X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS = 0x4;
17
+ const X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS = 0x8;
18
+ const X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS = 0x10;
19
+ const X509_CHECK_FLAG_NEVER_CHECK_SUBJECT = 0x20;
20
+ function getFlags(options) {
21
+ if (!options) return 0;
22
+ let flags = 0;
23
+ if (options.subject === 'always') {
24
+ flags |= X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT;
25
+ } else if (options.subject === 'never') {
26
+ flags |= X509_CHECK_FLAG_NEVER_CHECK_SUBJECT;
27
+ }
28
+ if (options.wildcards === false) {
29
+ flags |= X509_CHECK_FLAG_NO_WILDCARDS;
30
+ }
31
+ if (options.partialWildcards === false) {
32
+ flags |= X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;
33
+ }
34
+ if (options.multiLabelWildcards === true) {
35
+ flags |= X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS;
36
+ }
37
+ if (options.singleLabelSubdomains === true) {
38
+ flags |= X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS;
39
+ }
40
+ return flags;
41
+ }
42
+ class X509Certificate {
43
+ constructor(buffer) {
44
+ _defineProperty(this, "handle", void 0);
45
+ _defineProperty(this, "cache", new Map());
46
+ this.handle = _reactNativeNitroModules.NitroModules.createHybridObject('X509CertificateHandle');
47
+ let ab;
48
+ if (typeof buffer === 'string') {
49
+ ab = _reactNativeBuffer.Buffer.from(buffer).buffer;
50
+ } else {
51
+ ab = (0, _utils.binaryLikeToArrayBuffer)(buffer);
52
+ }
53
+ this.handle.init(ab);
54
+ }
55
+ cached(key, compute) {
56
+ if (this.cache.has(key)) {
57
+ return this.cache.get(key);
58
+ }
59
+ const value = compute();
60
+ this.cache.set(key, value);
61
+ return value;
62
+ }
63
+ get subject() {
64
+ return this.cached('subject', () => this.handle.subject());
65
+ }
66
+ get subjectAltName() {
67
+ return this.cached('subjectAltName', () => this.handle.subjectAltName());
68
+ }
69
+ get issuer() {
70
+ return this.cached('issuer', () => this.handle.issuer());
71
+ }
72
+ get infoAccess() {
73
+ return this.cached('infoAccess', () => this.handle.infoAccess());
74
+ }
75
+ get validFrom() {
76
+ return this.cached('validFrom', () => this.handle.validFrom());
77
+ }
78
+ get validTo() {
79
+ return this.cached('validTo', () => this.handle.validTo());
80
+ }
81
+ get validFromDate() {
82
+ return this.cached('validFromDate', () => new Date(this.handle.validFromDate()));
83
+ }
84
+ get validToDate() {
85
+ return this.cached('validToDate', () => new Date(this.handle.validToDate()));
86
+ }
87
+ get fingerprint() {
88
+ return this.cached('fingerprint', () => this.handle.fingerprint());
89
+ }
90
+ get fingerprint256() {
91
+ return this.cached('fingerprint256', () => this.handle.fingerprint256());
92
+ }
93
+ get fingerprint512() {
94
+ return this.cached('fingerprint512', () => this.handle.fingerprint512());
95
+ }
96
+ get extKeyUsage() {
97
+ return this.cached('extKeyUsage', () => this.handle.keyUsage());
98
+ }
99
+ get keyUsage() {
100
+ return this.extKeyUsage;
101
+ }
102
+ get serialNumber() {
103
+ return this.cached('serialNumber', () => this.handle.serialNumber());
104
+ }
105
+ get signatureAlgorithm() {
106
+ return this.cached('signatureAlgorithm', () => this.handle.signatureAlgorithm());
107
+ }
108
+ get signatureAlgorithmOid() {
109
+ return this.cached('signatureAlgorithmOid', () => this.handle.signatureAlgorithmOid());
110
+ }
111
+ get ca() {
112
+ return this.cached('ca', () => this.handle.ca());
113
+ }
114
+ get raw() {
115
+ return this.cached('raw', () => _reactNativeBuffer.Buffer.from(this.handle.raw()));
116
+ }
117
+ get publicKey() {
118
+ return this.cached('publicKey', () => new _keys.PublicKeyObject(this.handle.publicKey()));
119
+ }
120
+ get issuerCertificate() {
121
+ return undefined;
122
+ }
123
+ checkHost(name, options) {
124
+ if (typeof name !== 'string') {
125
+ throw new TypeError('The "name" argument must be a string');
126
+ }
127
+ return this.handle.checkHost(name, getFlags(options));
128
+ }
129
+ checkEmail(email, options) {
130
+ if (typeof email !== 'string') {
131
+ throw new TypeError('The "email" argument must be a string');
132
+ }
133
+ return this.handle.checkEmail(email, getFlags(options));
134
+ }
135
+ checkIP(ip) {
136
+ if (typeof ip !== 'string') {
137
+ throw new TypeError('The "ip" argument must be a string');
138
+ }
139
+ return this.handle.checkIP(ip);
140
+ }
141
+ checkIssued(otherCert) {
142
+ if (!(otherCert instanceof X509Certificate)) {
143
+ throw new TypeError('The "otherCert" argument must be an instance of X509Certificate');
144
+ }
145
+ return this.handle.checkIssued(otherCert.handle);
146
+ }
147
+ checkPrivateKey(pkey) {
148
+ if (!(pkey instanceof _keys.KeyObject)) {
149
+ throw new TypeError('The "pkey" argument must be an instance of KeyObject');
150
+ }
151
+ if (pkey.type !== 'private') {
152
+ throw new TypeError('The "pkey" argument must be a private key');
153
+ }
154
+ return this.handle.checkPrivateKey(pkey.handle);
155
+ }
156
+ verify(pkey) {
157
+ if (!(pkey instanceof _keys.KeyObject)) {
158
+ throw new TypeError('The "pkey" argument must be an instance of KeyObject');
159
+ }
160
+ if (pkey.type !== 'public') {
161
+ throw new TypeError(`The "pkey" argument must be a public key, got '${pkey.type}'`);
162
+ }
163
+ return this.handle.verify(pkey.handle);
164
+ }
165
+ toString() {
166
+ return this.cached('pem', () => this.handle.pem());
167
+ }
168
+ toJSON() {
169
+ return this.toString();
170
+ }
171
+ toLegacyObject() {
172
+ return {
173
+ subject: this.subject,
174
+ issuer: this.issuer,
175
+ subjectaltname: this.subjectAltName,
176
+ infoAccess: this.infoAccess,
177
+ ca: this.ca,
178
+ modulus: undefined,
179
+ bits: undefined,
180
+ exponent: undefined,
181
+ valid_from: this.validFrom,
182
+ valid_to: this.validTo,
183
+ fingerprint: this.fingerprint,
184
+ fingerprint256: this.fingerprint256,
185
+ fingerprint512: this.fingerprint512,
186
+ ext_key_usage: this.keyUsage,
187
+ serialNumber: this.serialNumber,
188
+ raw: this.raw
189
+ };
190
+ }
191
+ }
192
+ exports.X509Certificate = X509Certificate;
193
+ //# sourceMappingURL=x509certificate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeNitroModules","require","_reactNativeBuffer","_keys","_utils","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT","X509_CHECK_FLAG_NO_WILDCARDS","X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS","X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS","X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS","X509_CHECK_FLAG_NEVER_CHECK_SUBJECT","getFlags","options","flags","subject","wildcards","partialWildcards","multiLabelWildcards","singleLabelSubdomains","X509Certificate","constructor","buffer","Map","handle","NitroModules","createHybridObject","ab","Buffer","from","binaryLikeToArrayBuffer","init","cached","key","compute","cache","has","get","set","subjectAltName","issuer","infoAccess","validFrom","validTo","validFromDate","Date","validToDate","fingerprint","fingerprint256","fingerprint512","extKeyUsage","keyUsage","serialNumber","signatureAlgorithm","signatureAlgorithmOid","ca","raw","publicKey","PublicKeyObject","issuerCertificate","undefined","checkHost","name","checkEmail","email","checkIP","ip","checkIssued","otherCert","checkPrivateKey","pkey","KeyObject","type","verify","toString","pem","toJSON","toLegacyObject","subjectaltname","modulus","bits","exponent","valid_from","valid_to","ext_key_usage","exports"],"sources":["x509certificate.ts"],"sourcesContent":["import { NitroModules } from 'react-native-nitro-modules';\r\nimport { Buffer } from '@craftzdog/react-native-buffer';\r\nimport type { X509CertificateHandle } from './specs/v1/x509certificate.nitro';\r\nimport { PublicKeyObject, KeyObject } from './keys';\r\nimport type { BinaryLike } from './utils';\r\nimport { binaryLikeToArrayBuffer } from './utils';\r\n\r\nconst X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT = 0x1;\r\nconst X509_CHECK_FLAG_NO_WILDCARDS = 0x2;\r\nconst X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS = 0x4;\r\nconst X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS = 0x8;\r\nconst X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS = 0x10;\r\nconst X509_CHECK_FLAG_NEVER_CHECK_SUBJECT = 0x20;\r\n\r\nexport interface X509LegacyObject {\r\n subject: string;\r\n issuer: string;\r\n subjectaltname: string;\r\n infoAccess: string;\r\n ca: boolean;\r\n modulus: undefined;\r\n bits: undefined;\r\n exponent: undefined;\r\n valid_from: string;\r\n valid_to: string;\r\n fingerprint: string;\r\n fingerprint256: string;\r\n fingerprint512: string;\r\n ext_key_usage: string[];\r\n serialNumber: string;\r\n raw: Buffer;\r\n}\r\n\r\nexport interface CheckOptions {\r\n subject?: 'default' | 'always' | 'never';\r\n wildcards?: boolean;\r\n partialWildcards?: boolean;\r\n multiLabelWildcards?: boolean;\r\n singleLabelSubdomains?: boolean;\r\n}\r\n\r\nfunction getFlags(options?: CheckOptions): number {\r\n if (!options) return 0;\r\n\r\n let flags = 0;\r\n\r\n if (options.subject === 'always') {\r\n flags |= X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT;\r\n } else if (options.subject === 'never') {\r\n flags |= X509_CHECK_FLAG_NEVER_CHECK_SUBJECT;\r\n }\r\n\r\n if (options.wildcards === false) {\r\n flags |= X509_CHECK_FLAG_NO_WILDCARDS;\r\n }\r\n\r\n if (options.partialWildcards === false) {\r\n flags |= X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;\r\n }\r\n\r\n if (options.multiLabelWildcards === true) {\r\n flags |= X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS;\r\n }\r\n\r\n if (options.singleLabelSubdomains === true) {\r\n flags |= X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS;\r\n }\r\n\r\n return flags;\r\n}\r\n\r\nexport class X509Certificate {\r\n private readonly handle: X509CertificateHandle;\r\n private readonly cache = new Map<string, unknown>();\r\n\r\n constructor(buffer: BinaryLike) {\r\n this.handle = NitroModules.createHybridObject<X509CertificateHandle>(\r\n 'X509CertificateHandle',\r\n );\r\n\r\n let ab: ArrayBuffer;\r\n if (typeof buffer === 'string') {\r\n ab = Buffer.from(buffer).buffer as ArrayBuffer;\r\n } else {\r\n ab = binaryLikeToArrayBuffer(buffer);\r\n }\r\n\r\n this.handle.init(ab);\r\n }\r\n\r\n private cached<T>(key: string, compute: () => T): T {\r\n if (this.cache.has(key)) {\r\n return this.cache.get(key) as T;\r\n }\r\n const value = compute();\r\n this.cache.set(key, value);\r\n return value;\r\n }\r\n\r\n get subject(): string {\r\n return this.cached('subject', () => this.handle.subject());\r\n }\r\n\r\n get subjectAltName(): string {\r\n return this.cached('subjectAltName', () => this.handle.subjectAltName());\r\n }\r\n\r\n get issuer(): string {\r\n return this.cached('issuer', () => this.handle.issuer());\r\n }\r\n\r\n get infoAccess(): string {\r\n return this.cached('infoAccess', () => this.handle.infoAccess());\r\n }\r\n\r\n get validFrom(): string {\r\n return this.cached('validFrom', () => this.handle.validFrom());\r\n }\r\n\r\n get validTo(): string {\r\n return this.cached('validTo', () => this.handle.validTo());\r\n }\r\n\r\n get validFromDate(): Date {\r\n return this.cached(\r\n 'validFromDate',\r\n () => new Date(this.handle.validFromDate()),\r\n );\r\n }\r\n\r\n get validToDate(): Date {\r\n return this.cached(\r\n 'validToDate',\r\n () => new Date(this.handle.validToDate()),\r\n );\r\n }\r\n\r\n get fingerprint(): string {\r\n return this.cached('fingerprint', () => this.handle.fingerprint());\r\n }\r\n\r\n get fingerprint256(): string {\r\n return this.cached('fingerprint256', () => this.handle.fingerprint256());\r\n }\r\n\r\n get fingerprint512(): string {\r\n return this.cached('fingerprint512', () => this.handle.fingerprint512());\r\n }\r\n\r\n get extKeyUsage(): string[] {\r\n return this.cached('extKeyUsage', () => this.handle.keyUsage());\r\n }\r\n\r\n get keyUsage(): string[] {\r\n return this.extKeyUsage;\r\n }\r\n\r\n get serialNumber(): string {\r\n return this.cached('serialNumber', () => this.handle.serialNumber());\r\n }\r\n\r\n get signatureAlgorithm(): string {\r\n return this.cached('signatureAlgorithm', () =>\r\n this.handle.signatureAlgorithm(),\r\n );\r\n }\r\n\r\n get signatureAlgorithmOid(): string {\r\n return this.cached('signatureAlgorithmOid', () =>\r\n this.handle.signatureAlgorithmOid(),\r\n );\r\n }\r\n\r\n get ca(): boolean {\r\n return this.cached('ca', () => this.handle.ca());\r\n }\r\n\r\n get raw(): Buffer {\r\n return this.cached('raw', () => Buffer.from(this.handle.raw()));\r\n }\r\n\r\n get publicKey(): PublicKeyObject {\r\n return this.cached(\r\n 'publicKey',\r\n () => new PublicKeyObject(this.handle.publicKey()),\r\n );\r\n }\r\n\r\n get issuerCertificate(): undefined {\r\n return undefined;\r\n }\r\n\r\n checkHost(name: string, options?: CheckOptions): string | undefined {\r\n if (typeof name !== 'string') {\r\n throw new TypeError('The \"name\" argument must be a string');\r\n }\r\n return this.handle.checkHost(name, getFlags(options));\r\n }\r\n\r\n checkEmail(email: string, options?: CheckOptions): string | undefined {\r\n if (typeof email !== 'string') {\r\n throw new TypeError('The \"email\" argument must be a string');\r\n }\r\n return this.handle.checkEmail(email, getFlags(options));\r\n }\r\n\r\n checkIP(ip: string): string | undefined {\r\n if (typeof ip !== 'string') {\r\n throw new TypeError('The \"ip\" argument must be a string');\r\n }\r\n return this.handle.checkIP(ip);\r\n }\r\n\r\n checkIssued(otherCert: X509Certificate): boolean {\r\n if (!(otherCert instanceof X509Certificate)) {\r\n throw new TypeError(\r\n 'The \"otherCert\" argument must be an instance of X509Certificate',\r\n );\r\n }\r\n return this.handle.checkIssued(otherCert.handle);\r\n }\r\n\r\n checkPrivateKey(pkey: KeyObject): boolean {\r\n if (!(pkey instanceof KeyObject)) {\r\n throw new TypeError(\r\n 'The \"pkey\" argument must be an instance of KeyObject',\r\n );\r\n }\r\n if (pkey.type !== 'private') {\r\n throw new TypeError('The \"pkey\" argument must be a private key');\r\n }\r\n return this.handle.checkPrivateKey(pkey.handle);\r\n }\r\n\r\n verify(pkey: KeyObject): boolean {\r\n if (!(pkey instanceof KeyObject)) {\r\n throw new TypeError(\r\n 'The \"pkey\" argument must be an instance of KeyObject',\r\n );\r\n }\r\n if (pkey.type !== 'public') {\r\n throw new TypeError(\r\n `The \"pkey\" argument must be a public key, got '${pkey.type}'`,\r\n );\r\n }\r\n return this.handle.verify(pkey.handle);\r\n }\r\n\r\n toString(): string {\r\n return this.cached('pem', () => this.handle.pem());\r\n }\r\n\r\n toJSON(): string {\r\n return this.toString();\r\n }\r\n\r\n toLegacyObject(): X509LegacyObject {\r\n return {\r\n subject: this.subject,\r\n issuer: this.issuer,\r\n subjectaltname: this.subjectAltName,\r\n infoAccess: this.infoAccess,\r\n ca: this.ca,\r\n modulus: undefined,\r\n bits: undefined,\r\n exponent: undefined,\r\n valid_from: this.validFrom,\r\n valid_to: this.validTo,\r\n fingerprint: this.fingerprint,\r\n fingerprint256: this.fingerprint256,\r\n fingerprint512: this.fingerprint512,\r\n ext_key_usage: this.keyUsage,\r\n serialNumber: this.serialNumber,\r\n raw: this.raw,\r\n };\r\n }\r\n}\r\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ import { Buffer } from '@craftzdog/react-native-buffer';
2
+ import { NitroModules } from 'react-native-nitro-modules';
3
+ import { binaryLikeToArrayBuffer } from './utils';
4
+ let native;
5
+ function getNative() {
6
+ if (native == null) {
7
+ native = NitroModules.createHybridObject('Argon2');
8
+ }
9
+ return native;
10
+ }
11
+ const ARGON2_VERSION = 0x13; // v1.3
12
+
13
+ function validateAlgorithm(algorithm) {
14
+ if (algorithm !== 'argon2d' && algorithm !== 'argon2i' && algorithm !== 'argon2id') {
15
+ throw new TypeError(`Unknown argon2 algorithm: ${algorithm}`);
16
+ }
17
+ }
18
+ function toAB(value) {
19
+ return binaryLikeToArrayBuffer(value);
20
+ }
21
+ export function argon2Sync(algorithm, params) {
22
+ validateAlgorithm(algorithm);
23
+ const version = params.version ?? ARGON2_VERSION;
24
+ const result = getNative().hashSync(algorithm, toAB(params.message), toAB(params.nonce), params.parallelism, params.tagLength, params.memory, params.passes, version, params.secret ? toAB(params.secret) : undefined, params.associatedData ? toAB(params.associatedData) : undefined);
25
+ return Buffer.from(result);
26
+ }
27
+ export function argon2(algorithm, params, callback) {
28
+ validateAlgorithm(algorithm);
29
+ const version = params.version ?? ARGON2_VERSION;
30
+ getNative().hash(algorithm, toAB(params.message), toAB(params.nonce), params.parallelism, params.tagLength, params.memory, params.passes, version, params.secret ? toAB(params.secret) : undefined, params.associatedData ? toAB(params.associatedData) : undefined).then(ab => callback(null, Buffer.from(ab))).catch(err => callback(err, Buffer.alloc(0)));
31
+ }
32
+ //# sourceMappingURL=argon2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Buffer","NitroModules","binaryLikeToArrayBuffer","native","getNative","createHybridObject","ARGON2_VERSION","validateAlgorithm","algorithm","TypeError","toAB","value","argon2Sync","params","version","result","hashSync","message","nonce","parallelism","tagLength","memory","passes","secret","undefined","associatedData","from","argon2","callback","hash","then","ab","catch","err","alloc"],"sources":["argon2.ts"],"sourcesContent":["import { Buffer } from '@craftzdog/react-native-buffer';\r\nimport { NitroModules } from 'react-native-nitro-modules';\r\nimport type { Argon2 as NativeArgon2 } from './specs/v1/argon2.nitro';\r\nimport { binaryLikeToArrayBuffer } from './utils';\r\nimport type { BinaryLike } from './utils';\r\n\r\nlet native: NativeArgon2;\r\nfunction getNative(): NativeArgon2 {\r\n if (native == null) {\r\n native = NitroModules.createHybridObject<NativeArgon2>('Argon2');\r\n }\r\n return native;\r\n}\r\n\r\nexport interface Argon2Params {\r\n message: BinaryLike;\r\n nonce: BinaryLike;\r\n parallelism: number;\r\n tagLength: number;\r\n memory: number;\r\n passes: number;\r\n secret?: BinaryLike;\r\n associatedData?: BinaryLike;\r\n version?: number;\r\n}\r\n\r\nconst ARGON2_VERSION = 0x13; // v1.3\r\n\r\nfunction validateAlgorithm(algorithm: string): void {\r\n if (\r\n algorithm !== 'argon2d' &&\r\n algorithm !== 'argon2i' &&\r\n algorithm !== 'argon2id'\r\n ) {\r\n throw new TypeError(`Unknown argon2 algorithm: ${algorithm}`);\r\n }\r\n}\r\n\r\nfunction toAB(value: BinaryLike): ArrayBuffer {\r\n return binaryLikeToArrayBuffer(value);\r\n}\r\n\r\nexport function argon2Sync(algorithm: string, params: Argon2Params): Buffer {\r\n validateAlgorithm(algorithm);\r\n const version = params.version ?? ARGON2_VERSION;\r\n const result = getNative().hashSync(\r\n algorithm,\r\n toAB(params.message),\r\n toAB(params.nonce),\r\n params.parallelism,\r\n params.tagLength,\r\n params.memory,\r\n params.passes,\r\n version,\r\n params.secret ? toAB(params.secret) : undefined,\r\n params.associatedData ? toAB(params.associatedData) : undefined,\r\n );\r\n return Buffer.from(result);\r\n}\r\n\r\nexport function argon2(\r\n algorithm: string,\r\n params: Argon2Params,\r\n callback: (err: Error | null, result: Buffer) => void,\r\n): void {\r\n validateAlgorithm(algorithm);\r\n const version = params.version ?? ARGON2_VERSION;\r\n getNative()\r\n .hash(\r\n algorithm,\r\n toAB(params.message),\r\n toAB(params.nonce),\r\n params.parallelism,\r\n params.tagLength,\r\n params.memory,\r\n params.passes,\r\n version,\r\n params.secret ? toAB(params.secret) : undefined,\r\n params.associatedData ? toAB(params.associatedData) : undefined,\r\n )\r\n .then(ab => callback(null, Buffer.from(ab)))\r\n .catch((err: Error) => callback(err, Buffer.alloc(0)));\r\n}\r\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,gCAAgC;AACvD,SAASC,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,uBAAuB,QAAQ,SAAS;AAGjD,IAAIC,MAAoB;AACxB,SAASC,SAASA,CAAA,EAAiB;EACjC,IAAID,MAAM,IAAI,IAAI,EAAE;IAClBA,MAAM,GAAGF,YAAY,CAACI,kBAAkB,CAAe,QAAQ,CAAC;EAClE;EACA,OAAOF,MAAM;AACf;AAcA,MAAMG,cAAc,GAAG,IAAI,CAAC,CAAC;;AAE7B,SAASC,iBAAiBA,CAACC,SAAiB,EAAQ;EAClD,IACEA,SAAS,KAAK,SAAS,IACvBA,SAAS,KAAK,SAAS,IACvBA,SAAS,KAAK,UAAU,EACxB;IACA,MAAM,IAAIC,SAAS,CAAC,6BAA6BD,SAAS,EAAE,CAAC;EAC/D;AACF;AAEA,SAASE,IAAIA,CAACC,KAAiB,EAAe;EAC5C,OAAOT,uBAAuB,CAACS,KAAK,CAAC;AACvC;AAEA,OAAO,SAASC,UAAUA,CAACJ,SAAiB,EAAEK,MAAoB,EAAU;EAC1EN,iBAAiB,CAACC,SAAS,CAAC;EAC5B,MAAMM,OAAO,GAAGD,MAAM,CAACC,OAAO,IAAIR,cAAc;EAChD,MAAMS,MAAM,GAAGX,SAAS,CAAC,CAAC,CAACY,QAAQ,CACjCR,SAAS,EACTE,IAAI,CAACG,MAAM,CAACI,OAAO,CAAC,EACpBP,IAAI,CAACG,MAAM,CAACK,KAAK,CAAC,EAClBL,MAAM,CAACM,WAAW,EAClBN,MAAM,CAACO,SAAS,EAChBP,MAAM,CAACQ,MAAM,EACbR,MAAM,CAACS,MAAM,EACbR,OAAO,EACPD,MAAM,CAACU,MAAM,GAAGb,IAAI,CAACG,MAAM,CAACU,MAAM,CAAC,GAAGC,SAAS,EAC/CX,MAAM,CAACY,cAAc,GAAGf,IAAI,CAACG,MAAM,CAACY,cAAc,CAAC,GAAGD,SACxD,CAAC;EACD,OAAOxB,MAAM,CAAC0B,IAAI,CAACX,MAAM,CAAC;AAC5B;AAEA,OAAO,SAASY,MAAMA,CACpBnB,SAAiB,EACjBK,MAAoB,EACpBe,QAAqD,EAC/C;EACNrB,iBAAiB,CAACC,SAAS,CAAC;EAC5B,MAAMM,OAAO,GAAGD,MAAM,CAACC,OAAO,IAAIR,cAAc;EAChDF,SAAS,CAAC,CAAC,CACRyB,IAAI,CACHrB,SAAS,EACTE,IAAI,CAACG,MAAM,CAACI,OAAO,CAAC,EACpBP,IAAI,CAACG,MAAM,CAACK,KAAK,CAAC,EAClBL,MAAM,CAACM,WAAW,EAClBN,MAAM,CAACO,SAAS,EAChBP,MAAM,CAACQ,MAAM,EACbR,MAAM,CAACS,MAAM,EACbR,OAAO,EACPD,MAAM,CAACU,MAAM,GAAGb,IAAI,CAACG,MAAM,CAACU,MAAM,CAAC,GAAGC,SAAS,EAC/CX,MAAM,CAACY,cAAc,GAAGf,IAAI,CAACG,MAAM,CAACY,cAAc,CAAC,GAAGD,SACxD,CAAC,CACAM,IAAI,CAACC,EAAE,IAAIH,QAAQ,CAAC,IAAI,EAAE5B,MAAM,CAAC0B,IAAI,CAACK,EAAE,CAAC,CAAC,CAAC,CAC3CC,KAAK,CAAEC,GAAU,IAAKL,QAAQ,CAACK,GAAG,EAAEjC,MAAM,CAACkC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D","ignoreList":[]}
@@ -0,0 +1,96 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { NitroModules } from 'react-native-nitro-modules';
5
+ import { Buffer } from '@craftzdog/react-native-buffer';
6
+ import { binaryLikeToArrayBuffer, ab2str } from './utils';
7
+ import { toArrayBuffer } from './utils/conversion';
8
+ const BLAKE3_KEY_LEN = 32;
9
+ const BLAKE3_OUT_LEN = 32;
10
+ export class Blake3 {
11
+ constructor(opts) {
12
+ _defineProperty(this, "native", void 0);
13
+ _defineProperty(this, "mode", void 0);
14
+ _defineProperty(this, "keyData", void 0);
15
+ _defineProperty(this, "contextData", void 0);
16
+ this.native = NitroModules.createHybridObject('Blake3');
17
+ if (opts !== null && opts !== void 0 && opts.key && opts !== null && opts !== void 0 && opts.context) {
18
+ throw new Error('BLAKE3: cannot use both key and context options together');
19
+ }
20
+ if (opts !== null && opts !== void 0 && opts.key) {
21
+ if (opts.key.length !== BLAKE3_KEY_LEN) {
22
+ throw new Error(`BLAKE3: key must be exactly ${BLAKE3_KEY_LEN} bytes`);
23
+ }
24
+ this.mode = 'keyed';
25
+ this.keyData = opts.key;
26
+ this.native.initKeyed(toArrayBuffer(opts.key));
27
+ } else if ((opts === null || opts === void 0 ? void 0 : opts.context) !== undefined) {
28
+ if (typeof opts.context !== 'string' || opts.context.length === 0) {
29
+ throw new Error('BLAKE3: context must be a non-empty string');
30
+ }
31
+ this.mode = 'deriveKey';
32
+ this.contextData = opts.context;
33
+ this.native.initDeriveKey(opts.context);
34
+ } else {
35
+ this.mode = 'hash';
36
+ this.native.initHash();
37
+ }
38
+ }
39
+ update(data, inputEncoding) {
40
+ const buffer = binaryLikeToArrayBuffer(data, inputEncoding ?? 'utf8');
41
+ this.native.update(buffer);
42
+ return this;
43
+ }
44
+ digest(encodingOrLength) {
45
+ let length;
46
+ let encoding;
47
+ if (typeof encodingOrLength === 'number') {
48
+ length = encodingOrLength;
49
+ } else if (encodingOrLength) {
50
+ encoding = encodingOrLength;
51
+ }
52
+ const result = this.native.digest(length);
53
+ if (encoding && encoding !== 'buffer') {
54
+ return ab2str(result, encoding);
55
+ }
56
+ return Buffer.from(result);
57
+ }
58
+ digestLength(length) {
59
+ return Buffer.from(this.native.digest(length));
60
+ }
61
+ reset() {
62
+ this.native.reset();
63
+ return this;
64
+ }
65
+ copy() {
66
+ const copied = new Blake3();
67
+ // Replace the native with a copy
68
+ copied.native = this.native.copy();
69
+ copied.mode = this.mode;
70
+ copied.keyData = this.keyData;
71
+ copied.contextData = this.contextData;
72
+ return copied;
73
+ }
74
+ static getVersion() {
75
+ const native = NitroModules.createHybridObject('Blake3');
76
+ native.initHash();
77
+ return native.getVersion();
78
+ }
79
+ }
80
+ export function createBlake3(opts) {
81
+ return new Blake3(opts);
82
+ }
83
+ export function blake3(data, opts) {
84
+ const hasher = new Blake3(opts);
85
+ hasher.update(data);
86
+ const length = (opts === null || opts === void 0 ? void 0 : opts.dkLen) ?? BLAKE3_OUT_LEN;
87
+ const result = hasher.digestLength(length);
88
+ return new Uint8Array(result);
89
+ }
90
+ blake3.create = createBlake3;
91
+ export const blake3Exports = {
92
+ Blake3,
93
+ createBlake3,
94
+ blake3
95
+ };
96
+ //# sourceMappingURL=blake3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","Buffer","binaryLikeToArrayBuffer","ab2str","toArrayBuffer","BLAKE3_KEY_LEN","BLAKE3_OUT_LEN","Blake3","constructor","opts","_defineProperty","native","createHybridObject","key","context","Error","length","mode","keyData","initKeyed","undefined","contextData","initDeriveKey","initHash","update","data","inputEncoding","buffer","digest","encodingOrLength","encoding","result","from","digestLength","reset","copy","copied","getVersion","createBlake3","blake3","hasher","dkLen","Uint8Array","create","blake3Exports"],"sources":["blake3.ts"],"sourcesContent":["import { NitroModules } from 'react-native-nitro-modules';\r\nimport { Buffer } from '@craftzdog/react-native-buffer';\r\nimport type { Blake3 as NativeBlake3 } from './specs/v1/blake3.nitro';\r\nimport type { BinaryLike, Encoding } from './utils';\r\nimport { binaryLikeToArrayBuffer, ab2str } from './utils';\r\nimport { toArrayBuffer } from './utils/conversion';\r\n\r\nconst BLAKE3_KEY_LEN = 32;\r\nconst BLAKE3_OUT_LEN = 32;\r\n\r\nexport interface Blake3Options {\r\n dkLen?: number;\r\n key?: Uint8Array;\r\n context?: string;\r\n}\r\n\r\nexport class Blake3 {\r\n private native: NativeBlake3;\r\n private mode: 'hash' | 'keyed' | 'deriveKey';\r\n private keyData?: Uint8Array;\r\n private contextData?: string;\r\n\r\n constructor(opts?: Blake3Options) {\r\n this.native = NitroModules.createHybridObject<NativeBlake3>('Blake3');\r\n\r\n if (opts?.key && opts?.context) {\r\n throw new Error(\r\n 'BLAKE3: cannot use both key and context options together',\r\n );\r\n }\r\n\r\n if (opts?.key) {\r\n if (opts.key.length !== BLAKE3_KEY_LEN) {\r\n throw new Error(`BLAKE3: key must be exactly ${BLAKE3_KEY_LEN} bytes`);\r\n }\r\n this.mode = 'keyed';\r\n this.keyData = opts.key;\r\n this.native.initKeyed(toArrayBuffer(opts.key));\r\n } else if (opts?.context !== undefined) {\r\n if (typeof opts.context !== 'string' || opts.context.length === 0) {\r\n throw new Error('BLAKE3: context must be a non-empty string');\r\n }\r\n this.mode = 'deriveKey';\r\n this.contextData = opts.context;\r\n this.native.initDeriveKey(opts.context);\r\n } else {\r\n this.mode = 'hash';\r\n this.native.initHash();\r\n }\r\n }\r\n\r\n update(data: BinaryLike, inputEncoding?: Encoding): this {\r\n const buffer = binaryLikeToArrayBuffer(data, inputEncoding ?? 'utf8');\r\n this.native.update(buffer);\r\n return this;\r\n }\r\n\r\n digest(): Buffer;\r\n digest(encoding: Encoding): string;\r\n digest(length: number): Buffer;\r\n digest(encodingOrLength?: Encoding | number): Buffer | string {\r\n let length: number | undefined;\r\n let encoding: Encoding | undefined;\r\n\r\n if (typeof encodingOrLength === 'number') {\r\n length = encodingOrLength;\r\n } else if (encodingOrLength) {\r\n encoding = encodingOrLength;\r\n }\r\n\r\n const result = this.native.digest(length);\r\n\r\n if (encoding && encoding !== 'buffer') {\r\n return ab2str(result, encoding);\r\n }\r\n\r\n return Buffer.from(result);\r\n }\r\n\r\n digestLength(length: number): Buffer {\r\n return Buffer.from(this.native.digest(length));\r\n }\r\n\r\n reset(): this {\r\n this.native.reset();\r\n return this;\r\n }\r\n\r\n copy(): Blake3 {\r\n const copied = new Blake3();\r\n // Replace the native with a copy\r\n copied.native = this.native.copy() as NativeBlake3;\r\n copied.mode = this.mode;\r\n copied.keyData = this.keyData;\r\n copied.contextData = this.contextData;\r\n return copied;\r\n }\r\n\r\n static getVersion(): string {\r\n const native = NitroModules.createHybridObject<NativeBlake3>('Blake3');\r\n native.initHash();\r\n return native.getVersion();\r\n }\r\n}\r\n\r\nexport function createBlake3(opts?: Blake3Options): Blake3 {\r\n return new Blake3(opts);\r\n}\r\n\r\nexport function blake3(data: BinaryLike, opts?: Blake3Options): Uint8Array {\r\n const hasher = new Blake3(opts);\r\n hasher.update(data);\r\n const length = opts?.dkLen ?? BLAKE3_OUT_LEN;\r\n const result = hasher.digestLength(length);\r\n return new Uint8Array(result);\r\n}\r\n\r\nblake3.create = createBlake3;\r\n\r\nexport const blake3Exports = {\r\n Blake3,\r\n createBlake3,\r\n blake3,\r\n};\r\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,MAAM,QAAQ,gCAAgC;AAGvD,SAASC,uBAAuB,EAAEC,MAAM,QAAQ,SAAS;AACzD,SAASC,aAAa,QAAQ,oBAAoB;AAElD,MAAMC,cAAc,GAAG,EAAE;AACzB,MAAMC,cAAc,GAAG,EAAE;AAQzB,OAAO,MAAMC,MAAM,CAAC;EAMlBC,WAAWA,CAACC,IAAoB,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAChC,IAAI,CAACC,MAAM,GAAGX,YAAY,CAACY,kBAAkB,CAAe,QAAQ,CAAC;IAErE,IAAIH,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEI,GAAG,IAAIJ,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEK,OAAO,EAAE;MAC9B,MAAM,IAAIC,KAAK,CACb,0DACF,CAAC;IACH;IAEA,IAAIN,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEI,GAAG,EAAE;MACb,IAAIJ,IAAI,CAACI,GAAG,CAACG,MAAM,KAAKX,cAAc,EAAE;QACtC,MAAM,IAAIU,KAAK,CAAC,+BAA+BV,cAAc,QAAQ,CAAC;MACxE;MACA,IAAI,CAACY,IAAI,GAAG,OAAO;MACnB,IAAI,CAACC,OAAO,GAAGT,IAAI,CAACI,GAAG;MACvB,IAAI,CAACF,MAAM,CAACQ,SAAS,CAACf,aAAa,CAACK,IAAI,CAACI,GAAG,CAAC,CAAC;IAChD,CAAC,MAAM,IAAI,CAAAJ,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEK,OAAO,MAAKM,SAAS,EAAE;MACtC,IAAI,OAAOX,IAAI,CAACK,OAAO,KAAK,QAAQ,IAAIL,IAAI,CAACK,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;QACjE,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;MAC/D;MACA,IAAI,CAACE,IAAI,GAAG,WAAW;MACvB,IAAI,CAACI,WAAW,GAAGZ,IAAI,CAACK,OAAO;MAC/B,IAAI,CAACH,MAAM,CAACW,aAAa,CAACb,IAAI,CAACK,OAAO,CAAC;IACzC,CAAC,MAAM;MACL,IAAI,CAACG,IAAI,GAAG,MAAM;MAClB,IAAI,CAACN,MAAM,CAACY,QAAQ,CAAC,CAAC;IACxB;EACF;EAEAC,MAAMA,CAACC,IAAgB,EAAEC,aAAwB,EAAQ;IACvD,MAAMC,MAAM,GAAGzB,uBAAuB,CAACuB,IAAI,EAAEC,aAAa,IAAI,MAAM,CAAC;IACrE,IAAI,CAACf,MAAM,CAACa,MAAM,CAACG,MAAM,CAAC;IAC1B,OAAO,IAAI;EACb;EAKAC,MAAMA,CAACC,gBAAoC,EAAmB;IAC5D,IAAIb,MAA0B;IAC9B,IAAIc,QAA8B;IAElC,IAAI,OAAOD,gBAAgB,KAAK,QAAQ,EAAE;MACxCb,MAAM,GAAGa,gBAAgB;IAC3B,CAAC,MAAM,IAAIA,gBAAgB,EAAE;MAC3BC,QAAQ,GAAGD,gBAAgB;IAC7B;IAEA,MAAME,MAAM,GAAG,IAAI,CAACpB,MAAM,CAACiB,MAAM,CAACZ,MAAM,CAAC;IAEzC,IAAIc,QAAQ,IAAIA,QAAQ,KAAK,QAAQ,EAAE;MACrC,OAAO3B,MAAM,CAAC4B,MAAM,EAAED,QAAQ,CAAC;IACjC;IAEA,OAAO7B,MAAM,CAAC+B,IAAI,CAACD,MAAM,CAAC;EAC5B;EAEAE,YAAYA,CAACjB,MAAc,EAAU;IACnC,OAAOf,MAAM,CAAC+B,IAAI,CAAC,IAAI,CAACrB,MAAM,CAACiB,MAAM,CAACZ,MAAM,CAAC,CAAC;EAChD;EAEAkB,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACvB,MAAM,CAACuB,KAAK,CAAC,CAAC;IACnB,OAAO,IAAI;EACb;EAEAC,IAAIA,CAAA,EAAW;IACb,MAAMC,MAAM,GAAG,IAAI7B,MAAM,CAAC,CAAC;IAC3B;IACA6B,MAAM,CAACzB,MAAM,GAAG,IAAI,CAACA,MAAM,CAACwB,IAAI,CAAC,CAAiB;IAClDC,MAAM,CAACnB,IAAI,GAAG,IAAI,CAACA,IAAI;IACvBmB,MAAM,CAAClB,OAAO,GAAG,IAAI,CAACA,OAAO;IAC7BkB,MAAM,CAACf,WAAW,GAAG,IAAI,CAACA,WAAW;IACrC,OAAOe,MAAM;EACf;EAEA,OAAOC,UAAUA,CAAA,EAAW;IAC1B,MAAM1B,MAAM,GAAGX,YAAY,CAACY,kBAAkB,CAAe,QAAQ,CAAC;IACtED,MAAM,CAACY,QAAQ,CAAC,CAAC;IACjB,OAAOZ,MAAM,CAAC0B,UAAU,CAAC,CAAC;EAC5B;AACF;AAEA,OAAO,SAASC,YAAYA,CAAC7B,IAAoB,EAAU;EACzD,OAAO,IAAIF,MAAM,CAACE,IAAI,CAAC;AACzB;AAEA,OAAO,SAAS8B,MAAMA,CAACd,IAAgB,EAAEhB,IAAoB,EAAc;EACzE,MAAM+B,MAAM,GAAG,IAAIjC,MAAM,CAACE,IAAI,CAAC;EAC/B+B,MAAM,CAAChB,MAAM,CAACC,IAAI,CAAC;EACnB,MAAMT,MAAM,GAAG,CAAAP,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEgC,KAAK,KAAInC,cAAc;EAC5C,MAAMyB,MAAM,GAAGS,MAAM,CAACP,YAAY,CAACjB,MAAM,CAAC;EAC1C,OAAO,IAAI0B,UAAU,CAACX,MAAM,CAAC;AAC/B;AAEAQ,MAAM,CAACI,MAAM,GAAGL,YAAY;AAE5B,OAAO,MAAMM,aAAa,GAAG;EAC3BrC,MAAM;EACN+B,YAAY;EACZC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ import { NitroModules } from 'react-native-nitro-modules';
2
+ import { Buffer } from '@craftzdog/react-native-buffer';
3
+ import { binaryLikeToArrayBuffer } from './utils';
4
+ let native;
5
+ function getNative() {
6
+ if (native == null) {
7
+ native = NitroModules.createHybridObject('Certificate');
8
+ }
9
+ return native;
10
+ }
11
+ function toArrayBuffer(spkac, encoding) {
12
+ if (typeof spkac === 'string') {
13
+ return binaryLikeToArrayBuffer(spkac, encoding || 'utf8');
14
+ }
15
+ return binaryLikeToArrayBuffer(spkac);
16
+ }
17
+ export class Certificate {
18
+ static exportChallenge(spkac, encoding) {
19
+ return Buffer.from(getNative().exportChallenge(toArrayBuffer(spkac, encoding)));
20
+ }
21
+ static exportPublicKey(spkac, encoding) {
22
+ return Buffer.from(getNative().exportPublicKey(toArrayBuffer(spkac, encoding)));
23
+ }
24
+ static verifySpkac(spkac, encoding) {
25
+ return getNative().verifySpkac(toArrayBuffer(spkac, encoding));
26
+ }
27
+ }
28
+ //# sourceMappingURL=certificate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","Buffer","binaryLikeToArrayBuffer","native","getNative","createHybridObject","toArrayBuffer","spkac","encoding","Certificate","exportChallenge","from","exportPublicKey","verifySpkac"],"sources":["certificate.ts"],"sourcesContent":["import { NitroModules } from 'react-native-nitro-modules';\r\nimport { Buffer } from '@craftzdog/react-native-buffer';\r\nimport type { Certificate as NativeCertificate } from './specs/v1/certificate.nitro';\r\nimport type { BinaryLike } from './utils';\r\nimport { binaryLikeToArrayBuffer } from './utils';\r\n\r\nlet native: NativeCertificate;\r\nfunction getNative(): NativeCertificate {\r\n if (native == null) {\r\n native = NitroModules.createHybridObject<NativeCertificate>('Certificate');\r\n }\r\n return native;\r\n}\r\n\r\nfunction toArrayBuffer(\r\n spkac: BinaryLike,\r\n encoding?: BufferEncoding,\r\n): ArrayBuffer {\r\n if (typeof spkac === 'string') {\r\n return binaryLikeToArrayBuffer(spkac, encoding || 'utf8');\r\n }\r\n return binaryLikeToArrayBuffer(spkac);\r\n}\r\n\r\nexport class Certificate {\r\n static exportChallenge(spkac: BinaryLike, encoding?: BufferEncoding): Buffer {\r\n return Buffer.from(\r\n getNative().exportChallenge(toArrayBuffer(spkac, encoding)),\r\n );\r\n }\r\n\r\n static exportPublicKey(spkac: BinaryLike, encoding?: BufferEncoding): Buffer {\r\n return Buffer.from(\r\n getNative().exportPublicKey(toArrayBuffer(spkac, encoding)),\r\n );\r\n }\r\n\r\n static verifySpkac(spkac: BinaryLike, encoding?: BufferEncoding): boolean {\r\n return getNative().verifySpkac(toArrayBuffer(spkac, encoding));\r\n }\r\n}\r\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,MAAM,QAAQ,gCAAgC;AAGvD,SAASC,uBAAuB,QAAQ,SAAS;AAEjD,IAAIC,MAAyB;AAC7B,SAASC,SAASA,CAAA,EAAsB;EACtC,IAAID,MAAM,IAAI,IAAI,EAAE;IAClBA,MAAM,GAAGH,YAAY,CAACK,kBAAkB,CAAoB,aAAa,CAAC;EAC5E;EACA,OAAOF,MAAM;AACf;AAEA,SAASG,aAAaA,CACpBC,KAAiB,EACjBC,QAAyB,EACZ;EACb,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOL,uBAAuB,CAACK,KAAK,EAAEC,QAAQ,IAAI,MAAM,CAAC;EAC3D;EACA,OAAON,uBAAuB,CAACK,KAAK,CAAC;AACvC;AAEA,OAAO,MAAME,WAAW,CAAC;EACvB,OAAOC,eAAeA,CAACH,KAAiB,EAAEC,QAAyB,EAAU;IAC3E,OAAOP,MAAM,CAACU,IAAI,CAChBP,SAAS,CAAC,CAAC,CAACM,eAAe,CAACJ,aAAa,CAACC,KAAK,EAAEC,QAAQ,CAAC,CAC5D,CAAC;EACH;EAEA,OAAOI,eAAeA,CAACL,KAAiB,EAAEC,QAAyB,EAAU;IAC3E,OAAOP,MAAM,CAACU,IAAI,CAChBP,SAAS,CAAC,CAAC,CAACQ,eAAe,CAACN,aAAa,CAACC,KAAK,EAAEC,QAAQ,CAAC,CAC5D,CAAC;EACH;EAEA,OAAOK,WAAWA,CAACN,KAAiB,EAAEC,QAAyB,EAAW;IACxE,OAAOJ,SAAS,CAAC,CAAC,CAACS,WAAW,CAACP,aAAa,CAACC,KAAK,EAAEC,QAAQ,CAAC,CAAC;EAChE;AACF","ignoreList":[]}