@dotenvx/next-env 1.74.2 → 1.74.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2065) hide show
  1. package/README.md +1 -33
  2. package/node_modules/@dotenvx/dotenvx/CHANGELOG.md +2104 -0
  3. package/node_modules/@dotenvx/dotenvx/LICENSE +28 -0
  4. package/node_modules/@dotenvx/dotenvx/README.md +2781 -0
  5. package/node_modules/@dotenvx/dotenvx/package.json +77 -0
  6. package/node_modules/@dotenvx/dotenvx/src/cli/actions/armor/down.js +37 -0
  7. package/node_modules/@dotenvx/dotenvx/src/cli/actions/armor/move.js +42 -0
  8. package/node_modules/@dotenvx/dotenvx/src/cli/actions/armor/pull.js +37 -0
  9. package/node_modules/@dotenvx/dotenvx/src/cli/actions/armor/push.js +37 -0
  10. package/node_modules/@dotenvx/dotenvx/src/cli/actions/armor/up.js +37 -0
  11. package/node_modules/@dotenvx/dotenvx/src/cli/actions/decrypt.js +93 -0
  12. package/node_modules/@dotenvx/dotenvx/src/cli/actions/doctor.js +22 -0
  13. package/node_modules/@dotenvx/dotenvx/src/cli/actions/encrypt.js +114 -0
  14. package/node_modules/@dotenvx/dotenvx/src/cli/actions/ext/genexample.js +36 -0
  15. package/node_modules/@dotenvx/dotenvx/src/cli/actions/ext/gitignore.js +105 -0
  16. package/node_modules/@dotenvx/dotenvx/src/cli/actions/ext/prebuild.js +30 -0
  17. package/node_modules/@dotenvx/dotenvx/src/cli/actions/ext/precommit.js +30 -0
  18. package/node_modules/@dotenvx/dotenvx/src/cli/actions/ext/scan.js +34 -0
  19. package/node_modules/@dotenvx/dotenvx/src/cli/actions/get.js +98 -0
  20. package/node_modules/@dotenvx/dotenvx/src/cli/actions/keypair.js +66 -0
  21. package/node_modules/@dotenvx/dotenvx/src/cli/actions/login.js +62 -0
  22. package/node_modules/@dotenvx/dotenvx/src/cli/actions/logout.js +36 -0
  23. package/node_modules/@dotenvx/dotenvx/src/cli/actions/ls.js +24 -0
  24. package/node_modules/@dotenvx/dotenvx/src/cli/actions/normalizeArmorOptions.js +10 -0
  25. package/node_modules/@dotenvx/dotenvx/src/cli/actions/rotate.js +87 -0
  26. package/node_modules/@dotenvx/dotenvx/src/cli/actions/run.js +126 -0
  27. package/node_modules/@dotenvx/dotenvx/src/cli/actions/set.js +92 -0
  28. package/node_modules/@dotenvx/dotenvx/src/cli/commands/armor.js +72 -0
  29. package/node_modules/@dotenvx/dotenvx/src/cli/commands/ext.js +85 -0
  30. package/node_modules/@dotenvx/dotenvx/src/cli/dotenvx.js +297 -0
  31. package/node_modules/@dotenvx/dotenvx/src/cli/examples.js +99 -0
  32. package/node_modules/@dotenvx/dotenvx/src/db/device.js +73 -0
  33. package/node_modules/@dotenvx/dotenvx/src/db/session.js +279 -0
  34. package/node_modules/@dotenvx/dotenvx/src/lib/api/getAccount.js +32 -0
  35. package/node_modules/@dotenvx/dotenvx/src/lib/api/postArmorDown.js +48 -0
  36. package/node_modules/@dotenvx/dotenvx/src/lib/api/postArmorMove.js +48 -0
  37. package/node_modules/@dotenvx/dotenvx/src/lib/api/postArmorPull.js +48 -0
  38. package/node_modules/@dotenvx/dotenvx/src/lib/api/postArmorPush.js +48 -0
  39. package/node_modules/@dotenvx/dotenvx/src/lib/api/postArmorUp.js +51 -0
  40. package/node_modules/@dotenvx/dotenvx/src/lib/api/postKeypair.js +60 -0
  41. package/node_modules/@dotenvx/dotenvx/src/lib/api/postLogout.js +34 -0
  42. package/node_modules/@dotenvx/dotenvx/src/lib/api/postOauthDeviceCode.js +38 -0
  43. package/node_modules/@dotenvx/dotenvx/src/lib/api/postOauthToken.js +35 -0
  44. package/node_modules/@dotenvx/dotenvx/src/lib/config.d.ts +1 -0
  45. package/node_modules/@dotenvx/dotenvx/src/lib/config.js +1 -0
  46. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/append.js +61 -0
  47. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/armoredKeyDisplay.js +10 -0
  48. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/arrayToTree.js +27 -0
  49. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/buildApiError.js +16 -0
  50. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/buildEnvs.js +24 -0
  51. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/buildOauthError.js +14 -0
  52. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/canonicalEnvFilename.js +13 -0
  53. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/catchAndLog.js +13 -0
  54. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/chomp.js +5 -0
  55. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/colorDepth.js +17 -0
  56. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/conventions.js +28 -0
  57. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/createSpinner.js +24 -0
  58. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/armorKeypair.js +42 -0
  59. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/armorKeypairSync.js +55 -0
  60. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/decryptKeyValue.js +50 -0
  61. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/encryptValue.js +12 -0
  62. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/index.js +18 -0
  63. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/isEncrypted.js +7 -0
  64. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/isPublicKey.js +7 -0
  65. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/localKeypair.js +21 -0
  66. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/mutateKeysSrc.js +38 -0
  67. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/mutateKeysSrcSync.js +38 -0
  68. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/mutateSrc.js +24 -0
  69. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/provision.js +56 -0
  70. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/provisionSync.js +51 -0
  71. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/cryptography/provisionWithPrivateKey.js +26 -0
  72. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/decryptDeviceValue.js +10 -0
  73. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/detectEncoding.js +22 -0
  74. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/detectEncodingSync.js +22 -0
  75. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/dotenvOptionPaths.js +21 -0
  76. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/dotenvParse.js +55 -0
  77. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/dotenvPrivateKeyNames.js +7 -0
  78. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/encryptDeviceValue.js +9 -0
  79. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/envResolution/determine.js +46 -0
  80. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/envResolution/environment.js +27 -0
  81. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/envResolution/index.js +8 -0
  82. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/errors.js +295 -0
  83. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/escape.js +5 -0
  84. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/escapeDollarSigns.js +5 -0
  85. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/escapeForRegex.js +5 -0
  86. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/evalKeyValue.js +23 -0
  87. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/execute.js +12 -0
  88. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/executeCommand.js +181 -0
  89. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/executeDynamic.js +106 -0
  90. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/executeExtension.js +39 -0
  91. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/findEnvFiles.js +25 -0
  92. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/formatCode.js +11 -0
  93. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/fsx.js +54 -0
  94. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/getCommanderVersion.js +10 -0
  95. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/guessPrivateKeyFilename.js +15 -0
  96. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/http.js +7 -0
  97. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/installPrecommitHook.js +79 -0
  98. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/isFullyEncrypted.js +27 -0
  99. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/isIgnoringDotenvKeys.js +19 -0
  100. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/jsonToEnv.js +7 -0
  101. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/index.js +16 -0
  102. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/keyNamesForEnvFile.js +24 -0
  103. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/keyValues.js +99 -0
  104. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/keyValuesFromEnvSrc.js +80 -0
  105. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/keyValuesSync.js +103 -0
  106. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/readFileKey.js +17 -0
  107. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/readFileKeySync.js +15 -0
  108. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keyResolution/readProcessKey.js +7 -0
  109. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/keypairMetadata.js +77 -0
  110. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/kits/sample.js +23 -0
  111. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/listenForOpenKey.js +46 -0
  112. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/localDisplayPath.js +11 -0
  113. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/normalizeToken.js +5 -0
  114. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/openUrl.js +7 -0
  115. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/packageJson.js +3 -0
  116. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/parse.js +214 -0
  117. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/pluralize.js +10 -0
  118. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/prependPublicKey.js +17 -0
  119. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/preserveShebang.js +16 -0
  120. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/prompts.js +43 -0
  121. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/quotes.js +36 -0
  122. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/readEnvKey.js +31 -0
  123. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/removeDynamicHelpSection.js +21 -0
  124. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/removeEnvKey.js +50 -0
  125. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/removeOptionsHelpParts.js +42 -0
  126. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/replace.js +82 -0
  127. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/resolveEscapeSequences.js +5 -0
  128. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/resolveHome.js +12 -0
  129. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/sanitizeCommandForMetadata.js +64 -0
  130. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/teamChoicesFromMeta.js +8 -0
  131. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/truncate.js +10 -0
  132. package/node_modules/@dotenvx/dotenvx/src/lib/helpers/upsertEnvKey.js +61 -0
  133. package/node_modules/@dotenvx/dotenvx/src/lib/main.d.ts +420 -0
  134. package/node_modules/@dotenvx/dotenvx/src/lib/main.js +347 -0
  135. package/node_modules/@dotenvx/dotenvx/src/lib/services/armorDown.js +71 -0
  136. package/node_modules/@dotenvx/dotenvx/src/lib/services/armorKeypair.js +156 -0
  137. package/node_modules/@dotenvx/dotenvx/src/lib/services/armorMove.js +54 -0
  138. package/node_modules/@dotenvx/dotenvx/src/lib/services/armorPull.js +71 -0
  139. package/node_modules/@dotenvx/dotenvx/src/lib/services/armorPush.js +76 -0
  140. package/node_modules/@dotenvx/dotenvx/src/lib/services/armorUp.js +73 -0
  141. package/node_modules/@dotenvx/dotenvx/src/lib/services/decrypt.js +157 -0
  142. package/node_modules/@dotenvx/dotenvx/src/lib/services/doctor.js +93 -0
  143. package/node_modules/@dotenvx/dotenvx/src/lib/services/encrypt.js +214 -0
  144. package/node_modules/@dotenvx/dotenvx/src/lib/services/genexample.js +101 -0
  145. package/node_modules/@dotenvx/dotenvx/src/lib/services/get.js +76 -0
  146. package/node_modules/@dotenvx/dotenvx/src/lib/services/keypair.js +60 -0
  147. package/node_modules/@dotenvx/dotenvx/src/lib/services/login.js +26 -0
  148. package/node_modules/@dotenvx/dotenvx/src/lib/services/loginPoll.js +36 -0
  149. package/node_modules/@dotenvx/dotenvx/src/lib/services/logout.js +26 -0
  150. package/node_modules/@dotenvx/dotenvx/src/lib/services/ls.js +57 -0
  151. package/node_modules/@dotenvx/dotenvx/src/lib/services/prebuild.js +86 -0
  152. package/node_modules/@dotenvx/dotenvx/src/lib/services/precommit.js +133 -0
  153. package/node_modules/@dotenvx/dotenvx/src/lib/services/rotate.js +198 -0
  154. package/node_modules/@dotenvx/dotenvx/src/lib/services/run.js +255 -0
  155. package/node_modules/@dotenvx/dotenvx/src/lib/services/sets.js +326 -0
  156. package/node_modules/@dotenvx/dotenvx/src/shared/colors.js +67 -0
  157. package/node_modules/@dotenvx/dotenvx/src/shared/logger.js +147 -0
  158. package/node_modules/@ecies/ciphers/LICENSE +21 -0
  159. package/node_modules/@ecies/ciphers/README.md +71 -0
  160. package/node_modules/@ecies/ciphers/dist/_node/compat.d.ts +9 -0
  161. package/node_modules/@ecies/ciphers/dist/_node/compat.js +49 -0
  162. package/node_modules/@ecies/ciphers/dist/_node/hchacha.d.ts +4 -0
  163. package/node_modules/@ecies/ciphers/dist/_node/hchacha.js +89 -0
  164. package/node_modules/@ecies/ciphers/dist/aes/noble.d.ts +3 -0
  165. package/node_modules/@ecies/ciphers/dist/aes/noble.js +8 -0
  166. package/node_modules/@ecies/ciphers/dist/aes/node.d.ts +3 -0
  167. package/node_modules/@ecies/ciphers/dist/aes/node.js +8 -0
  168. package/node_modules/@ecies/ciphers/dist/chacha/noble.d.ts +3 -0
  169. package/node_modules/@ecies/ciphers/dist/chacha/noble.js +8 -0
  170. package/node_modules/@ecies/ciphers/dist/chacha/node.d.ts +3 -0
  171. package/node_modules/@ecies/ciphers/dist/chacha/node.js +26 -0
  172. package/node_modules/@ecies/ciphers/dist/index.d.ts +1 -0
  173. package/node_modules/@ecies/ciphers/dist/index.js +3 -0
  174. package/node_modules/@ecies/ciphers/package.json +76 -0
  175. package/node_modules/@noble/ciphers/LICENSE +22 -0
  176. package/node_modules/@noble/ciphers/README.md +543 -0
  177. package/node_modules/@noble/ciphers/_arx.d.ts +59 -0
  178. package/node_modules/@noble/ciphers/_arx.d.ts.map +1 -0
  179. package/node_modules/@noble/ciphers/_arx.js +175 -0
  180. package/node_modules/@noble/ciphers/_arx.js.map +1 -0
  181. package/node_modules/@noble/ciphers/_assert.d.ts +19 -0
  182. package/node_modules/@noble/ciphers/_assert.d.ts.map +1 -0
  183. package/node_modules/@noble/ciphers/_assert.js +20 -0
  184. package/node_modules/@noble/ciphers/_assert.js.map +1 -0
  185. package/node_modules/@noble/ciphers/_micro.d.ts +41 -0
  186. package/node_modules/@noble/ciphers/_micro.d.ts.map +1 -0
  187. package/node_modules/@noble/ciphers/_micro.js +260 -0
  188. package/node_modules/@noble/ciphers/_micro.js.map +1 -0
  189. package/node_modules/@noble/ciphers/_poly1305.d.ts +29 -0
  190. package/node_modules/@noble/ciphers/_poly1305.d.ts.map +1 -0
  191. package/node_modules/@noble/ciphers/_poly1305.js +281 -0
  192. package/node_modules/@noble/ciphers/_poly1305.js.map +1 -0
  193. package/node_modules/@noble/ciphers/_polyval.d.ts +33 -0
  194. package/node_modules/@noble/ciphers/_polyval.d.ts.map +1 -0
  195. package/node_modules/@noble/ciphers/_polyval.js +233 -0
  196. package/node_modules/@noble/ciphers/_polyval.js.map +1 -0
  197. package/node_modules/@noble/ciphers/aes.d.ts +117 -0
  198. package/node_modules/@noble/ciphers/aes.d.ts.map +1 -0
  199. package/node_modules/@noble/ciphers/aes.js +906 -0
  200. package/node_modules/@noble/ciphers/aes.js.map +1 -0
  201. package/node_modules/@noble/ciphers/chacha.d.ts +56 -0
  202. package/node_modules/@noble/ciphers/chacha.d.ts.map +1 -0
  203. package/node_modules/@noble/ciphers/chacha.js +320 -0
  204. package/node_modules/@noble/ciphers/chacha.js.map +1 -0
  205. package/node_modules/@noble/ciphers/crypto.d.ts +2 -0
  206. package/node_modules/@noble/ciphers/crypto.d.ts.map +1 -0
  207. package/node_modules/@noble/ciphers/crypto.js +5 -0
  208. package/node_modules/@noble/ciphers/crypto.js.map +1 -0
  209. package/node_modules/@noble/ciphers/cryptoNode.d.ts +2 -0
  210. package/node_modules/@noble/ciphers/cryptoNode.d.ts.map +1 -0
  211. package/node_modules/@noble/ciphers/cryptoNode.js +18 -0
  212. package/node_modules/@noble/ciphers/cryptoNode.js.map +1 -0
  213. package/node_modules/@noble/ciphers/esm/_arx.d.ts +59 -0
  214. package/node_modules/@noble/ciphers/esm/_arx.d.ts.map +1 -0
  215. package/node_modules/@noble/ciphers/esm/_arx.js +171 -0
  216. package/node_modules/@noble/ciphers/esm/_arx.js.map +1 -0
  217. package/node_modules/@noble/ciphers/esm/_assert.d.ts +19 -0
  218. package/node_modules/@noble/ciphers/esm/_assert.d.ts.map +1 -0
  219. package/node_modules/@noble/ciphers/esm/_assert.js +17 -0
  220. package/node_modules/@noble/ciphers/esm/_assert.js.map +1 -0
  221. package/node_modules/@noble/ciphers/esm/_micro.d.ts +41 -0
  222. package/node_modules/@noble/ciphers/esm/_micro.d.ts.map +1 -0
  223. package/node_modules/@noble/ciphers/esm/_micro.js +252 -0
  224. package/node_modules/@noble/ciphers/esm/_micro.js.map +1 -0
  225. package/node_modules/@noble/ciphers/esm/_poly1305.d.ts +29 -0
  226. package/node_modules/@noble/ciphers/esm/_poly1305.d.ts.map +1 -0
  227. package/node_modules/@noble/ciphers/esm/_poly1305.js +277 -0
  228. package/node_modules/@noble/ciphers/esm/_poly1305.js.map +1 -0
  229. package/node_modules/@noble/ciphers/esm/_polyval.d.ts +33 -0
  230. package/node_modules/@noble/ciphers/esm/_polyval.d.ts.map +1 -0
  231. package/node_modules/@noble/ciphers/esm/_polyval.js +229 -0
  232. package/node_modules/@noble/ciphers/esm/_polyval.js.map +1 -0
  233. package/node_modules/@noble/ciphers/esm/aes.d.ts +117 -0
  234. package/node_modules/@noble/ciphers/esm/aes.d.ts.map +1 -0
  235. package/node_modules/@noble/ciphers/esm/aes.js +903 -0
  236. package/node_modules/@noble/ciphers/esm/aes.js.map +1 -0
  237. package/node_modules/@noble/ciphers/esm/chacha.d.ts +56 -0
  238. package/node_modules/@noble/ciphers/esm/chacha.d.ts.map +1 -0
  239. package/node_modules/@noble/ciphers/esm/chacha.js +315 -0
  240. package/node_modules/@noble/ciphers/esm/chacha.js.map +1 -0
  241. package/node_modules/@noble/ciphers/esm/crypto.d.ts +2 -0
  242. package/node_modules/@noble/ciphers/esm/crypto.d.ts.map +1 -0
  243. package/node_modules/@noble/ciphers/esm/crypto.js +2 -0
  244. package/node_modules/@noble/ciphers/esm/crypto.js.map +1 -0
  245. package/node_modules/@noble/ciphers/esm/cryptoNode.d.ts +2 -0
  246. package/node_modules/@noble/ciphers/esm/cryptoNode.d.ts.map +1 -0
  247. package/node_modules/@noble/ciphers/esm/cryptoNode.js +15 -0
  248. package/node_modules/@noble/ciphers/esm/cryptoNode.js.map +1 -0
  249. package/node_modules/@noble/ciphers/esm/ff1.d.ts +9 -0
  250. package/node_modules/@noble/ciphers/esm/ff1.d.ts.map +1 -0
  251. package/node_modules/@noble/ciphers/esm/ff1.js +160 -0
  252. package/node_modules/@noble/ciphers/esm/ff1.js.map +1 -0
  253. package/node_modules/@noble/ciphers/esm/index.d.ts +2 -0
  254. package/node_modules/@noble/ciphers/esm/index.d.ts.map +1 -0
  255. package/node_modules/@noble/ciphers/esm/index.js +28 -0
  256. package/node_modules/@noble/ciphers/esm/index.js.map +1 -0
  257. package/node_modules/@noble/ciphers/esm/package.json +10 -0
  258. package/node_modules/@noble/ciphers/esm/salsa.d.ts +33 -0
  259. package/node_modules/@noble/ciphers/esm/salsa.d.ts.map +1 -0
  260. package/node_modules/@noble/ciphers/esm/salsa.js +201 -0
  261. package/node_modules/@noble/ciphers/esm/salsa.js.map +1 -0
  262. package/node_modules/@noble/ciphers/esm/utils.d.ts +155 -0
  263. package/node_modules/@noble/ciphers/esm/utils.d.ts.map +1 -0
  264. package/node_modules/@noble/ciphers/esm/utils.js +339 -0
  265. package/node_modules/@noble/ciphers/esm/utils.js.map +1 -0
  266. package/node_modules/@noble/ciphers/esm/webcrypto.d.ts +31 -0
  267. package/node_modules/@noble/ciphers/esm/webcrypto.d.ts.map +1 -0
  268. package/node_modules/@noble/ciphers/esm/webcrypto.js +135 -0
  269. package/node_modules/@noble/ciphers/esm/webcrypto.js.map +1 -0
  270. package/node_modules/@noble/ciphers/ff1.d.ts +9 -0
  271. package/node_modules/@noble/ciphers/ff1.d.ts.map +1 -0
  272. package/node_modules/@noble/ciphers/ff1.js +164 -0
  273. package/node_modules/@noble/ciphers/ff1.js.map +1 -0
  274. package/node_modules/@noble/ciphers/index.d.ts +1 -0
  275. package/node_modules/@noble/ciphers/index.d.ts.map +1 -0
  276. package/node_modules/@noble/ciphers/index.js +28 -0
  277. package/node_modules/@noble/ciphers/index.js.map +1 -0
  278. package/node_modules/@noble/ciphers/package.json +177 -0
  279. package/node_modules/@noble/ciphers/salsa.d.ts +33 -0
  280. package/node_modules/@noble/ciphers/salsa.d.ts.map +1 -0
  281. package/node_modules/@noble/ciphers/salsa.js +206 -0
  282. package/node_modules/@noble/ciphers/salsa.js.map +1 -0
  283. package/node_modules/@noble/ciphers/src/_arx.ts +224 -0
  284. package/node_modules/@noble/ciphers/src/_assert.ts +25 -0
  285. package/node_modules/@noble/ciphers/src/_micro.ts +311 -0
  286. package/node_modules/@noble/ciphers/src/_poly1305.ts +305 -0
  287. package/node_modules/@noble/ciphers/src/_polyval.ts +267 -0
  288. package/node_modules/@noble/ciphers/src/aes.ts +1016 -0
  289. package/node_modules/@noble/ciphers/src/chacha.ts +290 -0
  290. package/node_modules/@noble/ciphers/src/crypto.ts +9 -0
  291. package/node_modules/@noble/ciphers/src/cryptoNode.ts +15 -0
  292. package/node_modules/@noble/ciphers/src/ff1.ts +162 -0
  293. package/node_modules/@noble/ciphers/src/index.ts +26 -0
  294. package/node_modules/@noble/ciphers/src/package.json +3 -0
  295. package/node_modules/@noble/ciphers/src/salsa.ts +189 -0
  296. package/node_modules/@noble/ciphers/src/utils.ts +453 -0
  297. package/node_modules/@noble/ciphers/src/webcrypto.ts +169 -0
  298. package/node_modules/@noble/ciphers/utils.d.ts +155 -0
  299. package/node_modules/@noble/ciphers/utils.d.ts.map +1 -0
  300. package/node_modules/@noble/ciphers/utils.js +374 -0
  301. package/node_modules/@noble/ciphers/utils.js.map +1 -0
  302. package/node_modules/@noble/ciphers/webcrypto.d.ts +31 -0
  303. package/node_modules/@noble/ciphers/webcrypto.d.ts.map +1 -0
  304. package/node_modules/@noble/ciphers/webcrypto.js +141 -0
  305. package/node_modules/@noble/ciphers/webcrypto.js.map +1 -0
  306. package/node_modules/@noble/curves/LICENSE +21 -0
  307. package/node_modules/@noble/curves/README.md +1009 -0
  308. package/node_modules/@noble/curves/_shortw_utils.d.ts +19 -0
  309. package/node_modules/@noble/curves/_shortw_utils.d.ts.map +1 -0
  310. package/node_modules/@noble/curves/_shortw_utils.js +20 -0
  311. package/node_modules/@noble/curves/_shortw_utils.js.map +1 -0
  312. package/node_modules/@noble/curves/abstract/bls.d.ts +190 -0
  313. package/node_modules/@noble/curves/abstract/bls.d.ts.map +1 -0
  314. package/node_modules/@noble/curves/abstract/bls.js +411 -0
  315. package/node_modules/@noble/curves/abstract/bls.js.map +1 -0
  316. package/node_modules/@noble/curves/abstract/curve.d.ts +231 -0
  317. package/node_modules/@noble/curves/abstract/curve.d.ts.map +1 -0
  318. package/node_modules/@noble/curves/abstract/curve.js +476 -0
  319. package/node_modules/@noble/curves/abstract/curve.js.map +1 -0
  320. package/node_modules/@noble/curves/abstract/edwards.d.ts +243 -0
  321. package/node_modules/@noble/curves/abstract/edwards.d.ts.map +1 -0
  322. package/node_modules/@noble/curves/abstract/edwards.js +634 -0
  323. package/node_modules/@noble/curves/abstract/edwards.js.map +1 -0
  324. package/node_modules/@noble/curves/abstract/fft.d.ts +122 -0
  325. package/node_modules/@noble/curves/abstract/fft.d.ts.map +1 -0
  326. package/node_modules/@noble/curves/abstract/fft.js +438 -0
  327. package/node_modules/@noble/curves/abstract/fft.js.map +1 -0
  328. package/node_modules/@noble/curves/abstract/hash-to-curve.d.ts +102 -0
  329. package/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map +1 -0
  330. package/node_modules/@noble/curves/abstract/hash-to-curve.js +211 -0
  331. package/node_modules/@noble/curves/abstract/hash-to-curve.js.map +1 -0
  332. package/node_modules/@noble/curves/abstract/modular.d.ts +171 -0
  333. package/node_modules/@noble/curves/abstract/modular.d.ts.map +1 -0
  334. package/node_modules/@noble/curves/abstract/modular.js +554 -0
  335. package/node_modules/@noble/curves/abstract/modular.js.map +1 -0
  336. package/node_modules/@noble/curves/abstract/montgomery.d.ts +30 -0
  337. package/node_modules/@noble/curves/abstract/montgomery.d.ts.map +1 -0
  338. package/node_modules/@noble/curves/abstract/montgomery.js +160 -0
  339. package/node_modules/@noble/curves/abstract/montgomery.js.map +1 -0
  340. package/node_modules/@noble/curves/abstract/poseidon.d.ts +68 -0
  341. package/node_modules/@noble/curves/abstract/poseidon.d.ts.map +1 -0
  342. package/node_modules/@noble/curves/abstract/poseidon.js +305 -0
  343. package/node_modules/@noble/curves/abstract/poseidon.js.map +1 -0
  344. package/node_modules/@noble/curves/abstract/tower.d.ts +95 -0
  345. package/node_modules/@noble/curves/abstract/tower.d.ts.map +1 -0
  346. package/node_modules/@noble/curves/abstract/tower.js +718 -0
  347. package/node_modules/@noble/curves/abstract/tower.js.map +1 -0
  348. package/node_modules/@noble/curves/abstract/utils.d.ts +78 -0
  349. package/node_modules/@noble/curves/abstract/utils.d.ts.map +1 -0
  350. package/node_modules/@noble/curves/abstract/utils.js +73 -0
  351. package/node_modules/@noble/curves/abstract/utils.js.map +1 -0
  352. package/node_modules/@noble/curves/abstract/weierstrass.d.ts +416 -0
  353. package/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +1 -0
  354. package/node_modules/@noble/curves/abstract/weierstrass.js +1427 -0
  355. package/node_modules/@noble/curves/abstract/weierstrass.js.map +1 -0
  356. package/node_modules/@noble/curves/bls12-381.d.ts +16 -0
  357. package/node_modules/@noble/curves/bls12-381.d.ts.map +1 -0
  358. package/node_modules/@noble/curves/bls12-381.js +708 -0
  359. package/node_modules/@noble/curves/bls12-381.js.map +1 -0
  360. package/node_modules/@noble/curves/bn254.d.ts +18 -0
  361. package/node_modules/@noble/curves/bn254.d.ts.map +1 -0
  362. package/node_modules/@noble/curves/bn254.js +218 -0
  363. package/node_modules/@noble/curves/bn254.js.map +1 -0
  364. package/node_modules/@noble/curves/ed25519.d.ts +106 -0
  365. package/node_modules/@noble/curves/ed25519.d.ts.map +1 -0
  366. package/node_modules/@noble/curves/ed25519.js +472 -0
  367. package/node_modules/@noble/curves/ed25519.js.map +1 -0
  368. package/node_modules/@noble/curves/ed448.d.ts +100 -0
  369. package/node_modules/@noble/curves/ed448.d.ts.map +1 -0
  370. package/node_modules/@noble/curves/ed448.js +463 -0
  371. package/node_modules/@noble/curves/ed448.js.map +1 -0
  372. package/node_modules/@noble/curves/esm/_shortw_utils.d.ts +19 -0
  373. package/node_modules/@noble/curves/esm/_shortw_utils.d.ts.map +1 -0
  374. package/node_modules/@noble/curves/esm/_shortw_utils.js +16 -0
  375. package/node_modules/@noble/curves/esm/_shortw_utils.js.map +1 -0
  376. package/node_modules/@noble/curves/esm/abstract/bls.d.ts +190 -0
  377. package/node_modules/@noble/curves/esm/abstract/bls.d.ts.map +1 -0
  378. package/node_modules/@noble/curves/esm/abstract/bls.js +408 -0
  379. package/node_modules/@noble/curves/esm/abstract/bls.js.map +1 -0
  380. package/node_modules/@noble/curves/esm/abstract/curve.d.ts +231 -0
  381. package/node_modules/@noble/curves/esm/abstract/curve.d.ts.map +1 -0
  382. package/node_modules/@noble/curves/esm/abstract/curve.js +465 -0
  383. package/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -0
  384. package/node_modules/@noble/curves/esm/abstract/edwards.d.ts +243 -0
  385. package/node_modules/@noble/curves/esm/abstract/edwards.d.ts.map +1 -0
  386. package/node_modules/@noble/curves/esm/abstract/edwards.js +627 -0
  387. package/node_modules/@noble/curves/esm/abstract/edwards.js.map +1 -0
  388. package/node_modules/@noble/curves/esm/abstract/fft.d.ts +122 -0
  389. package/node_modules/@noble/curves/esm/abstract/fft.d.ts.map +1 -0
  390. package/node_modules/@noble/curves/esm/abstract/fft.js +425 -0
  391. package/node_modules/@noble/curves/esm/abstract/fft.js.map +1 -0
  392. package/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts +102 -0
  393. package/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts.map +1 -0
  394. package/node_modules/@noble/curves/esm/abstract/hash-to-curve.js +203 -0
  395. package/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map +1 -0
  396. package/node_modules/@noble/curves/esm/abstract/modular.d.ts +171 -0
  397. package/node_modules/@noble/curves/esm/abstract/modular.d.ts.map +1 -0
  398. package/node_modules/@noble/curves/esm/abstract/modular.js +530 -0
  399. package/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -0
  400. package/node_modules/@noble/curves/esm/abstract/montgomery.d.ts +30 -0
  401. package/node_modules/@noble/curves/esm/abstract/montgomery.d.ts.map +1 -0
  402. package/node_modules/@noble/curves/esm/abstract/montgomery.js +157 -0
  403. package/node_modules/@noble/curves/esm/abstract/montgomery.js.map +1 -0
  404. package/node_modules/@noble/curves/esm/abstract/poseidon.d.ts +68 -0
  405. package/node_modules/@noble/curves/esm/abstract/poseidon.d.ts.map +1 -0
  406. package/node_modules/@noble/curves/esm/abstract/poseidon.js +296 -0
  407. package/node_modules/@noble/curves/esm/abstract/poseidon.js.map +1 -0
  408. package/node_modules/@noble/curves/esm/abstract/tower.d.ts +95 -0
  409. package/node_modules/@noble/curves/esm/abstract/tower.d.ts.map +1 -0
  410. package/node_modules/@noble/curves/esm/abstract/tower.js +714 -0
  411. package/node_modules/@noble/curves/esm/abstract/tower.js.map +1 -0
  412. package/node_modules/@noble/curves/esm/abstract/utils.d.ts +78 -0
  413. package/node_modules/@noble/curves/esm/abstract/utils.d.ts.map +1 -0
  414. package/node_modules/@noble/curves/esm/abstract/utils.js +70 -0
  415. package/node_modules/@noble/curves/esm/abstract/utils.js.map +1 -0
  416. package/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts +416 -0
  417. package/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts.map +1 -0
  418. package/node_modules/@noble/curves/esm/abstract/weierstrass.js +1413 -0
  419. package/node_modules/@noble/curves/esm/abstract/weierstrass.js.map +1 -0
  420. package/node_modules/@noble/curves/esm/bls12-381.d.ts +16 -0
  421. package/node_modules/@noble/curves/esm/bls12-381.d.ts.map +1 -0
  422. package/node_modules/@noble/curves/esm/bls12-381.js +705 -0
  423. package/node_modules/@noble/curves/esm/bls12-381.js.map +1 -0
  424. package/node_modules/@noble/curves/esm/bn254.d.ts +18 -0
  425. package/node_modules/@noble/curves/esm/bn254.d.ts.map +1 -0
  426. package/node_modules/@noble/curves/esm/bn254.js +214 -0
  427. package/node_modules/@noble/curves/esm/bn254.js.map +1 -0
  428. package/node_modules/@noble/curves/esm/ed25519.d.ts +106 -0
  429. package/node_modules/@noble/curves/esm/ed25519.d.ts.map +1 -0
  430. package/node_modules/@noble/curves/esm/ed25519.js +467 -0
  431. package/node_modules/@noble/curves/esm/ed25519.js.map +1 -0
  432. package/node_modules/@noble/curves/esm/ed448.d.ts +100 -0
  433. package/node_modules/@noble/curves/esm/ed448.d.ts.map +1 -0
  434. package/node_modules/@noble/curves/esm/ed448.js +459 -0
  435. package/node_modules/@noble/curves/esm/ed448.js.map +1 -0
  436. package/node_modules/@noble/curves/esm/index.d.ts +2 -0
  437. package/node_modules/@noble/curves/esm/index.d.ts.map +1 -0
  438. package/node_modules/@noble/curves/esm/index.js +17 -0
  439. package/node_modules/@noble/curves/esm/index.js.map +1 -0
  440. package/node_modules/@noble/curves/esm/jubjub.d.ts +12 -0
  441. package/node_modules/@noble/curves/esm/jubjub.d.ts.map +1 -0
  442. package/node_modules/@noble/curves/esm/jubjub.js +12 -0
  443. package/node_modules/@noble/curves/esm/jubjub.js.map +1 -0
  444. package/node_modules/@noble/curves/esm/misc.d.ts +19 -0
  445. package/node_modules/@noble/curves/esm/misc.d.ts.map +1 -0
  446. package/node_modules/@noble/curves/esm/misc.js +109 -0
  447. package/node_modules/@noble/curves/esm/misc.js.map +1 -0
  448. package/node_modules/@noble/curves/esm/nist.d.ts +21 -0
  449. package/node_modules/@noble/curves/esm/nist.d.ts.map +1 -0
  450. package/node_modules/@noble/curves/esm/nist.js +132 -0
  451. package/node_modules/@noble/curves/esm/nist.js.map +1 -0
  452. package/node_modules/@noble/curves/esm/p256.d.ts +16 -0
  453. package/node_modules/@noble/curves/esm/p256.d.ts.map +1 -0
  454. package/node_modules/@noble/curves/esm/p256.js +16 -0
  455. package/node_modules/@noble/curves/esm/p256.js.map +1 -0
  456. package/node_modules/@noble/curves/esm/p384.d.ts +16 -0
  457. package/node_modules/@noble/curves/esm/p384.d.ts.map +1 -0
  458. package/node_modules/@noble/curves/esm/p384.js +16 -0
  459. package/node_modules/@noble/curves/esm/p384.js.map +1 -0
  460. package/node_modules/@noble/curves/esm/p521.d.ts +16 -0
  461. package/node_modules/@noble/curves/esm/p521.d.ts.map +1 -0
  462. package/node_modules/@noble/curves/esm/p521.js +16 -0
  463. package/node_modules/@noble/curves/esm/p521.js.map +1 -0
  464. package/node_modules/@noble/curves/esm/package.json +4 -0
  465. package/node_modules/@noble/curves/esm/pasta.d.ts +10 -0
  466. package/node_modules/@noble/curves/esm/pasta.d.ts.map +1 -0
  467. package/node_modules/@noble/curves/esm/pasta.js +10 -0
  468. package/node_modules/@noble/curves/esm/pasta.js.map +1 -0
  469. package/node_modules/@noble/curves/esm/secp256k1.d.ts +89 -0
  470. package/node_modules/@noble/curves/esm/secp256k1.d.ts.map +1 -0
  471. package/node_modules/@noble/curves/esm/secp256k1.js +294 -0
  472. package/node_modules/@noble/curves/esm/secp256k1.js.map +1 -0
  473. package/node_modules/@noble/curves/esm/utils.d.ts +110 -0
  474. package/node_modules/@noble/curves/esm/utils.d.ts.map +1 -0
  475. package/node_modules/@noble/curves/esm/utils.js +322 -0
  476. package/node_modules/@noble/curves/esm/utils.js.map +1 -0
  477. package/node_modules/@noble/curves/index.d.ts +1 -0
  478. package/node_modules/@noble/curves/index.d.ts.map +1 -0
  479. package/node_modules/@noble/curves/index.js +17 -0
  480. package/node_modules/@noble/curves/index.js.map +1 -0
  481. package/node_modules/@noble/curves/jubjub.d.ts +12 -0
  482. package/node_modules/@noble/curves/jubjub.d.ts.map +1 -0
  483. package/node_modules/@noble/curves/jubjub.js +15 -0
  484. package/node_modules/@noble/curves/jubjub.js.map +1 -0
  485. package/node_modules/@noble/curves/misc.d.ts +19 -0
  486. package/node_modules/@noble/curves/misc.d.ts.map +1 -0
  487. package/node_modules/@noble/curves/misc.js +114 -0
  488. package/node_modules/@noble/curves/misc.js.map +1 -0
  489. package/node_modules/@noble/curves/nist.d.ts +21 -0
  490. package/node_modules/@noble/curves/nist.d.ts.map +1 -0
  491. package/node_modules/@noble/curves/nist.js +135 -0
  492. package/node_modules/@noble/curves/nist.js.map +1 -0
  493. package/node_modules/@noble/curves/p256.d.ts +16 -0
  494. package/node_modules/@noble/curves/p256.d.ts.map +1 -0
  495. package/node_modules/@noble/curves/p256.js +13 -0
  496. package/node_modules/@noble/curves/p256.js.map +1 -0
  497. package/node_modules/@noble/curves/p384.d.ts +16 -0
  498. package/node_modules/@noble/curves/p384.d.ts.map +1 -0
  499. package/node_modules/@noble/curves/p384.js +13 -0
  500. package/node_modules/@noble/curves/p384.js.map +1 -0
  501. package/node_modules/@noble/curves/p521.d.ts +16 -0
  502. package/node_modules/@noble/curves/p521.d.ts.map +1 -0
  503. package/node_modules/@noble/curves/p521.js +13 -0
  504. package/node_modules/@noble/curves/p521.js.map +1 -0
  505. package/node_modules/@noble/curves/package.json +295 -0
  506. package/node_modules/@noble/curves/pasta.d.ts +10 -0
  507. package/node_modules/@noble/curves/pasta.d.ts.map +1 -0
  508. package/node_modules/@noble/curves/pasta.js +13 -0
  509. package/node_modules/@noble/curves/pasta.js.map +1 -0
  510. package/node_modules/@noble/curves/secp256k1.d.ts +89 -0
  511. package/node_modules/@noble/curves/secp256k1.d.ts.map +1 -0
  512. package/node_modules/@noble/curves/secp256k1.js +297 -0
  513. package/node_modules/@noble/curves/secp256k1.js.map +1 -0
  514. package/node_modules/@noble/curves/src/_shortw_utils.ts +21 -0
  515. package/node_modules/@noble/curves/src/abstract/bls.ts +747 -0
  516. package/node_modules/@noble/curves/src/abstract/curve.ts +692 -0
  517. package/node_modules/@noble/curves/src/abstract/edwards.ts +914 -0
  518. package/node_modules/@noble/curves/src/abstract/fft.ts +519 -0
  519. package/node_modules/@noble/curves/src/abstract/hash-to-curve.ts +306 -0
  520. package/node_modules/@noble/curves/src/abstract/modular.ts +605 -0
  521. package/node_modules/@noble/curves/src/abstract/montgomery.ts +194 -0
  522. package/node_modules/@noble/curves/src/abstract/poseidon.ts +335 -0
  523. package/node_modules/@noble/curves/src/abstract/tower.ts +867 -0
  524. package/node_modules/@noble/curves/src/abstract/utils.ts +80 -0
  525. package/node_modules/@noble/curves/src/abstract/weierstrass.ts +1884 -0
  526. package/node_modules/@noble/curves/src/bls12-381.ts +781 -0
  527. package/node_modules/@noble/curves/src/bn254.ts +243 -0
  528. package/node_modules/@noble/curves/src/ed25519.ts +554 -0
  529. package/node_modules/@noble/curves/src/ed448.ts +552 -0
  530. package/node_modules/@noble/curves/src/index.ts +15 -0
  531. package/node_modules/@noble/curves/src/jubjub.ts +12 -0
  532. package/node_modules/@noble/curves/src/misc.ts +124 -0
  533. package/node_modules/@noble/curves/src/nist.ts +197 -0
  534. package/node_modules/@noble/curves/src/p256.ts +15 -0
  535. package/node_modules/@noble/curves/src/p384.ts +15 -0
  536. package/node_modules/@noble/curves/src/p521.ts +15 -0
  537. package/node_modules/@noble/curves/src/package.json +3 -0
  538. package/node_modules/@noble/curves/src/pasta.ts +9 -0
  539. package/node_modules/@noble/curves/src/secp256k1.ts +362 -0
  540. package/node_modules/@noble/curves/src/utils.ts +376 -0
  541. package/node_modules/@noble/curves/utils.d.ts +110 -0
  542. package/node_modules/@noble/curves/utils.d.ts.map +1 -0
  543. package/node_modules/@noble/curves/utils.js +360 -0
  544. package/node_modules/@noble/curves/utils.js.map +1 -0
  545. package/node_modules/@noble/hashes/LICENSE +21 -0
  546. package/node_modules/@noble/hashes/README.md +521 -0
  547. package/node_modules/@noble/hashes/_assert.d.ts +17 -0
  548. package/node_modules/@noble/hashes/_assert.d.ts.map +1 -0
  549. package/node_modules/@noble/hashes/_assert.js +18 -0
  550. package/node_modules/@noble/hashes/_assert.js.map +1 -0
  551. package/node_modules/@noble/hashes/_blake.d.ts +14 -0
  552. package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
  553. package/node_modules/@noble/hashes/_blake.js +50 -0
  554. package/node_modules/@noble/hashes/_blake.js.map +1 -0
  555. package/node_modules/@noble/hashes/_md.d.ts +51 -0
  556. package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
  557. package/node_modules/@noble/hashes/_md.js +162 -0
  558. package/node_modules/@noble/hashes/_md.js.map +1 -0
  559. package/node_modules/@noble/hashes/_u64.d.ts +55 -0
  560. package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
  561. package/node_modules/@noble/hashes/_u64.js +90 -0
  562. package/node_modules/@noble/hashes/_u64.js.map +1 -0
  563. package/node_modules/@noble/hashes/argon2.d.ts +32 -0
  564. package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
  565. package/node_modules/@noble/hashes/argon2.js +401 -0
  566. package/node_modules/@noble/hashes/argon2.js.map +1 -0
  567. package/node_modules/@noble/hashes/blake1.d.ts +106 -0
  568. package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
  569. package/node_modules/@noble/hashes/blake1.js +459 -0
  570. package/node_modules/@noble/hashes/blake1.js.map +1 -0
  571. package/node_modules/@noble/hashes/blake2.d.ts +116 -0
  572. package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
  573. package/node_modules/@noble/hashes/blake2.js +420 -0
  574. package/node_modules/@noble/hashes/blake2.js.map +1 -0
  575. package/node_modules/@noble/hashes/blake2b.d.ts +11 -0
  576. package/node_modules/@noble/hashes/blake2b.d.ts.map +1 -0
  577. package/node_modules/@noble/hashes/blake2b.js +14 -0
  578. package/node_modules/@noble/hashes/blake2b.js.map +1 -0
  579. package/node_modules/@noble/hashes/blake2s.d.ts +20 -0
  580. package/node_modules/@noble/hashes/blake2s.d.ts.map +1 -0
  581. package/node_modules/@noble/hashes/blake2s.js +24 -0
  582. package/node_modules/@noble/hashes/blake2s.js.map +1 -0
  583. package/node_modules/@noble/hashes/blake3.d.ts +54 -0
  584. package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
  585. package/node_modules/@noble/hashes/blake3.js +255 -0
  586. package/node_modules/@noble/hashes/blake3.js.map +1 -0
  587. package/node_modules/@noble/hashes/crypto.d.ts +2 -0
  588. package/node_modules/@noble/hashes/crypto.d.ts.map +1 -0
  589. package/node_modules/@noble/hashes/crypto.js +5 -0
  590. package/node_modules/@noble/hashes/crypto.js.map +1 -0
  591. package/node_modules/@noble/hashes/cryptoNode.d.ts +2 -0
  592. package/node_modules/@noble/hashes/cryptoNode.d.ts.map +1 -0
  593. package/node_modules/@noble/hashes/cryptoNode.js +18 -0
  594. package/node_modules/@noble/hashes/cryptoNode.js.map +1 -0
  595. package/node_modules/@noble/hashes/eskdf.d.ts +47 -0
  596. package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
  597. package/node_modules/@noble/hashes/eskdf.js +166 -0
  598. package/node_modules/@noble/hashes/eskdf.js.map +1 -0
  599. package/node_modules/@noble/hashes/esm/_assert.d.ts +17 -0
  600. package/node_modules/@noble/hashes/esm/_assert.d.ts.map +1 -0
  601. package/node_modules/@noble/hashes/esm/_assert.js +15 -0
  602. package/node_modules/@noble/hashes/esm/_assert.js.map +1 -0
  603. package/node_modules/@noble/hashes/esm/_blake.d.ts +14 -0
  604. package/node_modules/@noble/hashes/esm/_blake.d.ts.map +1 -0
  605. package/node_modules/@noble/hashes/esm/_blake.js +45 -0
  606. package/node_modules/@noble/hashes/esm/_blake.js.map +1 -0
  607. package/node_modules/@noble/hashes/esm/_md.d.ts +51 -0
  608. package/node_modules/@noble/hashes/esm/_md.d.ts.map +1 -0
  609. package/node_modules/@noble/hashes/esm/_md.js +155 -0
  610. package/node_modules/@noble/hashes/esm/_md.js.map +1 -0
  611. package/node_modules/@noble/hashes/esm/_u64.d.ts +55 -0
  612. package/node_modules/@noble/hashes/esm/_u64.d.ts.map +1 -0
  613. package/node_modules/@noble/hashes/esm/_u64.js +67 -0
  614. package/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
  615. package/node_modules/@noble/hashes/esm/argon2.d.ts +32 -0
  616. package/node_modules/@noble/hashes/esm/argon2.d.ts.map +1 -0
  617. package/node_modules/@noble/hashes/esm/argon2.js +392 -0
  618. package/node_modules/@noble/hashes/esm/argon2.js.map +1 -0
  619. package/node_modules/@noble/hashes/esm/blake1.d.ts +106 -0
  620. package/node_modules/@noble/hashes/esm/blake1.d.ts.map +1 -0
  621. package/node_modules/@noble/hashes/esm/blake1.js +452 -0
  622. package/node_modules/@noble/hashes/esm/blake1.js.map +1 -0
  623. package/node_modules/@noble/hashes/esm/blake2.d.ts +116 -0
  624. package/node_modules/@noble/hashes/esm/blake2.d.ts.map +1 -0
  625. package/node_modules/@noble/hashes/esm/blake2.js +413 -0
  626. package/node_modules/@noble/hashes/esm/blake2.js.map +1 -0
  627. package/node_modules/@noble/hashes/esm/blake2b.d.ts +11 -0
  628. package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +1 -0
  629. package/node_modules/@noble/hashes/esm/blake2b.js +11 -0
  630. package/node_modules/@noble/hashes/esm/blake2b.js.map +1 -0
  631. package/node_modules/@noble/hashes/esm/blake2s.d.ts +20 -0
  632. package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +1 -0
  633. package/node_modules/@noble/hashes/esm/blake2s.js +21 -0
  634. package/node_modules/@noble/hashes/esm/blake2s.js.map +1 -0
  635. package/node_modules/@noble/hashes/esm/blake3.d.ts +54 -0
  636. package/node_modules/@noble/hashes/esm/blake3.d.ts.map +1 -0
  637. package/node_modules/@noble/hashes/esm/blake3.js +251 -0
  638. package/node_modules/@noble/hashes/esm/blake3.js.map +1 -0
  639. package/node_modules/@noble/hashes/esm/crypto.d.ts +2 -0
  640. package/node_modules/@noble/hashes/esm/crypto.d.ts.map +1 -0
  641. package/node_modules/@noble/hashes/esm/crypto.js +2 -0
  642. package/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
  643. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +2 -0
  644. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +1 -0
  645. package/node_modules/@noble/hashes/esm/cryptoNode.js +15 -0
  646. package/node_modules/@noble/hashes/esm/cryptoNode.js.map +1 -0
  647. package/node_modules/@noble/hashes/esm/eskdf.d.ts +47 -0
  648. package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +1 -0
  649. package/node_modules/@noble/hashes/esm/eskdf.js +160 -0
  650. package/node_modules/@noble/hashes/esm/eskdf.js.map +1 -0
  651. package/node_modules/@noble/hashes/esm/hkdf.d.ts +36 -0
  652. package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +1 -0
  653. package/node_modules/@noble/hashes/esm/hkdf.js +82 -0
  654. package/node_modules/@noble/hashes/esm/hkdf.js.map +1 -0
  655. package/node_modules/@noble/hashes/esm/hmac.d.ts +35 -0
  656. package/node_modules/@noble/hashes/esm/hmac.d.ts.map +1 -0
  657. package/node_modules/@noble/hashes/esm/hmac.js +86 -0
  658. package/node_modules/@noble/hashes/esm/hmac.js.map +1 -0
  659. package/node_modules/@noble/hashes/esm/index.d.ts +2 -0
  660. package/node_modules/@noble/hashes/esm/index.d.ts.map +1 -0
  661. package/node_modules/@noble/hashes/esm/index.js +33 -0
  662. package/node_modules/@noble/hashes/esm/index.js.map +1 -0
  663. package/node_modules/@noble/hashes/esm/legacy.d.ts +71 -0
  664. package/node_modules/@noble/hashes/esm/legacy.d.ts.map +1 -0
  665. package/node_modules/@noble/hashes/esm/legacy.js +281 -0
  666. package/node_modules/@noble/hashes/esm/legacy.js.map +1 -0
  667. package/node_modules/@noble/hashes/esm/package.json +10 -0
  668. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +23 -0
  669. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +1 -0
  670. package/node_modules/@noble/hashes/esm/pbkdf2.js +97 -0
  671. package/node_modules/@noble/hashes/esm/pbkdf2.js.map +1 -0
  672. package/node_modules/@noble/hashes/esm/ripemd160.d.ts +13 -0
  673. package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +1 -0
  674. package/node_modules/@noble/hashes/esm/ripemd160.js +13 -0
  675. package/node_modules/@noble/hashes/esm/ripemd160.js.map +1 -0
  676. package/node_modules/@noble/hashes/esm/scrypt.d.ts +34 -0
  677. package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +1 -0
  678. package/node_modules/@noble/hashes/esm/scrypt.js +228 -0
  679. package/node_modules/@noble/hashes/esm/scrypt.js.map +1 -0
  680. package/node_modules/@noble/hashes/esm/sha1.d.ts +11 -0
  681. package/node_modules/@noble/hashes/esm/sha1.d.ts.map +1 -0
  682. package/node_modules/@noble/hashes/esm/sha1.js +11 -0
  683. package/node_modules/@noble/hashes/esm/sha1.js.map +1 -0
  684. package/node_modules/@noble/hashes/esm/sha2.d.ts +159 -0
  685. package/node_modules/@noble/hashes/esm/sha2.d.ts.map +1 -0
  686. package/node_modules/@noble/hashes/esm/sha2.js +375 -0
  687. package/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
  688. package/node_modules/@noble/hashes/esm/sha256.d.ts +20 -0
  689. package/node_modules/@noble/hashes/esm/sha256.d.ts.map +1 -0
  690. package/node_modules/@noble/hashes/esm/sha256.js +20 -0
  691. package/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
  692. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +142 -0
  693. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +1 -0
  694. package/node_modules/@noble/hashes/esm/sha3-addons.js +393 -0
  695. package/node_modules/@noble/hashes/esm/sha3-addons.js.map +1 -0
  696. package/node_modules/@noble/hashes/esm/sha3.d.ts +53 -0
  697. package/node_modules/@noble/hashes/esm/sha3.d.ts.map +1 -0
  698. package/node_modules/@noble/hashes/esm/sha3.js +234 -0
  699. package/node_modules/@noble/hashes/esm/sha3.js.map +1 -0
  700. package/node_modules/@noble/hashes/esm/sha512.d.ts +26 -0
  701. package/node_modules/@noble/hashes/esm/sha512.d.ts.map +1 -0
  702. package/node_modules/@noble/hashes/esm/sha512.js +26 -0
  703. package/node_modules/@noble/hashes/esm/sha512.js.map +1 -0
  704. package/node_modules/@noble/hashes/esm/utils.d.ts +161 -0
  705. package/node_modules/@noble/hashes/esm/utils.d.ts.map +1 -0
  706. package/node_modules/@noble/hashes/esm/utils.js +281 -0
  707. package/node_modules/@noble/hashes/esm/utils.js.map +1 -0
  708. package/node_modules/@noble/hashes/hkdf.d.ts +36 -0
  709. package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
  710. package/node_modules/@noble/hashes/hkdf.js +88 -0
  711. package/node_modules/@noble/hashes/hkdf.js.map +1 -0
  712. package/node_modules/@noble/hashes/hmac.d.ts +35 -0
  713. package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
  714. package/node_modules/@noble/hashes/hmac.js +91 -0
  715. package/node_modules/@noble/hashes/hmac.js.map +1 -0
  716. package/node_modules/@noble/hashes/index.d.ts +1 -0
  717. package/node_modules/@noble/hashes/index.d.ts.map +1 -0
  718. package/node_modules/@noble/hashes/index.js +33 -0
  719. package/node_modules/@noble/hashes/index.js.map +1 -0
  720. package/node_modules/@noble/hashes/legacy.d.ts +71 -0
  721. package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
  722. package/node_modules/@noble/hashes/legacy.js +287 -0
  723. package/node_modules/@noble/hashes/legacy.js.map +1 -0
  724. package/node_modules/@noble/hashes/package.json +266 -0
  725. package/node_modules/@noble/hashes/pbkdf2.d.ts +23 -0
  726. package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
  727. package/node_modules/@noble/hashes/pbkdf2.js +101 -0
  728. package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
  729. package/node_modules/@noble/hashes/ripemd160.d.ts +13 -0
  730. package/node_modules/@noble/hashes/ripemd160.d.ts.map +1 -0
  731. package/node_modules/@noble/hashes/ripemd160.js +16 -0
  732. package/node_modules/@noble/hashes/ripemd160.js.map +1 -0
  733. package/node_modules/@noble/hashes/scrypt.d.ts +34 -0
  734. package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
  735. package/node_modules/@noble/hashes/scrypt.js +232 -0
  736. package/node_modules/@noble/hashes/scrypt.js.map +1 -0
  737. package/node_modules/@noble/hashes/sha1.d.ts +11 -0
  738. package/node_modules/@noble/hashes/sha1.d.ts.map +1 -0
  739. package/node_modules/@noble/hashes/sha1.js +14 -0
  740. package/node_modules/@noble/hashes/sha1.js.map +1 -0
  741. package/node_modules/@noble/hashes/sha2.d.ts +159 -0
  742. package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
  743. package/node_modules/@noble/hashes/sha2.js +384 -0
  744. package/node_modules/@noble/hashes/sha2.js.map +1 -0
  745. package/node_modules/@noble/hashes/sha256.d.ts +20 -0
  746. package/node_modules/@noble/hashes/sha256.d.ts.map +1 -0
  747. package/node_modules/@noble/hashes/sha256.js +23 -0
  748. package/node_modules/@noble/hashes/sha256.js.map +1 -0
  749. package/node_modules/@noble/hashes/sha3-addons.d.ts +142 -0
  750. package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
  751. package/node_modules/@noble/hashes/sha3-addons.js +402 -0
  752. package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
  753. package/node_modules/@noble/hashes/sha3.d.ts +53 -0
  754. package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
  755. package/node_modules/@noble/hashes/sha3.js +239 -0
  756. package/node_modules/@noble/hashes/sha3.js.map +1 -0
  757. package/node_modules/@noble/hashes/sha512.d.ts +26 -0
  758. package/node_modules/@noble/hashes/sha512.d.ts.map +1 -0
  759. package/node_modules/@noble/hashes/sha512.js +29 -0
  760. package/node_modules/@noble/hashes/sha512.js.map +1 -0
  761. package/node_modules/@noble/hashes/src/_assert.ts +22 -0
  762. package/node_modules/@noble/hashes/src/_blake.ts +50 -0
  763. package/node_modules/@noble/hashes/src/_md.ts +176 -0
  764. package/node_modules/@noble/hashes/src/_u64.ts +91 -0
  765. package/node_modules/@noble/hashes/src/argon2.ts +497 -0
  766. package/node_modules/@noble/hashes/src/blake1.ts +534 -0
  767. package/node_modules/@noble/hashes/src/blake2.ts +486 -0
  768. package/node_modules/@noble/hashes/src/blake2b.ts +10 -0
  769. package/node_modules/@noble/hashes/src/blake2s.ts +20 -0
  770. package/node_modules/@noble/hashes/src/blake3.ts +272 -0
  771. package/node_modules/@noble/hashes/src/crypto.ts +9 -0
  772. package/node_modules/@noble/hashes/src/cryptoNode.ts +15 -0
  773. package/node_modules/@noble/hashes/src/eskdf.ts +187 -0
  774. package/node_modules/@noble/hashes/src/hkdf.ts +88 -0
  775. package/node_modules/@noble/hashes/src/hmac.ts +94 -0
  776. package/node_modules/@noble/hashes/src/index.ts +31 -0
  777. package/node_modules/@noble/hashes/src/legacy.ts +293 -0
  778. package/node_modules/@noble/hashes/src/pbkdf2.ts +122 -0
  779. package/node_modules/@noble/hashes/src/ripemd160.ts +12 -0
  780. package/node_modules/@noble/hashes/src/scrypt.ts +257 -0
  781. package/node_modules/@noble/hashes/src/sha1.ts +10 -0
  782. package/node_modules/@noble/hashes/src/sha2.ts +402 -0
  783. package/node_modules/@noble/hashes/src/sha256.ts +24 -0
  784. package/node_modules/@noble/hashes/src/sha3-addons.ts +499 -0
  785. package/node_modules/@noble/hashes/src/sha3.ts +258 -0
  786. package/node_modules/@noble/hashes/src/sha512.ts +34 -0
  787. package/node_modules/@noble/hashes/src/utils.ts +395 -0
  788. package/node_modules/@noble/hashes/utils.d.ts +161 -0
  789. package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
  790. package/node_modules/@noble/hashes/utils.js +313 -0
  791. package/node_modules/@noble/hashes/utils.js.map +1 -0
  792. package/node_modules/ajv/.runkit_example.js +23 -0
  793. package/node_modules/ajv/LICENSE +22 -0
  794. package/node_modules/ajv/README.md +207 -0
  795. package/node_modules/ajv/dist/2019.d.ts +19 -0
  796. package/node_modules/ajv/dist/2019.js +61 -0
  797. package/node_modules/ajv/dist/2019.js.map +1 -0
  798. package/node_modules/ajv/dist/2020.d.ts +19 -0
  799. package/node_modules/ajv/dist/2020.js +55 -0
  800. package/node_modules/ajv/dist/2020.js.map +1 -0
  801. package/node_modules/ajv/dist/ajv.d.ts +18 -0
  802. package/node_modules/ajv/dist/ajv.js +50 -0
  803. package/node_modules/ajv/dist/ajv.js.map +1 -0
  804. package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
  805. package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
  806. package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  807. package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
  808. package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
  809. package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  810. package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
  811. package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
  812. package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  813. package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
  814. package/node_modules/ajv/dist/compile/errors.js +123 -0
  815. package/node_modules/ajv/dist/compile/errors.js.map +1 -0
  816. package/node_modules/ajv/dist/compile/index.d.ts +80 -0
  817. package/node_modules/ajv/dist/compile/index.js +242 -0
  818. package/node_modules/ajv/dist/compile/index.js.map +1 -0
  819. package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
  820. package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
  821. package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
  822. package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
  823. package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
  824. package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
  825. package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
  826. package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
  827. package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
  828. package/node_modules/ajv/dist/compile/names.d.ts +20 -0
  829. package/node_modules/ajv/dist/compile/names.js +28 -0
  830. package/node_modules/ajv/dist/compile/names.js.map +1 -0
  831. package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
  832. package/node_modules/ajv/dist/compile/ref_error.js +12 -0
  833. package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  834. package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
  835. package/node_modules/ajv/dist/compile/resolve.js +155 -0
  836. package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  837. package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
  838. package/node_modules/ajv/dist/compile/rules.js +26 -0
  839. package/node_modules/ajv/dist/compile/rules.js.map +1 -0
  840. package/node_modules/ajv/dist/compile/util.d.ts +40 -0
  841. package/node_modules/ajv/dist/compile/util.js +178 -0
  842. package/node_modules/ajv/dist/compile/util.js.map +1 -0
  843. package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
  844. package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
  845. package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  846. package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
  847. package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
  848. package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  849. package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
  850. package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
  851. package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  852. package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
  853. package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
  854. package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  855. package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
  856. package/node_modules/ajv/dist/compile/validate/index.js +520 -0
  857. package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  858. package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
  859. package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
  860. package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  861. package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
  862. package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
  863. package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  864. package/node_modules/ajv/dist/core.d.ts +174 -0
  865. package/node_modules/ajv/dist/core.js +618 -0
  866. package/node_modules/ajv/dist/core.js.map +1 -0
  867. package/node_modules/ajv/dist/jtd.d.ts +47 -0
  868. package/node_modules/ajv/dist/jtd.js +72 -0
  869. package/node_modules/ajv/dist/jtd.js.map +1 -0
  870. package/node_modules/ajv/dist/refs/data.json +13 -0
  871. package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
  872. package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
  873. package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
  874. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
  875. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
  876. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
  877. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
  878. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  879. package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
  880. package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
  881. package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
  882. package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
  883. package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
  884. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
  885. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
  886. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
  887. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  888. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  889. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  890. package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
  891. package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
  892. package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
  893. package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
  894. package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
  895. package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
  896. package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
  897. package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
  898. package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
  899. package/node_modules/ajv/dist/runtime/equal.js +7 -0
  900. package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  901. package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
  902. package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
  903. package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
  904. package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
  905. package/node_modules/ajv/dist/runtime/quote.js +30 -0
  906. package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
  907. package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
  908. package/node_modules/ajv/dist/runtime/re2.js +6 -0
  909. package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
  910. package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
  911. package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
  912. package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
  913. package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
  914. package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
  915. package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  916. package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
  917. package/node_modules/ajv/dist/runtime/uri.js +6 -0
  918. package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  919. package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
  920. package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
  921. package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  922. package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
  923. package/node_modules/ajv/dist/standalone/index.js +90 -0
  924. package/node_modules/ajv/dist/standalone/index.js.map +1 -0
  925. package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
  926. package/node_modules/ajv/dist/standalone/instance.js +35 -0
  927. package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
  928. package/node_modules/ajv/dist/types/index.d.ts +183 -0
  929. package/node_modules/ajv/dist/types/index.js +3 -0
  930. package/node_modules/ajv/dist/types/index.js.map +1 -0
  931. package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
  932. package/node_modules/ajv/dist/types/json-schema.js +3 -0
  933. package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
  934. package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
  935. package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
  936. package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
  937. package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
  938. package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
  939. package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  940. package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
  941. package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
  942. package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  943. package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
  944. package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
  945. package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  946. package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
  947. package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
  948. package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  949. package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
  950. package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
  951. package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  952. package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
  953. package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
  954. package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  955. package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
  956. package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
  957. package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
  958. package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
  959. package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
  960. package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  961. package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
  962. package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
  963. package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  964. package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
  965. package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
  966. package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  967. package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
  968. package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
  969. package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  970. package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
  971. package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
  972. package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  973. package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
  974. package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
  975. package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  976. package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
  977. package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
  978. package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  979. package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
  980. package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
  981. package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  982. package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
  983. package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
  984. package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  985. package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
  986. package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
  987. package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  988. package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
  989. package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
  990. package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  991. package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
  992. package/node_modules/ajv/dist/vocabularies/code.js +131 -0
  993. package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  994. package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
  995. package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
  996. package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  997. package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
  998. package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
  999. package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  1000. package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
  1001. package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
  1002. package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  1003. package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
  1004. package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
  1005. package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  1006. package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
  1007. package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
  1008. package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  1009. package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
  1010. package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
  1011. package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
  1012. package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
  1013. package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
  1014. package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  1015. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
  1016. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
  1017. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
  1018. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
  1019. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
  1020. package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
  1021. package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
  1022. package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
  1023. package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
  1024. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
  1025. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
  1026. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
  1027. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
  1028. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
  1029. package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
  1030. package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
  1031. package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
  1032. package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
  1033. package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
  1034. package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
  1035. package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  1036. package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
  1037. package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
  1038. package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  1039. package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
  1040. package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
  1041. package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
  1042. package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
  1043. package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
  1044. package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
  1045. package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
  1046. package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
  1047. package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
  1048. package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
  1049. package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
  1050. package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
  1051. package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
  1052. package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
  1053. package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
  1054. package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
  1055. package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
  1056. package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
  1057. package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
  1058. package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
  1059. package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
  1060. package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
  1061. package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
  1062. package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
  1063. package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
  1064. package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
  1065. package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
  1066. package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
  1067. package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
  1068. package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
  1069. package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
  1070. package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
  1071. package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
  1072. package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
  1073. package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
  1074. package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
  1075. package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
  1076. package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
  1077. package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
  1078. package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
  1079. package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
  1080. package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  1081. package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
  1082. package/node_modules/ajv/dist/vocabularies/next.js +8 -0
  1083. package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
  1084. package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
  1085. package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
  1086. package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
  1087. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
  1088. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
  1089. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
  1090. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
  1091. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
  1092. package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
  1093. package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
  1094. package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
  1095. package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  1096. package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
  1097. package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
  1098. package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
  1099. package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
  1100. package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
  1101. package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  1102. package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
  1103. package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
  1104. package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  1105. package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
  1106. package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
  1107. package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
  1108. package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
  1109. package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
  1110. package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  1111. package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
  1112. package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
  1113. package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  1114. package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
  1115. package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
  1116. package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  1117. package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
  1118. package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
  1119. package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  1120. package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
  1121. package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
  1122. package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  1123. package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
  1124. package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
  1125. package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  1126. package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
  1127. package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
  1128. package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  1129. package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
  1130. package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
  1131. package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  1132. package/node_modules/ajv/lib/2019.ts +81 -0
  1133. package/node_modules/ajv/lib/2020.ts +75 -0
  1134. package/node_modules/ajv/lib/ajv.ts +70 -0
  1135. package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
  1136. package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
  1137. package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
  1138. package/node_modules/ajv/lib/compile/errors.ts +184 -0
  1139. package/node_modules/ajv/lib/compile/index.ts +324 -0
  1140. package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
  1141. package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
  1142. package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
  1143. package/node_modules/ajv/lib/compile/names.ts +27 -0
  1144. package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
  1145. package/node_modules/ajv/lib/compile/resolve.ts +149 -0
  1146. package/node_modules/ajv/lib/compile/rules.ts +50 -0
  1147. package/node_modules/ajv/lib/compile/util.ts +213 -0
  1148. package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
  1149. package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
  1150. package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
  1151. package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
  1152. package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
  1153. package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
  1154. package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
  1155. package/node_modules/ajv/lib/core.ts +892 -0
  1156. package/node_modules/ajv/lib/jtd.ts +132 -0
  1157. package/node_modules/ajv/lib/refs/data.json +13 -0
  1158. package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
  1159. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
  1160. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
  1161. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
  1162. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
  1163. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  1164. package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
  1165. package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
  1166. package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
  1167. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
  1168. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
  1169. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
  1170. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  1171. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  1172. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  1173. package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
  1174. package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
  1175. package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
  1176. package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
  1177. package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
  1178. package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
  1179. package/node_modules/ajv/lib/runtime/equal.ts +7 -0
  1180. package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
  1181. package/node_modules/ajv/lib/runtime/quote.ts +31 -0
  1182. package/node_modules/ajv/lib/runtime/re2.ts +6 -0
  1183. package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
  1184. package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
  1185. package/node_modules/ajv/lib/runtime/uri.ts +6 -0
  1186. package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
  1187. package/node_modules/ajv/lib/standalone/index.ts +100 -0
  1188. package/node_modules/ajv/lib/standalone/instance.ts +36 -0
  1189. package/node_modules/ajv/lib/types/index.ts +244 -0
  1190. package/node_modules/ajv/lib/types/json-schema.ts +187 -0
  1191. package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
  1192. package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
  1193. package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
  1194. package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
  1195. package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
  1196. package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
  1197. package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
  1198. package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
  1199. package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
  1200. package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
  1201. package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
  1202. package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
  1203. package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
  1204. package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
  1205. package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
  1206. package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
  1207. package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
  1208. package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
  1209. package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
  1210. package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
  1211. package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
  1212. package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
  1213. package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
  1214. package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
  1215. package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
  1216. package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
  1217. package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
  1218. package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
  1219. package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
  1220. package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
  1221. package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
  1222. package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
  1223. package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
  1224. package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
  1225. package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
  1226. package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
  1227. package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
  1228. package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
  1229. package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
  1230. package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
  1231. package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
  1232. package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
  1233. package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
  1234. package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
  1235. package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
  1236. package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
  1237. package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
  1238. package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
  1239. package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
  1240. package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
  1241. package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
  1242. package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
  1243. package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
  1244. package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
  1245. package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
  1246. package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
  1247. package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
  1248. package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
  1249. package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
  1250. package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
  1251. package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
  1252. package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
  1253. package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
  1254. package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
  1255. package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
  1256. package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
  1257. package/node_modules/ajv/package.json +126 -0
  1258. package/node_modules/ajv-formats/LICENSE +21 -0
  1259. package/node_modules/ajv-formats/README.md +123 -0
  1260. package/node_modules/ajv-formats/dist/formats.d.ts +9 -0
  1261. package/node_modules/ajv-formats/dist/formats.js +173 -0
  1262. package/node_modules/ajv-formats/dist/formats.js.map +1 -0
  1263. package/node_modules/ajv-formats/dist/index.d.ts +15 -0
  1264. package/node_modules/ajv-formats/dist/index.js +37 -0
  1265. package/node_modules/ajv-formats/dist/index.js.map +1 -0
  1266. package/node_modules/ajv-formats/dist/limit.d.ts +10 -0
  1267. package/node_modules/ajv-formats/dist/limit.js +69 -0
  1268. package/node_modules/ajv-formats/dist/limit.js.map +1 -0
  1269. package/node_modules/ajv-formats/package.json +74 -0
  1270. package/node_modules/ajv-formats/src/formats.ts +232 -0
  1271. package/node_modules/ajv-formats/src/index.ts +62 -0
  1272. package/node_modules/ajv-formats/src/limit.ts +99 -0
  1273. package/node_modules/ansi-colors/LICENSE +21 -0
  1274. package/node_modules/ansi-colors/README.md +315 -0
  1275. package/node_modules/ansi-colors/index.js +184 -0
  1276. package/node_modules/ansi-colors/package.json +129 -0
  1277. package/node_modules/ansi-colors/symbols.js +69 -0
  1278. package/node_modules/ansi-colors/types/index.d.ts +235 -0
  1279. package/node_modules/ansi-regex/index.d.ts +37 -0
  1280. package/node_modules/ansi-regex/index.js +10 -0
  1281. package/node_modules/ansi-regex/license +9 -0
  1282. package/node_modules/ansi-regex/package.json +55 -0
  1283. package/node_modules/ansi-regex/readme.md +78 -0
  1284. package/node_modules/atomically/.editorconfig +13 -0
  1285. package/node_modules/atomically/.nvmrc +1 -0
  1286. package/node_modules/atomically/LICENSE +21 -0
  1287. package/node_modules/atomically/README.md +147 -0
  1288. package/node_modules/atomically/dist/consts.d.ts +13 -0
  1289. package/node_modules/atomically/dist/consts.js +28 -0
  1290. package/node_modules/atomically/dist/index.d.ts +13 -0
  1291. package/node_modules/atomically/dist/index.js +177 -0
  1292. package/node_modules/atomically/dist/types.d.ts +28 -0
  1293. package/node_modules/atomically/dist/types.js +3 -0
  1294. package/node_modules/atomically/dist/utils/attemptify.d.ts +4 -0
  1295. package/node_modules/atomically/dist/utils/attemptify.js +25 -0
  1296. package/node_modules/atomically/dist/utils/fs.d.ts +34 -0
  1297. package/node_modules/atomically/dist/utils/fs.js +42 -0
  1298. package/node_modules/atomically/dist/utils/fs_handlers.d.ts +7 -0
  1299. package/node_modules/atomically/dist/utils/fs_handlers.js +28 -0
  1300. package/node_modules/atomically/dist/utils/lang.d.ts +6 -0
  1301. package/node_modules/atomically/dist/utils/lang.js +16 -0
  1302. package/node_modules/atomically/dist/utils/retryify.d.ts +4 -0
  1303. package/node_modules/atomically/dist/utils/retryify.js +45 -0
  1304. package/node_modules/atomically/dist/utils/retryify_queue.d.ts +15 -0
  1305. package/node_modules/atomically/dist/utils/retryify_queue.js +58 -0
  1306. package/node_modules/atomically/dist/utils/scheduler.d.ts +6 -0
  1307. package/node_modules/atomically/dist/utils/scheduler.js +35 -0
  1308. package/node_modules/atomically/dist/utils/temp.d.ts +11 -0
  1309. package/node_modules/atomically/dist/utils/temp.js +56 -0
  1310. package/node_modules/atomically/package.json +51 -0
  1311. package/node_modules/atomically/src/consts.ts +30 -0
  1312. package/node_modules/atomically/src/index.ts +270 -0
  1313. package/node_modules/atomically/src/types.ts +37 -0
  1314. package/node_modules/atomically/src/utils/attemptify.ts +42 -0
  1315. package/node_modules/atomically/src/utils/fs.ts +51 -0
  1316. package/node_modules/atomically/src/utils/fs_handlers.ts +45 -0
  1317. package/node_modules/atomically/src/utils/lang.ts +28 -0
  1318. package/node_modules/atomically/src/utils/retryify.ts +78 -0
  1319. package/node_modules/atomically/src/utils/retryify_queue.ts +95 -0
  1320. package/node_modules/atomically/src/utils/scheduler.ts +60 -0
  1321. package/node_modules/atomically/src/utils/temp.ts +97 -0
  1322. package/node_modules/atomically/tasks/benchmark.js +72 -0
  1323. package/node_modules/atomically/test/basic.js +510 -0
  1324. package/node_modules/atomically/test/concurrency.js +153 -0
  1325. package/node_modules/atomically/test/integration.js +291 -0
  1326. package/node_modules/atomically/tsconfig.json +28 -0
  1327. package/node_modules/commander/LICENSE +22 -0
  1328. package/node_modules/commander/Readme.md +1148 -0
  1329. package/node_modules/commander/esm.mjs +16 -0
  1330. package/node_modules/commander/index.js +26 -0
  1331. package/node_modules/commander/lib/argument.js +145 -0
  1332. package/node_modules/commander/lib/command.js +2179 -0
  1333. package/node_modules/commander/lib/error.js +43 -0
  1334. package/node_modules/commander/lib/help.js +462 -0
  1335. package/node_modules/commander/lib/option.js +329 -0
  1336. package/node_modules/commander/lib/suggestSimilar.js +100 -0
  1337. package/node_modules/commander/package-support.json +16 -0
  1338. package/node_modules/commander/package.json +80 -0
  1339. package/node_modules/commander/typings/esm.d.mts +3 -0
  1340. package/node_modules/commander/typings/index.d.ts +884 -0
  1341. package/node_modules/conf/dist/source/index.d.ts +88 -0
  1342. package/node_modules/conf/dist/source/index.js +484 -0
  1343. package/node_modules/conf/dist/source/types.d.ts +233 -0
  1344. package/node_modules/conf/dist/source/types.js +2 -0
  1345. package/node_modules/conf/license +9 -0
  1346. package/node_modules/conf/package.json +100 -0
  1347. package/node_modules/conf/readme.md +445 -0
  1348. package/node_modules/cross-spawn/LICENSE +21 -0
  1349. package/node_modules/cross-spawn/README.md +89 -0
  1350. package/node_modules/cross-spawn/index.js +39 -0
  1351. package/node_modules/cross-spawn/lib/enoent.js +59 -0
  1352. package/node_modules/cross-spawn/lib/parse.js +91 -0
  1353. package/node_modules/cross-spawn/lib/util/escape.js +47 -0
  1354. package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
  1355. package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
  1356. package/node_modules/cross-spawn/node_modules/isexe/.npmignore +2 -0
  1357. package/node_modules/cross-spawn/node_modules/isexe/LICENSE +15 -0
  1358. package/node_modules/cross-spawn/node_modules/isexe/README.md +51 -0
  1359. package/node_modules/cross-spawn/node_modules/isexe/index.js +57 -0
  1360. package/node_modules/cross-spawn/node_modules/isexe/mode.js +41 -0
  1361. package/node_modules/cross-spawn/node_modules/isexe/package.json +31 -0
  1362. package/node_modules/cross-spawn/node_modules/isexe/test/basic.js +221 -0
  1363. package/node_modules/cross-spawn/node_modules/isexe/windows.js +42 -0
  1364. package/node_modules/cross-spawn/node_modules/which/CHANGELOG.md +166 -0
  1365. package/node_modules/cross-spawn/node_modules/which/LICENSE +15 -0
  1366. package/node_modules/cross-spawn/node_modules/which/README.md +54 -0
  1367. package/node_modules/cross-spawn/node_modules/which/bin/node-which +52 -0
  1368. package/node_modules/cross-spawn/node_modules/which/package.json +43 -0
  1369. package/node_modules/cross-spawn/node_modules/which/which.js +125 -0
  1370. package/node_modules/cross-spawn/package.json +73 -0
  1371. package/node_modules/debounce-fn/index.d.ts +74 -0
  1372. package/node_modules/debounce-fn/index.js +54 -0
  1373. package/node_modules/debounce-fn/license +9 -0
  1374. package/node_modules/debounce-fn/package.json +42 -0
  1375. package/node_modules/debounce-fn/readme.md +64 -0
  1376. package/node_modules/define-lazy-prop/index.d.ts +33 -0
  1377. package/node_modules/define-lazy-prop/index.js +19 -0
  1378. package/node_modules/define-lazy-prop/license +9 -0
  1379. package/node_modules/define-lazy-prop/package.json +48 -0
  1380. package/node_modules/define-lazy-prop/readme.md +64 -0
  1381. package/node_modules/dot-prop/index.d.ts +109 -0
  1382. package/node_modules/dot-prop/index.js +138 -0
  1383. package/node_modules/dot-prop/license +9 -0
  1384. package/node_modules/dot-prop/package.json +51 -0
  1385. package/node_modules/dot-prop/readme.md +125 -0
  1386. package/node_modules/dotenv/CHANGELOG.md +643 -0
  1387. package/node_modules/dotenv/LICENSE +23 -0
  1388. package/node_modules/dotenv/README-es.md +757 -0
  1389. package/node_modules/dotenv/README.md +812 -0
  1390. package/node_modules/dotenv/SECURITY.md +1 -0
  1391. package/node_modules/dotenv/config.d.ts +1 -0
  1392. package/node_modules/dotenv/config.js +9 -0
  1393. package/node_modules/dotenv/lib/cli-options.js +17 -0
  1394. package/node_modules/dotenv/lib/env-options.js +28 -0
  1395. package/node_modules/dotenv/lib/main.d.ts +179 -0
  1396. package/node_modules/dotenv/lib/main.js +423 -0
  1397. package/node_modules/dotenv/package.json +62 -0
  1398. package/node_modules/dotenv/skills/dotenv/SKILL.md +200 -0
  1399. package/node_modules/dotenv/skills/dotenvx/SKILL.md +118 -0
  1400. package/node_modules/eciesjs/LICENSE +21 -0
  1401. package/node_modules/eciesjs/README.md +213 -0
  1402. package/node_modules/eciesjs/dist/config.d.ts +24 -0
  1403. package/node_modules/eciesjs/dist/config.js +55 -0
  1404. package/node_modules/eciesjs/dist/consts.d.ts +7 -0
  1405. package/node_modules/eciesjs/dist/consts.js +12 -0
  1406. package/node_modules/eciesjs/dist/index.d.ts +36 -0
  1407. package/node_modules/eciesjs/dist/index.js +79 -0
  1408. package/node_modules/eciesjs/dist/keys/PrivateKey.d.ts +34 -0
  1409. package/node_modules/eciesjs/dist/keys/PrivateKey.js +71 -0
  1410. package/node_modules/eciesjs/dist/keys/PublicKey.d.ts +26 -0
  1411. package/node_modules/eciesjs/dist/keys/PublicKey.js +72 -0
  1412. package/node_modules/eciesjs/dist/keys/index.d.ts +2 -0
  1413. package/node_modules/eciesjs/dist/keys/index.js +9 -0
  1414. package/node_modules/eciesjs/dist/types.d.ts +1 -0
  1415. package/node_modules/eciesjs/dist/types.js +4 -0
  1416. package/node_modules/eciesjs/dist/utils/elliptic.d.ts +7 -0
  1417. package/node_modules/eciesjs/dist/utils/elliptic.js +75 -0
  1418. package/node_modules/eciesjs/dist/utils/hash.d.ts +2 -0
  1419. package/node_modules/eciesjs/dist/utils/hash.js +19 -0
  1420. package/node_modules/eciesjs/dist/utils/hex.d.ts +2 -0
  1421. package/node_modules/eciesjs/dist/utils/hex.js +10 -0
  1422. package/node_modules/eciesjs/dist/utils/index.d.ts +4 -0
  1423. package/node_modules/eciesjs/dist/utils/index.js +20 -0
  1424. package/node_modules/eciesjs/dist/utils/symmetric.d.ts +6 -0
  1425. package/node_modules/eciesjs/dist/utils/symmetric.js +63 -0
  1426. package/node_modules/eciesjs/package.json +81 -0
  1427. package/node_modules/enquirer/LICENSE +21 -0
  1428. package/node_modules/enquirer/README.md +1839 -0
  1429. package/node_modules/enquirer/index.d.ts +156 -0
  1430. package/node_modules/enquirer/index.js +254 -0
  1431. package/node_modules/enquirer/lib/ansi.js +125 -0
  1432. package/node_modules/enquirer/lib/combos.js +75 -0
  1433. package/node_modules/enquirer/lib/completer.js +52 -0
  1434. package/node_modules/enquirer/lib/interpolate.js +266 -0
  1435. package/node_modules/enquirer/lib/keypress.js +245 -0
  1436. package/node_modules/enquirer/lib/placeholder.js +63 -0
  1437. package/node_modules/enquirer/lib/prompt.js +497 -0
  1438. package/node_modules/enquirer/lib/prompts/autocomplete.js +118 -0
  1439. package/node_modules/enquirer/lib/prompts/basicauth.js +41 -0
  1440. package/node_modules/enquirer/lib/prompts/confirm.js +13 -0
  1441. package/node_modules/enquirer/lib/prompts/editable.js +136 -0
  1442. package/node_modules/enquirer/lib/prompts/form.js +195 -0
  1443. package/node_modules/enquirer/lib/prompts/index.js +28 -0
  1444. package/node_modules/enquirer/lib/prompts/input.js +55 -0
  1445. package/node_modules/enquirer/lib/prompts/invisible.js +11 -0
  1446. package/node_modules/enquirer/lib/prompts/list.js +36 -0
  1447. package/node_modules/enquirer/lib/prompts/multiselect.js +11 -0
  1448. package/node_modules/enquirer/lib/prompts/numeral.js +1 -0
  1449. package/node_modules/enquirer/lib/prompts/password.js +18 -0
  1450. package/node_modules/enquirer/lib/prompts/quiz.js +37 -0
  1451. package/node_modules/enquirer/lib/prompts/scale.js +237 -0
  1452. package/node_modules/enquirer/lib/prompts/select.js +139 -0
  1453. package/node_modules/enquirer/lib/prompts/snippet.js +185 -0
  1454. package/node_modules/enquirer/lib/prompts/sort.js +37 -0
  1455. package/node_modules/enquirer/lib/prompts/survey.js +163 -0
  1456. package/node_modules/enquirer/lib/prompts/text.js +1 -0
  1457. package/node_modules/enquirer/lib/prompts/toggle.js +109 -0
  1458. package/node_modules/enquirer/lib/queue.js +33 -0
  1459. package/node_modules/enquirer/lib/render.js +33 -0
  1460. package/node_modules/enquirer/lib/roles.js +46 -0
  1461. package/node_modules/enquirer/lib/state.js +69 -0
  1462. package/node_modules/enquirer/lib/styles.js +144 -0
  1463. package/node_modules/enquirer/lib/symbols.js +66 -0
  1464. package/node_modules/enquirer/lib/theme.js +11 -0
  1465. package/node_modules/enquirer/lib/timer.js +38 -0
  1466. package/node_modules/enquirer/lib/types/array.js +664 -0
  1467. package/node_modules/enquirer/lib/types/auth.js +29 -0
  1468. package/node_modules/enquirer/lib/types/boolean.js +88 -0
  1469. package/node_modules/enquirer/lib/types/index.js +7 -0
  1470. package/node_modules/enquirer/lib/types/number.js +86 -0
  1471. package/node_modules/enquirer/lib/types/string.js +209 -0
  1472. package/node_modules/enquirer/lib/utils.js +279 -0
  1473. package/node_modules/enquirer/package.json +112 -0
  1474. package/node_modules/env-paths/index.d.ts +101 -0
  1475. package/node_modules/env-paths/index.js +74 -0
  1476. package/node_modules/env-paths/license +9 -0
  1477. package/node_modules/env-paths/package.json +45 -0
  1478. package/node_modules/env-paths/readme.md +115 -0
  1479. package/node_modules/execa/index.d.ts +564 -0
  1480. package/node_modules/execa/index.js +268 -0
  1481. package/node_modules/execa/lib/command.js +52 -0
  1482. package/node_modules/execa/lib/error.js +88 -0
  1483. package/node_modules/execa/lib/kill.js +115 -0
  1484. package/node_modules/execa/lib/promise.js +46 -0
  1485. package/node_modules/execa/lib/stdio.js +52 -0
  1486. package/node_modules/execa/lib/stream.js +97 -0
  1487. package/node_modules/execa/license +9 -0
  1488. package/node_modules/execa/package.json +74 -0
  1489. package/node_modules/execa/readme.md +663 -0
  1490. package/node_modules/fast-deep-equal/LICENSE +21 -0
  1491. package/node_modules/fast-deep-equal/README.md +96 -0
  1492. package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
  1493. package/node_modules/fast-deep-equal/es6/index.js +72 -0
  1494. package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
  1495. package/node_modules/fast-deep-equal/es6/react.js +79 -0
  1496. package/node_modules/fast-deep-equal/index.d.ts +4 -0
  1497. package/node_modules/fast-deep-equal/index.js +46 -0
  1498. package/node_modules/fast-deep-equal/package.json +61 -0
  1499. package/node_modules/fast-deep-equal/react.d.ts +2 -0
  1500. package/node_modules/fast-deep-equal/react.js +53 -0
  1501. package/node_modules/fast-uri/.gitattributes +2 -0
  1502. package/node_modules/fast-uri/.github/dependabot.yml +13 -0
  1503. package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
  1504. package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
  1505. package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
  1506. package/node_modules/fast-uri/LICENSE +30 -0
  1507. package/node_modules/fast-uri/README.md +152 -0
  1508. package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
  1509. package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
  1510. package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
  1511. package/node_modules/fast-uri/benchmark/package.json +17 -0
  1512. package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
  1513. package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
  1514. package/node_modules/fast-uri/eslint.config.js +6 -0
  1515. package/node_modules/fast-uri/index.js +406 -0
  1516. package/node_modules/fast-uri/lib/schemes.js +267 -0
  1517. package/node_modules/fast-uri/lib/utils.js +443 -0
  1518. package/node_modules/fast-uri/package.json +68 -0
  1519. package/node_modules/fast-uri/test/ajv.test.js +43 -0
  1520. package/node_modules/fast-uri/test/equal.test.js +117 -0
  1521. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
  1522. package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
  1523. package/node_modules/fast-uri/test/parse.test.js +323 -0
  1524. package/node_modules/fast-uri/test/resolve.test.js +87 -0
  1525. package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
  1526. package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
  1527. package/node_modules/fast-uri/test/security.test.js +133 -0
  1528. package/node_modules/fast-uri/test/serialize.test.js +151 -0
  1529. package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
  1530. package/node_modules/fast-uri/test/uri-js.test.js +912 -0
  1531. package/node_modules/fast-uri/test/util.test.js +38 -0
  1532. package/node_modules/fast-uri/tsconfig.json +9 -0
  1533. package/node_modules/fast-uri/types/index.d.ts +60 -0
  1534. package/node_modules/fast-uri/types/index.test-d.ts +17 -0
  1535. package/node_modules/fdir/LICENSE +7 -0
  1536. package/node_modules/fdir/README.md +91 -0
  1537. package/node_modules/fdir/dist/index.cjs +588 -0
  1538. package/node_modules/fdir/dist/index.d.cts +155 -0
  1539. package/node_modules/fdir/dist/index.d.mts +155 -0
  1540. package/node_modules/fdir/dist/index.mjs +570 -0
  1541. package/node_modules/fdir/package.json +103 -0
  1542. package/node_modules/find-up/index.js +46 -0
  1543. package/node_modules/find-up/license +9 -0
  1544. package/node_modules/find-up/package.json +50 -0
  1545. package/node_modules/find-up/readme.md +87 -0
  1546. package/node_modules/get-stream/buffer-stream.js +52 -0
  1547. package/node_modules/get-stream/index.d.ts +105 -0
  1548. package/node_modules/get-stream/index.js +61 -0
  1549. package/node_modules/get-stream/license +9 -0
  1550. package/node_modules/get-stream/package.json +47 -0
  1551. package/node_modules/get-stream/readme.md +124 -0
  1552. package/node_modules/human-signals/CHANGELOG.md +11 -0
  1553. package/node_modules/human-signals/LICENSE +201 -0
  1554. package/node_modules/human-signals/README.md +165 -0
  1555. package/node_modules/human-signals/build/src/core.js +273 -0
  1556. package/node_modules/human-signals/build/src/core.js.map +1 -0
  1557. package/node_modules/human-signals/build/src/main.d.ts +52 -0
  1558. package/node_modules/human-signals/build/src/main.js +71 -0
  1559. package/node_modules/human-signals/build/src/main.js.map +1 -0
  1560. package/node_modules/human-signals/build/src/realtime.js +19 -0
  1561. package/node_modules/human-signals/build/src/realtime.js.map +1 -0
  1562. package/node_modules/human-signals/build/src/signals.js +35 -0
  1563. package/node_modules/human-signals/build/src/signals.js.map +1 -0
  1564. package/node_modules/human-signals/package.json +64 -0
  1565. package/node_modules/ignore/LICENSE-MIT +21 -0
  1566. package/node_modules/ignore/README.md +412 -0
  1567. package/node_modules/ignore/index.d.ts +61 -0
  1568. package/node_modules/ignore/index.js +636 -0
  1569. package/node_modules/ignore/legacy.js +559 -0
  1570. package/node_modules/ignore/package.json +74 -0
  1571. package/node_modules/is-docker/cli.js +5 -0
  1572. package/node_modules/is-docker/index.d.ts +15 -0
  1573. package/node_modules/is-docker/index.js +29 -0
  1574. package/node_modules/is-docker/license +9 -0
  1575. package/node_modules/is-docker/package.json +42 -0
  1576. package/node_modules/is-docker/readme.md +27 -0
  1577. package/node_modules/is-obj/index.d.ts +22 -0
  1578. package/node_modules/is-obj/index.js +6 -0
  1579. package/node_modules/is-obj/license +9 -0
  1580. package/node_modules/is-obj/package.json +34 -0
  1581. package/node_modules/is-obj/readme.md +39 -0
  1582. package/node_modules/is-stream/index.d.ts +79 -0
  1583. package/node_modules/is-stream/index.js +28 -0
  1584. package/node_modules/is-stream/license +9 -0
  1585. package/node_modules/is-stream/package.json +42 -0
  1586. package/node_modules/is-stream/readme.md +60 -0
  1587. package/node_modules/is-wsl/index.d.ts +15 -0
  1588. package/node_modules/is-wsl/index.js +31 -0
  1589. package/node_modules/is-wsl/license +9 -0
  1590. package/node_modules/is-wsl/package.json +45 -0
  1591. package/node_modules/is-wsl/readme.md +36 -0
  1592. package/node_modules/isexe/LICENSE.md +55 -0
  1593. package/node_modules/isexe/README.md +80 -0
  1594. package/node_modules/isexe/dist/commonjs/index.d.ts +14 -0
  1595. package/node_modules/isexe/dist/commonjs/index.d.ts.map +1 -0
  1596. package/node_modules/isexe/dist/commonjs/index.js +56 -0
  1597. package/node_modules/isexe/dist/commonjs/index.js.map +1 -0
  1598. package/node_modules/isexe/dist/commonjs/index.min.js +2 -0
  1599. package/node_modules/isexe/dist/commonjs/index.min.js.map +7 -0
  1600. package/node_modules/isexe/dist/commonjs/options.d.ts +32 -0
  1601. package/node_modules/isexe/dist/commonjs/options.d.ts.map +1 -0
  1602. package/node_modules/isexe/dist/commonjs/options.js +3 -0
  1603. package/node_modules/isexe/dist/commonjs/options.js.map +1 -0
  1604. package/node_modules/isexe/dist/commonjs/package.json +3 -0
  1605. package/node_modules/isexe/dist/commonjs/posix.d.ts +18 -0
  1606. package/node_modules/isexe/dist/commonjs/posix.d.ts.map +1 -0
  1607. package/node_modules/isexe/dist/commonjs/posix.js +67 -0
  1608. package/node_modules/isexe/dist/commonjs/posix.js.map +1 -0
  1609. package/node_modules/isexe/dist/commonjs/win32.d.ts +18 -0
  1610. package/node_modules/isexe/dist/commonjs/win32.d.ts.map +1 -0
  1611. package/node_modules/isexe/dist/commonjs/win32.js +63 -0
  1612. package/node_modules/isexe/dist/commonjs/win32.js.map +1 -0
  1613. package/node_modules/isexe/dist/esm/index.d.ts +14 -0
  1614. package/node_modules/isexe/dist/esm/index.d.ts.map +1 -0
  1615. package/node_modules/isexe/dist/esm/index.js +16 -0
  1616. package/node_modules/isexe/dist/esm/index.js.map +1 -0
  1617. package/node_modules/isexe/dist/esm/index.min.js +2 -0
  1618. package/node_modules/isexe/dist/esm/index.min.js.map +7 -0
  1619. package/node_modules/isexe/dist/esm/options.d.ts +32 -0
  1620. package/node_modules/isexe/dist/esm/options.d.ts.map +1 -0
  1621. package/node_modules/isexe/dist/esm/options.js +2 -0
  1622. package/node_modules/isexe/dist/esm/options.js.map +1 -0
  1623. package/node_modules/isexe/dist/esm/package.json +3 -0
  1624. package/node_modules/isexe/dist/esm/posix.d.ts +18 -0
  1625. package/node_modules/isexe/dist/esm/posix.d.ts.map +1 -0
  1626. package/node_modules/isexe/dist/esm/posix.js +62 -0
  1627. package/node_modules/isexe/dist/esm/posix.js.map +1 -0
  1628. package/node_modules/isexe/dist/esm/win32.d.ts +18 -0
  1629. package/node_modules/isexe/dist/esm/win32.d.ts.map +1 -0
  1630. package/node_modules/isexe/dist/esm/win32.js +58 -0
  1631. package/node_modules/isexe/dist/esm/win32.js.map +1 -0
  1632. package/node_modules/isexe/package.json +78 -0
  1633. package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
  1634. package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
  1635. package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
  1636. package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
  1637. package/node_modules/json-schema-traverse/LICENSE +21 -0
  1638. package/node_modules/json-schema-traverse/README.md +95 -0
  1639. package/node_modules/json-schema-traverse/index.d.ts +40 -0
  1640. package/node_modules/json-schema-traverse/index.js +93 -0
  1641. package/node_modules/json-schema-traverse/package.json +43 -0
  1642. package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
  1643. package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
  1644. package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
  1645. package/node_modules/json-schema-typed/LICENSE +27 -0
  1646. package/node_modules/json-schema-typed/README.md +63 -0
  1647. package/node_modules/json-schema-typed/dist-node/index.js +50 -0
  1648. package/node_modules/json-schema-typed/dist-node/index.js.map +1 -0
  1649. package/node_modules/json-schema-typed/dist-src/index.js +51 -0
  1650. package/node_modules/json-schema-typed/dist-types/__tests__/index.test.d.ts +1 -0
  1651. package/node_modules/json-schema-typed/dist-types/index.d.ts +909 -0
  1652. package/node_modules/json-schema-typed/dist-web/index.js +52 -0
  1653. package/node_modules/json-schema-typed/dist-web/index.js.map +1 -0
  1654. package/node_modules/json-schema-typed/package.json +76 -0
  1655. package/node_modules/locate-path/index.js +24 -0
  1656. package/node_modules/locate-path/license +9 -0
  1657. package/node_modules/locate-path/package.json +44 -0
  1658. package/node_modules/locate-path/readme.md +99 -0
  1659. package/node_modules/merge-stream/LICENSE +21 -0
  1660. package/node_modules/merge-stream/README.md +78 -0
  1661. package/node_modules/merge-stream/index.js +41 -0
  1662. package/node_modules/merge-stream/package.json +19 -0
  1663. package/node_modules/mimic-fn/index.d.ts +56 -0
  1664. package/node_modules/mimic-fn/index.js +75 -0
  1665. package/node_modules/mimic-fn/license +9 -0
  1666. package/node_modules/mimic-fn/package.json +42 -0
  1667. package/node_modules/mimic-fn/readme.md +95 -0
  1668. package/node_modules/npm-run-path/index.d.ts +89 -0
  1669. package/node_modules/npm-run-path/index.js +47 -0
  1670. package/node_modules/npm-run-path/license +9 -0
  1671. package/node_modules/npm-run-path/package.json +44 -0
  1672. package/node_modules/npm-run-path/readme.md +115 -0
  1673. package/node_modules/object-treeify/LICENSE +22 -0
  1674. package/node_modules/object-treeify/README.md +120 -0
  1675. package/node_modules/object-treeify/lib/index.js +49 -0
  1676. package/node_modules/object-treeify/package.json +109 -0
  1677. package/node_modules/onetime/index.d.ts +64 -0
  1678. package/node_modules/onetime/index.js +44 -0
  1679. package/node_modules/onetime/license +9 -0
  1680. package/node_modules/onetime/node_modules/mimic-fn/index.d.ts +54 -0
  1681. package/node_modules/onetime/node_modules/mimic-fn/index.js +13 -0
  1682. package/node_modules/onetime/node_modules/mimic-fn/license +9 -0
  1683. package/node_modules/onetime/node_modules/mimic-fn/package.json +42 -0
  1684. package/node_modules/onetime/node_modules/mimic-fn/readme.md +69 -0
  1685. package/node_modules/onetime/package.json +43 -0
  1686. package/node_modules/onetime/readme.md +94 -0
  1687. package/node_modules/open/index.d.ts +153 -0
  1688. package/node_modules/open/index.js +334 -0
  1689. package/node_modules/open/license +9 -0
  1690. package/node_modules/open/package.json +61 -0
  1691. package/node_modules/open/readme.md +171 -0
  1692. package/node_modules/open/xdg-open +1066 -0
  1693. package/node_modules/p-limit/index.d.ts +38 -0
  1694. package/node_modules/p-limit/index.js +57 -0
  1695. package/node_modules/p-limit/license +9 -0
  1696. package/node_modules/p-limit/package.json +52 -0
  1697. package/node_modules/p-limit/readme.md +101 -0
  1698. package/node_modules/p-locate/index.js +34 -0
  1699. package/node_modules/p-locate/license +9 -0
  1700. package/node_modules/p-locate/package.json +51 -0
  1701. package/node_modules/p-locate/readme.md +88 -0
  1702. package/node_modules/p-try/index.d.ts +39 -0
  1703. package/node_modules/p-try/index.js +9 -0
  1704. package/node_modules/p-try/license +9 -0
  1705. package/node_modules/p-try/package.json +42 -0
  1706. package/node_modules/p-try/readme.md +58 -0
  1707. package/node_modules/path-exists/index.js +17 -0
  1708. package/node_modules/path-exists/license +21 -0
  1709. package/node_modules/path-exists/package.json +40 -0
  1710. package/node_modules/path-exists/readme.md +50 -0
  1711. package/node_modules/path-key/index.d.ts +40 -0
  1712. package/node_modules/path-key/index.js +16 -0
  1713. package/node_modules/path-key/license +9 -0
  1714. package/node_modules/path-key/package.json +39 -0
  1715. package/node_modules/path-key/readme.md +61 -0
  1716. package/node_modules/picomatch/LICENSE +21 -0
  1717. package/node_modules/picomatch/README.md +749 -0
  1718. package/node_modules/picomatch/index.js +17 -0
  1719. package/node_modules/picomatch/lib/constants.js +184 -0
  1720. package/node_modules/picomatch/lib/parse.js +1386 -0
  1721. package/node_modules/picomatch/lib/picomatch.js +349 -0
  1722. package/node_modules/picomatch/lib/scan.js +391 -0
  1723. package/node_modules/picomatch/lib/utils.js +72 -0
  1724. package/node_modules/picomatch/package.json +82 -0
  1725. package/node_modules/picomatch/posix.js +3 -0
  1726. package/node_modules/pkg-up/index.d.ts +48 -0
  1727. package/node_modules/pkg-up/index.js +5 -0
  1728. package/node_modules/pkg-up/license +9 -0
  1729. package/node_modules/pkg-up/package.json +52 -0
  1730. package/node_modules/pkg-up/readme.md +68 -0
  1731. package/node_modules/require-from-string/index.js +34 -0
  1732. package/node_modules/require-from-string/license +21 -0
  1733. package/node_modules/require-from-string/package.json +28 -0
  1734. package/node_modules/require-from-string/readme.md +56 -0
  1735. package/node_modules/semver/LICENSE +15 -0
  1736. package/node_modules/semver/README.md +680 -0
  1737. package/node_modules/semver/bin/semver.js +195 -0
  1738. package/node_modules/semver/classes/comparator.js +143 -0
  1739. package/node_modules/semver/classes/index.js +7 -0
  1740. package/node_modules/semver/classes/range.js +573 -0
  1741. package/node_modules/semver/classes/semver.js +350 -0
  1742. package/node_modules/semver/functions/clean.js +8 -0
  1743. package/node_modules/semver/functions/cmp.js +54 -0
  1744. package/node_modules/semver/functions/coerce.js +62 -0
  1745. package/node_modules/semver/functions/compare-build.js +9 -0
  1746. package/node_modules/semver/functions/compare-loose.js +5 -0
  1747. package/node_modules/semver/functions/compare.js +7 -0
  1748. package/node_modules/semver/functions/diff.js +60 -0
  1749. package/node_modules/semver/functions/eq.js +5 -0
  1750. package/node_modules/semver/functions/gt.js +5 -0
  1751. package/node_modules/semver/functions/gte.js +5 -0
  1752. package/node_modules/semver/functions/inc.js +21 -0
  1753. package/node_modules/semver/functions/lt.js +5 -0
  1754. package/node_modules/semver/functions/lte.js +5 -0
  1755. package/node_modules/semver/functions/major.js +5 -0
  1756. package/node_modules/semver/functions/minor.js +5 -0
  1757. package/node_modules/semver/functions/neq.js +5 -0
  1758. package/node_modules/semver/functions/parse.js +18 -0
  1759. package/node_modules/semver/functions/patch.js +5 -0
  1760. package/node_modules/semver/functions/prerelease.js +8 -0
  1761. package/node_modules/semver/functions/rcompare.js +5 -0
  1762. package/node_modules/semver/functions/rsort.js +5 -0
  1763. package/node_modules/semver/functions/satisfies.js +12 -0
  1764. package/node_modules/semver/functions/sort.js +5 -0
  1765. package/node_modules/semver/functions/truncate.js +48 -0
  1766. package/node_modules/semver/functions/valid.js +8 -0
  1767. package/node_modules/semver/index.js +93 -0
  1768. package/node_modules/semver/internal/constants.js +37 -0
  1769. package/node_modules/semver/internal/debug.js +11 -0
  1770. package/node_modules/semver/internal/identifiers.js +29 -0
  1771. package/node_modules/semver/internal/lrucache.js +42 -0
  1772. package/node_modules/semver/internal/parse-options.js +17 -0
  1773. package/node_modules/semver/internal/re.js +223 -0
  1774. package/node_modules/semver/package.json +78 -0
  1775. package/node_modules/semver/preload.js +4 -0
  1776. package/node_modules/semver/range.bnf +17 -0
  1777. package/node_modules/semver/ranges/gtr.js +6 -0
  1778. package/node_modules/semver/ranges/intersects.js +9 -0
  1779. package/node_modules/semver/ranges/ltr.js +6 -0
  1780. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  1781. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  1782. package/node_modules/semver/ranges/min-version.js +63 -0
  1783. package/node_modules/semver/ranges/outside.js +82 -0
  1784. package/node_modules/semver/ranges/simplify.js +49 -0
  1785. package/node_modules/semver/ranges/subset.js +249 -0
  1786. package/node_modules/semver/ranges/to-comparators.js +10 -0
  1787. package/node_modules/semver/ranges/valid.js +13 -0
  1788. package/node_modules/shebang-command/index.js +19 -0
  1789. package/node_modules/shebang-command/license +9 -0
  1790. package/node_modules/shebang-command/package.json +34 -0
  1791. package/node_modules/shebang-command/readme.md +34 -0
  1792. package/node_modules/shebang-regex/index.d.ts +22 -0
  1793. package/node_modules/shebang-regex/index.js +2 -0
  1794. package/node_modules/shebang-regex/license +9 -0
  1795. package/node_modules/shebang-regex/package.json +35 -0
  1796. package/node_modules/shebang-regex/readme.md +33 -0
  1797. package/node_modules/signal-exit/LICENSE.txt +16 -0
  1798. package/node_modules/signal-exit/README.md +39 -0
  1799. package/node_modules/signal-exit/index.js +202 -0
  1800. package/node_modules/signal-exit/package.json +38 -0
  1801. package/node_modules/signal-exit/signals.js +53 -0
  1802. package/node_modules/strip-ansi/index.d.ts +17 -0
  1803. package/node_modules/strip-ansi/index.js +4 -0
  1804. package/node_modules/strip-ansi/license +9 -0
  1805. package/node_modules/strip-ansi/package.json +54 -0
  1806. package/node_modules/strip-ansi/readme.md +46 -0
  1807. package/node_modules/strip-final-newline/index.js +16 -0
  1808. package/node_modules/strip-final-newline/license +9 -0
  1809. package/node_modules/strip-final-newline/package.json +40 -0
  1810. package/node_modules/strip-final-newline/readme.md +30 -0
  1811. package/node_modules/systeminformation/LICENSE +20 -0
  1812. package/node_modules/systeminformation/README.md +1208 -0
  1813. package/node_modules/systeminformation/lib/audio.js +276 -0
  1814. package/node_modules/systeminformation/lib/battery.js +330 -0
  1815. package/node_modules/systeminformation/lib/bluetooth.js +311 -0
  1816. package/node_modules/systeminformation/lib/bluetoothVendors.js +1138 -0
  1817. package/node_modules/systeminformation/lib/cli.js +100 -0
  1818. package/node_modules/systeminformation/lib/cpu.js +2237 -0
  1819. package/node_modules/systeminformation/lib/docker.js +803 -0
  1820. package/node_modules/systeminformation/lib/dockerSocket.js +322 -0
  1821. package/node_modules/systeminformation/lib/filesystem.js +1745 -0
  1822. package/node_modules/systeminformation/lib/graphics.js +1235 -0
  1823. package/node_modules/systeminformation/lib/index.d.ts +1053 -0
  1824. package/node_modules/systeminformation/lib/index.js +518 -0
  1825. package/node_modules/systeminformation/lib/internet.js +259 -0
  1826. package/node_modules/systeminformation/lib/memory.js +613 -0
  1827. package/node_modules/systeminformation/lib/network.js +1992 -0
  1828. package/node_modules/systeminformation/lib/osinfo.js +1310 -0
  1829. package/node_modules/systeminformation/lib/printer.js +209 -0
  1830. package/node_modules/systeminformation/lib/processes.js +1425 -0
  1831. package/node_modules/systeminformation/lib/system.js +856 -0
  1832. package/node_modules/systeminformation/lib/usb.js +313 -0
  1833. package/node_modules/systeminformation/lib/users.js +412 -0
  1834. package/node_modules/systeminformation/lib/util.js +2787 -0
  1835. package/node_modules/systeminformation/lib/virtualbox.js +110 -0
  1836. package/node_modules/systeminformation/lib/wifi.js +822 -0
  1837. package/node_modules/systeminformation/package.json +101 -0
  1838. package/node_modules/undici/LICENSE +21 -0
  1839. package/node_modules/undici/README.md +741 -0
  1840. package/node_modules/undici/docs/docs/api/Agent.md +84 -0
  1841. package/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  1842. package/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  1843. package/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  1844. package/node_modules/undici/docs/docs/api/Client.md +288 -0
  1845. package/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  1846. package/node_modules/undici/docs/docs/api/Connector.md +115 -0
  1847. package/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  1848. package/node_modules/undici/docs/docs/api/Cookies.md +128 -0
  1849. package/node_modules/undici/docs/docs/api/Debug.md +62 -0
  1850. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +315 -0
  1851. package/node_modules/undici/docs/docs/api/Dispatcher.md +1392 -0
  1852. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  1853. package/node_modules/undici/docs/docs/api/Errors.md +49 -0
  1854. package/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  1855. package/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  1856. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  1857. package/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  1858. package/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  1859. package/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  1860. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  1861. package/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  1862. package/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  1863. package/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  1864. package/node_modules/undici/docs/docs/api/Pool.md +84 -0
  1865. package/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  1866. package/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  1867. package/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  1868. package/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  1869. package/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  1870. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  1871. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  1872. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
  1873. package/node_modules/undici/docs/docs/api/Util.md +25 -0
  1874. package/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  1875. package/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  1876. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  1877. package/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
  1878. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  1879. package/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  1880. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
  1881. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  1882. package/node_modules/undici/index-fetch.js +65 -0
  1883. package/node_modules/undici/index.d.ts +3 -0
  1884. package/node_modules/undici/index.js +234 -0
  1885. package/node_modules/undici/lib/api/abort-signal.js +59 -0
  1886. package/node_modules/undici/lib/api/api-connect.js +110 -0
  1887. package/node_modules/undici/lib/api/api-pipeline.js +252 -0
  1888. package/node_modules/undici/lib/api/api-request.js +214 -0
  1889. package/node_modules/undici/lib/api/api-stream.js +209 -0
  1890. package/node_modules/undici/lib/api/api-upgrade.js +111 -0
  1891. package/node_modules/undici/lib/api/index.js +7 -0
  1892. package/node_modules/undici/lib/api/readable.js +580 -0
  1893. package/node_modules/undici/lib/cache/memory-cache-store.js +234 -0
  1894. package/node_modules/undici/lib/cache/sqlite-cache-store.js +461 -0
  1895. package/node_modules/undici/lib/core/connect.js +153 -0
  1896. package/node_modules/undici/lib/core/constants.js +143 -0
  1897. package/node_modules/undici/lib/core/diagnostics.js +227 -0
  1898. package/node_modules/undici/lib/core/errors.js +477 -0
  1899. package/node_modules/undici/lib/core/request.js +453 -0
  1900. package/node_modules/undici/lib/core/socks5-client.js +422 -0
  1901. package/node_modules/undici/lib/core/socks5-utils.js +212 -0
  1902. package/node_modules/undici/lib/core/symbols.js +75 -0
  1903. package/node_modules/undici/lib/core/tree.js +160 -0
  1904. package/node_modules/undici/lib/core/util.js +992 -0
  1905. package/node_modules/undici/lib/dispatcher/agent.js +158 -0
  1906. package/node_modules/undici/lib/dispatcher/balanced-pool.js +219 -0
  1907. package/node_modules/undici/lib/dispatcher/client-h1.js +1722 -0
  1908. package/node_modules/undici/lib/dispatcher/client-h2.js +995 -0
  1909. package/node_modules/undici/lib/dispatcher/client.js +664 -0
  1910. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
  1911. package/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  1912. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  1913. package/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  1914. package/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  1915. package/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  1916. package/node_modules/undici/lib/dispatcher/pool.js +118 -0
  1917. package/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
  1918. package/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  1919. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  1920. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +260 -0
  1921. package/node_modules/undici/lib/encoding/index.js +33 -0
  1922. package/node_modules/undici/lib/global.js +59 -0
  1923. package/node_modules/undici/lib/handler/cache-handler.js +578 -0
  1924. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  1925. package/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  1926. package/node_modules/undici/lib/handler/deduplication-handler.js +460 -0
  1927. package/node_modules/undici/lib/handler/redirect-handler.js +238 -0
  1928. package/node_modules/undici/lib/handler/retry-handler.js +394 -0
  1929. package/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
  1930. package/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  1931. package/node_modules/undici/lib/interceptor/cache.js +495 -0
  1932. package/node_modules/undici/lib/interceptor/decompress.js +259 -0
  1933. package/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  1934. package/node_modules/undici/lib/interceptor/dns.js +571 -0
  1935. package/node_modules/undici/lib/interceptor/dump.js +112 -0
  1936. package/node_modules/undici/lib/interceptor/redirect.js +21 -0
  1937. package/node_modules/undici/lib/interceptor/response-error.js +95 -0
  1938. package/node_modules/undici/lib/interceptor/retry.js +19 -0
  1939. package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  1940. package/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
  1941. package/node_modules/undici/lib/llhttp/constants.js +531 -0
  1942. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  1943. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  1944. package/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
  1945. package/node_modules/undici/lib/llhttp/utils.js +12 -0
  1946. package/node_modules/undici/lib/mock/mock-agent.js +232 -0
  1947. package/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  1948. package/node_modules/undici/lib/mock/mock-client.js +68 -0
  1949. package/node_modules/undici/lib/mock/mock-errors.js +29 -0
  1950. package/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  1951. package/node_modules/undici/lib/mock/mock-pool.js +68 -0
  1952. package/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  1953. package/node_modules/undici/lib/mock/mock-utils.js +486 -0
  1954. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  1955. package/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  1956. package/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  1957. package/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  1958. package/node_modules/undici/lib/util/cache.js +414 -0
  1959. package/node_modules/undici/lib/util/date.js +653 -0
  1960. package/node_modules/undici/lib/util/promise.js +28 -0
  1961. package/node_modules/undici/lib/util/runtime-features.js +124 -0
  1962. package/node_modules/undici/lib/util/stats.js +32 -0
  1963. package/node_modules/undici/lib/util/timers.js +425 -0
  1964. package/node_modules/undici/lib/web/cache/cache.js +864 -0
  1965. package/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  1966. package/node_modules/undici/lib/web/cache/util.js +45 -0
  1967. package/node_modules/undici/lib/web/cookies/constants.js +12 -0
  1968. package/node_modules/undici/lib/web/cookies/index.js +199 -0
  1969. package/node_modules/undici/lib/web/cookies/parse.js +314 -0
  1970. package/node_modules/undici/lib/web/cookies/util.js +282 -0
  1971. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +399 -0
  1972. package/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
  1973. package/node_modules/undici/lib/web/eventsource/util.js +29 -0
  1974. package/node_modules/undici/lib/web/fetch/LICENSE +21 -0
  1975. package/node_modules/undici/lib/web/fetch/body.js +509 -0
  1976. package/node_modules/undici/lib/web/fetch/constants.js +131 -0
  1977. package/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  1978. package/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
  1979. package/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  1980. package/node_modules/undici/lib/web/fetch/global.js +40 -0
  1981. package/node_modules/undici/lib/web/fetch/headers.js +719 -0
  1982. package/node_modules/undici/lib/web/fetch/index.js +2413 -0
  1983. package/node_modules/undici/lib/web/fetch/request.js +1115 -0
  1984. package/node_modules/undici/lib/web/fetch/response.js +641 -0
  1985. package/node_modules/undici/lib/web/fetch/util.js +1522 -0
  1986. package/node_modules/undici/lib/web/infra/index.js +229 -0
  1987. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
  1988. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  1989. package/node_modules/undici/lib/web/webidl/index.js +1006 -0
  1990. package/node_modules/undici/lib/web/websocket/connection.js +329 -0
  1991. package/node_modules/undici/lib/web/websocket/constants.js +126 -0
  1992. package/node_modules/undici/lib/web/websocket/events.js +331 -0
  1993. package/node_modules/undici/lib/web/websocket/frame.js +133 -0
  1994. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +100 -0
  1995. package/node_modules/undici/lib/web/websocket/receiver.js +507 -0
  1996. package/node_modules/undici/lib/web/websocket/sender.js +109 -0
  1997. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  1998. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +498 -0
  1999. package/node_modules/undici/lib/web/websocket/util.js +347 -0
  2000. package/node_modules/undici/lib/web/websocket/websocket.js +758 -0
  2001. package/node_modules/undici/package.json +152 -0
  2002. package/node_modules/undici/scripts/strip-comments.js +10 -0
  2003. package/node_modules/undici/types/README.md +6 -0
  2004. package/node_modules/undici/types/agent.d.ts +32 -0
  2005. package/node_modules/undici/types/api.d.ts +43 -0
  2006. package/node_modules/undici/types/balanced-pool.d.ts +30 -0
  2007. package/node_modules/undici/types/cache-interceptor.d.ts +179 -0
  2008. package/node_modules/undici/types/cache.d.ts +36 -0
  2009. package/node_modules/undici/types/client-stats.d.ts +15 -0
  2010. package/node_modules/undici/types/client.d.ts +139 -0
  2011. package/node_modules/undici/types/connector.d.ts +36 -0
  2012. package/node_modules/undici/types/content-type.d.ts +21 -0
  2013. package/node_modules/undici/types/cookies.d.ts +30 -0
  2014. package/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  2015. package/node_modules/undici/types/dispatcher.d.ts +275 -0
  2016. package/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  2017. package/node_modules/undici/types/errors.d.ts +177 -0
  2018. package/node_modules/undici/types/eventsource.d.ts +66 -0
  2019. package/node_modules/undici/types/fetch.d.ts +231 -0
  2020. package/node_modules/undici/types/formdata.d.ts +114 -0
  2021. package/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  2022. package/node_modules/undici/types/global-origin.d.ts +7 -0
  2023. package/node_modules/undici/types/h2c-client.d.ts +73 -0
  2024. package/node_modules/undici/types/handlers.d.ts +14 -0
  2025. package/node_modules/undici/types/header.d.ts +160 -0
  2026. package/node_modules/undici/types/index.d.ts +91 -0
  2027. package/node_modules/undici/types/interceptors.d.ts +80 -0
  2028. package/node_modules/undici/types/mock-agent.d.ts +68 -0
  2029. package/node_modules/undici/types/mock-call-history.d.ts +111 -0
  2030. package/node_modules/undici/types/mock-client.d.ts +27 -0
  2031. package/node_modules/undici/types/mock-errors.d.ts +12 -0
  2032. package/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  2033. package/node_modules/undici/types/mock-pool.d.ts +27 -0
  2034. package/node_modules/undici/types/patch.d.ts +29 -0
  2035. package/node_modules/undici/types/pool-stats.d.ts +19 -0
  2036. package/node_modules/undici/types/pool.d.ts +41 -0
  2037. package/node_modules/undici/types/proxy-agent.d.ts +29 -0
  2038. package/node_modules/undici/types/readable.d.ts +68 -0
  2039. package/node_modules/undici/types/retry-agent.d.ts +8 -0
  2040. package/node_modules/undici/types/retry-handler.d.ts +125 -0
  2041. package/node_modules/undici/types/round-robin-pool.d.ts +41 -0
  2042. package/node_modules/undici/types/snapshot-agent.d.ts +109 -0
  2043. package/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
  2044. package/node_modules/undici/types/util.d.ts +18 -0
  2045. package/node_modules/undici/types/utility.d.ts +7 -0
  2046. package/node_modules/undici/types/webidl.d.ts +347 -0
  2047. package/node_modules/undici/types/websocket.d.ts +188 -0
  2048. package/node_modules/which/LICENSE +15 -0
  2049. package/node_modules/which/README.md +51 -0
  2050. package/node_modules/which/bin/which.js +52 -0
  2051. package/node_modules/which/lib/index.js +111 -0
  2052. package/node_modules/which/package.json +57 -0
  2053. package/node_modules/yocto-spinner/index.d.ts +162 -0
  2054. package/node_modules/yocto-spinner/index.js +428 -0
  2055. package/node_modules/yocto-spinner/license +9 -0
  2056. package/node_modules/yocto-spinner/package.json +64 -0
  2057. package/node_modules/yocto-spinner/readme.md +237 -0
  2058. package/node_modules/yoctocolors/base.d.ts +47 -0
  2059. package/node_modules/yoctocolors/base.js +94 -0
  2060. package/node_modules/yoctocolors/index.d.ts +2 -0
  2061. package/node_modules/yoctocolors/index.js +2 -0
  2062. package/node_modules/yoctocolors/license +9 -0
  2063. package/node_modules/yoctocolors/package.json +69 -0
  2064. package/node_modules/yoctocolors/readme.md +138 -0
  2065. package/package.json +5 -2
@@ -0,0 +1,1884 @@
1
+ /**
2
+ * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b.
3
+ *
4
+ * ### Design rationale for types
5
+ *
6
+ * * Interaction between classes from different curves should fail:
7
+ * `k256.Point.BASE.add(p256.Point.BASE)`
8
+ * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime
9
+ * * Different calls of `curve()` would return different classes -
10
+ * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve,
11
+ * it won't affect others
12
+ *
13
+ * TypeScript can't infer types for classes created inside a function. Classes is one instance
14
+ * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create
15
+ * unique type for every function call.
16
+ *
17
+ * We can use generic types via some param, like curve opts, but that would:
18
+ * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params)
19
+ * which is hard to debug.
20
+ * 2. Params can be generic and we can't enforce them to be constant value:
21
+ * if somebody creates curve from non-constant params,
22
+ * it would be allowed to interact with other curves with non-constant params
23
+ *
24
+ * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol
25
+ * @module
26
+ */
27
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
28
+ import { hmac as nobleHmac } from '@noble/hashes/hmac.js';
29
+ import { ahash } from '@noble/hashes/utils';
30
+ import {
31
+ _validateObject,
32
+ _abool2 as abool,
33
+ _abytes2 as abytes,
34
+ aInRange,
35
+ bitLen,
36
+ bitMask,
37
+ bytesToHex,
38
+ bytesToNumberBE,
39
+ concatBytes,
40
+ createHmacDrbg,
41
+ ensureBytes,
42
+ hexToBytes,
43
+ inRange,
44
+ isBytes,
45
+ memoized,
46
+ numberToHexUnpadded,
47
+ randomBytes as randomBytesWeb,
48
+ type CHash,
49
+ type Hex,
50
+ type PrivKey,
51
+ } from '../utils.ts';
52
+ import {
53
+ _createCurveFields,
54
+ mulEndoUnsafe,
55
+ negateCt,
56
+ normalizeZ,
57
+ pippenger,
58
+ wNAF,
59
+ type AffinePoint,
60
+ type BasicCurve,
61
+ type CurveLengths,
62
+ type CurvePoint,
63
+ type CurvePointCons,
64
+ } from './curve.ts';
65
+ import {
66
+ Field,
67
+ FpInvertBatch,
68
+ getMinHashLength,
69
+ mapHashToField,
70
+ nLength,
71
+ validateField,
72
+ type IField,
73
+ type NLength,
74
+ } from './modular.ts';
75
+
76
+ export type { AffinePoint };
77
+ export type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
78
+
79
+ type EndoBasis = [[bigint, bigint], [bigint, bigint]];
80
+ /**
81
+ * When Weierstrass curve has `a=0`, it becomes Koblitz curve.
82
+ * Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**.
83
+ * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.
84
+ * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.
85
+ *
86
+ * Endomorphism consists of beta, lambda and splitScalar:
87
+ *
88
+ * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)`
89
+ * 2. GLV scalar decomposition transforms a scalar: `k ≡ k₁ + k₂·λ (mod n)`
90
+ * 3. Then these are combined: `k·P = k₁·P + k₂·ψ(P)`
91
+ * 4. Two 128-bit point-by-scalar multiplications + one point addition is faster than
92
+ * one 256-bit multiplication.
93
+ *
94
+ * where
95
+ * * beta: β ∈ Fₚ with β³ = 1, β ≠ 1
96
+ * * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1
97
+ * * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors.
98
+ * Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)`
99
+ *
100
+ * Check out `test/misc/endomorphism.js` and
101
+ * [gist](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066).
102
+ */
103
+ export type EndomorphismOpts = {
104
+ beta: bigint;
105
+ basises?: EndoBasis;
106
+ splitScalar?: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint };
107
+ };
108
+
109
+ // We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value)
110
+ const divNearest = (num: bigint, den: bigint) => (num + (num >= 0 ? den : -den) / _2n) / den;
111
+
112
+ export type ScalarEndoParts = { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint };
113
+
114
+ /**
115
+ * Splits scalar for GLV endomorphism.
116
+ */
117
+ export function _splitEndoScalar(k: bigint, basis: EndoBasis, n: bigint): ScalarEndoParts {
118
+ // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)`
119
+ // Since part can be negative, we need to do this on point.
120
+ // TODO: verifyScalar function which consumes lambda
121
+ const [[a1, b1], [a2, b2]] = basis;
122
+ const c1 = divNearest(b2 * k, n);
123
+ const c2 = divNearest(-b1 * k, n);
124
+ // |k1|/|k2| is < sqrt(N), but can be negative.
125
+ // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead.
126
+ let k1 = k - c1 * a1 - c2 * a2;
127
+ let k2 = -c1 * b1 - c2 * b2;
128
+ const k1neg = k1 < _0n;
129
+ const k2neg = k2 < _0n;
130
+ if (k1neg) k1 = -k1;
131
+ if (k2neg) k2 = -k2;
132
+ // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail.
133
+ // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it.
134
+ const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n; // Half bits of N
135
+ if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) {
136
+ throw new Error('splitScalar (endomorphism): failed, k=' + k);
137
+ }
138
+ return { k1neg, k1, k2neg, k2 };
139
+ }
140
+
141
+ export type ECDSASigFormat = 'compact' | 'recovered' | 'der';
142
+ export type ECDSARecoverOpts = {
143
+ prehash?: boolean;
144
+ };
145
+ export type ECDSAVerifyOpts = {
146
+ prehash?: boolean;
147
+ lowS?: boolean;
148
+ format?: ECDSASigFormat;
149
+ };
150
+ export type ECDSASignOpts = {
151
+ prehash?: boolean;
152
+ lowS?: boolean;
153
+ format?: ECDSASigFormat;
154
+ extraEntropy?: Uint8Array | boolean;
155
+ };
156
+
157
+ function validateSigFormat(format: string): ECDSASigFormat {
158
+ if (!['compact', 'recovered', 'der'].includes(format))
159
+ throw new Error('Signature format must be "compact", "recovered", or "der"');
160
+ return format as ECDSASigFormat;
161
+ }
162
+
163
+ function validateSigOpts<T extends ECDSASignOpts, D extends Required<ECDSASignOpts>>(
164
+ opts: T,
165
+ def: D
166
+ ): Required<ECDSASignOpts> {
167
+ const optsn: ECDSASignOpts = {};
168
+ for (let optName of Object.keys(def)) {
169
+ // @ts-ignore
170
+ optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName];
171
+ }
172
+ abool(optsn.lowS!, 'lowS');
173
+ abool(optsn.prehash!, 'prehash');
174
+ if (optsn.format !== undefined) validateSigFormat(optsn.format);
175
+ return optsn as Required<ECDSASignOpts>;
176
+ }
177
+
178
+ /** Instance methods for 3D XYZ projective points. */
179
+ export interface WeierstrassPoint<T> extends CurvePoint<T, WeierstrassPoint<T>> {
180
+ /** projective X coordinate. Different from affine x. */
181
+ readonly X: T;
182
+ /** projective Y coordinate. Different from affine y. */
183
+ readonly Y: T;
184
+ /** projective z coordinate */
185
+ readonly Z: T;
186
+ /** affine x coordinate. Different from projective X. */
187
+ get x(): T;
188
+ /** affine y coordinate. Different from projective Y. */
189
+ get y(): T;
190
+ /** Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed. */
191
+ toBytes(isCompressed?: boolean): Uint8Array;
192
+ toHex(isCompressed?: boolean): string;
193
+
194
+ /** @deprecated use `.X` */
195
+ readonly px: T;
196
+ /** @deprecated use `.Y` */
197
+ readonly py: T;
198
+ /** @deprecated use `.Z` */
199
+ readonly pz: T;
200
+ /** @deprecated use `toBytes` */
201
+ toRawBytes(isCompressed?: boolean): Uint8Array;
202
+ /** @deprecated use `multiplyUnsafe` */
203
+ multiplyAndAddUnsafe(
204
+ Q: WeierstrassPoint<T>,
205
+ a: bigint,
206
+ b: bigint
207
+ ): WeierstrassPoint<T> | undefined;
208
+ /** @deprecated use `p.y % 2n === 0n` */
209
+ hasEvenY(): boolean;
210
+ /** @deprecated use `p.precompute(windowSize)` */
211
+ _setWindowSize(windowSize: number): void;
212
+ }
213
+
214
+ /** Static methods for 3D XYZ projective points. */
215
+ export interface WeierstrassPointCons<T> extends CurvePointCons<WeierstrassPoint<T>> {
216
+ /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
217
+ new (X: T, Y: T, Z: T): WeierstrassPoint<T>;
218
+ CURVE(): WeierstrassOpts<T>;
219
+ /** @deprecated use `Point.BASE.multiply(Point.Fn.fromBytes(privateKey))` */
220
+ fromPrivateKey(privateKey: PrivKey): WeierstrassPoint<T>;
221
+ /** @deprecated use `import { normalizeZ } from '@noble/curves/abstract/curve.js';` */
222
+ normalizeZ(points: WeierstrassPoint<T>[]): WeierstrassPoint<T>[];
223
+ /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */
224
+ msm(points: WeierstrassPoint<T>[], scalars: bigint[]): WeierstrassPoint<T>;
225
+ }
226
+
227
+ /**
228
+ * Weierstrass curve options.
229
+ *
230
+ * * p: prime characteristic (order) of finite field, in which arithmetics is done
231
+ * * n: order of prime subgroup a.k.a total amount of valid curve points
232
+ * * h: cofactor, usually 1. h*n is group order; n is subgroup order
233
+ * * a: formula param, must be in field of p
234
+ * * b: formula param, must be in field of p
235
+ * * Gx: x coordinate of generator point a.k.a. base point
236
+ * * Gy: y coordinate of generator point
237
+ */
238
+ export type WeierstrassOpts<T> = Readonly<{
239
+ p: bigint;
240
+ n: bigint;
241
+ h: bigint;
242
+ a: T;
243
+ b: T;
244
+ Gx: T;
245
+ Gy: T;
246
+ }>;
247
+
248
+ // When a cofactor != 1, there can be an effective methods to:
249
+ // 1. Determine whether a point is torsion-free
250
+ // 2. Clear torsion component
251
+ // wrapPrivateKey: bls12-381 requires mod(n) instead of rejecting keys >= n
252
+ export type WeierstrassExtraOpts<T> = Partial<{
253
+ Fp: IField<T>;
254
+ Fn: IField<bigint>;
255
+ allowInfinityPoint: boolean;
256
+ endo: EndomorphismOpts;
257
+ isTorsionFree: (c: WeierstrassPointCons<T>, point: WeierstrassPoint<T>) => boolean;
258
+ clearCofactor: (c: WeierstrassPointCons<T>, point: WeierstrassPoint<T>) => WeierstrassPoint<T>;
259
+ fromBytes: (bytes: Uint8Array) => AffinePoint<T>;
260
+ toBytes: (
261
+ c: WeierstrassPointCons<T>,
262
+ point: WeierstrassPoint<T>,
263
+ isCompressed: boolean
264
+ ) => Uint8Array;
265
+ }>;
266
+
267
+ /**
268
+ * Options for ECDSA signatures over a Weierstrass curve.
269
+ *
270
+ * * lowS: (default: true) whether produced / verified signatures occupy low half of ecdsaOpts.p. Prevents malleability.
271
+ * * hmac: (default: noble-hashes hmac) function, would be used to init hmac-drbg for k generation.
272
+ * * randomBytes: (default: webcrypto os-level CSPRNG) custom method for fetching secure randomness.
273
+ * * bits2int, bits2int_modN: used in sigs, sometimes overridden by curves
274
+ */
275
+ export type ECDSAOpts = Partial<{
276
+ lowS: boolean;
277
+ hmac: HmacFnSync;
278
+ randomBytes: (bytesLength?: number) => Uint8Array;
279
+ bits2int: (bytes: Uint8Array) => bigint;
280
+ bits2int_modN: (bytes: Uint8Array) => bigint;
281
+ }>;
282
+
283
+ /**
284
+ * Elliptic Curve Diffie-Hellman interface.
285
+ * Provides keygen, secret-to-public conversion, calculating shared secrets.
286
+ */
287
+ export interface ECDH {
288
+ keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array };
289
+ getPublicKey: (secretKey: PrivKey, isCompressed?: boolean) => Uint8Array;
290
+ getSharedSecret: (secretKeyA: PrivKey, publicKeyB: Hex, isCompressed?: boolean) => Uint8Array;
291
+ Point: WeierstrassPointCons<bigint>;
292
+ utils: {
293
+ isValidSecretKey: (secretKey: PrivKey) => boolean;
294
+ isValidPublicKey: (publicKey: Uint8Array, isCompressed?: boolean) => boolean;
295
+ randomSecretKey: (seed?: Uint8Array) => Uint8Array;
296
+ /** @deprecated use `randomSecretKey` */
297
+ randomPrivateKey: (seed?: Uint8Array) => Uint8Array;
298
+ /** @deprecated use `isValidSecretKey` */
299
+ isValidPrivateKey: (secretKey: PrivKey) => boolean;
300
+ /** @deprecated use `Point.Fn.fromBytes()` */
301
+ normPrivateKeyToScalar: (key: PrivKey) => bigint;
302
+ /** @deprecated use `point.precompute()` */
303
+ precompute: (windowSize?: number, point?: WeierstrassPoint<bigint>) => WeierstrassPoint<bigint>;
304
+ };
305
+ lengths: CurveLengths;
306
+ }
307
+
308
+ /**
309
+ * ECDSA interface.
310
+ * Only supported for prime fields, not Fp2 (extension fields).
311
+ */
312
+ export interface ECDSA extends ECDH {
313
+ sign: (message: Hex, secretKey: PrivKey, opts?: ECDSASignOpts) => ECDSASigRecovered;
314
+ verify: (
315
+ signature: Uint8Array,
316
+ message: Uint8Array,
317
+ publicKey: Uint8Array,
318
+ opts?: ECDSAVerifyOpts
319
+ ) => boolean;
320
+ recoverPublicKey(signature: Uint8Array, message: Uint8Array, opts?: ECDSARecoverOpts): Uint8Array;
321
+ Signature: ECDSASignatureCons;
322
+ }
323
+ export class DERErr extends Error {
324
+ constructor(m = '') {
325
+ super(m);
326
+ }
327
+ }
328
+ export type IDER = {
329
+ // asn.1 DER encoding utils
330
+ Err: typeof DERErr;
331
+ // Basic building block is TLV (Tag-Length-Value)
332
+ _tlv: {
333
+ encode: (tag: number, data: string) => string;
334
+ // v - value, l - left bytes (unparsed)
335
+ decode(tag: number, data: Uint8Array): { v: Uint8Array; l: Uint8Array };
336
+ };
337
+ // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
338
+ // since we always use positive integers here. It must always be empty:
339
+ // - add zero byte if exists
340
+ // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
341
+ _int: {
342
+ encode(num: bigint): string;
343
+ decode(data: Uint8Array): bigint;
344
+ };
345
+ toSig(hex: string | Uint8Array): { r: bigint; s: bigint };
346
+ hexFromSig(sig: { r: bigint; s: bigint }): string;
347
+ };
348
+ /**
349
+ * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:
350
+ *
351
+ * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]
352
+ *
353
+ * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html
354
+ */
355
+ export const DER: IDER = {
356
+ // asn.1 DER encoding utils
357
+ Err: DERErr,
358
+ // Basic building block is TLV (Tag-Length-Value)
359
+ _tlv: {
360
+ encode: (tag: number, data: string): string => {
361
+ const { Err: E } = DER;
362
+ if (tag < 0 || tag > 256) throw new E('tlv.encode: wrong tag');
363
+ if (data.length & 1) throw new E('tlv.encode: unpadded data');
364
+ const dataLen = data.length / 2;
365
+ const len = numberToHexUnpadded(dataLen);
366
+ if ((len.length / 2) & 0b1000_0000) throw new E('tlv.encode: long form length too big');
367
+ // length of length with long form flag
368
+ const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : '';
369
+ const t = numberToHexUnpadded(tag);
370
+ return t + lenLen + len + data;
371
+ },
372
+ // v - value, l - left bytes (unparsed)
373
+ decode(tag: number, data: Uint8Array): { v: Uint8Array; l: Uint8Array } {
374
+ const { Err: E } = DER;
375
+ let pos = 0;
376
+ if (tag < 0 || tag > 256) throw new E('tlv.encode: wrong tag');
377
+ if (data.length < 2 || data[pos++] !== tag) throw new E('tlv.decode: wrong tlv');
378
+ const first = data[pos++];
379
+ const isLong = !!(first & 0b1000_0000); // First bit of first length byte is flag for short/long form
380
+ let length = 0;
381
+ if (!isLong) length = first;
382
+ else {
383
+ // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)]
384
+ const lenLen = first & 0b0111_1111;
385
+ if (!lenLen) throw new E('tlv.decode(long): indefinite length not supported');
386
+ if (lenLen > 4) throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js
387
+ const lengthBytes = data.subarray(pos, pos + lenLen);
388
+ if (lengthBytes.length !== lenLen) throw new E('tlv.decode: length bytes not complete');
389
+ if (lengthBytes[0] === 0) throw new E('tlv.decode(long): zero leftmost byte');
390
+ for (const b of lengthBytes) length = (length << 8) | b;
391
+ pos += lenLen;
392
+ if (length < 128) throw new E('tlv.decode(long): not minimal encoding');
393
+ }
394
+ const v = data.subarray(pos, pos + length);
395
+ if (v.length !== length) throw new E('tlv.decode: wrong value length');
396
+ return { v, l: data.subarray(pos + length) };
397
+ },
398
+ },
399
+ // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
400
+ // since we always use positive integers here. It must always be empty:
401
+ // - add zero byte if exists
402
+ // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
403
+ _int: {
404
+ encode(num: bigint): string {
405
+ const { Err: E } = DER;
406
+ if (num < _0n) throw new E('integer: negative integers are not allowed');
407
+ let hex = numberToHexUnpadded(num);
408
+ // Pad with zero byte if negative flag is present
409
+ if (Number.parseInt(hex[0], 16) & 0b1000) hex = '00' + hex;
410
+ if (hex.length & 1) throw new E('unexpected DER parsing assertion: unpadded hex');
411
+ return hex;
412
+ },
413
+ decode(data: Uint8Array): bigint {
414
+ const { Err: E } = DER;
415
+ if (data[0] & 0b1000_0000) throw new E('invalid signature integer: negative');
416
+ if (data[0] === 0x00 && !(data[1] & 0b1000_0000))
417
+ throw new E('invalid signature integer: unnecessary leading zero');
418
+ return bytesToNumberBE(data);
419
+ },
420
+ },
421
+ toSig(hex: string | Uint8Array): { r: bigint; s: bigint } {
422
+ // parse DER signature
423
+ const { Err: E, _int: int, _tlv: tlv } = DER;
424
+ const data = ensureBytes('signature', hex);
425
+ const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data);
426
+ if (seqLeftBytes.length) throw new E('invalid signature: left bytes after parsing');
427
+ const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes);
428
+ const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes);
429
+ if (sLeftBytes.length) throw new E('invalid signature: left bytes after parsing');
430
+ return { r: int.decode(rBytes), s: int.decode(sBytes) };
431
+ },
432
+ hexFromSig(sig: { r: bigint; s: bigint }): string {
433
+ const { _tlv: tlv, _int: int } = DER;
434
+ const rs = tlv.encode(0x02, int.encode(sig.r));
435
+ const ss = tlv.encode(0x02, int.encode(sig.s));
436
+ const seq = rs + ss;
437
+ return tlv.encode(0x30, seq);
438
+ },
439
+ };
440
+
441
+ // Be friendly to bad ECMAScript parsers by not using bigint literals
442
+ // prettier-ignore
443
+ const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);
444
+
445
+ export function _normFnElement(Fn: IField<bigint>, key: PrivKey): bigint {
446
+ const { BYTES: expected } = Fn;
447
+ let num: bigint;
448
+ if (typeof key === 'bigint') {
449
+ num = key;
450
+ } else {
451
+ let bytes = ensureBytes('private key', key);
452
+ try {
453
+ num = Fn.fromBytes(bytes);
454
+ } catch (error) {
455
+ throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`);
456
+ }
457
+ }
458
+ if (!Fn.isValidNot0(num)) throw new Error('invalid private key: out of range [1..N-1]');
459
+ return num;
460
+ }
461
+
462
+ /**
463
+ * Creates weierstrass Point constructor, based on specified curve options.
464
+ *
465
+ * @example
466
+ ```js
467
+ const opts = {
468
+ p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'),
469
+ n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'),
470
+ h: BigInt(1),
471
+ a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'),
472
+ b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'),
473
+ Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'),
474
+ Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'),
475
+ };
476
+ const p256_Point = weierstrass(opts);
477
+ ```
478
+ */
479
+ export function weierstrassN<T>(
480
+ params: WeierstrassOpts<T>,
481
+ extraOpts: WeierstrassExtraOpts<T> = {}
482
+ ): WeierstrassPointCons<T> {
483
+ const validated = _createCurveFields('weierstrass', params, extraOpts);
484
+ const { Fp, Fn } = validated;
485
+ let CURVE = validated.CURVE as WeierstrassOpts<T>;
486
+ const { h: cofactor, n: CURVE_ORDER } = CURVE;
487
+ _validateObject(
488
+ extraOpts,
489
+ {},
490
+ {
491
+ allowInfinityPoint: 'boolean',
492
+ clearCofactor: 'function',
493
+ isTorsionFree: 'function',
494
+ fromBytes: 'function',
495
+ toBytes: 'function',
496
+ endo: 'object',
497
+ wrapPrivateKey: 'boolean',
498
+ }
499
+ );
500
+
501
+ const { endo } = extraOpts;
502
+ if (endo) {
503
+ // validateObject(endo, { beta: 'bigint', splitScalar: 'function' });
504
+ if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) {
505
+ throw new Error('invalid endo: expected "beta": bigint and "basises": array');
506
+ }
507
+ }
508
+
509
+ const lengths = getWLengths(Fp, Fn);
510
+
511
+ function assertCompressionIsSupported() {
512
+ if (!Fp.isOdd) throw new Error('compression is not supported: Field does not have .isOdd()');
513
+ }
514
+
515
+ // Implements IEEE P1363 point encoding
516
+ function pointToBytes(
517
+ _c: WeierstrassPointCons<T>,
518
+ point: WeierstrassPoint<T>,
519
+ isCompressed: boolean
520
+ ): Uint8Array {
521
+ const { x, y } = point.toAffine();
522
+ const bx = Fp.toBytes(x);
523
+ abool(isCompressed, 'isCompressed');
524
+ if (isCompressed) {
525
+ assertCompressionIsSupported();
526
+ const hasEvenY = !Fp.isOdd!(y);
527
+ return concatBytes(pprefix(hasEvenY), bx);
528
+ } else {
529
+ return concatBytes(Uint8Array.of(0x04), bx, Fp.toBytes(y));
530
+ }
531
+ }
532
+ function pointFromBytes(bytes: Uint8Array) {
533
+ abytes(bytes, undefined, 'Point');
534
+ const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65
535
+ const length = bytes.length;
536
+ const head = bytes[0];
537
+ const tail = bytes.subarray(1);
538
+ // No actual validation is done here: use .assertValidity()
539
+ if (length === comp && (head === 0x02 || head === 0x03)) {
540
+ const x = Fp.fromBytes(tail);
541
+ if (!Fp.isValid(x)) throw new Error('bad point: is not on curve, wrong x');
542
+ const y2 = weierstrassEquation(x); // y² = x³ + ax + b
543
+ let y: T;
544
+ try {
545
+ y = Fp.sqrt(y2); // y = y² ^ (p+1)/4
546
+ } catch (sqrtError) {
547
+ const err = sqrtError instanceof Error ? ': ' + sqrtError.message : '';
548
+ throw new Error('bad point: is not on curve, sqrt error' + err);
549
+ }
550
+ assertCompressionIsSupported();
551
+ const isYOdd = Fp.isOdd!(y); // (y & _1n) === _1n;
552
+ const isHeadOdd = (head & 1) === 1; // ECDSA-specific
553
+ if (isHeadOdd !== isYOdd) y = Fp.neg(y);
554
+ return { x, y };
555
+ } else if (length === uncomp && head === 0x04) {
556
+ // TODO: more checks
557
+ const L = Fp.BYTES;
558
+ const x = Fp.fromBytes(tail.subarray(0, L));
559
+ const y = Fp.fromBytes(tail.subarray(L, L * 2));
560
+ if (!isValidXY(x, y)) throw new Error('bad point: is not on curve');
561
+ return { x, y };
562
+ } else {
563
+ throw new Error(
564
+ `bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}`
565
+ );
566
+ }
567
+ }
568
+
569
+ const encodePoint = extraOpts.toBytes || pointToBytes;
570
+ const decodePoint = extraOpts.fromBytes || pointFromBytes;
571
+ function weierstrassEquation(x: T): T {
572
+ const x2 = Fp.sqr(x); // x * x
573
+ const x3 = Fp.mul(x2, x); // x² * x
574
+ return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b
575
+ }
576
+
577
+ // TODO: move top-level
578
+ /** Checks whether equation holds for given x, y: y² == x³ + ax + b */
579
+ function isValidXY(x: T, y: T): boolean {
580
+ const left = Fp.sqr(y); // y²
581
+ const right = weierstrassEquation(x); // x³ + ax + b
582
+ return Fp.eql(left, right);
583
+ }
584
+
585
+ // Validate whether the passed curve params are valid.
586
+ // Test 1: equation y² = x³ + ax + b should work for generator point.
587
+ if (!isValidXY(CURVE.Gx, CURVE.Gy)) throw new Error('bad curve params: generator point');
588
+
589
+ // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0.
590
+ // Guarantees curve is genus-1, smooth (non-singular).
591
+ const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n);
592
+ const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27));
593
+ if (Fp.is0(Fp.add(_4a3, _27b2))) throw new Error('bad curve params: a or b');
594
+
595
+ /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */
596
+ function acoord(title: string, n: T, banZero = false) {
597
+ if (!Fp.isValid(n) || (banZero && Fp.is0(n))) throw new Error(`bad point coordinate ${title}`);
598
+ return n;
599
+ }
600
+
601
+ function aprjpoint(other: unknown) {
602
+ if (!(other instanceof Point)) throw new Error('ProjectivePoint expected');
603
+ }
604
+
605
+ function splitEndoScalarN(k: bigint) {
606
+ if (!endo || !endo.basises) throw new Error('no endo');
607
+ return _splitEndoScalar(k, endo.basises, Fn.ORDER);
608
+ }
609
+
610
+ // Memoized toAffine / validity check. They are heavy. Points are immutable.
611
+
612
+ // Converts Projective point to affine (x, y) coordinates.
613
+ // Can accept precomputed Z^-1 - for example, from invertBatch.
614
+ // (X, Y, Z) ∋ (x=X/Z, y=Y/Z)
615
+ const toAffineMemo = memoized((p: Point, iz?: T): AffinePoint<T> => {
616
+ const { X, Y, Z } = p;
617
+ // Fast-path for normalized points
618
+ if (Fp.eql(Z, Fp.ONE)) return { x: X, y: Y };
619
+ const is0 = p.is0();
620
+ // If invZ was 0, we return zero point. However we still want to execute
621
+ // all operations, so we replace invZ with a random number, 1.
622
+ if (iz == null) iz = is0 ? Fp.ONE : Fp.inv(Z);
623
+ const x = Fp.mul(X, iz);
624
+ const y = Fp.mul(Y, iz);
625
+ const zz = Fp.mul(Z, iz);
626
+ if (is0) return { x: Fp.ZERO, y: Fp.ZERO };
627
+ if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid');
628
+ return { x, y };
629
+ });
630
+ // NOTE: on exception this will crash 'cached' and no value will be set.
631
+ // Otherwise true will be return
632
+ const assertValidMemo = memoized((p: Point) => {
633
+ if (p.is0()) {
634
+ // (0, 1, 0) aka ZERO is invalid in most contexts.
635
+ // In BLS, ZERO can be serialized, so we allow it.
636
+ // (0, 0, 0) is invalid representation of ZERO.
637
+ if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y)) return;
638
+ throw new Error('bad point: ZERO');
639
+ }
640
+ // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`
641
+ const { x, y } = p.toAffine();
642
+ if (!Fp.isValid(x) || !Fp.isValid(y)) throw new Error('bad point: x or y not field elements');
643
+ if (!isValidXY(x, y)) throw new Error('bad point: equation left != right');
644
+ if (!p.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup');
645
+ return true;
646
+ });
647
+
648
+ function finishEndo(
649
+ endoBeta: EndomorphismOpts['beta'],
650
+ k1p: Point,
651
+ k2p: Point,
652
+ k1neg: boolean,
653
+ k2neg: boolean
654
+ ) {
655
+ k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z);
656
+ k1p = negateCt(k1neg, k1p);
657
+ k2p = negateCt(k2neg, k2p);
658
+ return k1p.add(k2p);
659
+ }
660
+
661
+ /**
662
+ * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z).
663
+ * Default Point works in 2d / affine coordinates: (x, y).
664
+ * We're doing calculations in projective, because its operations don't require costly inversion.
665
+ */
666
+ class Point implements WeierstrassPoint<T> {
667
+ // base / generator point
668
+ static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);
669
+ // zero / infinity / identity point
670
+ static readonly ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0
671
+ // math field
672
+ static readonly Fp = Fp;
673
+ // scalar field
674
+ static readonly Fn = Fn;
675
+
676
+ readonly X: T;
677
+ readonly Y: T;
678
+ readonly Z: T;
679
+
680
+ /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
681
+ constructor(X: T, Y: T, Z: T) {
682
+ this.X = acoord('x', X);
683
+ this.Y = acoord('y', Y, true);
684
+ this.Z = acoord('z', Z);
685
+ Object.freeze(this);
686
+ }
687
+
688
+ static CURVE(): WeierstrassOpts<T> {
689
+ return CURVE;
690
+ }
691
+
692
+ /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
693
+ static fromAffine(p: AffinePoint<T>): Point {
694
+ const { x, y } = p || {};
695
+ if (!p || !Fp.isValid(x) || !Fp.isValid(y)) throw new Error('invalid affine point');
696
+ if (p instanceof Point) throw new Error('projective point not allowed');
697
+ // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0)
698
+ if (Fp.is0(x) && Fp.is0(y)) return Point.ZERO;
699
+ return new Point(x, y, Fp.ONE);
700
+ }
701
+
702
+ static fromBytes(bytes: Uint8Array): Point {
703
+ const P = Point.fromAffine(decodePoint(abytes(bytes, undefined, 'point')));
704
+ P.assertValidity();
705
+ return P;
706
+ }
707
+ static fromHex(hex: Hex): Point {
708
+ return Point.fromBytes(ensureBytes('pointHex', hex));
709
+ }
710
+
711
+ get x(): T {
712
+ return this.toAffine().x;
713
+ }
714
+ get y(): T {
715
+ return this.toAffine().y;
716
+ }
717
+
718
+ /**
719
+ *
720
+ * @param windowSize
721
+ * @param isLazy true will defer table computation until the first multiplication
722
+ * @returns
723
+ */
724
+ precompute(windowSize: number = 8, isLazy = true): Point {
725
+ wnaf.createCache(this, windowSize);
726
+ if (!isLazy) this.multiply(_3n); // random number
727
+ return this;
728
+ }
729
+
730
+ // TODO: return `this`
731
+ /** A point on curve is valid if it conforms to equation. */
732
+ assertValidity(): void {
733
+ assertValidMemo(this);
734
+ }
735
+
736
+ hasEvenY(): boolean {
737
+ const { y } = this.toAffine();
738
+ if (!Fp.isOdd) throw new Error("Field doesn't support isOdd");
739
+ return !Fp.isOdd(y);
740
+ }
741
+
742
+ /** Compare one point to another. */
743
+ equals(other: Point): boolean {
744
+ aprjpoint(other);
745
+ const { X: X1, Y: Y1, Z: Z1 } = this;
746
+ const { X: X2, Y: Y2, Z: Z2 } = other;
747
+ const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));
748
+ const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));
749
+ return U1 && U2;
750
+ }
751
+
752
+ /** Flips point to one corresponding to (x, -y) in Affine coordinates. */
753
+ negate(): Point {
754
+ return new Point(this.X, Fp.neg(this.Y), this.Z);
755
+ }
756
+
757
+ // Renes-Costello-Batina exception-free doubling formula.
758
+ // There is 30% faster Jacobian formula, but it is not complete.
759
+ // https://eprint.iacr.org/2015/1060, algorithm 3
760
+ // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
761
+ double() {
762
+ const { a, b } = CURVE;
763
+ const b3 = Fp.mul(b, _3n);
764
+ const { X: X1, Y: Y1, Z: Z1 } = this;
765
+ let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore
766
+ let t0 = Fp.mul(X1, X1); // step 1
767
+ let t1 = Fp.mul(Y1, Y1);
768
+ let t2 = Fp.mul(Z1, Z1);
769
+ let t3 = Fp.mul(X1, Y1);
770
+ t3 = Fp.add(t3, t3); // step 5
771
+ Z3 = Fp.mul(X1, Z1);
772
+ Z3 = Fp.add(Z3, Z3);
773
+ X3 = Fp.mul(a, Z3);
774
+ Y3 = Fp.mul(b3, t2);
775
+ Y3 = Fp.add(X3, Y3); // step 10
776
+ X3 = Fp.sub(t1, Y3);
777
+ Y3 = Fp.add(t1, Y3);
778
+ Y3 = Fp.mul(X3, Y3);
779
+ X3 = Fp.mul(t3, X3);
780
+ Z3 = Fp.mul(b3, Z3); // step 15
781
+ t2 = Fp.mul(a, t2);
782
+ t3 = Fp.sub(t0, t2);
783
+ t3 = Fp.mul(a, t3);
784
+ t3 = Fp.add(t3, Z3);
785
+ Z3 = Fp.add(t0, t0); // step 20
786
+ t0 = Fp.add(Z3, t0);
787
+ t0 = Fp.add(t0, t2);
788
+ t0 = Fp.mul(t0, t3);
789
+ Y3 = Fp.add(Y3, t0);
790
+ t2 = Fp.mul(Y1, Z1); // step 25
791
+ t2 = Fp.add(t2, t2);
792
+ t0 = Fp.mul(t2, t3);
793
+ X3 = Fp.sub(X3, t0);
794
+ Z3 = Fp.mul(t2, t1);
795
+ Z3 = Fp.add(Z3, Z3); // step 30
796
+ Z3 = Fp.add(Z3, Z3);
797
+ return new Point(X3, Y3, Z3);
798
+ }
799
+
800
+ // Renes-Costello-Batina exception-free addition formula.
801
+ // There is 30% faster Jacobian formula, but it is not complete.
802
+ // https://eprint.iacr.org/2015/1060, algorithm 1
803
+ // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
804
+ add(other: Point): Point {
805
+ aprjpoint(other);
806
+ const { X: X1, Y: Y1, Z: Z1 } = this;
807
+ const { X: X2, Y: Y2, Z: Z2 } = other;
808
+ let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore
809
+ const a = CURVE.a;
810
+ const b3 = Fp.mul(CURVE.b, _3n);
811
+ let t0 = Fp.mul(X1, X2); // step 1
812
+ let t1 = Fp.mul(Y1, Y2);
813
+ let t2 = Fp.mul(Z1, Z2);
814
+ let t3 = Fp.add(X1, Y1);
815
+ let t4 = Fp.add(X2, Y2); // step 5
816
+ t3 = Fp.mul(t3, t4);
817
+ t4 = Fp.add(t0, t1);
818
+ t3 = Fp.sub(t3, t4);
819
+ t4 = Fp.add(X1, Z1);
820
+ let t5 = Fp.add(X2, Z2); // step 10
821
+ t4 = Fp.mul(t4, t5);
822
+ t5 = Fp.add(t0, t2);
823
+ t4 = Fp.sub(t4, t5);
824
+ t5 = Fp.add(Y1, Z1);
825
+ X3 = Fp.add(Y2, Z2); // step 15
826
+ t5 = Fp.mul(t5, X3);
827
+ X3 = Fp.add(t1, t2);
828
+ t5 = Fp.sub(t5, X3);
829
+ Z3 = Fp.mul(a, t4);
830
+ X3 = Fp.mul(b3, t2); // step 20
831
+ Z3 = Fp.add(X3, Z3);
832
+ X3 = Fp.sub(t1, Z3);
833
+ Z3 = Fp.add(t1, Z3);
834
+ Y3 = Fp.mul(X3, Z3);
835
+ t1 = Fp.add(t0, t0); // step 25
836
+ t1 = Fp.add(t1, t0);
837
+ t2 = Fp.mul(a, t2);
838
+ t4 = Fp.mul(b3, t4);
839
+ t1 = Fp.add(t1, t2);
840
+ t2 = Fp.sub(t0, t2); // step 30
841
+ t2 = Fp.mul(a, t2);
842
+ t4 = Fp.add(t4, t2);
843
+ t0 = Fp.mul(t1, t4);
844
+ Y3 = Fp.add(Y3, t0);
845
+ t0 = Fp.mul(t5, t4); // step 35
846
+ X3 = Fp.mul(t3, X3);
847
+ X3 = Fp.sub(X3, t0);
848
+ t0 = Fp.mul(t3, t1);
849
+ Z3 = Fp.mul(t5, Z3);
850
+ Z3 = Fp.add(Z3, t0); // step 40
851
+ return new Point(X3, Y3, Z3);
852
+ }
853
+
854
+ subtract(other: Point) {
855
+ return this.add(other.negate());
856
+ }
857
+
858
+ is0(): boolean {
859
+ return this.equals(Point.ZERO);
860
+ }
861
+
862
+ /**
863
+ * Constant time multiplication.
864
+ * Uses wNAF method. Windowed method may be 10% faster,
865
+ * but takes 2x longer to generate and consumes 2x memory.
866
+ * Uses precomputes when available.
867
+ * Uses endomorphism for Koblitz curves.
868
+ * @param scalar by which the point would be multiplied
869
+ * @returns New point
870
+ */
871
+ multiply(scalar: bigint): Point {
872
+ const { endo } = extraOpts;
873
+ if (!Fn.isValidNot0(scalar)) throw new Error('invalid scalar: out of range'); // 0 is invalid
874
+ let point: Point, fake: Point; // Fake point is used to const-time mult
875
+ const mul = (n: bigint) => wnaf.cached(this, n, (p) => normalizeZ(Point, p));
876
+ /** See docs for {@link EndomorphismOpts} */
877
+ if (endo) {
878
+ const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar);
879
+ const { p: k1p, f: k1f } = mul(k1);
880
+ const { p: k2p, f: k2f } = mul(k2);
881
+ fake = k1f.add(k2f);
882
+ point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg);
883
+ } else {
884
+ const { p, f } = mul(scalar);
885
+ point = p;
886
+ fake = f;
887
+ }
888
+ // Normalize `z` for both points, but return only real one
889
+ return normalizeZ(Point, [point, fake])[0];
890
+ }
891
+
892
+ /**
893
+ * Non-constant-time multiplication. Uses double-and-add algorithm.
894
+ * It's faster, but should only be used when you don't care about
895
+ * an exposed secret key e.g. sig verification, which works over *public* keys.
896
+ */
897
+ multiplyUnsafe(sc: bigint): Point {
898
+ const { endo } = extraOpts;
899
+ const p = this as Point;
900
+ if (!Fn.isValid(sc)) throw new Error('invalid scalar: out of range'); // 0 is valid
901
+ if (sc === _0n || p.is0()) return Point.ZERO;
902
+ if (sc === _1n) return p; // fast-path
903
+ if (wnaf.hasCache(this)) return this.multiply(sc);
904
+ if (endo) {
905
+ const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc);
906
+ const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); // 30% faster vs wnaf.unsafe
907
+ return finishEndo(endo.beta, p1, p2, k1neg, k2neg);
908
+ } else {
909
+ return wnaf.unsafe(p, sc);
910
+ }
911
+ }
912
+
913
+ multiplyAndAddUnsafe(Q: Point, a: bigint, b: bigint): Point | undefined {
914
+ const sum = this.multiplyUnsafe(a).add(Q.multiplyUnsafe(b));
915
+ return sum.is0() ? undefined : sum;
916
+ }
917
+
918
+ /**
919
+ * Converts Projective point to affine (x, y) coordinates.
920
+ * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch
921
+ */
922
+ toAffine(invertedZ?: T): AffinePoint<T> {
923
+ return toAffineMemo(this, invertedZ);
924
+ }
925
+
926
+ /**
927
+ * Checks whether Point is free of torsion elements (is in prime subgroup).
928
+ * Always torsion-free for cofactor=1 curves.
929
+ */
930
+ isTorsionFree(): boolean {
931
+ const { isTorsionFree } = extraOpts;
932
+ if (cofactor === _1n) return true;
933
+ if (isTorsionFree) return isTorsionFree(Point, this);
934
+ return wnaf.unsafe(this, CURVE_ORDER).is0();
935
+ }
936
+
937
+ clearCofactor(): Point {
938
+ const { clearCofactor } = extraOpts;
939
+ if (cofactor === _1n) return this; // Fast-path
940
+ if (clearCofactor) return clearCofactor(Point, this) as Point;
941
+ return this.multiplyUnsafe(cofactor);
942
+ }
943
+
944
+ isSmallOrder(): boolean {
945
+ // can we use this.clearCofactor()?
946
+ return this.multiplyUnsafe(cofactor).is0();
947
+ }
948
+
949
+ toBytes(isCompressed = true): Uint8Array {
950
+ abool(isCompressed, 'isCompressed');
951
+ this.assertValidity();
952
+ return encodePoint(Point, this, isCompressed);
953
+ }
954
+
955
+ toHex(isCompressed = true): string {
956
+ return bytesToHex(this.toBytes(isCompressed));
957
+ }
958
+
959
+ toString() {
960
+ return `<Point ${this.is0() ? 'ZERO' : this.toHex()}>`;
961
+ }
962
+
963
+ // TODO: remove
964
+ get px(): T {
965
+ return this.X;
966
+ }
967
+ get py(): T {
968
+ return this.X;
969
+ }
970
+ get pz(): T {
971
+ return this.Z;
972
+ }
973
+ toRawBytes(isCompressed = true): Uint8Array {
974
+ return this.toBytes(isCompressed);
975
+ }
976
+ _setWindowSize(windowSize: number) {
977
+ this.precompute(windowSize);
978
+ }
979
+ static normalizeZ(points: Point[]): Point[] {
980
+ return normalizeZ(Point, points);
981
+ }
982
+ static msm(points: Point[], scalars: bigint[]): Point {
983
+ return pippenger(Point, Fn, points, scalars);
984
+ }
985
+ static fromPrivateKey(privateKey: PrivKey) {
986
+ return Point.BASE.multiply(_normFnElement(Fn, privateKey));
987
+ }
988
+ }
989
+ const bits = Fn.BITS;
990
+ const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits);
991
+ Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms.
992
+ return Point;
993
+ }
994
+
995
+ /** Methods of ECDSA signature instance. */
996
+ export interface ECDSASignature {
997
+ readonly r: bigint;
998
+ readonly s: bigint;
999
+ readonly recovery?: number;
1000
+ addRecoveryBit(recovery: number): ECDSASigRecovered;
1001
+ hasHighS(): boolean;
1002
+ toBytes(format?: string): Uint8Array;
1003
+ toHex(format?: string): string;
1004
+
1005
+ /** @deprecated */
1006
+ assertValidity(): void;
1007
+ /** @deprecated */
1008
+ normalizeS(): ECDSASignature;
1009
+ /** @deprecated use standalone method `curve.recoverPublicKey(sig.toBytes('recovered'), msg)` */
1010
+ recoverPublicKey(msgHash: Hex): WeierstrassPoint<bigint>;
1011
+ /** @deprecated use `.toBytes('compact')` */
1012
+ toCompactRawBytes(): Uint8Array;
1013
+ /** @deprecated use `.toBytes('compact')` */
1014
+ toCompactHex(): string;
1015
+ /** @deprecated use `.toBytes('der')` */
1016
+ toDERRawBytes(): Uint8Array;
1017
+ /** @deprecated use `.toBytes('der')` */
1018
+ toDERHex(): string;
1019
+ }
1020
+ export type ECDSASigRecovered = ECDSASignature & {
1021
+ readonly recovery: number;
1022
+ };
1023
+ /** Methods of ECDSA signature constructor. */
1024
+ export type ECDSASignatureCons = {
1025
+ new (r: bigint, s: bigint, recovery?: number): ECDSASignature;
1026
+ fromBytes(bytes: Uint8Array, format?: ECDSASigFormat): ECDSASignature;
1027
+ fromHex(hex: string, format?: ECDSASigFormat): ECDSASignature;
1028
+
1029
+ /** @deprecated use `.fromBytes(bytes, 'compact')` */
1030
+ fromCompact(hex: Hex): ECDSASignature;
1031
+ /** @deprecated use `.fromBytes(bytes, 'der')` */
1032
+ fromDER(hex: Hex): ECDSASignature;
1033
+ };
1034
+
1035
+ // Points start with byte 0x02 when y is even; otherwise 0x03
1036
+ function pprefix(hasEvenY: boolean): Uint8Array {
1037
+ return Uint8Array.of(hasEvenY ? 0x02 : 0x03);
1038
+ }
1039
+
1040
+ /**
1041
+ * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.
1042
+ * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.
1043
+ * b = True and y = sqrt(u / v) if (u / v) is square in F, and
1044
+ * b = False and y = sqrt(Z * (u / v)) otherwise.
1045
+ * @param Fp
1046
+ * @param Z
1047
+ * @returns
1048
+ */
1049
+ export function SWUFpSqrtRatio<T>(
1050
+ Fp: IField<T>,
1051
+ Z: T
1052
+ ): (u: T, v: T) => { isValid: boolean; value: T } {
1053
+ // Generic implementation
1054
+ const q = Fp.ORDER;
1055
+ let l = _0n;
1056
+ for (let o = q - _1n; o % _2n === _0n; o /= _2n) l += _1n;
1057
+ const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.
1058
+ // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.
1059
+ // 2n ** c1 == 2n << (c1-1)
1060
+ const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);
1061
+ const _2n_pow_c1 = _2n_pow_c1_1 * _2n;
1062
+ const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic
1063
+ const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic
1064
+ const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic
1065
+ const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic
1066
+ const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2
1067
+ const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)
1068
+ let sqrtRatio = (u: T, v: T): { isValid: boolean; value: T } => {
1069
+ let tv1 = c6; // 1. tv1 = c6
1070
+ let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4
1071
+ let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2
1072
+ tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v
1073
+ let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3
1074
+ tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3
1075
+ tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2
1076
+ tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v
1077
+ tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u
1078
+ let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2
1079
+ tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5
1080
+ let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1
1081
+ tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7
1082
+ tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1
1083
+ tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)
1084
+ tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)
1085
+ // 17. for i in (c1, c1 - 1, ..., 2):
1086
+ for (let i = c1; i > _1n; i--) {
1087
+ let tv5 = i - _2n; // 18. tv5 = i - 2
1088
+ tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5
1089
+ let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5
1090
+ const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1
1091
+ tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1
1092
+ tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1
1093
+ tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1
1094
+ tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)
1095
+ tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)
1096
+ }
1097
+ return { isValid: isQR, value: tv3 };
1098
+ };
1099
+ if (Fp.ORDER % _4n === _3n) {
1100
+ // sqrt_ratio_3mod4(u, v)
1101
+ const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic
1102
+ const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)
1103
+ sqrtRatio = (u: T, v: T) => {
1104
+ let tv1 = Fp.sqr(v); // 1. tv1 = v^2
1105
+ const tv2 = Fp.mul(u, v); // 2. tv2 = u * v
1106
+ tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2
1107
+ let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1
1108
+ y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2
1109
+ const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2
1110
+ const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v
1111
+ const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u
1112
+ let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)
1113
+ return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2
1114
+ };
1115
+ }
1116
+ // No curves uses that
1117
+ // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8
1118
+ return sqrtRatio;
1119
+ }
1120
+ /**
1121
+ * Simplified Shallue-van de Woestijne-Ulas Method
1122
+ * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2
1123
+ */
1124
+ export function mapToCurveSimpleSWU<T>(
1125
+ Fp: IField<T>,
1126
+ opts: {
1127
+ A: T;
1128
+ B: T;
1129
+ Z: T;
1130
+ }
1131
+ ): (u: T) => { x: T; y: T } {
1132
+ validateField(Fp);
1133
+ const { A, B, Z } = opts;
1134
+ if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z))
1135
+ throw new Error('mapToCurveSimpleSWU: invalid opts');
1136
+ const sqrtRatio = SWUFpSqrtRatio(Fp, Z);
1137
+ if (!Fp.isOdd) throw new Error('Field does not have .isOdd()');
1138
+ // Input: u, an element of F.
1139
+ // Output: (x, y), a point on E.
1140
+ return (u: T): { x: T; y: T } => {
1141
+ // prettier-ignore
1142
+ let tv1, tv2, tv3, tv4, tv5, tv6, x, y;
1143
+ tv1 = Fp.sqr(u); // 1. tv1 = u^2
1144
+ tv1 = Fp.mul(tv1, Z); // 2. tv1 = Z * tv1
1145
+ tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2
1146
+ tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1
1147
+ tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1
1148
+ tv3 = Fp.mul(tv3, B); // 6. tv3 = B * tv3
1149
+ tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)
1150
+ tv4 = Fp.mul(tv4, A); // 8. tv4 = A * tv4
1151
+ tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2
1152
+ tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2
1153
+ tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6
1154
+ tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5
1155
+ tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3
1156
+ tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4
1157
+ tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6
1158
+ tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5
1159
+ x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3
1160
+ const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)
1161
+ y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1
1162
+ y = Fp.mul(y, value); // 20. y = y * y1
1163
+ x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)
1164
+ y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)
1165
+ const e1 = Fp.isOdd!(u) === Fp.isOdd!(y); // 23. e1 = sgn0(u) == sgn0(y)
1166
+ y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)
1167
+ const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0];
1168
+ x = Fp.mul(x, tv4_inv); // 25. x = x / tv4
1169
+ return { x, y };
1170
+ };
1171
+ }
1172
+
1173
+ function getWLengths<T>(Fp: IField<T>, Fn: IField<bigint>) {
1174
+ return {
1175
+ secretKey: Fn.BYTES,
1176
+ publicKey: 1 + Fp.BYTES,
1177
+ publicKeyUncompressed: 1 + 2 * Fp.BYTES,
1178
+ publicKeyHasPrefix: true,
1179
+ signature: 2 * Fn.BYTES,
1180
+ };
1181
+ }
1182
+
1183
+ /**
1184
+ * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling.
1185
+ * This helper ensures no signature functionality is present. Less code, smaller bundle size.
1186
+ */
1187
+ export function ecdh(
1188
+ Point: WeierstrassPointCons<bigint>,
1189
+ ecdhOpts: { randomBytes?: (bytesLength?: number) => Uint8Array } = {}
1190
+ ): ECDH {
1191
+ const { Fn } = Point;
1192
+ const randomBytes_ = ecdhOpts.randomBytes || randomBytesWeb;
1193
+ const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: getMinHashLength(Fn.ORDER) });
1194
+
1195
+ function isValidSecretKey(secretKey: PrivKey) {
1196
+ try {
1197
+ return !!_normFnElement(Fn, secretKey);
1198
+ } catch (error) {
1199
+ return false;
1200
+ }
1201
+ }
1202
+
1203
+ function isValidPublicKey(publicKey: Uint8Array, isCompressed?: boolean): boolean {
1204
+ const { publicKey: comp, publicKeyUncompressed } = lengths;
1205
+ try {
1206
+ const l = publicKey.length;
1207
+ if (isCompressed === true && l !== comp) return false;
1208
+ if (isCompressed === false && l !== publicKeyUncompressed) return false;
1209
+ return !!Point.fromBytes(publicKey);
1210
+ } catch (error) {
1211
+ return false;
1212
+ }
1213
+ }
1214
+
1215
+ /**
1216
+ * Produces cryptographically secure secret key from random of size
1217
+ * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.
1218
+ */
1219
+ function randomSecretKey(seed = randomBytes_(lengths.seed)): Uint8Array {
1220
+ return mapHashToField(abytes(seed, lengths.seed, 'seed'), Fn.ORDER);
1221
+ }
1222
+
1223
+ /**
1224
+ * Computes public key for a secret key. Checks for validity of the secret key.
1225
+ * @param isCompressed whether to return compact (default), or full key
1226
+ * @returns Public key, full when isCompressed=false; short when isCompressed=true
1227
+ */
1228
+ function getPublicKey(secretKey: PrivKey, isCompressed = true): Uint8Array {
1229
+ return Point.BASE.multiply(_normFnElement(Fn, secretKey)).toBytes(isCompressed);
1230
+ }
1231
+
1232
+ function keygen(seed?: Uint8Array) {
1233
+ const secretKey = randomSecretKey(seed);
1234
+ return { secretKey, publicKey: getPublicKey(secretKey) };
1235
+ }
1236
+
1237
+ /**
1238
+ * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.
1239
+ */
1240
+ function isProbPub(item: PrivKey | PubKey): boolean | undefined {
1241
+ if (typeof item === 'bigint') return false;
1242
+ if (item instanceof Point) return true;
1243
+ const { secretKey, publicKey, publicKeyUncompressed } = lengths;
1244
+ if (Fn.allowedLengths || secretKey === publicKey) return undefined;
1245
+ const l = ensureBytes('key', item).length;
1246
+ return l === publicKey || l === publicKeyUncompressed;
1247
+ }
1248
+
1249
+ /**
1250
+ * ECDH (Elliptic Curve Diffie Hellman).
1251
+ * Computes shared public key from secret key A and public key B.
1252
+ * Checks: 1) secret key validity 2) shared key is on-curve.
1253
+ * Does NOT hash the result.
1254
+ * @param isCompressed whether to return compact (default), or full key
1255
+ * @returns shared public key
1256
+ */
1257
+ function getSharedSecret(secretKeyA: PrivKey, publicKeyB: Hex, isCompressed = true): Uint8Array {
1258
+ if (isProbPub(secretKeyA) === true) throw new Error('first arg must be private key');
1259
+ if (isProbPub(publicKeyB) === false) throw new Error('second arg must be public key');
1260
+ const s = _normFnElement(Fn, secretKeyA);
1261
+ const b = Point.fromHex(publicKeyB); // checks for being on-curve
1262
+ return b.multiply(s).toBytes(isCompressed);
1263
+ }
1264
+
1265
+ const utils = {
1266
+ isValidSecretKey,
1267
+ isValidPublicKey,
1268
+ randomSecretKey,
1269
+
1270
+ // TODO: remove
1271
+ isValidPrivateKey: isValidSecretKey,
1272
+ randomPrivateKey: randomSecretKey,
1273
+ normPrivateKeyToScalar: (key: PrivKey) => _normFnElement(Fn, key),
1274
+ precompute(windowSize = 8, point = Point.BASE): WeierstrassPoint<bigint> {
1275
+ return point.precompute(windowSize, false);
1276
+ },
1277
+ };
1278
+
1279
+ return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths });
1280
+ }
1281
+
1282
+ /**
1283
+ * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function.
1284
+ * We need `hash` for 2 features:
1285
+ * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false`
1286
+ * 2. k generation in `sign`, using HMAC-drbg(hash)
1287
+ *
1288
+ * ECDSAOpts are only rarely needed.
1289
+ *
1290
+ * @example
1291
+ * ```js
1292
+ * const p256_Point = weierstrass(...);
1293
+ * const p256_sha256 = ecdsa(p256_Point, sha256);
1294
+ * const p256_sha224 = ecdsa(p256_Point, sha224);
1295
+ * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } });
1296
+ * ```
1297
+ */
1298
+ export function ecdsa(
1299
+ Point: WeierstrassPointCons<bigint>,
1300
+ hash: CHash,
1301
+ ecdsaOpts: ECDSAOpts = {}
1302
+ ): ECDSA {
1303
+ ahash(hash);
1304
+ _validateObject(
1305
+ ecdsaOpts,
1306
+ {},
1307
+ {
1308
+ hmac: 'function',
1309
+ lowS: 'boolean',
1310
+ randomBytes: 'function',
1311
+ bits2int: 'function',
1312
+ bits2int_modN: 'function',
1313
+ }
1314
+ );
1315
+
1316
+ const randomBytes = ecdsaOpts.randomBytes || randomBytesWeb;
1317
+ const hmac: HmacFnSync =
1318
+ ecdsaOpts.hmac ||
1319
+ (((key, ...msgs) => nobleHmac(hash, key, concatBytes(...msgs))) satisfies HmacFnSync);
1320
+
1321
+ const { Fp, Fn } = Point;
1322
+ const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn;
1323
+ const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts);
1324
+ const defaultSigOpts: Required<ECDSASignOpts> = {
1325
+ prehash: false,
1326
+ lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : false,
1327
+ format: undefined as any, //'compact' as ECDSASigFormat,
1328
+ extraEntropy: false,
1329
+ };
1330
+ const defaultSigOpts_format = 'compact';
1331
+
1332
+ function isBiggerThanHalfOrder(number: bigint) {
1333
+ const HALF = CURVE_ORDER >> _1n;
1334
+ return number > HALF;
1335
+ }
1336
+ function validateRS(title: string, num: bigint): bigint {
1337
+ if (!Fn.isValidNot0(num))
1338
+ throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`);
1339
+ return num;
1340
+ }
1341
+ function validateSigLength(bytes: Uint8Array, format: ECDSASigFormat) {
1342
+ validateSigFormat(format);
1343
+ const size = lengths.signature!;
1344
+ const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined;
1345
+ return abytes(bytes, sizer, `${format} signature`);
1346
+ }
1347
+
1348
+ /**
1349
+ * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations.
1350
+ */
1351
+ class Signature implements ECDSASignature {
1352
+ readonly r: bigint;
1353
+ readonly s: bigint;
1354
+ readonly recovery?: number;
1355
+ constructor(r: bigint, s: bigint, recovery?: number) {
1356
+ this.r = validateRS('r', r); // r in [1..N-1];
1357
+ this.s = validateRS('s', s); // s in [1..N-1];
1358
+ if (recovery != null) this.recovery = recovery;
1359
+ Object.freeze(this);
1360
+ }
1361
+
1362
+ static fromBytes(bytes: Uint8Array, format: ECDSASigFormat = defaultSigOpts_format): Signature {
1363
+ validateSigLength(bytes, format);
1364
+ let recid: number | undefined;
1365
+ if (format === 'der') {
1366
+ const { r, s } = DER.toSig(abytes(bytes));
1367
+ return new Signature(r, s);
1368
+ }
1369
+ if (format === 'recovered') {
1370
+ recid = bytes[0];
1371
+ format = 'compact';
1372
+ bytes = bytes.subarray(1);
1373
+ }
1374
+ const L = Fn.BYTES;
1375
+ const r = bytes.subarray(0, L);
1376
+ const s = bytes.subarray(L, L * 2);
1377
+ return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid);
1378
+ }
1379
+
1380
+ static fromHex(hex: string, format?: ECDSASigFormat) {
1381
+ return this.fromBytes(hexToBytes(hex), format);
1382
+ }
1383
+
1384
+ addRecoveryBit(recovery: number): RecoveredSignature {
1385
+ return new Signature(this.r, this.s, recovery) as RecoveredSignature;
1386
+ }
1387
+
1388
+ recoverPublicKey(messageHash: Hex): WeierstrassPoint<bigint> {
1389
+ const FIELD_ORDER = Fp.ORDER;
1390
+ const { r, s, recovery: rec } = this;
1391
+ if (rec == null || ![0, 1, 2, 3].includes(rec)) throw new Error('recovery id invalid');
1392
+
1393
+ // ECDSA recovery is hard for cofactor > 1 curves.
1394
+ // In sign, `r = q.x mod n`, and here we recover q.x from r.
1395
+ // While recovering q.x >= n, we need to add r+n for cofactor=1 curves.
1396
+ // However, for cofactor>1, r+n may not get q.x:
1397
+ // r+n*i would need to be done instead where i is unknown.
1398
+ // To easily get i, we either need to:
1399
+ // a. increase amount of valid recid values (4, 5...); OR
1400
+ // b. prohibit non-prime-order signatures (recid > 1).
1401
+ const hasCofactor = CURVE_ORDER * _2n < FIELD_ORDER;
1402
+ if (hasCofactor && rec > 1) throw new Error('recovery id is ambiguous for h>1 curve');
1403
+
1404
+ const radj = rec === 2 || rec === 3 ? r + CURVE_ORDER : r;
1405
+ if (!Fp.isValid(radj)) throw new Error('recovery id 2 or 3 invalid');
1406
+ const x = Fp.toBytes(radj);
1407
+ const R = Point.fromBytes(concatBytes(pprefix((rec & 1) === 0), x));
1408
+ const ir = Fn.inv(radj); // r^-1
1409
+ const h = bits2int_modN(ensureBytes('msgHash', messageHash)); // Truncate hash
1410
+ const u1 = Fn.create(-h * ir); // -hr^-1
1411
+ const u2 = Fn.create(s * ir); // sr^-1
1412
+ // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data.
1413
+ const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2));
1414
+ if (Q.is0()) throw new Error('point at infinify');
1415
+ Q.assertValidity();
1416
+ return Q;
1417
+ }
1418
+
1419
+ // Signatures should be low-s, to prevent malleability.
1420
+ hasHighS(): boolean {
1421
+ return isBiggerThanHalfOrder(this.s);
1422
+ }
1423
+
1424
+ toBytes(format: ECDSASigFormat = defaultSigOpts_format) {
1425
+ validateSigFormat(format);
1426
+ if (format === 'der') return hexToBytes(DER.hexFromSig(this));
1427
+ const r = Fn.toBytes(this.r);
1428
+ const s = Fn.toBytes(this.s);
1429
+ if (format === 'recovered') {
1430
+ if (this.recovery == null) throw new Error('recovery bit must be present');
1431
+ return concatBytes(Uint8Array.of(this.recovery), r, s);
1432
+ }
1433
+ return concatBytes(r, s);
1434
+ }
1435
+
1436
+ toHex(format?: ECDSASigFormat) {
1437
+ return bytesToHex(this.toBytes(format));
1438
+ }
1439
+
1440
+ // TODO: remove
1441
+ assertValidity(): void {}
1442
+ static fromCompact(hex: Hex) {
1443
+ return Signature.fromBytes(ensureBytes('sig', hex), 'compact');
1444
+ }
1445
+ static fromDER(hex: Hex) {
1446
+ return Signature.fromBytes(ensureBytes('sig', hex), 'der');
1447
+ }
1448
+ normalizeS() {
1449
+ return this.hasHighS() ? new Signature(this.r, Fn.neg(this.s), this.recovery) : this;
1450
+ }
1451
+ toDERRawBytes() {
1452
+ return this.toBytes('der');
1453
+ }
1454
+ toDERHex() {
1455
+ return bytesToHex(this.toBytes('der'));
1456
+ }
1457
+ toCompactRawBytes() {
1458
+ return this.toBytes('compact');
1459
+ }
1460
+ toCompactHex() {
1461
+ return bytesToHex(this.toBytes('compact'));
1462
+ }
1463
+ }
1464
+ type RecoveredSignature = Signature & { recovery: number };
1465
+
1466
+ // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.
1467
+ // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.
1468
+ // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.
1469
+ // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors
1470
+ const bits2int =
1471
+ ecdsaOpts.bits2int ||
1472
+ function bits2int_def(bytes: Uint8Array): bigint {
1473
+ // Our custom check "just in case", for protection against DoS
1474
+ if (bytes.length > 8192) throw new Error('input is too large');
1475
+ // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)
1476
+ // for some cases, since bytes.length * 8 is not actual bitLength.
1477
+ const num = bytesToNumberBE(bytes); // check for == u8 done here
1478
+ const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits
1479
+ return delta > 0 ? num >> BigInt(delta) : num;
1480
+ };
1481
+ const bits2int_modN =
1482
+ ecdsaOpts.bits2int_modN ||
1483
+ function bits2int_modN_def(bytes: Uint8Array): bigint {
1484
+ return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here
1485
+ };
1486
+ // Pads output with zero as per spec
1487
+ const ORDER_MASK = bitMask(fnBits);
1488
+ /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */
1489
+ function int2octets(num: bigint): Uint8Array {
1490
+ // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8`
1491
+ aInRange('num < 2^' + fnBits, num, _0n, ORDER_MASK);
1492
+ return Fn.toBytes(num);
1493
+ }
1494
+
1495
+ function validateMsgAndHash(message: Uint8Array, prehash: boolean) {
1496
+ abytes(message, undefined, 'message');
1497
+ return prehash ? abytes(hash(message), undefined, 'prehashed message') : message;
1498
+ }
1499
+
1500
+ /**
1501
+ * Steps A, D of RFC6979 3.2.
1502
+ * Creates RFC6979 seed; converts msg/privKey to numbers.
1503
+ * Used only in sign, not in verify.
1504
+ *
1505
+ * Warning: we cannot assume here that message has same amount of bytes as curve order,
1506
+ * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256.
1507
+ */
1508
+ function prepSig(message: Uint8Array, privateKey: PrivKey, opts: ECDSASignOpts) {
1509
+ if (['recovered', 'canonical'].some((k) => k in opts))
1510
+ throw new Error('sign() legacy options not supported');
1511
+ const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts);
1512
+ message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m)
1513
+ // We can't later call bits2octets, since nested bits2int is broken for curves
1514
+ // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call.
1515
+ // const bits2octets = (bits) => int2octets(bits2int_modN(bits))
1516
+ const h1int = bits2int_modN(message);
1517
+ const d = _normFnElement(Fn, privateKey); // validate secret key, convert to bigint
1518
+ const seedArgs = [int2octets(d), int2octets(h1int)];
1519
+ // extraEntropy. RFC6979 3.6: additional k' (optional).
1520
+ if (extraEntropy != null && extraEntropy !== false) {
1521
+ // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')
1522
+ // gen random bytes OR pass as-is
1523
+ const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy;
1524
+ seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes
1525
+ }
1526
+ const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2
1527
+ const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!
1528
+ // Converts signature params into point w r/s, checks result for validity.
1529
+ // To transform k => Signature:
1530
+ // q = k⋅G
1531
+ // r = q.x mod n
1532
+ // s = k^-1(m + rd) mod n
1533
+ // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to
1534
+ // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:
1535
+ // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT
1536
+ function k2sig(kBytes: Uint8Array): RecoveredSignature | undefined {
1537
+ // RFC 6979 Section 3.2, step 3: k = bits2int(T)
1538
+ // Important: all mod() calls here must be done over N
1539
+ const k = bits2int(kBytes); // mod n, not mod p
1540
+ if (!Fn.isValidNot0(k)) return; // Valid scalars (including k) must be in 1..N-1
1541
+ const ik = Fn.inv(k); // k^-1 mod n
1542
+ const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G
1543
+ const r = Fn.create(q.x); // r = q.x mod n
1544
+ if (r === _0n) return;
1545
+ const s = Fn.create(ik * Fn.create(m + r * d)); // Not using blinding here, see comment above
1546
+ if (s === _0n) return;
1547
+ let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)
1548
+ let normS = s;
1549
+ if (lowS && isBiggerThanHalfOrder(s)) {
1550
+ normS = Fn.neg(s); // if lowS was passed, ensure s is always
1551
+ recovery ^= 1; // // in the bottom half of N
1552
+ }
1553
+ return new Signature(r, normS, recovery) as RecoveredSignature; // use normS, not s
1554
+ }
1555
+ return { seed, k2sig };
1556
+ }
1557
+
1558
+ /**
1559
+ * Signs message hash with a secret key.
1560
+ *
1561
+ * ```
1562
+ * sign(m, d) where
1563
+ * k = rfc6979_hmac_drbg(m, d)
1564
+ * (x, y) = G × k
1565
+ * r = x mod n
1566
+ * s = (m + dr) / k mod n
1567
+ * ```
1568
+ */
1569
+ function sign(message: Hex, secretKey: PrivKey, opts: ECDSASignOpts = {}): RecoveredSignature {
1570
+ message = ensureBytes('message', message);
1571
+ const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2.
1572
+ const drbg = createHmacDrbg<RecoveredSignature>(hash.outputLen, Fn.BYTES, hmac);
1573
+ const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G
1574
+ return sig;
1575
+ }
1576
+
1577
+ function tryParsingSig(sg: Hex | SignatureLike) {
1578
+ // Try to deduce format
1579
+ let sig: Signature | undefined = undefined;
1580
+ const isHex = typeof sg === 'string' || isBytes(sg);
1581
+ const isObj =
1582
+ !isHex &&
1583
+ sg !== null &&
1584
+ typeof sg === 'object' &&
1585
+ typeof sg.r === 'bigint' &&
1586
+ typeof sg.s === 'bigint';
1587
+ if (!isHex && !isObj)
1588
+ throw new Error('invalid signature, expected Uint8Array, hex string or Signature instance');
1589
+ if (isObj) {
1590
+ sig = new Signature(sg.r, sg.s);
1591
+ } else if (isHex) {
1592
+ try {
1593
+ sig = Signature.fromBytes(ensureBytes('sig', sg), 'der');
1594
+ } catch (derError) {
1595
+ if (!(derError instanceof DER.Err)) throw derError;
1596
+ }
1597
+ if (!sig) {
1598
+ try {
1599
+ sig = Signature.fromBytes(ensureBytes('sig', sg), 'compact');
1600
+ } catch (error) {
1601
+ return false;
1602
+ }
1603
+ }
1604
+ }
1605
+ if (!sig) return false;
1606
+ return sig;
1607
+ }
1608
+
1609
+ /**
1610
+ * Verifies a signature against message and public key.
1611
+ * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}.
1612
+ * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:
1613
+ *
1614
+ * ```
1615
+ * verify(r, s, h, P) where
1616
+ * u1 = hs^-1 mod n
1617
+ * u2 = rs^-1 mod n
1618
+ * R = u1⋅G + u2⋅P
1619
+ * mod(R.x, n) == r
1620
+ * ```
1621
+ */
1622
+ function verify(
1623
+ signature: Hex | SignatureLike,
1624
+ message: Hex,
1625
+ publicKey: Hex,
1626
+ opts: ECDSAVerifyOpts = {}
1627
+ ): boolean {
1628
+ const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts);
1629
+ publicKey = ensureBytes('publicKey', publicKey);
1630
+ message = validateMsgAndHash(ensureBytes('message', message), prehash);
1631
+ if ('strict' in opts) throw new Error('options.strict was renamed to lowS');
1632
+ const sig =
1633
+ format === undefined
1634
+ ? tryParsingSig(signature)
1635
+ : Signature.fromBytes(ensureBytes('sig', signature as Hex), format);
1636
+ if (sig === false) return false;
1637
+ try {
1638
+ const P = Point.fromBytes(publicKey);
1639
+ if (lowS && sig.hasHighS()) return false;
1640
+ const { r, s } = sig;
1641
+ const h = bits2int_modN(message); // mod n, not mod p
1642
+ const is = Fn.inv(s); // s^-1 mod n
1643
+ const u1 = Fn.create(h * is); // u1 = hs^-1 mod n
1644
+ const u2 = Fn.create(r * is); // u2 = rs^-1 mod n
1645
+ const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P
1646
+ if (R.is0()) return false;
1647
+ const v = Fn.create(R.x); // v = r.x mod n
1648
+ return v === r;
1649
+ } catch (e) {
1650
+ return false;
1651
+ }
1652
+ }
1653
+
1654
+ function recoverPublicKey(
1655
+ signature: Uint8Array,
1656
+ message: Uint8Array,
1657
+ opts: ECDSARecoverOpts = {}
1658
+ ): Uint8Array {
1659
+ const { prehash } = validateSigOpts(opts, defaultSigOpts);
1660
+ message = validateMsgAndHash(message, prehash);
1661
+ return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes();
1662
+ }
1663
+
1664
+ return Object.freeze({
1665
+ keygen,
1666
+ getPublicKey,
1667
+ getSharedSecret,
1668
+ utils,
1669
+ lengths,
1670
+ Point,
1671
+ sign,
1672
+ verify,
1673
+ recoverPublicKey,
1674
+ Signature,
1675
+ hash,
1676
+ });
1677
+ }
1678
+
1679
+ // TODO: remove everything below
1680
+ /** @deprecated use ECDSASignature */
1681
+ export type SignatureType = ECDSASignature;
1682
+ /** @deprecated use ECDSASigRecovered */
1683
+ export type RecoveredSignatureType = ECDSASigRecovered;
1684
+ /** @deprecated switch to Uint8Array signatures in format 'compact' */
1685
+ export type SignatureLike = { r: bigint; s: bigint };
1686
+ export type ECDSAExtraEntropy = Hex | boolean;
1687
+ /** @deprecated use `ECDSAExtraEntropy` */
1688
+ export type Entropy = Hex | boolean;
1689
+ export type BasicWCurve<T> = BasicCurve<T> & {
1690
+ // Params: a, b
1691
+ a: T;
1692
+ b: T;
1693
+
1694
+ // Optional params
1695
+ allowedPrivateKeyLengths?: readonly number[]; // for P521
1696
+ wrapPrivateKey?: boolean; // bls12-381 requires mod(n) instead of rejecting keys >= n
1697
+ endo?: EndomorphismOpts;
1698
+ // When a cofactor != 1, there can be an effective methods to:
1699
+ // 1. Determine whether a point is torsion-free
1700
+ isTorsionFree?: (c: WeierstrassPointCons<T>, point: WeierstrassPoint<T>) => boolean;
1701
+ // 2. Clear torsion component
1702
+ clearCofactor?: (c: WeierstrassPointCons<T>, point: WeierstrassPoint<T>) => WeierstrassPoint<T>;
1703
+ };
1704
+ /** @deprecated use ECDSASignOpts */
1705
+ export type SignOpts = ECDSASignOpts;
1706
+ /** @deprecated use ECDSASignOpts */
1707
+ export type VerOpts = ECDSAVerifyOpts;
1708
+
1709
+ /** @deprecated use WeierstrassPoint */
1710
+ export type ProjPointType<T> = WeierstrassPoint<T>;
1711
+ /** @deprecated use WeierstrassPointCons */
1712
+ export type ProjConstructor<T> = WeierstrassPointCons<T>;
1713
+ /** @deprecated use ECDSASignatureCons */
1714
+ export type SignatureConstructor = ECDSASignatureCons;
1715
+
1716
+ // TODO: remove
1717
+ export type CurvePointsType<T> = BasicWCurve<T> & {
1718
+ fromBytes?: (bytes: Uint8Array) => AffinePoint<T>;
1719
+ toBytes?: (
1720
+ c: WeierstrassPointCons<T>,
1721
+ point: WeierstrassPoint<T>,
1722
+ isCompressed: boolean
1723
+ ) => Uint8Array;
1724
+ };
1725
+
1726
+ // LegacyWeierstrassOpts
1727
+ export type CurvePointsTypeWithLength<T> = Readonly<CurvePointsType<T> & Partial<NLength>>;
1728
+
1729
+ // LegacyWeierstrass
1730
+ export type CurvePointsRes<T> = {
1731
+ Point: WeierstrassPointCons<T>;
1732
+
1733
+ /** @deprecated use `Point.CURVE()` */
1734
+ CURVE: CurvePointsType<T>;
1735
+ /** @deprecated use `Point` */
1736
+ ProjectivePoint: WeierstrassPointCons<T>;
1737
+ /** @deprecated use `Point.Fn.fromBytes(privateKey)` */
1738
+ normPrivateKeyToScalar: (key: PrivKey) => bigint;
1739
+ /** @deprecated */
1740
+ weierstrassEquation: (x: T) => T;
1741
+ /** @deprecated use `Point.Fn.isValidNot0(num)` */
1742
+ isWithinCurveOrder: (num: bigint) => boolean;
1743
+ };
1744
+
1745
+ // Aliases to legacy types
1746
+ // export type CurveType = LegacyECDSAOpts;
1747
+ // export type CurveFn = LegacyECDSA;
1748
+ // export type CurvePointsRes<T> = LegacyWeierstrass<T>;
1749
+ // export type CurvePointsType<T> = LegacyWeierstrassOpts<T>;
1750
+ // export type CurvePointsTypeWithLength<T> = LegacyWeierstrassOpts<T>;
1751
+ // export type BasicWCurve<T> = LegacyWeierstrassOpts<T>;
1752
+
1753
+ /** @deprecated use `Uint8Array` */
1754
+ export type PubKey = Hex | WeierstrassPoint<bigint>;
1755
+ export type CurveType = BasicWCurve<bigint> & {
1756
+ hash: CHash; // CHash not FHash because we need outputLen for DRBG
1757
+ hmac?: HmacFnSync;
1758
+ randomBytes?: (bytesLength?: number) => Uint8Array;
1759
+ lowS?: boolean;
1760
+ bits2int?: (bytes: Uint8Array) => bigint;
1761
+ bits2int_modN?: (bytes: Uint8Array) => bigint;
1762
+ };
1763
+ export type CurveFn = {
1764
+ /** @deprecated use `Point.CURVE()` */
1765
+ CURVE: CurvePointsType<bigint>;
1766
+ keygen: ECDSA['keygen'];
1767
+ getPublicKey: ECDSA['getPublicKey'];
1768
+ getSharedSecret: ECDSA['getSharedSecret'];
1769
+ sign: ECDSA['sign'];
1770
+ verify: ECDSA['verify'];
1771
+ Point: WeierstrassPointCons<bigint>;
1772
+ /** @deprecated use `Point` */
1773
+ ProjectivePoint: WeierstrassPointCons<bigint>;
1774
+ Signature: ECDSASignatureCons;
1775
+ utils: ECDSA['utils'];
1776
+ lengths: ECDSA['lengths'];
1777
+ };
1778
+ /** @deprecated use `weierstrass` in newer releases */
1779
+ export function weierstrassPoints<T>(c: CurvePointsTypeWithLength<T>): CurvePointsRes<T> {
1780
+ const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c);
1781
+ const Point = weierstrassN(CURVE, curveOpts);
1782
+ return _weierstrass_new_output_to_legacy(c, Point);
1783
+ }
1784
+ export type WsPointComposed<T> = {
1785
+ CURVE: WeierstrassOpts<T>;
1786
+ curveOpts: WeierstrassExtraOpts<T>;
1787
+ };
1788
+ export type WsComposed = {
1789
+ /** @deprecated use `Point.CURVE()` */
1790
+ CURVE: WeierstrassOpts<bigint>;
1791
+ hash: CHash;
1792
+ curveOpts: WeierstrassExtraOpts<bigint>;
1793
+ ecdsaOpts: ECDSAOpts;
1794
+ };
1795
+ function _weierstrass_legacy_opts_to_new<T>(c: CurvePointsType<T>): WsPointComposed<T> {
1796
+ const CURVE: WeierstrassOpts<T> = {
1797
+ a: c.a,
1798
+ b: c.b,
1799
+ p: c.Fp.ORDER,
1800
+ n: c.n,
1801
+ h: c.h,
1802
+ Gx: c.Gx,
1803
+ Gy: c.Gy,
1804
+ };
1805
+ const Fp = c.Fp;
1806
+ let allowedLengths = c.allowedPrivateKeyLengths
1807
+ ? Array.from(new Set(c.allowedPrivateKeyLengths.map((l) => Math.ceil(l / 2))))
1808
+ : undefined;
1809
+ const Fn = Field(CURVE.n, {
1810
+ BITS: c.nBitLength,
1811
+ allowedLengths: allowedLengths,
1812
+ modFromBytes: c.wrapPrivateKey,
1813
+ });
1814
+ const curveOpts: WeierstrassExtraOpts<T> = {
1815
+ Fp,
1816
+ Fn,
1817
+ allowInfinityPoint: c.allowInfinityPoint,
1818
+ endo: c.endo,
1819
+ isTorsionFree: c.isTorsionFree,
1820
+ clearCofactor: c.clearCofactor,
1821
+ fromBytes: c.fromBytes,
1822
+ toBytes: c.toBytes,
1823
+ };
1824
+ return { CURVE, curveOpts };
1825
+ }
1826
+ function _ecdsa_legacy_opts_to_new(c: CurveType): WsComposed {
1827
+ const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c);
1828
+ const ecdsaOpts: ECDSAOpts = {
1829
+ hmac: c.hmac,
1830
+ randomBytes: c.randomBytes,
1831
+ lowS: c.lowS,
1832
+ bits2int: c.bits2int,
1833
+ bits2int_modN: c.bits2int_modN,
1834
+ };
1835
+ return { CURVE, curveOpts, hash: c.hash, ecdsaOpts };
1836
+ }
1837
+ export function _legacyHelperEquat<T>(Fp: IField<T>, a: T, b: T): (x: T) => T {
1838
+ /**
1839
+ * y² = x³ + ax + b: Short weierstrass curve formula. Takes x, returns y².
1840
+ * @returns y²
1841
+ */
1842
+ function weierstrassEquation(x: T): T {
1843
+ const x2 = Fp.sqr(x); // x * x
1844
+ const x3 = Fp.mul(x2, x); // x² * x
1845
+ return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x³ + a * x + b
1846
+ }
1847
+ return weierstrassEquation;
1848
+ }
1849
+ function _weierstrass_new_output_to_legacy<T>(
1850
+ c: CurvePointsType<T>,
1851
+ Point: WeierstrassPointCons<T>
1852
+ ): CurvePointsRes<T> {
1853
+ const { Fp, Fn } = Point;
1854
+ function isWithinCurveOrder(num: bigint): boolean {
1855
+ return inRange(num, _1n, Fn.ORDER);
1856
+ }
1857
+ const weierstrassEquation = _legacyHelperEquat(Fp, c.a, c.b);
1858
+ return Object.assign(
1859
+ {},
1860
+ {
1861
+ CURVE: c,
1862
+ Point: Point,
1863
+ ProjectivePoint: Point,
1864
+ normPrivateKeyToScalar: (key: PrivKey) => _normFnElement(Fn, key),
1865
+ weierstrassEquation,
1866
+ isWithinCurveOrder,
1867
+ }
1868
+ );
1869
+ }
1870
+ function _ecdsa_new_output_to_legacy(c: CurveType, _ecdsa: ECDSA): CurveFn {
1871
+ const Point = _ecdsa.Point;
1872
+ return Object.assign({}, _ecdsa, {
1873
+ ProjectivePoint: Point,
1874
+ CURVE: Object.assign({}, c, nLength(Point.Fn.ORDER, Point.Fn.BITS)),
1875
+ });
1876
+ }
1877
+
1878
+ // _ecdsa_legacy
1879
+ export function weierstrass(c: CurveType): CurveFn {
1880
+ const { CURVE, curveOpts, hash, ecdsaOpts } = _ecdsa_legacy_opts_to_new(c);
1881
+ const Point = weierstrassN(CURVE, curveOpts);
1882
+ const signs = ecdsa(Point, hash, ecdsaOpts);
1883
+ return _ecdsa_new_output_to_legacy(c, signs);
1884
+ }