@contrast/agent-bundle 5.46.0 → 5.48.0

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 (647) hide show
  1. package/README.md +1 -1
  2. package/node_modules/@contrast/agent/README.md +1 -1
  3. package/node_modules/@contrast/agent/package.json +12 -12
  4. package/node_modules/@contrast/agentify/package.json +15 -15
  5. package/node_modules/@contrast/architecture-components/package.json +5 -5
  6. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/common.js +1 -1
  7. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/handlers.js +23 -10
  8. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/index.js +6 -4
  9. package/node_modules/@contrast/assess/lib/configuration-analysis/install/apollo-server.js +92 -0
  10. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/express-session.js +2 -2
  11. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/fastify-cookie.js +2 -2
  12. package/node_modules/@contrast/assess/lib/configuration-analysis/install/graphql-yoga.js +90 -0
  13. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/hapi.js +2 -2
  14. package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/koa.js +3 -3
  15. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/string/substring.js +1 -1
  16. package/node_modules/@contrast/assess/lib/dataflow/sinks/install/fs.js +8 -15
  17. package/node_modules/@contrast/assess/lib/dataflow/sources/handler.js +9 -2
  18. package/node_modules/@contrast/assess/lib/dataflow/sources/index.js +2 -0
  19. package/node_modules/@contrast/assess/lib/dataflow/sources/install/fastify-websocket.js +63 -0
  20. package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +42 -38
  21. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/index.js +1 -1
  22. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +76 -48
  23. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-multer.js +1 -1
  24. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-routers.js +2 -2
  25. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/{koa2.js → koa.js} +3 -3
  26. package/node_modules/@contrast/assess/lib/dataflow/sources/install/socket.io.js +80 -0
  27. package/node_modules/@contrast/assess/lib/index.d.ts +4 -3
  28. package/node_modules/@contrast/assess/lib/index.js +1 -1
  29. package/node_modules/@contrast/assess/lib/policy.js +2 -2
  30. package/node_modules/@contrast/assess/package.json +12 -12
  31. package/node_modules/@contrast/common/lib/constants.d.ts +12 -4
  32. package/node_modules/@contrast/common/lib/constants.js +16 -7
  33. package/node_modules/@contrast/common/lib/types.d.ts +5 -1
  34. package/node_modules/@contrast/common/package.json +1 -1
  35. package/node_modules/@contrast/config/lib/common.js +1 -0
  36. package/node_modules/@contrast/config/lib/options.js +7 -1
  37. package/node_modules/@contrast/config/package.json +3 -3
  38. package/node_modules/@contrast/core/package.json +5 -5
  39. package/node_modules/@contrast/deadzones/package.json +5 -5
  40. package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +1 -10
  41. package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +1 -1
  42. package/node_modules/@contrast/dep-hooks/lib/index.d.ts +1 -1
  43. package/node_modules/@contrast/dep-hooks/lib/index.js +1 -1
  44. package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +3 -2
  45. package/node_modules/@contrast/dep-hooks/lib/package-finder.js +14 -4
  46. package/node_modules/@contrast/dep-hooks/package.json +4 -4
  47. package/node_modules/@contrast/esm-hooks/README.md +2 -2
  48. package/node_modules/@contrast/esm-hooks/package.json +6 -6
  49. package/node_modules/@contrast/instrumentation/package.json +5 -5
  50. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +166 -224
  51. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/index.js +2 -11
  52. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/utils.js +2 -0
  53. package/node_modules/@contrast/library-analysis/lib/install/library-usage/index.js +3 -1
  54. package/node_modules/@contrast/library-analysis/lib/util.js +0 -2
  55. package/node_modules/@contrast/library-analysis/package.json +4 -4
  56. package/node_modules/@contrast/logger/package.json +4 -4
  57. package/node_modules/@contrast/metrics/package.json +6 -6
  58. package/node_modules/@contrast/patcher/package.json +2 -2
  59. package/node_modules/@contrast/protect/lib/error-handlers/index.js +1 -1
  60. package/node_modules/@contrast/protect/lib/error-handlers/install/{koa2.js → koa.js} +4 -4
  61. package/node_modules/@contrast/protect/lib/index.d.ts +1 -1
  62. package/node_modules/@contrast/protect/lib/input-analysis/index.js +2 -3
  63. package/node_modules/@contrast/protect/lib/input-analysis/install/koa-bodyparsers.js +92 -0
  64. package/node_modules/@contrast/protect/lib/input-analysis/install/{koa2.js → koa.js} +5 -5
  65. package/node_modules/@contrast/protect/lib/input-tracing/install/fs.js +0 -8
  66. package/node_modules/@contrast/protect/package.json +11 -11
  67. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +6 -10
  68. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/routes-observed.js +4 -0
  69. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.d.ts +1 -1
  70. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
  71. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -1
  72. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +22 -9
  73. package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
  74. package/node_modules/@contrast/reporter/package.json +6 -6
  75. package/node_modules/@contrast/rewriter/package.json +5 -5
  76. package/node_modules/@contrast/route-coverage/lib/index.d.ts +2 -2
  77. package/node_modules/@contrast/route-coverage/lib/index.js +12 -2
  78. package/node_modules/@contrast/route-coverage/lib/install/express.js +535 -0
  79. package/node_modules/@contrast/route-coverage/lib/install/fastify/fastify-express.js +71 -0
  80. package/node_modules/@contrast/route-coverage/lib/install/fastify/fastify-middie.js +67 -0
  81. package/node_modules/@contrast/route-coverage/lib/install/{fastify.js → fastify/fastify.js} +32 -22
  82. package/node_modules/@contrast/route-coverage/lib/install/{express → fastify}/index.js +6 -5
  83. package/node_modules/@contrast/route-coverage/lib/install/graphql.js +6 -1
  84. package/node_modules/@contrast/route-coverage/lib/install/koa.js +39 -45
  85. package/node_modules/@contrast/route-coverage/lib/install/socket.io.js +127 -0
  86. package/node_modules/@contrast/route-coverage/lib/utils/route-info.js +26 -1
  87. package/node_modules/@contrast/route-coverage/package.json +8 -8
  88. package/node_modules/@contrast/scopes/package.json +5 -5
  89. package/node_modules/@contrast/sec-obs/package.json +9 -9
  90. package/node_modules/@contrast/sources/lib/index.js +65 -22
  91. package/node_modules/@contrast/sources/lib/index.test.js +78 -33
  92. package/node_modules/@contrast/sources/lib/source-info.js +1 -10
  93. package/node_modules/@contrast/sources/package.json +3 -3
  94. package/node_modules/@contrast/telemetry/package.json +5 -5
  95. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +697 -30
  96. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +697 -30
  97. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
  98. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.d.ts +6 -0
  99. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +6 -0
  100. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js.map +1 -1
  101. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +877 -49
  102. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +877 -49
  103. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
  104. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +13 -4
  105. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +13 -4
  106. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
  107. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
  108. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
  109. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
  110. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +697 -30
  111. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +697 -30
  112. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
  113. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.d.ts +6 -0
  114. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +6 -0
  115. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js.map +1 -1
  116. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +877 -49
  117. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +877 -49
  118. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
  119. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +13 -4
  120. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +13 -4
  121. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
  122. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
  123. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
  124. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
  125. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +697 -30
  126. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +729 -61
  127. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
  128. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.d.ts +6 -0
  129. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +7 -1
  130. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js.map +1 -1
  131. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +877 -49
  132. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +886 -56
  133. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
  134. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +13 -4
  135. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +13 -4
  136. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
  137. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
  138. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
  139. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
  140. package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -5
  141. package/node_modules/{pino → @pinojs/redact}/.github/dependabot.yml +1 -1
  142. package/node_modules/@pinojs/redact/.github/workflows/ci.yml +48 -0
  143. package/node_modules/@pinojs/redact/.github/workflows/publish-release.yml +43 -0
  144. package/node_modules/{pino/node_modules/sonic-boom → @pinojs/redact}/LICENSE +1 -1
  145. package/node_modules/@pinojs/redact/README.md +350 -0
  146. package/node_modules/@pinojs/redact/benchmarks/basic.js +184 -0
  147. package/node_modules/@pinojs/redact/eslint.config.js +1 -0
  148. package/node_modules/@pinojs/redact/index.d.ts +52 -0
  149. package/node_modules/@pinojs/redact/index.js +529 -0
  150. package/node_modules/@pinojs/redact/index.test-d.ts +22 -0
  151. package/node_modules/@pinojs/redact/package.json +37 -0
  152. package/node_modules/@pinojs/redact/scripts/sync-version.mjs +20 -0
  153. package/node_modules/@pinojs/redact/test/actual-redact-comparison.test.js +211 -0
  154. package/node_modules/@pinojs/redact/test/index.test.js +824 -0
  155. package/node_modules/@pinojs/redact/test/integration.test.js +390 -0
  156. package/node_modules/@pinojs/redact/test/multiple-wildcards.test.js +227 -0
  157. package/node_modules/@pinojs/redact/test/prototype-pollution.test.js +223 -0
  158. package/node_modules/@pinojs/redact/test/selective-clone.test.js +115 -0
  159. package/node_modules/@pinojs/redact/tsconfig.json +19 -0
  160. package/node_modules/@types/node/README.md +1 -1
  161. package/node_modules/@types/node/assert.d.ts +37 -2
  162. package/node_modules/@types/node/buffer.buffer.d.ts +9 -0
  163. package/node_modules/@types/node/buffer.d.ts +8 -4
  164. package/node_modules/@types/node/child_process.d.ts +65 -42
  165. package/node_modules/@types/node/cluster.d.ts +4 -5
  166. package/node_modules/@types/node/console.d.ts +3 -2
  167. package/node_modules/@types/node/crypto.d.ts +1079 -338
  168. package/node_modules/@types/node/dgram.d.ts +9 -8
  169. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  170. package/node_modules/@types/node/dns.d.ts +1 -1
  171. package/node_modules/@types/node/events.d.ts +1 -1
  172. package/node_modules/@types/node/fs/promises.d.ts +39 -21
  173. package/node_modules/@types/node/fs.d.ts +104 -87
  174. package/node_modules/@types/node/globals.d.ts +2 -0
  175. package/node_modules/@types/node/globals.typedarray.d.ts +19 -0
  176. package/node_modules/@types/node/http.d.ts +66 -27
  177. package/node_modules/@types/node/http2.d.ts +178 -52
  178. package/node_modules/@types/node/https.d.ts +91 -62
  179. package/node_modules/@types/node/index.d.ts +2 -0
  180. package/node_modules/@types/node/inspector.d.ts +24 -0
  181. package/node_modules/@types/node/inspector.generated.d.ts +181 -0
  182. package/node_modules/@types/node/net.d.ts +12 -11
  183. package/node_modules/@types/node/os.d.ts +14 -3
  184. package/node_modules/@types/node/package.json +3 -3
  185. package/node_modules/@types/node/perf_hooks.d.ts +6 -8
  186. package/node_modules/@types/node/process.d.ts +19 -23
  187. package/node_modules/@types/node/readline/promises.d.ts +1 -1
  188. package/node_modules/@types/node/sea.d.ts +9 -0
  189. package/node_modules/@types/node/sqlite.d.ts +226 -10
  190. package/node_modules/@types/node/stream/consumers.d.ts +2 -2
  191. package/node_modules/@types/node/stream/web.d.ts +6 -55
  192. package/node_modules/@types/node/stream.d.ts +38 -23
  193. package/node_modules/@types/node/string_decoder.d.ts +2 -2
  194. package/node_modules/@types/node/test.d.ts +29 -3
  195. package/node_modules/@types/node/tls.d.ts +90 -66
  196. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
  197. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +16 -0
  198. package/node_modules/@types/node/ts5.6/index.d.ts +2 -0
  199. package/node_modules/@types/node/ts5.7/index.d.ts +2 -0
  200. package/node_modules/@types/node/url.d.ts +34 -10
  201. package/node_modules/@types/node/util.d.ts +12 -3
  202. package/node_modules/@types/node/v8.d.ts +38 -5
  203. package/node_modules/@types/node/vm.d.ts +169 -88
  204. package/node_modules/@types/node/wasi.d.ts +1 -1
  205. package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  206. package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  207. package/node_modules/@types/node/worker_threads.d.ts +76 -1
  208. package/node_modules/@types/node/zlib.d.ts +25 -24
  209. package/node_modules/axios/CHANGELOG.md +410 -346
  210. package/node_modules/axios/README.md +79 -51
  211. package/node_modules/axios/dist/axios.js +121 -46
  212. package/node_modules/axios/dist/axios.js.map +1 -1
  213. package/node_modules/axios/dist/axios.min.js +2 -2
  214. package/node_modules/axios/dist/axios.min.js.map +1 -1
  215. package/node_modules/axios/dist/browser/axios.cjs +126 -57
  216. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  217. package/node_modules/axios/dist/esm/axios.js +126 -57
  218. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  219. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  220. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  221. package/node_modules/axios/dist/node/axios.cjs +351 -97
  222. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  223. package/node_modules/axios/index.d.cts +4 -0
  224. package/node_modules/axios/index.d.ts +4 -0
  225. package/node_modules/axios/lib/adapters/adapters.js +85 -40
  226. package/node_modules/axios/lib/adapters/fetch.js +1 -1
  227. package/node_modules/axios/lib/adapters/http.js +224 -42
  228. package/node_modules/axios/lib/core/InterceptorManager.js +1 -1
  229. package/node_modules/axios/lib/core/mergeConfig.js +4 -4
  230. package/node_modules/axios/lib/env/data.js +1 -1
  231. package/node_modules/axios/lib/helpers/HttpStatusCode.js +6 -0
  232. package/node_modules/axios/lib/helpers/bind.js +7 -0
  233. package/node_modules/axios/lib/helpers/cookies.js +24 -13
  234. package/node_modules/axios/package.json +9 -4
  235. package/node_modules/detect-libc/lib/filesystem.js +1 -1
  236. package/node_modules/detect-libc/package.json +3 -1
  237. package/node_modules/form-data/CHANGELOG.md +60 -2
  238. package/node_modules/form-data/README.md +4 -4
  239. package/node_modules/form-data/lib/form_data.js +2 -2
  240. package/node_modules/form-data/package.json +4 -4
  241. package/node_modules/ipaddr.js/README.md +1 -0
  242. package/node_modules/ipaddr.js/ipaddr.min.js +1 -1
  243. package/node_modules/ipaddr.js/lib/ipaddr.js +11 -0
  244. package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +1 -0
  245. package/node_modules/ipaddr.js/package.json +2 -3
  246. package/node_modules/nan/.github/workflows/ci.yml +3 -1
  247. package/node_modules/nan/CHANGELOG.md +4 -1
  248. package/node_modules/nan/README.md +2 -2
  249. package/node_modules/nan/nan.h +25 -15
  250. package/node_modules/nan/nan_maybe_43_inl.h +5 -1
  251. package/node_modules/nan/package.json +2 -2
  252. package/node_modules/node-abi/abi_registry.json +19 -2
  253. package/node_modules/node-abi/package.json +3 -6
  254. package/node_modules/pino/CONTRIBUTING.md +4 -0
  255. package/node_modules/pino/LICENSE +1 -1
  256. package/node_modules/pino/README.md +20 -3
  257. package/node_modules/pino/benchmarks/basic.bench.js +1 -1
  258. package/node_modules/pino/benchmarks/child-child.bench.js +1 -1
  259. package/node_modules/pino/benchmarks/child-creation.bench.js +1 -1
  260. package/node_modules/pino/benchmarks/child.bench.js +1 -1
  261. package/node_modules/pino/benchmarks/deep-object.bench.js +1 -1
  262. package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +1 -1
  263. package/node_modules/pino/benchmarks/internal/just-pino.bench.js +1 -1
  264. package/node_modules/pino/benchmarks/internal/redact.bench.js +1 -1
  265. package/node_modules/pino/benchmarks/long-string.bench.js +1 -1
  266. package/node_modules/pino/benchmarks/multi-arg.bench.js +1 -1
  267. package/node_modules/pino/benchmarks/multistream.js +1 -1
  268. package/node_modules/pino/benchmarks/object.bench.js +1 -1
  269. package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +2 -2
  270. package/node_modules/pino/benchmarks/utils/runbench.js +3 -3
  271. package/node_modules/pino/benchmarks/utils/wrap-log-level.js +2 -2
  272. package/node_modules/pino/browser.js +76 -36
  273. package/node_modules/pino/build/sync-version.js +18 -3
  274. package/node_modules/pino/docs/api.md +155 -13
  275. package/node_modules/pino/docs/browser.md +16 -1
  276. package/node_modules/pino/docs/bundling.md +5 -3
  277. package/node_modules/pino/docs/diagnostics.md +16 -0
  278. package/node_modules/pino/docs/ecosystem.md +15 -12
  279. package/node_modules/pino/docs/help.md +29 -3
  280. package/node_modules/pino/docs/lts.md +5 -4
  281. package/node_modules/pino/docs/transports.md +442 -271
  282. package/node_modules/pino/docs/web.md +59 -9
  283. package/node_modules/pino/eslint.config.js +19 -0
  284. package/node_modules/pino/examples/transport.js +2 -2
  285. package/node_modules/pino/file.js +1 -1
  286. package/node_modules/pino/lib/meta.js +1 -1
  287. package/node_modules/pino/lib/multistream.js +17 -2
  288. package/node_modules/pino/lib/proto.js +35 -11
  289. package/node_modules/pino/lib/redaction.js +9 -13
  290. package/node_modules/pino/lib/time.js +29 -1
  291. package/node_modules/pino/lib/tools.js +37 -8
  292. package/node_modules/pino/lib/transport-stream.js +10 -4
  293. package/node_modules/pino/lib/transport.js +23 -9
  294. package/node_modules/pino/lib/worker.js +164 -24
  295. package/node_modules/pino/package.json +28 -27
  296. package/node_modules/pino/pino.d.ts +244 -203
  297. package/node_modules/pino/pino.js +7 -3
  298. package/node_modules/pino/test/basic.test.js +181 -169
  299. package/node_modules/pino/test/broken-pipe.test.js +18 -16
  300. package/node_modules/pino/test/browser-child.test.js +26 -0
  301. package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
  302. package/node_modules/pino/test/browser-serializers.test.js +0 -2
  303. package/node_modules/pino/test/browser-transmit.test.js +68 -0
  304. package/node_modules/pino/test/browser.test.js +98 -13
  305. package/node_modules/pino/test/complex-objects.test.js +8 -6
  306. package/node_modules/pino/test/crlf.test.js +7 -5
  307. package/node_modules/pino/test/custom-levels.test.js +80 -66
  308. package/node_modules/pino/test/diagnostics.test.js +107 -0
  309. package/node_modules/pino/test/error-key.test.js +37 -0
  310. package/node_modules/pino/test/error.test.js +48 -43
  311. package/node_modules/pino/test/escaping.test.js +8 -6
  312. package/node_modules/pino/test/esm/esm.mjs +5 -3
  313. package/node_modules/pino/test/esm/index.test.js +14 -27
  314. package/node_modules/pino/test/esm/named-exports.mjs +9 -8
  315. package/node_modules/pino/test/exit.test.js +18 -16
  316. package/node_modules/pino/test/fixtures/broken-pipe/basic.js +1 -1
  317. package/node_modules/pino/test/fixtures/broken-pipe/destination.js +1 -1
  318. package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +1 -1
  319. package/node_modules/pino/test/fixtures/console-transport.js +1 -1
  320. package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
  321. package/node_modules/pino/test/fixtures/default-exit.js +1 -1
  322. package/node_modules/pino/test/fixtures/destination-exit.js +1 -1
  323. package/node_modules/pino/test/fixtures/noop-transport.js +1 -1
  324. package/node_modules/pino/test/fixtures/pretty/null-prototype.js +1 -1
  325. package/node_modules/pino/test/fixtures/stdout-hack-protection.js +1 -1
  326. package/node_modules/pino/test/fixtures/syncfalse-child.js +1 -1
  327. package/node_modules/pino/test/fixtures/syncfalse-exit.js +1 -1
  328. package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +1 -1
  329. package/node_modules/pino/test/fixtures/syncfalse.js +1 -1
  330. package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
  331. package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +3 -3
  332. package/node_modules/pino/test/fixtures/to-file-transport.js +2 -2
  333. package/node_modules/pino/test/fixtures/to-file-transport.mjs +2 -2
  334. package/node_modules/pino/test/fixtures/transport/index.js +2 -2
  335. package/node_modules/pino/test/fixtures/transport-main.js +1 -1
  336. package/node_modules/pino/test/fixtures/transport-transform.js +1 -1
  337. package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +1 -1
  338. package/node_modules/pino/test/fixtures/transport-worker-data.js +1 -1
  339. package/node_modules/pino/test/fixtures/transport-worker.js +2 -2
  340. package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +3 -3
  341. package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +2 -2
  342. package/node_modules/pino/test/fixtures/ts/transpile.cjs +1 -1
  343. package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +1 -1
  344. package/node_modules/pino/test/fixtures/ts/transport-main.ts +1 -1
  345. package/node_modules/pino/test/fixtures/ts/transport-worker.ts +1 -1
  346. package/node_modules/pino/test/formatters.test.js +46 -37
  347. package/node_modules/pino/test/helper.d.ts +1 -1
  348. package/node_modules/pino/test/helper.js +37 -10
  349. package/node_modules/pino/test/hooks.test.js +45 -28
  350. package/node_modules/pino/test/http.test.js +39 -67
  351. package/node_modules/pino/test/internals/version.test.js +11 -9
  352. package/node_modules/pino/test/is-level-enabled.test.js +66 -72
  353. package/node_modules/pino/test/levels.test.js +245 -141
  354. package/node_modules/pino/test/metadata.test.js +45 -31
  355. package/node_modules/pino/test/mixin-merge-strategy.test.js +9 -7
  356. package/node_modules/pino/test/mixin.test.js +63 -40
  357. package/node_modules/pino/test/multistream.test.js +174 -118
  358. package/node_modules/pino/test/redact.test.js +172 -126
  359. package/node_modules/pino/test/serializers.test.js +61 -57
  360. package/node_modules/pino/test/stdout-protection.test.js +14 -12
  361. package/node_modules/pino/test/syncfalse.test.js +29 -34
  362. package/node_modules/pino/test/timestamp-nano.test.js +37 -0
  363. package/node_modules/pino/test/timestamp.test.js +37 -34
  364. package/node_modules/pino/test/transport/big.test.js +11 -12
  365. package/node_modules/pino/test/transport/bundlers-support.test.js +15 -43
  366. package/node_modules/pino/test/transport/caller.test.js +9 -8
  367. package/node_modules/pino/test/transport/core.test.js +175 -145
  368. package/node_modules/pino/test/transport/core.transpiled.test.ts +17 -19
  369. package/node_modules/pino/test/transport/crash.test.js +36 -0
  370. package/node_modules/pino/test/transport/module-link.test.js +21 -19
  371. package/node_modules/pino/test/transport/pipeline.test.js +109 -8
  372. package/node_modules/pino/test/transport/repl.test.js +4 -3
  373. package/node_modules/pino/test/transport/{syncfalse.test.js → sync-false.test.js} +14 -12
  374. package/node_modules/pino/test/transport/sync-true.test.js +57 -0
  375. package/node_modules/pino/test/transport/targets.test.js +25 -5
  376. package/node_modules/pino/test/transport/uses-pino-config.test.js +16 -17
  377. package/node_modules/pino/test/transport-stream.test.js +40 -0
  378. package/node_modules/pino/test/types/{pino-import.test-d.ts → pino-import.test-d.cts} +4 -3
  379. package/node_modules/pino/test/types/pino-multistream.test-d.ts +1 -1
  380. package/node_modules/pino/test/types/pino-top-export.test-d.ts +1 -0
  381. package/node_modules/pino/test/types/pino-transport.test-d.ts +1 -1
  382. package/node_modules/pino/test/types/pino-type-only.test-d.ts +24 -6
  383. package/node_modules/pino/test/types/pino.test-d.ts +161 -6
  384. package/node_modules/pino/test/types/pino.ts +31 -19
  385. package/node_modules/pino/tsconfig.json +1 -1
  386. package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +2 -4
  387. package/node_modules/pino-abstract-transport/index.js +1 -1
  388. package/node_modules/pino-abstract-transport/package.json +2 -3
  389. package/node_modules/pino-abstract-transport/test/base.test.js +1 -1
  390. package/node_modules/pino-abstract-transport/test/worker.test.js +7 -14
  391. package/node_modules/pino-std-serializers/.github/workflows/ci.yml +5 -5
  392. package/node_modules/pino-std-serializers/Readme.md +1 -0
  393. package/node_modules/pino-std-serializers/package.json +9 -8
  394. package/node_modules/pino-std-serializers/test/err-with-cause.test.js +72 -88
  395. package/node_modules/pino-std-serializers/test/err.test.js +76 -91
  396. package/node_modules/pino-std-serializers/test/req.test.js +142 -98
  397. package/node_modules/pino-std-serializers/test/res.test.js +42 -31
  398. package/node_modules/process-warning/.github/dependabot.yml +1 -1
  399. package/node_modules/process-warning/.github/workflows/ci.yml +1 -2
  400. package/node_modules/process-warning/README.md +4 -4
  401. package/node_modules/process-warning/eslint.config.js +6 -0
  402. package/node_modules/process-warning/package.json +39 -8
  403. package/node_modules/process-warning/test/emit-interpolated-string.test.js +11 -6
  404. package/node_modules/process-warning/test/emit-once-only.test.js +11 -6
  405. package/node_modules/process-warning/test/emit-reset.test.js +10 -6
  406. package/node_modules/process-warning/test/emit-set.test.js +10 -5
  407. package/node_modules/process-warning/test/emit-unlimited.test.js +12 -7
  408. package/node_modules/process-warning/test/index.test.js +20 -20
  409. package/node_modules/process-warning/test/issue-88.test.js +8 -3
  410. package/node_modules/process-warning/test/jest.test.js +17 -15
  411. package/node_modules/process-warning/test/no-warnings.test.js +9 -9
  412. package/node_modules/process-warning/test/promise.js +10 -0
  413. package/node_modules/process-warning/types/index.d.ts +5 -5
  414. package/node_modules/semver/classes/range.js +1 -0
  415. package/node_modules/semver/classes/semver.js +19 -5
  416. package/node_modules/semver/internal/identifiers.js +4 -0
  417. package/node_modules/semver/package.json +3 -3
  418. package/node_modules/thread-stream/.github/workflows/ci.yml +4 -8
  419. package/node_modules/thread-stream/index.d.ts +4 -5
  420. package/node_modules/thread-stream/lib/worker.js +5 -2
  421. package/node_modules/thread-stream/package.json +6 -4
  422. package/node_modules/thread-stream/test/base.test.js +12 -0
  423. package/node_modules/thread-stream/test/never-drain.test.js +3 -1
  424. package/node_modules/thread-stream/test/pkg/pkg.test.js +2 -0
  425. package/node_modules/thread-stream/test/syntax-error.mjs +2 -0
  426. package/node_modules/thread-stream/tsconfig.json +8 -0
  427. package/node_modules/undici-types/agent.d.ts +1 -0
  428. package/node_modules/undici-types/diagnostics-channel.d.ts +0 -1
  429. package/node_modules/undici-types/errors.d.ts +5 -15
  430. package/node_modules/undici-types/eventsource.d.ts +6 -1
  431. package/node_modules/undici-types/index.d.ts +4 -1
  432. package/node_modules/undici-types/interceptors.d.ts +5 -0
  433. package/node_modules/undici-types/package.json +1 -1
  434. package/node_modules/undici-types/snapshot-agent.d.ts +5 -3
  435. package/node_modules/undici-types/webidl.d.ts +82 -21
  436. package/node_modules/yaml/browser/dist/compose/compose-collection.js +1 -1
  437. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +1 -1
  438. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +2 -2
  439. package/node_modules/yaml/browser/dist/errors.js +1 -1
  440. package/node_modules/yaml/browser/dist/nodes/Alias.js +1 -1
  441. package/node_modules/yaml/browser/dist/parse/parser.js +2 -2
  442. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +1 -1
  443. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
  444. package/node_modules/yaml/dist/compose/compose-collection.js +1 -1
  445. package/node_modules/yaml/dist/compose/resolve-block-seq.js +1 -1
  446. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +2 -2
  447. package/node_modules/yaml/dist/errors.js +1 -1
  448. package/node_modules/yaml/dist/nodes/Alias.js +1 -1
  449. package/node_modules/yaml/dist/parse/parser.js +2 -2
  450. package/node_modules/yaml/dist/stringify/stringifyNumber.js +1 -1
  451. package/node_modules/yaml/dist/stringify/stringifyPair.js +1 -1
  452. package/node_modules/yaml/package.json +4 -4
  453. package/package.json +3 -3
  454. package/node_modules/@contrast/protect/lib/input-analysis/install/koa-body5.js +0 -63
  455. package/node_modules/@contrast/protect/lib/input-analysis/install/koa-bodyparser4.js +0 -64
  456. package/node_modules/@contrast/route-coverage/lib/install/express/express4.js +0 -157
  457. package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +0 -538
  458. package/node_modules/abort-controller/LICENSE +0 -21
  459. package/node_modules/abort-controller/README.md +0 -98
  460. package/node_modules/abort-controller/browser.js +0 -13
  461. package/node_modules/abort-controller/browser.mjs +0 -11
  462. package/node_modules/abort-controller/dist/abort-controller.d.ts +0 -43
  463. package/node_modules/abort-controller/dist/abort-controller.js +0 -127
  464. package/node_modules/abort-controller/dist/abort-controller.js.map +0 -1
  465. package/node_modules/abort-controller/dist/abort-controller.mjs +0 -118
  466. package/node_modules/abort-controller/dist/abort-controller.mjs.map +0 -1
  467. package/node_modules/abort-controller/dist/abort-controller.umd.js +0 -5
  468. package/node_modules/abort-controller/dist/abort-controller.umd.js.map +0 -1
  469. package/node_modules/abort-controller/package.json +0 -97
  470. package/node_modules/abort-controller/polyfill.js +0 -21
  471. package/node_modules/abort-controller/polyfill.mjs +0 -19
  472. package/node_modules/base64-js/LICENSE +0 -21
  473. package/node_modules/base64-js/README.md +0 -34
  474. package/node_modules/base64-js/base64js.min.js +0 -1
  475. package/node_modules/base64-js/index.d.ts +0 -3
  476. package/node_modules/base64-js/index.js +0 -150
  477. package/node_modules/base64-js/package.json +0 -47
  478. package/node_modules/buffer/AUTHORS.md +0 -73
  479. package/node_modules/buffer/LICENSE +0 -21
  480. package/node_modules/buffer/README.md +0 -410
  481. package/node_modules/buffer/index.d.ts +0 -194
  482. package/node_modules/buffer/index.js +0 -2106
  483. package/node_modules/buffer/package.json +0 -93
  484. package/node_modules/event-target-shim/LICENSE +0 -22
  485. package/node_modules/event-target-shim/README.md +0 -293
  486. package/node_modules/event-target-shim/dist/event-target-shim.js +0 -871
  487. package/node_modules/event-target-shim/dist/event-target-shim.js.map +0 -1
  488. package/node_modules/event-target-shim/dist/event-target-shim.mjs +0 -862
  489. package/node_modules/event-target-shim/dist/event-target-shim.mjs.map +0 -1
  490. package/node_modules/event-target-shim/dist/event-target-shim.umd.js +0 -6
  491. package/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +0 -1
  492. package/node_modules/event-target-shim/index.d.ts +0 -399
  493. package/node_modules/event-target-shim/package.json +0 -82
  494. package/node_modules/events/.airtap.yml +0 -15
  495. package/node_modules/events/.github/FUNDING.yml +0 -12
  496. package/node_modules/events/.travis.yml +0 -18
  497. package/node_modules/events/History.md +0 -118
  498. package/node_modules/events/LICENSE +0 -22
  499. package/node_modules/events/Readme.md +0 -50
  500. package/node_modules/events/events.js +0 -497
  501. package/node_modules/events/package.json +0 -37
  502. package/node_modules/events/security.md +0 -10
  503. package/node_modules/events/tests/add-listeners.js +0 -111
  504. package/node_modules/events/tests/check-listener-leaks.js +0 -101
  505. package/node_modules/events/tests/common.js +0 -104
  506. package/node_modules/events/tests/errors.js +0 -13
  507. package/node_modules/events/tests/events-list.js +0 -28
  508. package/node_modules/events/tests/events-once.js +0 -234
  509. package/node_modules/events/tests/index.js +0 -64
  510. package/node_modules/events/tests/legacy-compat.js +0 -16
  511. package/node_modules/events/tests/listener-count.js +0 -37
  512. package/node_modules/events/tests/listeners-side-effects.js +0 -56
  513. package/node_modules/events/tests/listeners.js +0 -168
  514. package/node_modules/events/tests/max-listeners.js +0 -47
  515. package/node_modules/events/tests/method-names.js +0 -35
  516. package/node_modules/events/tests/modify-in-emit.js +0 -90
  517. package/node_modules/events/tests/num-args.js +0 -60
  518. package/node_modules/events/tests/once.js +0 -83
  519. package/node_modules/events/tests/prepend.js +0 -31
  520. package/node_modules/events/tests/remove-all-listeners.js +0 -133
  521. package/node_modules/events/tests/remove-listeners.js +0 -212
  522. package/node_modules/events/tests/set-max-listeners-side-effects.js +0 -31
  523. package/node_modules/events/tests/special-event-names.js +0 -45
  524. package/node_modules/events/tests/subclass.js +0 -66
  525. package/node_modules/events/tests/symbols.js +0 -25
  526. package/node_modules/fast-redact/.github/workflows/ci.yml +0 -37
  527. package/node_modules/fast-redact/LICENSE +0 -21
  528. package/node_modules/fast-redact/benchmark/index.js +0 -223
  529. package/node_modules/fast-redact/example/default-usage.js +0 -14
  530. package/node_modules/fast-redact/example/intermediate-wildcard-array.js +0 -11
  531. package/node_modules/fast-redact/example/multi-wildcard-array-depth.js +0 -11
  532. package/node_modules/fast-redact/example/multi-wildcard-array-end.js +0 -11
  533. package/node_modules/fast-redact/example/multi-wildcard-array.js +0 -11
  534. package/node_modules/fast-redact/example/serialize-false.js +0 -11
  535. package/node_modules/fast-redact/example/serialize-function.js +0 -4
  536. package/node_modules/fast-redact/example/top-wildcard-object.js +0 -9
  537. package/node_modules/fast-redact/index.js +0 -56
  538. package/node_modules/fast-redact/lib/modifiers.js +0 -291
  539. package/node_modules/fast-redact/lib/parse.js +0 -44
  540. package/node_modules/fast-redact/lib/redactor.js +0 -108
  541. package/node_modules/fast-redact/lib/restorer.js +0 -92
  542. package/node_modules/fast-redact/lib/rx.js +0 -16
  543. package/node_modules/fast-redact/lib/state.js +0 -20
  544. package/node_modules/fast-redact/lib/validator.js +0 -33
  545. package/node_modules/fast-redact/package.json +0 -50
  546. package/node_modules/fast-redact/readme.md +0 -282
  547. package/node_modules/fast-redact/test/index.js +0 -1502
  548. package/node_modules/ieee754/LICENSE +0 -11
  549. package/node_modules/ieee754/README.md +0 -51
  550. package/node_modules/ieee754/index.d.ts +0 -10
  551. package/node_modules/ieee754/index.js +0 -85
  552. package/node_modules/ieee754/package.json +0 -52
  553. package/node_modules/pino/.eslintignore +0 -2
  554. package/node_modules/pino/.eslintrc +0 -8
  555. package/node_modules/pino/.github/workflows/bench.yml +0 -61
  556. package/node_modules/pino/.github/workflows/ci.yml +0 -86
  557. package/node_modules/pino/.github/workflows/lock-threads.yml +0 -30
  558. package/node_modules/pino/.github/workflows/package-manager-ci.yml +0 -99
  559. package/node_modules/pino/.github/workflows/target-main.yml +0 -23
  560. package/node_modules/pino/.taprc.yaml +0 -8
  561. package/node_modules/pino/docsify/sidebar.md +0 -26
  562. package/node_modules/pino/favicon-16x16.png +0 -0
  563. package/node_modules/pino/favicon-32x32.png +0 -0
  564. package/node_modules/pino/lib/worker-pipeline.js +0 -38
  565. package/node_modules/pino/node_modules/sonic-boom/.eslintignore +0 -2
  566. package/node_modules/pino/node_modules/sonic-boom/.husky/pre-commit +0 -4
  567. package/node_modules/pino/node_modules/sonic-boom/.taprc.yaml +0 -11
  568. package/node_modules/pino/node_modules/sonic-boom/README.md +0 -151
  569. package/node_modules/pino/node_modules/sonic-boom/bench.js +0 -98
  570. package/node_modules/pino/node_modules/sonic-boom/check.js +0 -18
  571. package/node_modules/pino/node_modules/sonic-boom/example.js +0 -8
  572. package/node_modules/pino/node_modules/sonic-boom/fixtures/firehose.js +0 -22
  573. package/node_modules/pino/node_modules/sonic-boom/index.js +0 -690
  574. package/node_modules/pino/node_modules/sonic-boom/package.json +0 -50
  575. package/node_modules/pino/node_modules/sonic-boom/test/destroy.test.js +0 -49
  576. package/node_modules/pino/node_modules/sonic-boom/test/end.test.js +0 -98
  577. package/node_modules/pino/node_modules/sonic-boom/test/flush-sync.test.js +0 -140
  578. package/node_modules/pino/node_modules/sonic-boom/test/flush.test.js +0 -419
  579. package/node_modules/pino/node_modules/sonic-boom/test/fsync.test.js +0 -63
  580. package/node_modules/pino/node_modules/sonic-boom/test/helper.js +0 -42
  581. package/node_modules/pino/node_modules/sonic-boom/test/minlength.test.js +0 -35
  582. package/node_modules/pino/node_modules/sonic-boom/test/mode.test.js +0 -116
  583. package/node_modules/pino/node_modules/sonic-boom/test/reopen.test.js +0 -239
  584. package/node_modules/pino/node_modules/sonic-boom/test/retry.test.js +0 -414
  585. package/node_modules/pino/node_modules/sonic-boom/test/sync.test.js +0 -261
  586. package/node_modules/pino/node_modules/sonic-boom/test/write.test.js +0 -465
  587. package/node_modules/pino/node_modules/sonic-boom/types/index.d.ts +0 -62
  588. package/node_modules/pino/node_modules/sonic-boom/types/tests/test.ts +0 -4
  589. package/node_modules/pino/pino-banner.png +0 -0
  590. package/node_modules/pino/pino-logo-hire.png +0 -0
  591. package/node_modules/pino/pino-tree.png +0 -0
  592. package/node_modules/pino/pretty-demo.png +0 -0
  593. package/node_modules/pino/test/errorKey.test.js +0 -34
  594. package/node_modules/pino/test/transport/core.test.ts +0 -236
  595. package/node_modules/pino-std-serializers/.taprc +0 -2
  596. package/node_modules/process/.eslintrc +0 -21
  597. package/node_modules/process/LICENSE +0 -22
  598. package/node_modules/process/README.md +0 -26
  599. package/node_modules/process/browser.js +0 -184
  600. package/node_modules/process/index.js +0 -2
  601. package/node_modules/process/package.json +0 -27
  602. package/node_modules/process/test.js +0 -199
  603. package/node_modules/process-warning/.taprc +0 -2
  604. package/node_modules/readable-stream/LICENSE +0 -47
  605. package/node_modules/readable-stream/README.md +0 -116
  606. package/node_modules/readable-stream/lib/_stream_duplex.js +0 -4
  607. package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -4
  608. package/node_modules/readable-stream/lib/_stream_readable.js +0 -4
  609. package/node_modules/readable-stream/lib/_stream_transform.js +0 -4
  610. package/node_modules/readable-stream/lib/_stream_writable.js +0 -4
  611. package/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +0 -52
  612. package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -157
  613. package/node_modules/readable-stream/lib/internal/streams/compose.js +0 -194
  614. package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -290
  615. package/node_modules/readable-stream/lib/internal/streams/duplex.js +0 -143
  616. package/node_modules/readable-stream/lib/internal/streams/duplexify.js +0 -378
  617. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -286
  618. package/node_modules/readable-stream/lib/internal/streams/from.js +0 -98
  619. package/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +0 -51
  620. package/node_modules/readable-stream/lib/internal/streams/legacy.js +0 -89
  621. package/node_modules/readable-stream/lib/internal/streams/operators.js +0 -457
  622. package/node_modules/readable-stream/lib/internal/streams/passthrough.js +0 -39
  623. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -471
  624. package/node_modules/readable-stream/lib/internal/streams/readable.js +0 -1290
  625. package/node_modules/readable-stream/lib/internal/streams/state.js +0 -39
  626. package/node_modules/readable-stream/lib/internal/streams/transform.js +0 -180
  627. package/node_modules/readable-stream/lib/internal/streams/utils.js +0 -327
  628. package/node_modules/readable-stream/lib/internal/streams/writable.js +0 -819
  629. package/node_modules/readable-stream/lib/internal/validators.js +0 -530
  630. package/node_modules/readable-stream/lib/ours/browser.js +0 -35
  631. package/node_modules/readable-stream/lib/ours/errors.js +0 -343
  632. package/node_modules/readable-stream/lib/ours/index.js +0 -65
  633. package/node_modules/readable-stream/lib/ours/primordials.js +0 -124
  634. package/node_modules/readable-stream/lib/ours/util/inspect.js +0 -55
  635. package/node_modules/readable-stream/lib/ours/util.js +0 -148
  636. package/node_modules/readable-stream/lib/stream/promises.js +0 -43
  637. package/node_modules/readable-stream/lib/stream.js +0 -143
  638. package/node_modules/readable-stream/package.json +0 -88
  639. package/node_modules/safe-buffer/LICENSE +0 -21
  640. package/node_modules/safe-buffer/README.md +0 -584
  641. package/node_modules/safe-buffer/index.d.ts +0 -187
  642. package/node_modules/safe-buffer/index.js +0 -65
  643. package/node_modules/safe-buffer/package.json +0 -51
  644. package/node_modules/string_decoder/LICENSE +0 -48
  645. package/node_modules/string_decoder/README.md +0 -47
  646. package/node_modules/string_decoder/lib/string_decoder.js +0 -296
  647. package/node_modules/string_decoder/package.json +0 -34
@@ -17,6 +17,7 @@
17
17
  * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/crypto.js)
18
18
  */
19
19
  declare module "crypto" {
20
+ import { NonSharedBuffer } from "node:buffer";
20
21
  import * as stream from "node:stream";
21
22
  import { PeerCertificate } from "node:tls";
22
23
  /**
@@ -44,7 +45,7 @@ declare module "crypto" {
44
45
  * @param encoding The `encoding` of the `spkac` string.
45
46
  * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
46
47
  */
47
- static exportChallenge(spkac: BinaryLike): Buffer;
48
+ static exportChallenge(spkac: BinaryLike): NonSharedBuffer;
48
49
  /**
49
50
  * ```js
50
51
  * const { Certificate } = await import('node:crypto');
@@ -57,7 +58,7 @@ declare module "crypto" {
57
58
  * @param encoding The `encoding` of the `spkac` string.
58
59
  * @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
59
60
  */
60
- static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
61
+ static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
61
62
  /**
62
63
  * ```js
63
64
  * import { Buffer } from 'node:buffer';
@@ -78,7 +79,7 @@ declare module "crypto" {
78
79
  * @returns The challenge component of the `spkac` data structure,
79
80
  * which includes a public key and a challenge.
80
81
  */
81
- exportChallenge(spkac: BinaryLike): Buffer;
82
+ exportChallenge(spkac: BinaryLike): NonSharedBuffer;
82
83
  /**
83
84
  * @deprecated
84
85
  * @param spkac
@@ -86,7 +87,7 @@ declare module "crypto" {
86
87
  * @returns The public key component of the `spkac` data structure,
87
88
  * which includes a public key and a challenge.
88
89
  */
89
- exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
90
+ exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
90
91
  /**
91
92
  * @deprecated
92
93
  * @param spkac
@@ -402,7 +403,7 @@ declare module "crypto" {
402
403
  * @since v0.1.92
403
404
  * @param encoding The `encoding` of the return value.
404
405
  */
405
- digest(): Buffer;
406
+ digest(): NonSharedBuffer;
406
407
  digest(encoding: BinaryToTextEncoding): string;
407
408
  }
408
409
  /**
@@ -496,7 +497,7 @@ declare module "crypto" {
496
497
  * @since v0.1.94
497
498
  * @param encoding The `encoding` of the return value.
498
499
  */
499
- digest(): Buffer;
500
+ digest(): NonSharedBuffer;
500
501
  digest(encoding: BinaryToTextEncoding): string;
501
502
  }
502
503
  type KeyObjectType = "secret" | "public" | "private";
@@ -510,50 +511,50 @@ declare module "crypto" {
510
511
  format: "jwk";
511
512
  }
512
513
  interface JsonWebKey {
513
- crv?: string | undefined;
514
- d?: string | undefined;
515
- dp?: string | undefined;
516
- dq?: string | undefined;
517
- e?: string | undefined;
518
- k?: string | undefined;
519
- kty?: string | undefined;
520
- n?: string | undefined;
521
- p?: string | undefined;
522
- q?: string | undefined;
523
- qi?: string | undefined;
524
- x?: string | undefined;
525
- y?: string | undefined;
514
+ crv?: string;
515
+ d?: string;
516
+ dp?: string;
517
+ dq?: string;
518
+ e?: string;
519
+ k?: string;
520
+ kty?: string;
521
+ n?: string;
522
+ p?: string;
523
+ q?: string;
524
+ qi?: string;
525
+ x?: string;
526
+ y?: string;
526
527
  [key: string]: unknown;
527
528
  }
528
529
  interface AsymmetricKeyDetails {
529
530
  /**
530
531
  * Key size in bits (RSA, DSA).
531
532
  */
532
- modulusLength?: number | undefined;
533
+ modulusLength?: number;
533
534
  /**
534
535
  * Public exponent (RSA).
535
536
  */
536
- publicExponent?: bigint | undefined;
537
+ publicExponent?: bigint;
537
538
  /**
538
539
  * Name of the message digest (RSA-PSS).
539
540
  */
540
- hashAlgorithm?: string | undefined;
541
+ hashAlgorithm?: string;
541
542
  /**
542
543
  * Name of the message digest used by MGF1 (RSA-PSS).
543
544
  */
544
- mgf1HashAlgorithm?: string | undefined;
545
+ mgf1HashAlgorithm?: string;
545
546
  /**
546
547
  * Minimal salt length in bytes (RSA-PSS).
547
548
  */
548
- saltLength?: number | undefined;
549
+ saltLength?: number;
549
550
  /**
550
551
  * Size of q in bits (DSA).
551
552
  */
552
- divisorLength?: number | undefined;
553
+ divisorLength?: number;
553
554
  /**
554
555
  * Name of the curve (EC).
555
556
  */
556
- namedCurve?: string | undefined;
557
+ namedCurve?: string;
557
558
  }
558
559
  /**
559
560
  * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
@@ -591,27 +592,14 @@ declare module "crypto" {
591
592
  */
592
593
  static from(key: webcrypto.CryptoKey): KeyObject;
593
594
  /**
594
- * For asymmetric keys, this property represents the type of the key. Supported key
595
- * types are:
596
- *
597
- * * `'rsa'` (OID 1.2.840.113549.1.1.1)
598
- * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
599
- * * `'dsa'` (OID 1.2.840.10040.4.1)
600
- * * `'ec'` (OID 1.2.840.10045.2.1)
601
- * * `'x25519'` (OID 1.3.101.110)
602
- * * `'x448'` (OID 1.3.101.111)
603
- * * `'ed25519'` (OID 1.3.101.112)
604
- * * `'ed448'` (OID 1.3.101.113)
605
- * * `'dh'` (OID 1.2.840.113549.1.3.1)
606
- * * `'ml-dsa-44'` (OID 2.16.840.1.101.3.4.3.17)
607
- * * `'ml-dsa-65'` (OID 2.16.840.1.101.3.4.3.18)
608
- * * `'ml-dsa-87'` (OID 2.16.840.1.101.3.4.3.19)
595
+ * For asymmetric keys, this property represents the type of the key. See the
596
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
609
597
  *
610
598
  * This property is `undefined` for unrecognized `KeyObject` types and symmetric
611
599
  * keys.
612
600
  * @since v11.6.0
613
601
  */
614
- asymmetricKeyType?: KeyType | undefined;
602
+ asymmetricKeyType?: KeyType;
615
603
  /**
616
604
  * This property exists only on asymmetric keys. Depending on the type of the key,
617
605
  * this object contains information about the key. None of the information obtained
@@ -625,7 +613,7 @@ declare module "crypto" {
625
613
  * Other key details might be exposed via this API using additional attributes.
626
614
  * @since v15.7.0
627
615
  */
628
- asymmetricKeyDetails?: AsymmetricKeyDetails | undefined;
616
+ asymmetricKeyDetails?: AsymmetricKeyDetails;
629
617
  /**
630
618
  * For symmetric keys, the following encoding options can be used:
631
619
  *
@@ -649,8 +637,8 @@ declare module "crypto" {
649
637
  * PKCS#1 and SEC1 encryption.
650
638
  * @since v11.6.0
651
639
  */
652
- export(options: KeyExportOptions<"pem">): string | Buffer;
653
- export(options?: KeyExportOptions<"der">): Buffer;
640
+ export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
641
+ export(options?: KeyExportOptions<"der">): NonSharedBuffer;
654
642
  export(options?: JwkKeyExportOptions): JsonWebKey;
655
643
  /**
656
644
  * Returns `true` or `false` depending on whether the keys have exactly the same
@@ -664,7 +652,7 @@ declare module "crypto" {
664
652
  * property is `undefined` for asymmetric keys.
665
653
  * @since v11.6.0
666
654
  */
667
- symmetricKeySize?: number | undefined;
655
+ symmetricKeySize?: number;
668
656
  /**
669
657
  * Converts a `KeyObject` instance to a `CryptoKey`.
670
658
  * @since 22.10.0
@@ -899,8 +887,8 @@ declare module "crypto" {
899
887
  * @param inputEncoding The `encoding` of the data.
900
888
  * @param outputEncoding The `encoding` of the return value.
901
889
  */
902
- update(data: BinaryLike): Buffer;
903
- update(data: string, inputEncoding: Encoding): Buffer;
890
+ update(data: BinaryLike): NonSharedBuffer;
891
+ update(data: string, inputEncoding: Encoding): NonSharedBuffer;
904
892
  update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
905
893
  update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
906
894
  /**
@@ -911,7 +899,7 @@ declare module "crypto" {
911
899
  * @param outputEncoding The `encoding` of the return value.
912
900
  * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
913
901
  */
914
- final(): Buffer;
902
+ final(): NonSharedBuffer;
915
903
  final(outputEncoding: BufferEncoding): string;
916
904
  /**
917
905
  * When using block encryption algorithms, the `Cipheriv` class will automatically
@@ -937,7 +925,7 @@ declare module "crypto" {
937
925
  plaintextLength: number;
938
926
  },
939
927
  ): this;
940
- getAuthTag(): Buffer;
928
+ getAuthTag(): NonSharedBuffer;
941
929
  }
942
930
  interface CipherGCM extends Cipheriv {
943
931
  setAAD(
@@ -946,7 +934,7 @@ declare module "crypto" {
946
934
  plaintextLength: number;
947
935
  },
948
936
  ): this;
949
- getAuthTag(): Buffer;
937
+ getAuthTag(): NonSharedBuffer;
950
938
  }
951
939
  interface CipherOCB extends Cipheriv {
952
940
  setAAD(
@@ -955,7 +943,7 @@ declare module "crypto" {
955
943
  plaintextLength: number;
956
944
  },
957
945
  ): this;
958
- getAuthTag(): Buffer;
946
+ getAuthTag(): NonSharedBuffer;
959
947
  }
960
948
  interface CipherChaCha20Poly1305 extends Cipheriv {
961
949
  setAAD(
@@ -964,7 +952,7 @@ declare module "crypto" {
964
952
  plaintextLength: number;
965
953
  },
966
954
  ): this;
967
- getAuthTag(): Buffer;
955
+ getAuthTag(): NonSharedBuffer;
968
956
  }
969
957
  /**
970
958
  * Creates and returns a `Decipheriv` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
@@ -1149,8 +1137,8 @@ declare module "crypto" {
1149
1137
  * @param inputEncoding The `encoding` of the `data` string.
1150
1138
  * @param outputEncoding The `encoding` of the return value.
1151
1139
  */
1152
- update(data: NodeJS.ArrayBufferView): Buffer;
1153
- update(data: string, inputEncoding: Encoding): Buffer;
1140
+ update(data: NodeJS.ArrayBufferView): NonSharedBuffer;
1141
+ update(data: string, inputEncoding: Encoding): NonSharedBuffer;
1154
1142
  update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
1155
1143
  update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
1156
1144
  /**
@@ -1161,7 +1149,7 @@ declare module "crypto" {
1161
1149
  * @param outputEncoding The `encoding` of the return value.
1162
1150
  * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
1163
1151
  */
1164
- final(): Buffer;
1152
+ final(): NonSharedBuffer;
1165
1153
  final(outputEncoding: BufferEncoding): string;
1166
1154
  /**
1167
1155
  * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
@@ -1323,6 +1311,7 @@ declare module "crypto" {
1323
1311
  * @since v0.1.92
1324
1312
  * @param options `stream.Writable` options
1325
1313
  */
1314
+ // TODO: signing algorithm type
1326
1315
  function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
1327
1316
  type DSAEncoding = "der" | "ieee-p1363";
1328
1317
  interface SigningOptions {
@@ -1332,6 +1321,7 @@ declare module "crypto" {
1332
1321
  padding?: number | undefined;
1333
1322
  saltLength?: number | undefined;
1334
1323
  dsaEncoding?: DSAEncoding | undefined;
1324
+ context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
1335
1325
  }
1336
1326
  interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
1337
1327
  interface SignKeyObjectInput extends SigningOptions {
@@ -1433,7 +1423,7 @@ declare module "crypto" {
1433
1423
  * called. Multiple calls to `sign.sign()` will result in an error being thrown.
1434
1424
  * @since v0.1.92
1435
1425
  */
1436
- sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): Buffer;
1426
+ sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
1437
1427
  sign(
1438
1428
  privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
1439
1429
  outputFormat: BinaryToTextEncoding,
@@ -1592,7 +1582,7 @@ declare module "crypto" {
1592
1582
  * @since v0.5.0
1593
1583
  * @param encoding The `encoding` of the return value.
1594
1584
  */
1595
- generateKeys(): Buffer;
1585
+ generateKeys(): NonSharedBuffer;
1596
1586
  generateKeys(encoding: BinaryToTextEncoding): string;
1597
1587
  /**
1598
1588
  * Computes the shared secret using `otherPublicKey` as the other
@@ -1607,8 +1597,16 @@ declare module "crypto" {
1607
1597
  * @param inputEncoding The `encoding` of an `otherPublicKey` string.
1608
1598
  * @param outputEncoding The `encoding` of the return value.
1609
1599
  */
1610
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
1611
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
1600
+ computeSecret(
1601
+ otherPublicKey: NodeJS.ArrayBufferView,
1602
+ inputEncoding?: null,
1603
+ outputEncoding?: null,
1604
+ ): NonSharedBuffer;
1605
+ computeSecret(
1606
+ otherPublicKey: string,
1607
+ inputEncoding: BinaryToTextEncoding,
1608
+ outputEncoding?: null,
1609
+ ): NonSharedBuffer;
1612
1610
  computeSecret(
1613
1611
  otherPublicKey: NodeJS.ArrayBufferView,
1614
1612
  inputEncoding: null,
@@ -1626,7 +1624,7 @@ declare module "crypto" {
1626
1624
  * @since v0.5.0
1627
1625
  * @param encoding The `encoding` of the return value.
1628
1626
  */
1629
- getPrime(): Buffer;
1627
+ getPrime(): NonSharedBuffer;
1630
1628
  getPrime(encoding: BinaryToTextEncoding): string;
1631
1629
  /**
1632
1630
  * Returns the Diffie-Hellman generator in the specified `encoding`.
@@ -1635,7 +1633,7 @@ declare module "crypto" {
1635
1633
  * @since v0.5.0
1636
1634
  * @param encoding The `encoding` of the return value.
1637
1635
  */
1638
- getGenerator(): Buffer;
1636
+ getGenerator(): NonSharedBuffer;
1639
1637
  getGenerator(encoding: BinaryToTextEncoding): string;
1640
1638
  /**
1641
1639
  * Returns the Diffie-Hellman public key in the specified `encoding`.
@@ -1644,7 +1642,7 @@ declare module "crypto" {
1644
1642
  * @since v0.5.0
1645
1643
  * @param encoding The `encoding` of the return value.
1646
1644
  */
1647
- getPublicKey(): Buffer;
1645
+ getPublicKey(): NonSharedBuffer;
1648
1646
  getPublicKey(encoding: BinaryToTextEncoding): string;
1649
1647
  /**
1650
1648
  * Returns the Diffie-Hellman private key in the specified `encoding`.
@@ -1653,7 +1651,7 @@ declare module "crypto" {
1653
1651
  * @since v0.5.0
1654
1652
  * @param encoding The `encoding` of the return value.
1655
1653
  */
1656
- getPrivateKey(): Buffer;
1654
+ getPrivateKey(): NonSharedBuffer;
1657
1655
  getPrivateKey(encoding: BinaryToTextEncoding): string;
1658
1656
  /**
1659
1657
  * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
@@ -1797,7 +1795,7 @@ declare module "crypto" {
1797
1795
  iterations: number,
1798
1796
  keylen: number,
1799
1797
  digest: string,
1800
- callback: (err: Error | null, derivedKey: Buffer) => void,
1798
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
1801
1799
  ): void;
1802
1800
  /**
1803
1801
  * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
@@ -1834,7 +1832,7 @@ declare module "crypto" {
1834
1832
  iterations: number,
1835
1833
  keylen: number,
1836
1834
  digest: string,
1837
- ): Buffer;
1835
+ ): NonSharedBuffer;
1838
1836
  /**
1839
1837
  * Generates cryptographically strong pseudorandom data. The `size` argument
1840
1838
  * is a number indicating the number of bytes to generate.
@@ -1887,10 +1885,10 @@ declare module "crypto" {
1887
1885
  * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
1888
1886
  * @return if the `callback` function is not provided.
1889
1887
  */
1890
- function randomBytes(size: number): Buffer;
1891
- function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
1892
- function pseudoRandomBytes(size: number): Buffer;
1893
- function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
1888
+ function randomBytes(size: number): NonSharedBuffer;
1889
+ function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
1890
+ function pseudoRandomBytes(size: number): NonSharedBuffer;
1891
+ function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
1894
1892
  /**
1895
1893
  * Return a random integer `n` such that `min <= n < max`. This
1896
1894
  * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
@@ -2120,14 +2118,14 @@ declare module "crypto" {
2120
2118
  password: BinaryLike,
2121
2119
  salt: BinaryLike,
2122
2120
  keylen: number,
2123
- callback: (err: Error | null, derivedKey: Buffer) => void,
2121
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
2124
2122
  ): void;
2125
2123
  function scrypt(
2126
2124
  password: BinaryLike,
2127
2125
  salt: BinaryLike,
2128
2126
  keylen: number,
2129
2127
  options: ScryptOptions,
2130
- callback: (err: Error | null, derivedKey: Buffer) => void,
2128
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
2131
2129
  ): void;
2132
2130
  /**
2133
2131
  * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
@@ -2159,7 +2157,12 @@ declare module "crypto" {
2159
2157
  * ```
2160
2158
  * @since v10.5.0
2161
2159
  */
2162
- function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
2160
+ function scryptSync(
2161
+ password: BinaryLike,
2162
+ salt: BinaryLike,
2163
+ keylen: number,
2164
+ options?: ScryptOptions,
2165
+ ): NonSharedBuffer;
2163
2166
  interface RsaPublicKey {
2164
2167
  key: KeyLike;
2165
2168
  padding?: number | undefined;
@@ -2188,7 +2191,7 @@ declare module "crypto" {
2188
2191
  function publicEncrypt(
2189
2192
  key: RsaPublicKey | RsaPrivateKey | KeyLike,
2190
2193
  buffer: NodeJS.ArrayBufferView | string,
2191
- ): Buffer;
2194
+ ): NonSharedBuffer;
2192
2195
  /**
2193
2196
  * Decrypts `buffer` with `key`.`buffer` was previously encrypted using
2194
2197
  * the corresponding private key, for example using {@link privateEncrypt}.
@@ -2203,7 +2206,7 @@ declare module "crypto" {
2203
2206
  function publicDecrypt(
2204
2207
  key: RsaPublicKey | RsaPrivateKey | KeyLike,
2205
2208
  buffer: NodeJS.ArrayBufferView | string,
2206
- ): Buffer;
2209
+ ): NonSharedBuffer;
2207
2210
  /**
2208
2211
  * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
2209
2212
  * the corresponding public key, for example using {@link publicEncrypt}.
@@ -2212,7 +2215,10 @@ declare module "crypto" {
2212
2215
  * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
2213
2216
  * @since v0.11.14
2214
2217
  */
2215
- function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): Buffer;
2218
+ function privateDecrypt(
2219
+ privateKey: RsaPrivateKey | KeyLike,
2220
+ buffer: NodeJS.ArrayBufferView | string,
2221
+ ): NonSharedBuffer;
2216
2222
  /**
2217
2223
  * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
2218
2224
  * the corresponding public key, for example using {@link publicDecrypt}.
@@ -2221,7 +2227,10 @@ declare module "crypto" {
2221
2227
  * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
2222
2228
  * @since v1.1.0
2223
2229
  */
2224
- function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): Buffer;
2230
+ function privateEncrypt(
2231
+ privateKey: RsaPrivateKey | KeyLike,
2232
+ buffer: NodeJS.ArrayBufferView | string,
2233
+ ): NonSharedBuffer;
2225
2234
  /**
2226
2235
  * ```js
2227
2236
  * const {
@@ -2350,7 +2359,7 @@ declare module "crypto" {
2350
2359
  inputEncoding?: BinaryToTextEncoding,
2351
2360
  outputEncoding?: "latin1" | "hex" | "base64" | "base64url",
2352
2361
  format?: "uncompressed" | "compressed" | "hybrid",
2353
- ): Buffer | string;
2362
+ ): NonSharedBuffer | string;
2354
2363
  /**
2355
2364
  * Generates private and public EC Diffie-Hellman key values, and returns
2356
2365
  * the public key in the specified `format` and `encoding`. This key should be
@@ -2363,7 +2372,7 @@ declare module "crypto" {
2363
2372
  * @param encoding The `encoding` of the return value.
2364
2373
  * @param [format='uncompressed']
2365
2374
  */
2366
- generateKeys(): Buffer;
2375
+ generateKeys(): NonSharedBuffer;
2367
2376
  generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
2368
2377
  /**
2369
2378
  * Computes the shared secret using `otherPublicKey` as the other
@@ -2382,8 +2391,8 @@ declare module "crypto" {
2382
2391
  * @param inputEncoding The `encoding` of the `otherPublicKey` string.
2383
2392
  * @param outputEncoding The `encoding` of the return value.
2384
2393
  */
2385
- computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
2386
- computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
2394
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer;
2395
+ computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer;
2387
2396
  computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
2388
2397
  computeSecret(
2389
2398
  otherPublicKey: string,
@@ -2397,7 +2406,7 @@ declare module "crypto" {
2397
2406
  * @param encoding The `encoding` of the return value.
2398
2407
  * @return The EC Diffie-Hellman in the specified `encoding`.
2399
2408
  */
2400
- getPrivateKey(): Buffer;
2409
+ getPrivateKey(): NonSharedBuffer;
2401
2410
  getPrivateKey(encoding: BinaryToTextEncoding): string;
2402
2411
  /**
2403
2412
  * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
@@ -2409,7 +2418,7 @@ declare module "crypto" {
2409
2418
  * @param [format='uncompressed']
2410
2419
  * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
2411
2420
  */
2412
- getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer;
2421
+ getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
2413
2422
  getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
2414
2423
  /**
2415
2424
  * Sets the EC Diffie-Hellman private key.
@@ -2460,17 +2469,33 @@ declare module "crypto" {
2460
2469
  */
2461
2470
  function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
2462
2471
  type KeyType =
2463
- | "rsa"
2464
- | "rsa-pss"
2472
+ | "dh"
2465
2473
  | "dsa"
2466
2474
  | "ec"
2467
2475
  | "ed25519"
2468
2476
  | "ed448"
2469
- | "x25519"
2470
- | "x448"
2471
2477
  | "ml-dsa-44"
2472
2478
  | "ml-dsa-65"
2473
- | "ml-dsa-87";
2479
+ | "ml-dsa-87"
2480
+ | "ml-kem-1024"
2481
+ | "ml-kem-512"
2482
+ | "ml-kem-768"
2483
+ | "rsa-pss"
2484
+ | "rsa"
2485
+ | "slh-dsa-sha2-128f"
2486
+ | "slh-dsa-sha2-128s"
2487
+ | "slh-dsa-sha2-192f"
2488
+ | "slh-dsa-sha2-192s"
2489
+ | "slh-dsa-sha2-256f"
2490
+ | "slh-dsa-sha2-256s"
2491
+ | "slh-dsa-shake-128f"
2492
+ | "slh-dsa-shake-128s"
2493
+ | "slh-dsa-shake-192f"
2494
+ | "slh-dsa-shake-192s"
2495
+ | "slh-dsa-shake-256f"
2496
+ | "slh-dsa-shake-256s"
2497
+ | "x25519"
2498
+ | "x448";
2474
2499
  type KeyFormat = "pem" | "der" | "jwk";
2475
2500
  interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
2476
2501
  format: T;
@@ -2486,6 +2511,8 @@ declare module "crypto" {
2486
2511
  interface X25519KeyPairKeyObjectOptions {}
2487
2512
  interface X448KeyPairKeyObjectOptions {}
2488
2513
  interface MLDSAKeyPairKeyObjectOptions {}
2514
+ interface MLKEMKeyPairKeyObjectOptions {}
2515
+ interface SLHDSAKeyPairKeyObjectOptions {}
2489
2516
  interface ECKeyPairKeyObjectOptions {
2490
2517
  /**
2491
2518
  * Name of the curve to use
@@ -2520,15 +2547,15 @@ declare module "crypto" {
2520
2547
  /**
2521
2548
  * Name of the message digest
2522
2549
  */
2523
- hashAlgorithm?: string;
2550
+ hashAlgorithm?: string | undefined;
2524
2551
  /**
2525
2552
  * Name of the message digest used by MGF1
2526
2553
  */
2527
- mgf1HashAlgorithm?: string;
2554
+ mgf1HashAlgorithm?: string | undefined;
2528
2555
  /**
2529
2556
  * Minimal salt length in bytes
2530
2557
  */
2531
- saltLength?: string;
2558
+ saltLength?: string | undefined;
2532
2559
  }
2533
2560
  interface DSAKeyPairKeyObjectOptions {
2534
2561
  /**
@@ -2571,15 +2598,15 @@ declare module "crypto" {
2571
2598
  /**
2572
2599
  * Name of the message digest
2573
2600
  */
2574
- hashAlgorithm?: string;
2601
+ hashAlgorithm?: string | undefined;
2575
2602
  /**
2576
2603
  * Name of the message digest used by MGF1
2577
2604
  */
2578
- mgf1HashAlgorithm?: string;
2605
+ mgf1HashAlgorithm?: string | undefined;
2579
2606
  /**
2580
2607
  * Minimal salt length in bytes
2581
2608
  */
2582
- saltLength?: string;
2609
+ saltLength?: string | undefined;
2583
2610
  publicKeyEncoding: {
2584
2611
  type: "spki";
2585
2612
  format: PubF;
@@ -2659,6 +2686,24 @@ declare module "crypto" {
2659
2686
  type: "pkcs8";
2660
2687
  };
2661
2688
  }
2689
+ interface MLKEMKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2690
+ publicKeyEncoding: {
2691
+ type: "spki";
2692
+ format: PubF;
2693
+ };
2694
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2695
+ type: "pkcs8";
2696
+ };
2697
+ }
2698
+ interface SLHDSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2699
+ publicKeyEncoding: {
2700
+ type: "spki";
2701
+ format: PubF;
2702
+ };
2703
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2704
+ type: "pkcs8";
2705
+ };
2706
+ }
2662
2707
  interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
2663
2708
  publicKey: T1;
2664
2709
  privateKey: T2;
@@ -2702,8 +2747,8 @@ declare module "crypto" {
2702
2747
  * When PEM encoding was selected, the respective key will be a string, otherwise
2703
2748
  * it will be a buffer containing the data encoded as DER.
2704
2749
  * @since v10.12.0
2705
- * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`,
2706
- * `'ed448'`, `'x25519'`, `'x448'`, `'dh'`, `'ml-dsa-44'`, `'ml-dsa-65'`, or `'ml-dsa-87'`.
2750
+ * @param type The asymmetric key type to generate. See the
2751
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
2707
2752
  */
2708
2753
  function generateKeyPairSync(
2709
2754
  type: "rsa",
@@ -2712,15 +2757,15 @@ declare module "crypto" {
2712
2757
  function generateKeyPairSync(
2713
2758
  type: "rsa",
2714
2759
  options: RSAKeyPairOptions<"pem", "der">,
2715
- ): KeyPairSyncResult<string, Buffer>;
2760
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2716
2761
  function generateKeyPairSync(
2717
2762
  type: "rsa",
2718
2763
  options: RSAKeyPairOptions<"der", "pem">,
2719
- ): KeyPairSyncResult<Buffer, string>;
2764
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2720
2765
  function generateKeyPairSync(
2721
2766
  type: "rsa",
2722
2767
  options: RSAKeyPairOptions<"der", "der">,
2723
- ): KeyPairSyncResult<Buffer, Buffer>;
2768
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2724
2769
  function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2725
2770
  function generateKeyPairSync(
2726
2771
  type: "rsa-pss",
@@ -2729,15 +2774,15 @@ declare module "crypto" {
2729
2774
  function generateKeyPairSync(
2730
2775
  type: "rsa-pss",
2731
2776
  options: RSAPSSKeyPairOptions<"pem", "der">,
2732
- ): KeyPairSyncResult<string, Buffer>;
2777
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2733
2778
  function generateKeyPairSync(
2734
2779
  type: "rsa-pss",
2735
2780
  options: RSAPSSKeyPairOptions<"der", "pem">,
2736
- ): KeyPairSyncResult<Buffer, string>;
2781
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2737
2782
  function generateKeyPairSync(
2738
2783
  type: "rsa-pss",
2739
2784
  options: RSAPSSKeyPairOptions<"der", "der">,
2740
- ): KeyPairSyncResult<Buffer, Buffer>;
2785
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2741
2786
  function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2742
2787
  function generateKeyPairSync(
2743
2788
  type: "dsa",
@@ -2746,15 +2791,15 @@ declare module "crypto" {
2746
2791
  function generateKeyPairSync(
2747
2792
  type: "dsa",
2748
2793
  options: DSAKeyPairOptions<"pem", "der">,
2749
- ): KeyPairSyncResult<string, Buffer>;
2794
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2750
2795
  function generateKeyPairSync(
2751
2796
  type: "dsa",
2752
2797
  options: DSAKeyPairOptions<"der", "pem">,
2753
- ): KeyPairSyncResult<Buffer, string>;
2798
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2754
2799
  function generateKeyPairSync(
2755
2800
  type: "dsa",
2756
2801
  options: DSAKeyPairOptions<"der", "der">,
2757
- ): KeyPairSyncResult<Buffer, Buffer>;
2802
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2758
2803
  function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2759
2804
  function generateKeyPairSync(
2760
2805
  type: "ec",
@@ -2763,15 +2808,15 @@ declare module "crypto" {
2763
2808
  function generateKeyPairSync(
2764
2809
  type: "ec",
2765
2810
  options: ECKeyPairOptions<"pem", "der">,
2766
- ): KeyPairSyncResult<string, Buffer>;
2811
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2767
2812
  function generateKeyPairSync(
2768
2813
  type: "ec",
2769
2814
  options: ECKeyPairOptions<"der", "pem">,
2770
- ): KeyPairSyncResult<Buffer, string>;
2815
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2771
2816
  function generateKeyPairSync(
2772
2817
  type: "ec",
2773
2818
  options: ECKeyPairOptions<"der", "der">,
2774
- ): KeyPairSyncResult<Buffer, Buffer>;
2819
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2775
2820
  function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2776
2821
  function generateKeyPairSync(
2777
2822
  type: "ed25519",
@@ -2780,15 +2825,15 @@ declare module "crypto" {
2780
2825
  function generateKeyPairSync(
2781
2826
  type: "ed25519",
2782
2827
  options: ED25519KeyPairOptions<"pem", "der">,
2783
- ): KeyPairSyncResult<string, Buffer>;
2828
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2784
2829
  function generateKeyPairSync(
2785
2830
  type: "ed25519",
2786
2831
  options: ED25519KeyPairOptions<"der", "pem">,
2787
- ): KeyPairSyncResult<Buffer, string>;
2832
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2788
2833
  function generateKeyPairSync(
2789
2834
  type: "ed25519",
2790
2835
  options: ED25519KeyPairOptions<"der", "der">,
2791
- ): KeyPairSyncResult<Buffer, Buffer>;
2836
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2792
2837
  function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2793
2838
  function generateKeyPairSync(
2794
2839
  type: "ed448",
@@ -2797,15 +2842,15 @@ declare module "crypto" {
2797
2842
  function generateKeyPairSync(
2798
2843
  type: "ed448",
2799
2844
  options: ED448KeyPairOptions<"pem", "der">,
2800
- ): KeyPairSyncResult<string, Buffer>;
2845
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2801
2846
  function generateKeyPairSync(
2802
2847
  type: "ed448",
2803
2848
  options: ED448KeyPairOptions<"der", "pem">,
2804
- ): KeyPairSyncResult<Buffer, string>;
2849
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2805
2850
  function generateKeyPairSync(
2806
2851
  type: "ed448",
2807
2852
  options: ED448KeyPairOptions<"der", "der">,
2808
- ): KeyPairSyncResult<Buffer, Buffer>;
2853
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2809
2854
  function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2810
2855
  function generateKeyPairSync(
2811
2856
  type: "x25519",
@@ -2814,15 +2859,15 @@ declare module "crypto" {
2814
2859
  function generateKeyPairSync(
2815
2860
  type: "x25519",
2816
2861
  options: X25519KeyPairOptions<"pem", "der">,
2817
- ): KeyPairSyncResult<string, Buffer>;
2862
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2818
2863
  function generateKeyPairSync(
2819
2864
  type: "x25519",
2820
2865
  options: X25519KeyPairOptions<"der", "pem">,
2821
- ): KeyPairSyncResult<Buffer, string>;
2866
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2822
2867
  function generateKeyPairSync(
2823
2868
  type: "x25519",
2824
2869
  options: X25519KeyPairOptions<"der", "der">,
2825
- ): KeyPairSyncResult<Buffer, Buffer>;
2870
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2826
2871
  function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2827
2872
  function generateKeyPairSync(
2828
2873
  type: "x448",
@@ -2831,15 +2876,15 @@ declare module "crypto" {
2831
2876
  function generateKeyPairSync(
2832
2877
  type: "x448",
2833
2878
  options: X448KeyPairOptions<"pem", "der">,
2834
- ): KeyPairSyncResult<string, Buffer>;
2879
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2835
2880
  function generateKeyPairSync(
2836
2881
  type: "x448",
2837
2882
  options: X448KeyPairOptions<"der", "pem">,
2838
- ): KeyPairSyncResult<Buffer, string>;
2883
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2839
2884
  function generateKeyPairSync(
2840
2885
  type: "x448",
2841
2886
  options: X448KeyPairOptions<"der", "der">,
2842
- ): KeyPairSyncResult<Buffer, Buffer>;
2887
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2843
2888
  function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2844
2889
  function generateKeyPairSync(
2845
2890
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
@@ -2848,19 +2893,119 @@ declare module "crypto" {
2848
2893
  function generateKeyPairSync(
2849
2894
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
2850
2895
  options: MLDSAKeyPairOptions<"pem", "der">,
2851
- ): KeyPairSyncResult<string, Buffer>;
2896
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2852
2897
  function generateKeyPairSync(
2853
2898
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
2854
2899
  options: MLDSAKeyPairOptions<"der", "pem">,
2855
- ): KeyPairSyncResult<Buffer, string>;
2900
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2856
2901
  function generateKeyPairSync(
2857
2902
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
2858
2903
  options: MLDSAKeyPairOptions<"der", "der">,
2859
- ): KeyPairSyncResult<Buffer, Buffer>;
2904
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2860
2905
  function generateKeyPairSync(
2861
2906
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
2862
2907
  options?: MLDSAKeyPairKeyObjectOptions,
2863
2908
  ): KeyPairKeyObjectResult;
2909
+ function generateKeyPairSync(
2910
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
2911
+ options: MLKEMKeyPairOptions<"pem", "pem">,
2912
+ ): KeyPairSyncResult<string, string>;
2913
+ function generateKeyPairSync(
2914
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
2915
+ options: MLKEMKeyPairOptions<"pem", "der">,
2916
+ ): KeyPairSyncResult<string, NonSharedBuffer>;
2917
+ function generateKeyPairSync(
2918
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
2919
+ options: MLKEMKeyPairOptions<"der", "pem">,
2920
+ ): KeyPairSyncResult<NonSharedBuffer, string>;
2921
+ function generateKeyPairSync(
2922
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
2923
+ options: MLKEMKeyPairOptions<"der", "der">,
2924
+ ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2925
+ function generateKeyPairSync(
2926
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
2927
+ options?: MLKEMKeyPairKeyObjectOptions,
2928
+ ): KeyPairKeyObjectResult;
2929
+ function generateKeyPairSync(
2930
+ type:
2931
+ | "slh-dsa-sha2-128f"
2932
+ | "slh-dsa-sha2-128s"
2933
+ | "slh-dsa-sha2-192f"
2934
+ | "slh-dsa-sha2-192s"
2935
+ | "slh-dsa-sha2-256f"
2936
+ | "slh-dsa-sha2-256s"
2937
+ | "slh-dsa-shake-128f"
2938
+ | "slh-dsa-shake-128s"
2939
+ | "slh-dsa-shake-192f"
2940
+ | "slh-dsa-shake-192s"
2941
+ | "slh-dsa-shake-256f"
2942
+ | "slh-dsa-shake-256s",
2943
+ options: SLHDSAKeyPairOptions<"pem", "pem">,
2944
+ ): KeyPairSyncResult<string, string>;
2945
+ function generateKeyPairSync(
2946
+ type:
2947
+ | "slh-dsa-sha2-128f"
2948
+ | "slh-dsa-sha2-128s"
2949
+ | "slh-dsa-sha2-192f"
2950
+ | "slh-dsa-sha2-192s"
2951
+ | "slh-dsa-sha2-256f"
2952
+ | "slh-dsa-sha2-256s"
2953
+ | "slh-dsa-shake-128f"
2954
+ | "slh-dsa-shake-128s"
2955
+ | "slh-dsa-shake-192f"
2956
+ | "slh-dsa-shake-192s"
2957
+ | "slh-dsa-shake-256f"
2958
+ | "slh-dsa-shake-256s",
2959
+ options: SLHDSAKeyPairOptions<"pem", "der">,
2960
+ ): KeyPairSyncResult<string, Buffer>;
2961
+ function generateKeyPairSync(
2962
+ type:
2963
+ | "slh-dsa-sha2-128f"
2964
+ | "slh-dsa-sha2-128s"
2965
+ | "slh-dsa-sha2-192f"
2966
+ | "slh-dsa-sha2-192s"
2967
+ | "slh-dsa-sha2-256f"
2968
+ | "slh-dsa-sha2-256s"
2969
+ | "slh-dsa-shake-128f"
2970
+ | "slh-dsa-shake-128s"
2971
+ | "slh-dsa-shake-192f"
2972
+ | "slh-dsa-shake-192s"
2973
+ | "slh-dsa-shake-256f"
2974
+ | "slh-dsa-shake-256s",
2975
+ options: SLHDSAKeyPairOptions<"der", "pem">,
2976
+ ): KeyPairSyncResult<Buffer, string>;
2977
+ function generateKeyPairSync(
2978
+ type:
2979
+ | "slh-dsa-sha2-128f"
2980
+ | "slh-dsa-sha2-128s"
2981
+ | "slh-dsa-sha2-192f"
2982
+ | "slh-dsa-sha2-192s"
2983
+ | "slh-dsa-sha2-256f"
2984
+ | "slh-dsa-sha2-256s"
2985
+ | "slh-dsa-shake-128f"
2986
+ | "slh-dsa-shake-128s"
2987
+ | "slh-dsa-shake-192f"
2988
+ | "slh-dsa-shake-192s"
2989
+ | "slh-dsa-shake-256f"
2990
+ | "slh-dsa-shake-256s",
2991
+ options: SLHDSAKeyPairOptions<"der", "der">,
2992
+ ): KeyPairSyncResult<Buffer, Buffer>;
2993
+ function generateKeyPairSync(
2994
+ type:
2995
+ | "slh-dsa-sha2-128f"
2996
+ | "slh-dsa-sha2-128s"
2997
+ | "slh-dsa-sha2-192f"
2998
+ | "slh-dsa-sha2-192s"
2999
+ | "slh-dsa-sha2-256f"
3000
+ | "slh-dsa-sha2-256s"
3001
+ | "slh-dsa-shake-128f"
3002
+ | "slh-dsa-shake-128s"
3003
+ | "slh-dsa-shake-192f"
3004
+ | "slh-dsa-shake-192s"
3005
+ | "slh-dsa-shake-256f"
3006
+ | "slh-dsa-shake-256s",
3007
+ options?: SLHDSAKeyPairKeyObjectOptions,
3008
+ ): KeyPairKeyObjectResult;
2864
3009
  /**
2865
3010
  * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
2866
3011
  * Ed25519, Ed448, X25519, X448, and DH are currently supported.
@@ -2898,8 +3043,8 @@ declare module "crypto" {
2898
3043
  * If this method is invoked as its `util.promisify()` ed version, it returns
2899
3044
  * a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
2900
3045
  * @since v10.12.0
2901
- * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`,
2902
- * `'ed448'`, `'x25519'`, `'x448'`, `'dh'`, `'ml-dsa-44'`, `'ml-dsa-65'`, or `'ml-dsa-87'`.
3046
+ * @param type The asymmetric key type to generate. See the
3047
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v24.x/api/crypto.html#asymmetric-key-types).
2903
3048
  */
2904
3049
  function generateKeyPair(
2905
3050
  type: "rsa",
@@ -2909,17 +3054,17 @@ declare module "crypto" {
2909
3054
  function generateKeyPair(
2910
3055
  type: "rsa",
2911
3056
  options: RSAKeyPairOptions<"pem", "der">,
2912
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3057
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2913
3058
  ): void;
2914
3059
  function generateKeyPair(
2915
3060
  type: "rsa",
2916
3061
  options: RSAKeyPairOptions<"der", "pem">,
2917
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3062
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2918
3063
  ): void;
2919
3064
  function generateKeyPair(
2920
3065
  type: "rsa",
2921
3066
  options: RSAKeyPairOptions<"der", "der">,
2922
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3067
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2923
3068
  ): void;
2924
3069
  function generateKeyPair(
2925
3070
  type: "rsa",
@@ -2934,17 +3079,17 @@ declare module "crypto" {
2934
3079
  function generateKeyPair(
2935
3080
  type: "rsa-pss",
2936
3081
  options: RSAPSSKeyPairOptions<"pem", "der">,
2937
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3082
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2938
3083
  ): void;
2939
3084
  function generateKeyPair(
2940
3085
  type: "rsa-pss",
2941
3086
  options: RSAPSSKeyPairOptions<"der", "pem">,
2942
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3087
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2943
3088
  ): void;
2944
3089
  function generateKeyPair(
2945
3090
  type: "rsa-pss",
2946
3091
  options: RSAPSSKeyPairOptions<"der", "der">,
2947
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3092
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2948
3093
  ): void;
2949
3094
  function generateKeyPair(
2950
3095
  type: "rsa-pss",
@@ -2959,17 +3104,17 @@ declare module "crypto" {
2959
3104
  function generateKeyPair(
2960
3105
  type: "dsa",
2961
3106
  options: DSAKeyPairOptions<"pem", "der">,
2962
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3107
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2963
3108
  ): void;
2964
3109
  function generateKeyPair(
2965
3110
  type: "dsa",
2966
3111
  options: DSAKeyPairOptions<"der", "pem">,
2967
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3112
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2968
3113
  ): void;
2969
3114
  function generateKeyPair(
2970
3115
  type: "dsa",
2971
3116
  options: DSAKeyPairOptions<"der", "der">,
2972
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3117
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2973
3118
  ): void;
2974
3119
  function generateKeyPair(
2975
3120
  type: "dsa",
@@ -2984,17 +3129,17 @@ declare module "crypto" {
2984
3129
  function generateKeyPair(
2985
3130
  type: "ec",
2986
3131
  options: ECKeyPairOptions<"pem", "der">,
2987
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3132
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2988
3133
  ): void;
2989
3134
  function generateKeyPair(
2990
3135
  type: "ec",
2991
3136
  options: ECKeyPairOptions<"der", "pem">,
2992
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3137
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2993
3138
  ): void;
2994
3139
  function generateKeyPair(
2995
3140
  type: "ec",
2996
3141
  options: ECKeyPairOptions<"der", "der">,
2997
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3142
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2998
3143
  ): void;
2999
3144
  function generateKeyPair(
3000
3145
  type: "ec",
@@ -3009,17 +3154,17 @@ declare module "crypto" {
3009
3154
  function generateKeyPair(
3010
3155
  type: "ed25519",
3011
3156
  options: ED25519KeyPairOptions<"pem", "der">,
3012
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3157
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3013
3158
  ): void;
3014
3159
  function generateKeyPair(
3015
3160
  type: "ed25519",
3016
3161
  options: ED25519KeyPairOptions<"der", "pem">,
3017
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3162
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3018
3163
  ): void;
3019
3164
  function generateKeyPair(
3020
3165
  type: "ed25519",
3021
3166
  options: ED25519KeyPairOptions<"der", "der">,
3022
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3167
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3023
3168
  ): void;
3024
3169
  function generateKeyPair(
3025
3170
  type: "ed25519",
@@ -3034,17 +3179,17 @@ declare module "crypto" {
3034
3179
  function generateKeyPair(
3035
3180
  type: "ed448",
3036
3181
  options: ED448KeyPairOptions<"pem", "der">,
3037
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3182
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3038
3183
  ): void;
3039
3184
  function generateKeyPair(
3040
3185
  type: "ed448",
3041
3186
  options: ED448KeyPairOptions<"der", "pem">,
3042
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3187
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3043
3188
  ): void;
3044
3189
  function generateKeyPair(
3045
3190
  type: "ed448",
3046
3191
  options: ED448KeyPairOptions<"der", "der">,
3047
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3192
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3048
3193
  ): void;
3049
3194
  function generateKeyPair(
3050
3195
  type: "ed448",
@@ -3059,17 +3204,17 @@ declare module "crypto" {
3059
3204
  function generateKeyPair(
3060
3205
  type: "x25519",
3061
3206
  options: X25519KeyPairOptions<"pem", "der">,
3062
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3207
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3063
3208
  ): void;
3064
3209
  function generateKeyPair(
3065
3210
  type: "x25519",
3066
3211
  options: X25519KeyPairOptions<"der", "pem">,
3067
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3212
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3068
3213
  ): void;
3069
3214
  function generateKeyPair(
3070
3215
  type: "x25519",
3071
3216
  options: X25519KeyPairOptions<"der", "der">,
3072
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3217
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3073
3218
  ): void;
3074
3219
  function generateKeyPair(
3075
3220
  type: "x25519",
@@ -3084,17 +3229,17 @@ declare module "crypto" {
3084
3229
  function generateKeyPair(
3085
3230
  type: "x448",
3086
3231
  options: X448KeyPairOptions<"pem", "der">,
3087
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3232
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3088
3233
  ): void;
3089
3234
  function generateKeyPair(
3090
3235
  type: "x448",
3091
3236
  options: X448KeyPairOptions<"der", "pem">,
3092
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3237
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3093
3238
  ): void;
3094
3239
  function generateKeyPair(
3095
3240
  type: "x448",
3096
3241
  options: X448KeyPairOptions<"der", "der">,
3097
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3242
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3098
3243
  ): void;
3099
3244
  function generateKeyPair(
3100
3245
  type: "x448",
@@ -3109,23 +3254,133 @@ declare module "crypto" {
3109
3254
  function generateKeyPair(
3110
3255
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3111
3256
  options: MLDSAKeyPairOptions<"pem", "der">,
3112
- callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3257
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3113
3258
  ): void;
3114
3259
  function generateKeyPair(
3115
3260
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3116
3261
  options: MLDSAKeyPairOptions<"der", "pem">,
3117
- callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3262
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3118
3263
  ): void;
3119
3264
  function generateKeyPair(
3120
3265
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3121
3266
  options: MLDSAKeyPairOptions<"der", "der">,
3122
- callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3267
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3123
3268
  ): void;
3124
3269
  function generateKeyPair(
3125
3270
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3126
3271
  options: MLDSAKeyPairKeyObjectOptions | undefined,
3127
3272
  callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3128
3273
  ): void;
3274
+ function generateKeyPair(
3275
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3276
+ options: MLKEMKeyPairOptions<"pem", "pem">,
3277
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3278
+ ): void;
3279
+ function generateKeyPair(
3280
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3281
+ options: MLKEMKeyPairOptions<"pem", "der">,
3282
+ callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3283
+ ): void;
3284
+ function generateKeyPair(
3285
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3286
+ options: MLKEMKeyPairOptions<"der", "pem">,
3287
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3288
+ ): void;
3289
+ function generateKeyPair(
3290
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3291
+ options: MLKEMKeyPairOptions<"der", "der">,
3292
+ callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3293
+ ): void;
3294
+ function generateKeyPair(
3295
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3296
+ options: MLKEMKeyPairKeyObjectOptions | undefined,
3297
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3298
+ ): void;
3299
+ function generateKeyPair(
3300
+ type:
3301
+ | "slh-dsa-sha2-128f"
3302
+ | "slh-dsa-sha2-128s"
3303
+ | "slh-dsa-sha2-192f"
3304
+ | "slh-dsa-sha2-192s"
3305
+ | "slh-dsa-sha2-256f"
3306
+ | "slh-dsa-sha2-256s"
3307
+ | "slh-dsa-shake-128f"
3308
+ | "slh-dsa-shake-128s"
3309
+ | "slh-dsa-shake-192f"
3310
+ | "slh-dsa-shake-192s"
3311
+ | "slh-dsa-shake-256f"
3312
+ | "slh-dsa-shake-256s",
3313
+ options: SLHDSAKeyPairOptions<"pem", "pem">,
3314
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3315
+ ): void;
3316
+ function generateKeyPair(
3317
+ type:
3318
+ | "slh-dsa-sha2-128f"
3319
+ | "slh-dsa-sha2-128s"
3320
+ | "slh-dsa-sha2-192f"
3321
+ | "slh-dsa-sha2-192s"
3322
+ | "slh-dsa-sha2-256f"
3323
+ | "slh-dsa-sha2-256s"
3324
+ | "slh-dsa-shake-128f"
3325
+ | "slh-dsa-shake-128s"
3326
+ | "slh-dsa-shake-192f"
3327
+ | "slh-dsa-shake-192s"
3328
+ | "slh-dsa-shake-256f"
3329
+ | "slh-dsa-shake-256s",
3330
+ options: SLHDSAKeyPairOptions<"pem", "der">,
3331
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
3332
+ ): void;
3333
+ function generateKeyPair(
3334
+ type:
3335
+ | "slh-dsa-sha2-128f"
3336
+ | "slh-dsa-sha2-128s"
3337
+ | "slh-dsa-sha2-192f"
3338
+ | "slh-dsa-sha2-192s"
3339
+ | "slh-dsa-sha2-256f"
3340
+ | "slh-dsa-sha2-256s"
3341
+ | "slh-dsa-shake-128f"
3342
+ | "slh-dsa-shake-128s"
3343
+ | "slh-dsa-shake-192f"
3344
+ | "slh-dsa-shake-192s"
3345
+ | "slh-dsa-shake-256f"
3346
+ | "slh-dsa-shake-256s",
3347
+ options: SLHDSAKeyPairOptions<"der", "pem">,
3348
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
3349
+ ): void;
3350
+ function generateKeyPair(
3351
+ type:
3352
+ | "slh-dsa-sha2-128f"
3353
+ | "slh-dsa-sha2-128s"
3354
+ | "slh-dsa-sha2-192f"
3355
+ | "slh-dsa-sha2-192s"
3356
+ | "slh-dsa-sha2-256f"
3357
+ | "slh-dsa-sha2-256s"
3358
+ | "slh-dsa-shake-128f"
3359
+ | "slh-dsa-shake-128s"
3360
+ | "slh-dsa-shake-192f"
3361
+ | "slh-dsa-shake-192s"
3362
+ | "slh-dsa-shake-256f"
3363
+ | "slh-dsa-shake-256s",
3364
+ options: SLHDSAKeyPairOptions<"der", "der">,
3365
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
3366
+ ): void;
3367
+ function generateKeyPair(
3368
+ type:
3369
+ | "slh-dsa-sha2-128f"
3370
+ | "slh-dsa-sha2-128s"
3371
+ | "slh-dsa-sha2-192f"
3372
+ | "slh-dsa-sha2-192s"
3373
+ | "slh-dsa-sha2-256f"
3374
+ | "slh-dsa-sha2-256s"
3375
+ | "slh-dsa-shake-128f"
3376
+ | "slh-dsa-shake-128s"
3377
+ | "slh-dsa-shake-192f"
3378
+ | "slh-dsa-shake-192s"
3379
+ | "slh-dsa-shake-256f"
3380
+ | "slh-dsa-shake-256s",
3381
+ options: SLHDSAKeyPairKeyObjectOptions | undefined,
3382
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3383
+ ): void;
3129
3384
  namespace generateKeyPair {
3130
3385
  function __promisify__(
3131
3386
  type: "rsa",
@@ -3139,21 +3394,21 @@ declare module "crypto" {
3139
3394
  options: RSAKeyPairOptions<"pem", "der">,
3140
3395
  ): Promise<{
3141
3396
  publicKey: string;
3142
- privateKey: Buffer;
3397
+ privateKey: NonSharedBuffer;
3143
3398
  }>;
3144
3399
  function __promisify__(
3145
3400
  type: "rsa",
3146
3401
  options: RSAKeyPairOptions<"der", "pem">,
3147
3402
  ): Promise<{
3148
- publicKey: Buffer;
3403
+ publicKey: NonSharedBuffer;
3149
3404
  privateKey: string;
3150
3405
  }>;
3151
3406
  function __promisify__(
3152
3407
  type: "rsa",
3153
3408
  options: RSAKeyPairOptions<"der", "der">,
3154
3409
  ): Promise<{
3155
- publicKey: Buffer;
3156
- privateKey: Buffer;
3410
+ publicKey: NonSharedBuffer;
3411
+ privateKey: NonSharedBuffer;
3157
3412
  }>;
3158
3413
  function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3159
3414
  function __promisify__(
@@ -3168,21 +3423,21 @@ declare module "crypto" {
3168
3423
  options: RSAPSSKeyPairOptions<"pem", "der">,
3169
3424
  ): Promise<{
3170
3425
  publicKey: string;
3171
- privateKey: Buffer;
3426
+ privateKey: NonSharedBuffer;
3172
3427
  }>;
3173
3428
  function __promisify__(
3174
3429
  type: "rsa-pss",
3175
3430
  options: RSAPSSKeyPairOptions<"der", "pem">,
3176
3431
  ): Promise<{
3177
- publicKey: Buffer;
3432
+ publicKey: NonSharedBuffer;
3178
3433
  privateKey: string;
3179
3434
  }>;
3180
3435
  function __promisify__(
3181
3436
  type: "rsa-pss",
3182
3437
  options: RSAPSSKeyPairOptions<"der", "der">,
3183
3438
  ): Promise<{
3184
- publicKey: Buffer;
3185
- privateKey: Buffer;
3439
+ publicKey: NonSharedBuffer;
3440
+ privateKey: NonSharedBuffer;
3186
3441
  }>;
3187
3442
  function __promisify__(
3188
3443
  type: "rsa-pss",
@@ -3200,21 +3455,21 @@ declare module "crypto" {
3200
3455
  options: DSAKeyPairOptions<"pem", "der">,
3201
3456
  ): Promise<{
3202
3457
  publicKey: string;
3203
- privateKey: Buffer;
3458
+ privateKey: NonSharedBuffer;
3204
3459
  }>;
3205
3460
  function __promisify__(
3206
3461
  type: "dsa",
3207
3462
  options: DSAKeyPairOptions<"der", "pem">,
3208
3463
  ): Promise<{
3209
- publicKey: Buffer;
3464
+ publicKey: NonSharedBuffer;
3210
3465
  privateKey: string;
3211
3466
  }>;
3212
3467
  function __promisify__(
3213
3468
  type: "dsa",
3214
3469
  options: DSAKeyPairOptions<"der", "der">,
3215
3470
  ): Promise<{
3216
- publicKey: Buffer;
3217
- privateKey: Buffer;
3471
+ publicKey: NonSharedBuffer;
3472
+ privateKey: NonSharedBuffer;
3218
3473
  }>;
3219
3474
  function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3220
3475
  function __promisify__(
@@ -3229,21 +3484,21 @@ declare module "crypto" {
3229
3484
  options: ECKeyPairOptions<"pem", "der">,
3230
3485
  ): Promise<{
3231
3486
  publicKey: string;
3232
- privateKey: Buffer;
3487
+ privateKey: NonSharedBuffer;
3233
3488
  }>;
3234
3489
  function __promisify__(
3235
3490
  type: "ec",
3236
3491
  options: ECKeyPairOptions<"der", "pem">,
3237
3492
  ): Promise<{
3238
- publicKey: Buffer;
3493
+ publicKey: NonSharedBuffer;
3239
3494
  privateKey: string;
3240
3495
  }>;
3241
3496
  function __promisify__(
3242
3497
  type: "ec",
3243
3498
  options: ECKeyPairOptions<"der", "der">,
3244
3499
  ): Promise<{
3245
- publicKey: Buffer;
3246
- privateKey: Buffer;
3500
+ publicKey: NonSharedBuffer;
3501
+ privateKey: NonSharedBuffer;
3247
3502
  }>;
3248
3503
  function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3249
3504
  function __promisify__(
@@ -3258,21 +3513,21 @@ declare module "crypto" {
3258
3513
  options: ED25519KeyPairOptions<"pem", "der">,
3259
3514
  ): Promise<{
3260
3515
  publicKey: string;
3261
- privateKey: Buffer;
3516
+ privateKey: NonSharedBuffer;
3262
3517
  }>;
3263
3518
  function __promisify__(
3264
3519
  type: "ed25519",
3265
3520
  options: ED25519KeyPairOptions<"der", "pem">,
3266
3521
  ): Promise<{
3267
- publicKey: Buffer;
3522
+ publicKey: NonSharedBuffer;
3268
3523
  privateKey: string;
3269
3524
  }>;
3270
3525
  function __promisify__(
3271
3526
  type: "ed25519",
3272
3527
  options: ED25519KeyPairOptions<"der", "der">,
3273
3528
  ): Promise<{
3274
- publicKey: Buffer;
3275
- privateKey: Buffer;
3529
+ publicKey: NonSharedBuffer;
3530
+ privateKey: NonSharedBuffer;
3276
3531
  }>;
3277
3532
  function __promisify__(
3278
3533
  type: "ed25519",
@@ -3290,21 +3545,21 @@ declare module "crypto" {
3290
3545
  options: ED448KeyPairOptions<"pem", "der">,
3291
3546
  ): Promise<{
3292
3547
  publicKey: string;
3293
- privateKey: Buffer;
3548
+ privateKey: NonSharedBuffer;
3294
3549
  }>;
3295
3550
  function __promisify__(
3296
3551
  type: "ed448",
3297
3552
  options: ED448KeyPairOptions<"der", "pem">,
3298
3553
  ): Promise<{
3299
- publicKey: Buffer;
3554
+ publicKey: NonSharedBuffer;
3300
3555
  privateKey: string;
3301
3556
  }>;
3302
3557
  function __promisify__(
3303
3558
  type: "ed448",
3304
3559
  options: ED448KeyPairOptions<"der", "der">,
3305
3560
  ): Promise<{
3306
- publicKey: Buffer;
3307
- privateKey: Buffer;
3561
+ publicKey: NonSharedBuffer;
3562
+ privateKey: NonSharedBuffer;
3308
3563
  }>;
3309
3564
  function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3310
3565
  function __promisify__(
@@ -3319,21 +3574,21 @@ declare module "crypto" {
3319
3574
  options: X25519KeyPairOptions<"pem", "der">,
3320
3575
  ): Promise<{
3321
3576
  publicKey: string;
3322
- privateKey: Buffer;
3577
+ privateKey: NonSharedBuffer;
3323
3578
  }>;
3324
3579
  function __promisify__(
3325
3580
  type: "x25519",
3326
3581
  options: X25519KeyPairOptions<"der", "pem">,
3327
3582
  ): Promise<{
3328
- publicKey: Buffer;
3583
+ publicKey: NonSharedBuffer;
3329
3584
  privateKey: string;
3330
3585
  }>;
3331
3586
  function __promisify__(
3332
3587
  type: "x25519",
3333
3588
  options: X25519KeyPairOptions<"der", "der">,
3334
3589
  ): Promise<{
3335
- publicKey: Buffer;
3336
- privateKey: Buffer;
3590
+ publicKey: NonSharedBuffer;
3591
+ privateKey: NonSharedBuffer;
3337
3592
  }>;
3338
3593
  function __promisify__(
3339
3594
  type: "x25519",
@@ -3351,21 +3606,21 @@ declare module "crypto" {
3351
3606
  options: X448KeyPairOptions<"pem", "der">,
3352
3607
  ): Promise<{
3353
3608
  publicKey: string;
3354
- privateKey: Buffer;
3609
+ privateKey: NonSharedBuffer;
3355
3610
  }>;
3356
3611
  function __promisify__(
3357
3612
  type: "x448",
3358
3613
  options: X448KeyPairOptions<"der", "pem">,
3359
3614
  ): Promise<{
3360
- publicKey: Buffer;
3615
+ publicKey: NonSharedBuffer;
3361
3616
  privateKey: string;
3362
3617
  }>;
3363
3618
  function __promisify__(
3364
3619
  type: "x448",
3365
3620
  options: X448KeyPairOptions<"der", "der">,
3366
3621
  ): Promise<{
3367
- publicKey: Buffer;
3368
- privateKey: Buffer;
3622
+ publicKey: NonSharedBuffer;
3623
+ privateKey: NonSharedBuffer;
3369
3624
  }>;
3370
3625
  function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3371
3626
  function __promisify__(
@@ -3380,26 +3635,150 @@ declare module "crypto" {
3380
3635
  options: MLDSAKeyPairOptions<"pem", "der">,
3381
3636
  ): Promise<{
3382
3637
  publicKey: string;
3383
- privateKey: Buffer;
3638
+ privateKey: NonSharedBuffer;
3384
3639
  }>;
3385
3640
  function __promisify__(
3386
3641
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3387
3642
  options: MLDSAKeyPairOptions<"der", "pem">,
3388
3643
  ): Promise<{
3389
- publicKey: Buffer;
3644
+ publicKey: NonSharedBuffer;
3390
3645
  privateKey: string;
3391
3646
  }>;
3392
3647
  function __promisify__(
3393
3648
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3394
3649
  options: MLDSAKeyPairOptions<"der", "der">,
3395
3650
  ): Promise<{
3396
- publicKey: Buffer;
3397
- privateKey: Buffer;
3651
+ publicKey: NonSharedBuffer;
3652
+ privateKey: NonSharedBuffer;
3398
3653
  }>;
3399
3654
  function __promisify__(
3400
3655
  type: "ml-dsa-44" | "ml-dsa-65" | "ml-dsa-87",
3401
3656
  options?: MLDSAKeyPairKeyObjectOptions,
3402
3657
  ): Promise<KeyPairKeyObjectResult>;
3658
+ function __promisify__(
3659
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3660
+ options: MLKEMKeyPairOptions<"pem", "pem">,
3661
+ ): Promise<{
3662
+ publicKey: string;
3663
+ privateKey: string;
3664
+ }>;
3665
+ function __promisify__(
3666
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3667
+ options: MLKEMKeyPairOptions<"pem", "der">,
3668
+ ): Promise<{
3669
+ publicKey: string;
3670
+ privateKey: NonSharedBuffer;
3671
+ }>;
3672
+ function __promisify__(
3673
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3674
+ options: MLKEMKeyPairOptions<"der", "pem">,
3675
+ ): Promise<{
3676
+ publicKey: NonSharedBuffer;
3677
+ privateKey: string;
3678
+ }>;
3679
+ function __promisify__(
3680
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3681
+ options: MLKEMKeyPairOptions<"der", "der">,
3682
+ ): Promise<{
3683
+ publicKey: NonSharedBuffer;
3684
+ privateKey: NonSharedBuffer;
3685
+ }>;
3686
+ function __promisify__(
3687
+ type: "ml-kem-1024" | "ml-kem-512" | "ml-kem-768",
3688
+ options?: MLKEMKeyPairKeyObjectOptions,
3689
+ ): Promise<KeyPairKeyObjectResult>;
3690
+ function __promisify__(
3691
+ type:
3692
+ | "slh-dsa-sha2-128f"
3693
+ | "slh-dsa-sha2-128s"
3694
+ | "slh-dsa-sha2-192f"
3695
+ | "slh-dsa-sha2-192s"
3696
+ | "slh-dsa-sha2-256f"
3697
+ | "slh-dsa-sha2-256s"
3698
+ | "slh-dsa-shake-128f"
3699
+ | "slh-dsa-shake-128s"
3700
+ | "slh-dsa-shake-192f"
3701
+ | "slh-dsa-shake-192s"
3702
+ | "slh-dsa-shake-256f"
3703
+ | "slh-dsa-shake-256s",
3704
+ options: SLHDSAKeyPairOptions<"pem", "pem">,
3705
+ ): Promise<{
3706
+ publicKey: string;
3707
+ privateKey: string;
3708
+ }>;
3709
+ function __promisify__(
3710
+ type:
3711
+ | "slh-dsa-sha2-128f"
3712
+ | "slh-dsa-sha2-128s"
3713
+ | "slh-dsa-sha2-192f"
3714
+ | "slh-dsa-sha2-192s"
3715
+ | "slh-dsa-sha2-256f"
3716
+ | "slh-dsa-sha2-256s"
3717
+ | "slh-dsa-shake-128f"
3718
+ | "slh-dsa-shake-128s"
3719
+ | "slh-dsa-shake-192f"
3720
+ | "slh-dsa-shake-192s"
3721
+ | "slh-dsa-shake-256f"
3722
+ | "slh-dsa-shake-256s",
3723
+ options: SLHDSAKeyPairOptions<"pem", "der">,
3724
+ ): Promise<{
3725
+ publicKey: string;
3726
+ privateKey: Buffer;
3727
+ }>;
3728
+ function __promisify__(
3729
+ type:
3730
+ | "slh-dsa-sha2-128f"
3731
+ | "slh-dsa-sha2-128s"
3732
+ | "slh-dsa-sha2-192f"
3733
+ | "slh-dsa-sha2-192s"
3734
+ | "slh-dsa-sha2-256f"
3735
+ | "slh-dsa-sha2-256s"
3736
+ | "slh-dsa-shake-128f"
3737
+ | "slh-dsa-shake-128s"
3738
+ | "slh-dsa-shake-192f"
3739
+ | "slh-dsa-shake-192s"
3740
+ | "slh-dsa-shake-256f"
3741
+ | "slh-dsa-shake-256s",
3742
+ options: SLHDSAKeyPairOptions<"der", "pem">,
3743
+ ): Promise<{
3744
+ publicKey: Buffer;
3745
+ privateKey: string;
3746
+ }>;
3747
+ function __promisify__(
3748
+ type:
3749
+ | "slh-dsa-sha2-128f"
3750
+ | "slh-dsa-sha2-128s"
3751
+ | "slh-dsa-sha2-192f"
3752
+ | "slh-dsa-sha2-192s"
3753
+ | "slh-dsa-sha2-256f"
3754
+ | "slh-dsa-sha2-256s"
3755
+ | "slh-dsa-shake-128f"
3756
+ | "slh-dsa-shake-128s"
3757
+ | "slh-dsa-shake-192f"
3758
+ | "slh-dsa-shake-192s"
3759
+ | "slh-dsa-shake-256f"
3760
+ | "slh-dsa-shake-256s",
3761
+ options: SLHDSAKeyPairOptions<"der", "der">,
3762
+ ): Promise<{
3763
+ publicKey: Buffer;
3764
+ privateKey: Buffer;
3765
+ }>;
3766
+ function __promisify__(
3767
+ type:
3768
+ | "slh-dsa-sha2-128f"
3769
+ | "slh-dsa-sha2-128s"
3770
+ | "slh-dsa-sha2-192f"
3771
+ | "slh-dsa-sha2-192s"
3772
+ | "slh-dsa-sha2-256f"
3773
+ | "slh-dsa-sha2-256s"
3774
+ | "slh-dsa-shake-128f"
3775
+ | "slh-dsa-shake-128s"
3776
+ | "slh-dsa-shake-192f"
3777
+ | "slh-dsa-shake-192s"
3778
+ | "slh-dsa-shake-256f"
3779
+ | "slh-dsa-shake-256s",
3780
+ options?: SLHDSAKeyPairKeyObjectOptions,
3781
+ ): Promise<KeyPairKeyObjectResult>;
3403
3782
  }
3404
3783
  /**
3405
3784
  * Calculates and returns the signature for `data` using the given private key and
@@ -3420,12 +3799,12 @@ declare module "crypto" {
3420
3799
  algorithm: string | null | undefined,
3421
3800
  data: NodeJS.ArrayBufferView,
3422
3801
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
3423
- ): Buffer;
3802
+ ): NonSharedBuffer;
3424
3803
  function sign(
3425
3804
  algorithm: string | null | undefined,
3426
3805
  data: NodeJS.ArrayBufferView,
3427
3806
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
3428
- callback: (error: Error | null, data: Buffer) => void,
3807
+ callback: (error: Error | null, data: NonSharedBuffer) => void,
3429
3808
  ): void;
3430
3809
  /**
3431
3810
  * Verifies the given signature for `data` using the given key and algorithm. If
@@ -3461,17 +3840,71 @@ declare module "crypto" {
3461
3840
  callback: (error: Error | null, result: boolean) => void,
3462
3841
  ): void;
3463
3842
  /**
3464
- * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
3465
- * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`
3466
- * (for Diffie-Hellman), `'ec'`, `'x448'`, or `'x25519'` (for ECDH).
3843
+ * Key decapsulation using a KEM algorithm with a private key.
3844
+ *
3845
+ * Supported key types and their KEM algorithms are:
3846
+ *
3847
+ * * `'rsa'` RSA Secret Value Encapsulation
3848
+ * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
3849
+ * * `'x25519'` DHKEM(X25519, HKDF-SHA256)
3850
+ * * `'x448'` DHKEM(X448, HKDF-SHA512)
3851
+ * * `'ml-kem-512'` ML-KEM
3852
+ * * `'ml-kem-768'` ML-KEM
3853
+ * * `'ml-kem-1024'` ML-KEM
3854
+ *
3855
+ * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
3856
+ * passed to `crypto.createPrivateKey()`.
3857
+ *
3858
+ * If the `callback` function is provided this function uses libuv's threadpool.
3859
+ * @since v24.7.0
3860
+ */
3861
+ function decapsulate(
3862
+ key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
3863
+ ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
3864
+ ): NonSharedBuffer;
3865
+ function decapsulate(
3866
+ key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
3867
+ ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
3868
+ callback: (err: Error, sharedKey: NonSharedBuffer) => void,
3869
+ ): void;
3870
+ /**
3871
+ * Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`.
3872
+ * Both keys must have the same `asymmetricKeyType` and must support either the DH or
3873
+ * ECDH operation.
3467
3874
  *
3468
3875
  * If the `callback` function is provided this function uses libuv's threadpool.
3469
3876
  * @since v13.9.0, v12.17.0
3470
3877
  */
3471
- function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
3878
+ function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
3472
3879
  function diffieHellman(
3473
3880
  options: { privateKey: KeyObject; publicKey: KeyObject },
3474
- callback: (err: Error | null, secret: Buffer) => void,
3881
+ callback: (err: Error | null, secret: NonSharedBuffer) => void,
3882
+ ): void;
3883
+ /**
3884
+ * Key encapsulation using a KEM algorithm with a public key.
3885
+ *
3886
+ * Supported key types and their KEM algorithms are:
3887
+ *
3888
+ * * `'rsa'` RSA Secret Value Encapsulation
3889
+ * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
3890
+ * * `'x25519'` DHKEM(X25519, HKDF-SHA256)
3891
+ * * `'x448'` DHKEM(X448, HKDF-SHA512)
3892
+ * * `'ml-kem-512'` ML-KEM
3893
+ * * `'ml-kem-768'` ML-KEM
3894
+ * * `'ml-kem-1024'` ML-KEM
3895
+ *
3896
+ * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
3897
+ * passed to `crypto.createPublicKey()`.
3898
+ *
3899
+ * If the `callback` function is provided this function uses libuv's threadpool.
3900
+ * @since v24.7.0
3901
+ */
3902
+ function encapsulate(
3903
+ key: KeyLike | PublicKeyInput | JsonWebKeyInput,
3904
+ ): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
3905
+ function encapsulate(
3906
+ key: KeyLike | PublicKeyInput | JsonWebKeyInput,
3907
+ callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
3475
3908
  ): void;
3476
3909
  interface OneShotDigestOptions {
3477
3910
  /**
@@ -3536,12 +3969,12 @@ declare module "crypto" {
3536
3969
  algorithm: string,
3537
3970
  data: BinaryLike,
3538
3971
  options: OneShotDigestOptionsWithBufferEncoding | "buffer",
3539
- ): Buffer;
3972
+ ): NonSharedBuffer;
3540
3973
  function hash(
3541
3974
  algorithm: string,
3542
3975
  data: BinaryLike,
3543
3976
  options: OneShotDigestOptions | BinaryToTextEncoding | "buffer",
3544
- ): string | Buffer;
3977
+ ): string | NonSharedBuffer;
3545
3978
  type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
3546
3979
  interface CipherInfoOptions {
3547
3980
  /**
@@ -3705,23 +4138,23 @@ declare module "crypto" {
3705
4138
  /**
3706
4139
  * @default 'always'
3707
4140
  */
3708
- subject?: "always" | "default" | "never";
4141
+ subject?: "always" | "default" | "never" | undefined;
3709
4142
  /**
3710
4143
  * @default true
3711
4144
  */
3712
- wildcards?: boolean;
4145
+ wildcards?: boolean | undefined;
3713
4146
  /**
3714
4147
  * @default true
3715
4148
  */
3716
- partialWildcards?: boolean;
4149
+ partialWildcards?: boolean | undefined;
3717
4150
  /**
3718
4151
  * @default false
3719
4152
  */
3720
- multiLabelWildcards?: boolean;
4153
+ multiLabelWildcards?: boolean | undefined;
3721
4154
  /**
3722
4155
  * @default false
3723
4156
  */
3724
- singleLabelSubdomains?: boolean;
4157
+ singleLabelSubdomains?: boolean | undefined;
3725
4158
  }
3726
4159
  /**
3727
4160
  * Encapsulates an X509 certificate and provides read-only access to
@@ -3823,7 +4256,7 @@ declare module "crypto" {
3823
4256
  * available.
3824
4257
  * @since v15.9.0
3825
4258
  */
3826
- readonly issuerCertificate?: X509Certificate | undefined;
4259
+ readonly issuerCertificate: X509Certificate | undefined;
3827
4260
  /**
3828
4261
  * The public key `KeyObject` for this certificate.
3829
4262
  * @since v15.6.0
@@ -3833,7 +4266,7 @@ declare module "crypto" {
3833
4266
  * A `Buffer` containing the DER encoding of this certificate.
3834
4267
  * @since v15.6.0
3835
4268
  */
3836
- readonly raw: Buffer;
4269
+ readonly raw: NonSharedBuffer;
3837
4270
  /**
3838
4271
  * The serial number of this certificate.
3839
4272
  *
@@ -3843,6 +4276,16 @@ declare module "crypto" {
3843
4276
  * @since v15.6.0
3844
4277
  */
3845
4278
  readonly serialNumber: string;
4279
+ /**
4280
+ * The algorithm used to sign the certificate or `undefined` if the signature algorithm is unknown by OpenSSL.
4281
+ * @since v24.9.0
4282
+ */
4283
+ readonly signatureAlgorithm: string | undefined;
4284
+ /**
4285
+ * The OID of the algorithm used to sign the certificate.
4286
+ * @since v24.9.0
4287
+ */
4288
+ readonly signatureAlgorithmOid: string;
3846
4289
  /**
3847
4290
  * The date/time from which this certificate is considered valid.
3848
4291
  * @since v15.6.0
@@ -4115,6 +4558,130 @@ declare module "crypto" {
4115
4558
  * @return Returns `typedArray`.
4116
4559
  */
4117
4560
  function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
4561
+ type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
4562
+ interface Argon2Parameters {
4563
+ /**
4564
+ * REQUIRED, this is the password for password hashing applications of Argon2.
4565
+ */
4566
+ message: string | ArrayBuffer | NodeJS.ArrayBufferView;
4567
+ /**
4568
+ * REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.
4569
+ */
4570
+ nonce: string | ArrayBuffer | NodeJS.ArrayBufferView;
4571
+ /**
4572
+ * REQUIRED, degree of parallelism determines how many computational chains (lanes)
4573
+ * can be run. Must be greater than 1 and less than `2**24-1`.
4574
+ */
4575
+ parallelism: number;
4576
+ /**
4577
+ * REQUIRED, the length of the key to generate. Must be greater than 4 and
4578
+ * less than `2**32-1`.
4579
+ */
4580
+ tagLength: number;
4581
+ /**
4582
+ * REQUIRED, memory cost in 1KiB blocks. Must be greater than
4583
+ * `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded
4584
+ * down to the nearest multiple of `4 * parallelism`.
4585
+ */
4586
+ memory: number;
4587
+ /**
4588
+ * REQUIRED, number of passes (iterations). Must be greater than 1 and less
4589
+ * than `2**32-1`.
4590
+ */
4591
+ passes: number;
4592
+ /**
4593
+ * OPTIONAL, Random additional input,
4594
+ * similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in
4595
+ * password hashing applications. If used, must have a length not greater than `2**32-1` bytes.
4596
+ */
4597
+ secret?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
4598
+ /**
4599
+ * OPTIONAL, Additional data to
4600
+ * be added to the hash, functionally equivalent to salt or secret, but meant for
4601
+ * non-random data. If used, must have a length not greater than `2**32-1` bytes.
4602
+ */
4603
+ associatedData?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
4604
+ }
4605
+ /**
4606
+ * Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based
4607
+ * key derivation function that is designed to be expensive computationally and
4608
+ * memory-wise in order to make brute-force attacks unrewarding.
4609
+ *
4610
+ * The `nonce` should be as unique as possible. It is recommended that a nonce is
4611
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
4612
+ *
4613
+ * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
4614
+ * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
4615
+ *
4616
+ * The `callback` function is called with two arguments: `err` and `derivedKey`.
4617
+ * `err` is an exception object when key derivation fails, otherwise `err` is
4618
+ * `null`. `derivedKey` is passed to the callback as a `Buffer`.
4619
+ *
4620
+ * An exception is thrown when any of the input arguments specify invalid values
4621
+ * or types.
4622
+ *
4623
+ * ```js
4624
+ * const { argon2, randomBytes } = await import('node:crypto');
4625
+ *
4626
+ * const parameters = {
4627
+ * message: 'password',
4628
+ * nonce: randomBytes(16),
4629
+ * parallelism: 4,
4630
+ * tagLength: 64,
4631
+ * memory: 65536,
4632
+ * passes: 3,
4633
+ * };
4634
+ *
4635
+ * argon2('argon2id', parameters, (err, derivedKey) => {
4636
+ * if (err) throw err;
4637
+ * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
4638
+ * });
4639
+ * ```
4640
+ * @since v24.7.0
4641
+ * @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
4642
+ * @experimental
4643
+ */
4644
+ function argon2(
4645
+ algorithm: Argon2Algorithm,
4646
+ parameters: Argon2Parameters,
4647
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
4648
+ ): void;
4649
+ /**
4650
+ * Provides a synchronous [Argon2][] implementation. Argon2 is a password-based
4651
+ * key derivation function that is designed to be expensive computationally and
4652
+ * memory-wise in order to make brute-force attacks unrewarding.
4653
+ *
4654
+ * The `nonce` should be as unique as possible. It is recommended that a nonce is
4655
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
4656
+ *
4657
+ * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
4658
+ * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v24.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
4659
+ *
4660
+ * An exception is thrown when key derivation fails, otherwise the derived key is
4661
+ * returned as a `Buffer`.
4662
+ *
4663
+ * An exception is thrown when any of the input arguments specify invalid values
4664
+ * or types.
4665
+ *
4666
+ * ```js
4667
+ * const { argon2Sync, randomBytes } = await import('node:crypto');
4668
+ *
4669
+ * const parameters = {
4670
+ * message: 'password',
4671
+ * nonce: randomBytes(16),
4672
+ * parallelism: 4,
4673
+ * tagLength: 64,
4674
+ * memory: 65536,
4675
+ * passes: 3,
4676
+ * };
4677
+ *
4678
+ * const derivedKey = argon2Sync('argon2id', parameters);
4679
+ * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
4680
+ * ```
4681
+ * @since v24.7.0
4682
+ * @experimental
4683
+ */
4684
+ function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
4118
4685
  /**
4119
4686
  * A convenient alias for `crypto.webcrypto.subtle`.
4120
4687
  * @since v17.4.0
@@ -4129,21 +4696,30 @@ declare module "crypto" {
4129
4696
  const webcrypto: webcrypto.Crypto;
4130
4697
  namespace webcrypto {
4131
4698
  type BufferSource = ArrayBufferView | ArrayBuffer;
4132
- type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
4699
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
4133
4700
  type KeyType = "private" | "public" | "secret";
4134
4701
  type KeyUsage =
4135
- | "decrypt"
4136
- | "deriveBits"
4137
- | "deriveKey"
4138
4702
  | "encrypt"
4703
+ | "decrypt"
4139
4704
  | "sign"
4140
- | "unwrapKey"
4141
4705
  | "verify"
4142
- | "wrapKey";
4706
+ | "deriveKey"
4707
+ | "deriveBits"
4708
+ | "encapsulateBits"
4709
+ | "decapsulateBits"
4710
+ | "encapsulateKey"
4711
+ | "decapsulateKey"
4712
+ | "wrapKey"
4713
+ | "unwrapKey";
4143
4714
  type AlgorithmIdentifier = Algorithm | string;
4144
4715
  type HashAlgorithmIdentifier = AlgorithmIdentifier;
4145
4716
  type NamedCurve = string;
4146
4717
  type BigInteger = Uint8Array;
4718
+ interface AeadParams extends Algorithm {
4719
+ additionalData?: BufferSource;
4720
+ iv: BufferSource;
4721
+ tagLength: number;
4722
+ }
4147
4723
  interface AesCbcParams extends Algorithm {
4148
4724
  iv: BufferSource;
4149
4725
  }
@@ -4154,6 +4730,8 @@ declare module "crypto" {
4154
4730
  interface AesDerivedKeyParams extends Algorithm {
4155
4731
  length: number;
4156
4732
  }
4733
+ // TODO: remove in next major
4734
+ /** @deprecated Replaced by `AeadParams`. */
4157
4735
  interface AesGcmParams extends Algorithm {
4158
4736
  additionalData?: BufferSource;
4159
4737
  iv: BufferSource;
@@ -4168,6 +4746,23 @@ declare module "crypto" {
4168
4746
  interface Algorithm {
4169
4747
  name: string;
4170
4748
  }
4749
+ interface Argon2Params extends Algorithm {
4750
+ associatedData?: BufferSource;
4751
+ memory: number;
4752
+ nonce: BufferSource;
4753
+ parallelism: number;
4754
+ passes: number;
4755
+ secretValue?: BufferSource;
4756
+ version?: number;
4757
+ }
4758
+ interface CShakeParams extends Algorithm {
4759
+ customization?: BufferSource;
4760
+ functionName?: BufferSource;
4761
+ length: number;
4762
+ }
4763
+ interface ContextParams extends Algorithm {
4764
+ context?: BufferSource;
4765
+ }
4171
4766
  interface EcKeyAlgorithm extends KeyAlgorithm {
4172
4767
  namedCurve: NamedCurve;
4173
4768
  }
@@ -4183,9 +4778,6 @@ declare module "crypto" {
4183
4778
  interface EcdsaParams extends Algorithm {
4184
4779
  hash: HashAlgorithmIdentifier;
4185
4780
  }
4186
- interface Ed448Params extends Algorithm {
4187
- context?: BufferSource;
4188
- }
4189
4781
  interface HkdfParams extends Algorithm {
4190
4782
  hash: HashAlgorithmIdentifier;
4191
4783
  info: BufferSource;
@@ -4226,6 +4818,19 @@ declare module "crypto" {
4226
4818
  interface KeyAlgorithm {
4227
4819
  name: string;
4228
4820
  }
4821
+ interface KmacImportParams extends Algorithm {
4822
+ length?: number;
4823
+ }
4824
+ interface KmacKeyAlgorithm extends KeyAlgorithm {
4825
+ length: number;
4826
+ }
4827
+ interface KmacKeyGenParams extends Algorithm {
4828
+ length?: number;
4829
+ }
4830
+ interface KmacParams extends Algorithm {
4831
+ customization?: BufferSource;
4832
+ length: number;
4833
+ }
4229
4834
  interface Pbkdf2Params extends Algorithm {
4230
4835
  hash: HashAlgorithmIdentifier;
4231
4836
  iterations: number;
@@ -4279,22 +4884,15 @@ declare module "crypto" {
4279
4884
  * An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
4280
4885
  * @since v15.0.0
4281
4886
  */
4282
- getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
4887
+ getRandomValues<T extends Exclude<NodeJS.TypedArray, Float16Array | Float32Array | Float64Array>>(
4888
+ typedArray: T,
4889
+ ): T;
4283
4890
  /**
4284
4891
  * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
4285
4892
  * The UUID is generated using a cryptographic pseudorandom number generator.
4286
4893
  * @since v16.7.0
4287
4894
  */
4288
4895
  randomUUID(): UUID;
4289
- CryptoKey: CryptoKeyConstructor;
4290
- }
4291
- // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
4292
- interface CryptoKeyConstructor {
4293
- /** Illegal constructor */
4294
- (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
4295
- readonly length: 0;
4296
- readonly name: "CryptoKey";
4297
- readonly prototype: CryptoKey;
4298
4896
  }
4299
4897
  /**
4300
4898
  * @since v15.0.0
@@ -4349,31 +4947,81 @@ declare module "crypto" {
4349
4947
  */
4350
4948
  publicKey: CryptoKey;
4351
4949
  }
4950
+ interface EncapsulatedBits {
4951
+ sharedKey: ArrayBuffer;
4952
+ ciphertext: ArrayBuffer;
4953
+ }
4954
+ interface EncapsulatedKey {
4955
+ sharedKey: CryptoKey;
4956
+ ciphertext: ArrayBuffer;
4957
+ }
4352
4958
  /**
4353
4959
  * @since v15.0.0
4354
4960
  */
4355
4961
  interface SubtleCrypto {
4962
+ /**
4963
+ * A message recipient uses their asymmetric private key to decrypt an
4964
+ * "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
4965
+ * key (represented as `ArrayBuffer`) which is then used to decrypt a message.
4966
+ *
4967
+ * The algorithms currently supported include:
4968
+ *
4969
+ * * `'ML-KEM-512'`
4970
+ * * `'ML-KEM-768'`
4971
+ * * `'ML-KEM-1024'`
4972
+ * @since v24.7.0
4973
+ * @returns Fulfills with `ArrayBuffer` upon success.
4974
+ */
4975
+ decapsulateBits(
4976
+ decapsulationAlgorithm: AlgorithmIdentifier,
4977
+ decapsulationKey: CryptoKey,
4978
+ ciphertext: BufferSource,
4979
+ ): Promise<ArrayBuffer>;
4980
+ /**
4981
+ * A message recipient uses their asymmetric private key to decrypt an
4982
+ * "encapsulated key" (ciphertext), thereby recovering a temporary symmetric
4983
+ * key (represented as `CryptoKey`) which is then used to decrypt a message.
4984
+ *
4985
+ * The algorithms currently supported include:
4986
+ *
4987
+ * * `'ML-KEM-512'`
4988
+ * * `'ML-KEM-768'`
4989
+ * * `'ML-KEM-1024'`
4990
+ * @since v24.7.0
4991
+ * @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
4992
+ * @returns Fulfills with `CryptoKey` upon success.
4993
+ */
4994
+ decapsulateKey(
4995
+ decapsulationAlgorithm: AlgorithmIdentifier,
4996
+ decapsulationKey: CryptoKey,
4997
+ ciphertext: BufferSource,
4998
+ sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
4999
+ extractable: boolean,
5000
+ usages: KeyUsage[],
5001
+ ): Promise<CryptoKey>;
4356
5002
  /**
4357
5003
  * Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
4358
- * `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
5004
+ * this method attempts to decipher the provided `data`. If successful,
4359
5005
  * the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
4360
5006
  *
4361
5007
  * The algorithms currently supported include:
4362
5008
  *
4363
- * - `'RSA-OAEP'`
4364
- * - `'AES-CTR'`
4365
- * - `'AES-CBC'`
4366
- * - `'AES-GCM'`
5009
+ * * `'AES-CBC'`
5010
+ * * `'AES-CTR'`
5011
+ * * `'AES-GCM'`
5012
+ * * `'AES-OCB'`
5013
+ * * `'ChaCha20-Poly1305'`
5014
+ * * `'RSA-OAEP'`
4367
5015
  * @since v15.0.0
4368
5016
  */
4369
5017
  decrypt(
4370
- algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
5018
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4371
5019
  key: CryptoKey,
4372
5020
  data: BufferSource,
4373
5021
  ): Promise<ArrayBuffer>;
4374
5022
  /**
4375
5023
  * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
4376
- * `subtle.deriveBits()` attempts to generate `length` bits.
5024
+ * this method attempts to generate `length` bits.
4377
5025
  * The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
4378
5026
  * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
4379
5027
  * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
@@ -4381,11 +5029,14 @@ declare module "crypto" {
4381
5029
  *
4382
5030
  * The algorithms currently supported include:
4383
5031
  *
4384
- * - `'ECDH'`
4385
- * - `'X25519'`
4386
- * - `'X448'`
4387
- * - `'HKDF'`
4388
- * - `'PBKDF2'`
5032
+ * * `'Argon2d'`
5033
+ * * `'Argon2i'`
5034
+ * * `'Argon2id'`
5035
+ * * `'ECDH'`
5036
+ * * `'HKDF'`
5037
+ * * `'PBKDF2'`
5038
+ * * `'X25519'`
5039
+ * * `'X448'`
4389
5040
  * @since v15.0.0
4390
5041
  */
4391
5042
  deriveBits(
@@ -4394,31 +5045,34 @@ declare module "crypto" {
4394
5045
  length?: number | null,
4395
5046
  ): Promise<ArrayBuffer>;
4396
5047
  deriveBits(
4397
- algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
5048
+ algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
4398
5049
  baseKey: CryptoKey,
4399
5050
  length: number,
4400
5051
  ): Promise<ArrayBuffer>;
4401
5052
  /**
4402
5053
  * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
4403
- * `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
5054
+ * this method attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
4404
5055
  *
4405
5056
  * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
4406
5057
  * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
4407
5058
  *
4408
5059
  * The algorithms currently supported include:
4409
5060
  *
4410
- * - `'ECDH'`
4411
- * - `'X25519'`
4412
- * - `'X448'`
4413
- * - `'HKDF'`
4414
- * - `'PBKDF2'`
5061
+ * * `'Argon2d'`
5062
+ * * `'Argon2i'`
5063
+ * * `'Argon2id'`
5064
+ * * `'ECDH'`
5065
+ * * `'HKDF'`
5066
+ * * `'PBKDF2'`
5067
+ * * `'X25519'`
5068
+ * * `'X448'`
4415
5069
  * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4416
5070
  * @since v15.0.0
4417
5071
  */
4418
5072
  deriveKey(
4419
- algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
5073
+ algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
4420
5074
  baseKey: CryptoKey,
4421
- derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
5075
+ derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
4422
5076
  extractable: boolean,
4423
5077
  keyUsages: readonly KeyUsage[],
4424
5078
  ): Promise<CryptoKey>;
@@ -4428,30 +5082,73 @@ declare module "crypto" {
4428
5082
  *
4429
5083
  * If `algorithm` is provided as a `<string>`, it must be one of:
4430
5084
  *
4431
- * - `'SHA-1'`
4432
- * - `'SHA-256'`
4433
- * - `'SHA-384'`
4434
- * - `'SHA-512'`
5085
+ * * `'cSHAKE128'`
5086
+ * * `'cSHAKE256'`
5087
+ * * `'SHA-1'`
5088
+ * * `'SHA-256'`
5089
+ * * `'SHA-384'`
5090
+ * * `'SHA-512'`
5091
+ * * `'SHA3-256'`
5092
+ * * `'SHA3-384'`
5093
+ * * `'SHA3-512'`
4435
5094
  *
4436
5095
  * If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
4437
5096
  * @since v15.0.0
4438
5097
  */
4439
- digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
5098
+ digest(algorithm: AlgorithmIdentifier | CShakeParams, data: BufferSource): Promise<ArrayBuffer>;
5099
+ /**
5100
+ * Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
5101
+ * This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`.
5102
+ *
5103
+ * The algorithms currently supported include:
5104
+ *
5105
+ * * `'ML-KEM-512'`
5106
+ * * `'ML-KEM-768'`
5107
+ * * `'ML-KEM-1024'`
5108
+ * @since v24.7.0
5109
+ * @returns Fulfills with `EncapsulatedBits` upon success.
5110
+ */
5111
+ encapsulateBits(
5112
+ encapsulationAlgorithm: AlgorithmIdentifier,
5113
+ encapsulationKey: CryptoKey,
5114
+ ): Promise<EncapsulatedBits>;
5115
+ /**
5116
+ * Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
5117
+ * This encrypted key is the "encapsulated key" represented as `EncapsulatedKey`.
5118
+ *
5119
+ * The algorithms currently supported include:
5120
+ *
5121
+ * * `'ML-KEM-512'`
5122
+ * * `'ML-KEM-768'`
5123
+ * * `'ML-KEM-1024'`
5124
+ * @since v24.7.0
5125
+ * @param usages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
5126
+ * @returns Fulfills with `EncapsulatedKey` upon success.
5127
+ */
5128
+ encapsulateKey(
5129
+ encapsulationAlgorithm: AlgorithmIdentifier,
5130
+ encapsulationKey: CryptoKey,
5131
+ sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
5132
+ extractable: boolean,
5133
+ usages: KeyUsage[],
5134
+ ): Promise<EncapsulatedKey>;
4440
5135
  /**
4441
5136
  * Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
4442
- * `subtle.encrypt()` attempts to encipher `data`. If successful,
5137
+ * this method attempts to encipher `data`. If successful,
4443
5138
  * the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
4444
5139
  *
4445
5140
  * The algorithms currently supported include:
4446
5141
  *
4447
- * - `'RSA-OAEP'`
4448
- * - `'AES-CTR'`
4449
- * - `'AES-CBC'`
4450
- * - `'AES-GCM'`
5142
+ * * `'AES-CBC'`
5143
+ * * `'AES-CTR'`
5144
+ * * `'AES-GCM'`
5145
+ * * `'AES-OCB'`
5146
+ * * `'ChaCha20-Poly1305'`
5147
+ * * `'RSA-OAEP'`
4451
5148
  * @since v15.0.0
4452
5149
  */
4453
5150
  encrypt(
4454
- algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
5151
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4455
5152
  key: CryptoKey,
4456
5153
  data: BufferSource,
4457
5154
  ): Promise<ArrayBuffer>;
@@ -4465,35 +5162,47 @@ declare module "crypto" {
4465
5162
  *
4466
5163
  * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
4467
5164
  * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
4468
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
5165
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
5166
+ * `'raw-public'`, or `'raw-seed'`.
4469
5167
  * @returns `<Promise>` containing `<ArrayBuffer>`.
4470
5168
  * @since v15.0.0
4471
5169
  */
4472
5170
  exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
4473
5171
  exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
4474
5172
  /**
4475
- * Using the method and parameters provided in `algorithm`,
4476
- * `subtle.generateKey()` attempts to generate new keying material.
4477
- * Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
5173
+ * Using the parameters provided in `algorithm`, this method
5174
+ * attempts to generate new keying material. Depending on the algorithm used
5175
+ * either a single `CryptoKey` or a `CryptoKeyPair` is generated.
4478
5176
  *
4479
- * The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
5177
+ * The `CryptoKeyPair` (public and private key) generating algorithms supported
5178
+ * include:
4480
5179
  *
4481
- * - `'RSASSA-PKCS1-v1_5'`
4482
- * - `'RSA-PSS'`
4483
- * - `'RSA-OAEP'`
4484
- * - `'ECDSA'`
4485
- * - `'Ed25519'`
4486
- * - `'Ed448'`
4487
- * - `'ECDH'`
4488
- * - `'X25519'`
4489
- * - `'X448'`
4490
- * The `<CryptoKey>` (secret key) generating algorithms supported include:
5180
+ * * `'ECDH'`
5181
+ * * `'ECDSA'`
5182
+ * * `'Ed25519'`
5183
+ * * `'Ed448'`
5184
+ * * `'ML-DSA-44'`
5185
+ * * `'ML-DSA-65'`
5186
+ * * `'ML-DSA-87'`
5187
+ * * `'ML-KEM-512'`
5188
+ * * `'ML-KEM-768'`
5189
+ * * `'ML-KEM-1024'`
5190
+ * * `'RSA-OAEP'`
5191
+ * * `'RSA-PSS'`
5192
+ * * `'RSASSA-PKCS1-v1_5'`
5193
+ * * `'X25519'`
5194
+ * * `'X448'`
4491
5195
  *
4492
- * - `'HMAC'`
4493
- * - `'AES-CTR'`
4494
- * - `'AES-CBC'`
4495
- * - `'AES-GCM'`
4496
- * - `'AES-KW'`
5196
+ * The `CryptoKey` (secret key) generating algorithms supported include:
5197
+ * * `'AES-CBC'`
5198
+ * * `'AES-CTR'`
5199
+ * * `'AES-GCM'`
5200
+ * * `'AES-KW'`
5201
+ * * `'AES-OCB'`
5202
+ * * `'ChaCha20-Poly1305'`
5203
+ * * `'HMAC'`
5204
+ * * `'KMAC128'`
5205
+ * * `'KMAC256'`
4497
5206
  * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4498
5207
  * @since v15.0.0
4499
5208
  */
@@ -4503,7 +5212,7 @@ declare module "crypto" {
4503
5212
  keyUsages: readonly KeyUsage[],
4504
5213
  ): Promise<CryptoKeyPair>;
4505
5214
  generateKey(
4506
- algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
5215
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams,
4507
5216
  extractable: boolean,
4508
5217
  keyUsages: readonly KeyUsage[],
4509
5218
  ): Promise<CryptoKey>;
@@ -4513,12 +5222,23 @@ declare module "crypto" {
4513
5222
  keyUsages: KeyUsage[],
4514
5223
  ): Promise<CryptoKeyPair | CryptoKey>;
4515
5224
  /**
4516
- * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
4517
- * to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
4518
- * If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
5225
+ * Derives the public key from a given private key.
5226
+ * @since v24.7.0
5227
+ * @param key A private key from which to derive the corresponding public key.
5228
+ * @param keyUsages See [Key usages](https://nodejs.org/docs/latest-v24.x/api/webcrypto.html#cryptokeyusages).
5229
+ * @returns Fulfills with a `CryptoKey` upon success.
5230
+ */
5231
+ getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise<CryptoKey>;
5232
+ /**
5233
+ * This method attempts to interpret the provided `keyData`
5234
+ * as the given `format` to create a `CryptoKey` instance using the provided
5235
+ * `algorithm`, `extractable`, and `keyUsages` arguments. If the import is
5236
+ * successful, the returned promise will be resolved with a {CryptoKey}
5237
+ * representation of the key material.
4519
5238
  *
4520
- * If importing a `'PBKDF2'` key, `extractable` must be `false`.
4521
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
5239
+ * If importing KDF algorithm keys, `extractable` must be `false`.
5240
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
5241
+ * `'raw-public'`, or `'raw-seed'`.
4522
5242
  * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4523
5243
  * @since v15.0.0
4524
5244
  */
@@ -4530,7 +5250,8 @@ declare module "crypto" {
4530
5250
  | RsaHashedImportParams
4531
5251
  | EcKeyImportParams
4532
5252
  | HmacImportParams
4533
- | AesKeyAlgorithm,
5253
+ | AesKeyAlgorithm
5254
+ | KmacImportParams,
4534
5255
  extractable: boolean,
4535
5256
  keyUsages: readonly KeyUsage[],
4536
5257
  ): Promise<CryptoKey>;
@@ -4542,62 +5263,81 @@ declare module "crypto" {
4542
5263
  | RsaHashedImportParams
4543
5264
  | EcKeyImportParams
4544
5265
  | HmacImportParams
4545
- | AesKeyAlgorithm,
5266
+ | AesKeyAlgorithm
5267
+ | KmacImportParams,
4546
5268
  extractable: boolean,
4547
5269
  keyUsages: KeyUsage[],
4548
5270
  ): Promise<CryptoKey>;
4549
5271
  /**
4550
5272
  * Using the method and parameters given by `algorithm` and the keying material provided by `key`,
4551
- * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
5273
+ * this method attempts to generate a cryptographic signature of `data`. If successful,
4552
5274
  * the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
4553
5275
  *
4554
5276
  * The algorithms currently supported include:
4555
5277
  *
4556
- * - `'RSASSA-PKCS1-v1_5'`
4557
- * - `'RSA-PSS'`
4558
- * - `'ECDSA'`
4559
- * - `'Ed25519'`
4560
- * - `'Ed448'`
4561
- * - `'HMAC'`
5278
+ * * `'ECDSA'`
5279
+ * * `'Ed25519'`
5280
+ * * `'Ed448'`
5281
+ * * `'HMAC'`
5282
+ * * `'KMAC128'`
5283
+ * * `'KMAC256'`
5284
+ * * `'ML-DSA-44'`
5285
+ * * `'ML-DSA-65'`
5286
+ * * `'ML-DSA-87'`
5287
+ * * `'RSA-PSS'`
5288
+ * * `'RSASSA-PKCS1-v1_5'`
4562
5289
  * @since v15.0.0
4563
5290
  */
4564
5291
  sign(
4565
- algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
5292
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
4566
5293
  key: CryptoKey,
4567
5294
  data: BufferSource,
4568
5295
  ): Promise<ArrayBuffer>;
4569
5296
  /**
4570
5297
  * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
4571
- * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
5298
+ * This method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
4572
5299
  * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
4573
5300
  * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
4574
5301
  * If successful, the returned promise is resolved with a `<CryptoKey>` object.
4575
5302
  *
4576
5303
  * The wrapping algorithms currently supported include:
4577
5304
  *
4578
- * - `'RSA-OAEP'`
4579
- * - `'AES-CTR'`
4580
- * - `'AES-CBC'`
4581
- * - `'AES-GCM'`
4582
- * - `'AES-KW'`
5305
+ * * `'AES-CBC'`
5306
+ * * `'AES-CTR'`
5307
+ * * `'AES-GCM'`
5308
+ * * `'AES-KW'`
5309
+ * * `'AES-OCB'`
5310
+ * * `'ChaCha20-Poly1305'`
5311
+ * * `'RSA-OAEP'`
4583
5312
  *
4584
5313
  * The unwrapped key algorithms supported include:
4585
5314
  *
4586
- * - `'RSASSA-PKCS1-v1_5'`
4587
- * - `'RSA-PSS'`
4588
- * - `'RSA-OAEP'`
4589
- * - `'ECDSA'`
4590
- * - `'Ed25519'`
4591
- * - `'Ed448'`
4592
- * - `'ECDH'`
4593
- * - `'X25519'`
4594
- * - `'X448'`
4595
- * - `'HMAC'`
4596
- * - `'AES-CTR'`
4597
- * - `'AES-CBC'`
4598
- * - `'AES-GCM'`
4599
- * - `'AES-KW'`
4600
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
5315
+ * * `'AES-CBC'`
5316
+ * * `'AES-CTR'`
5317
+ * * `'AES-GCM'`
5318
+ * * `'AES-KW'`
5319
+ * * `'AES-OCB'`
5320
+ * * `'ChaCha20-Poly1305'`
5321
+ * * `'ECDH'`
5322
+ * * `'ECDSA'`
5323
+ * * `'Ed25519'`
5324
+ * * `'Ed448'`
5325
+ * * `'HMAC'`
5326
+ * * `'KMAC128'`
5327
+ * * `'KMAC256'`
5328
+ * * `'ML-DSA-44'`
5329
+ * * `'ML-DSA-65'`
5330
+ * * `'ML-DSA-87'`
5331
+ * * `'ML-KEM-512'`
5332
+ * * `'ML-KEM-768'`
5333
+ * * `'ML-KEM-1024'`
5334
+ * * `'RSA-OAEP'`
5335
+ * * `'RSA-PSS'`
5336
+ * * `'RSASSA-PKCS1-v1_5'`
5337
+ * * `'X25519'`
5338
+ * * `'X448'`
5339
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
5340
+ * `'raw-public'`, or `'raw-seed'`.
4601
5341
  * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4602
5342
  * @since v15.0.0
4603
5343
  */
@@ -4605,40 +5345,46 @@ declare module "crypto" {
4605
5345
  format: KeyFormat,
4606
5346
  wrappedKey: BufferSource,
4607
5347
  unwrappingKey: CryptoKey,
4608
- unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
5348
+ unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4609
5349
  unwrappedKeyAlgorithm:
4610
5350
  | AlgorithmIdentifier
4611
5351
  | RsaHashedImportParams
4612
5352
  | EcKeyImportParams
4613
5353
  | HmacImportParams
4614
- | AesKeyAlgorithm,
5354
+ | AesKeyAlgorithm
5355
+ | KmacImportParams,
4615
5356
  extractable: boolean,
4616
5357
  keyUsages: KeyUsage[],
4617
5358
  ): Promise<CryptoKey>;
4618
5359
  /**
4619
5360
  * Using the method and parameters given in `algorithm` and the keying material provided by `key`,
4620
- * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
5361
+ * This method attempts to verify that `signature` is a valid cryptographic signature of `data`.
4621
5362
  * The returned promise is resolved with either `true` or `false`.
4622
5363
  *
4623
5364
  * The algorithms currently supported include:
4624
5365
  *
4625
- * - `'RSASSA-PKCS1-v1_5'`
4626
- * - `'RSA-PSS'`
4627
- * - `'ECDSA'`
4628
- * - `'Ed25519'`
4629
- * - `'Ed448'`
4630
- * - `'HMAC'`
5366
+ * * `'ECDSA'`
5367
+ * * `'Ed25519'`
5368
+ * * `'Ed448'`
5369
+ * * `'HMAC'`
5370
+ * * `'KMAC128'`
5371
+ * * `'KMAC256'`
5372
+ * * `'ML-DSA-44'`
5373
+ * * `'ML-DSA-65'`
5374
+ * * `'ML-DSA-87'`
5375
+ * * `'RSA-PSS'`
5376
+ * * `'RSASSA-PKCS1-v1_5'`
4631
5377
  * @since v15.0.0
4632
5378
  */
4633
5379
  verify(
4634
- algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
5380
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
4635
5381
  key: CryptoKey,
4636
5382
  signature: BufferSource,
4637
5383
  data: BufferSource,
4638
5384
  ): Promise<boolean>;
4639
5385
  /**
4640
5386
  * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
4641
- * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
5387
+ * This method exports the keying material into the format identified by `format`,
4642
5388
  * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
4643
5389
  * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
4644
5390
  * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
@@ -4646,30 +5392,25 @@ declare module "crypto" {
4646
5392
  *
4647
5393
  * The wrapping algorithms currently supported include:
4648
5394
  *
4649
- * - `'RSA-OAEP'`
4650
- * - `'AES-CTR'`
4651
- * - `'AES-CBC'`
4652
- * - `'AES-GCM'`
4653
- * - `'AES-KW'`
4654
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
5395
+ * * `'AES-CBC'`
5396
+ * * `'AES-CTR'`
5397
+ * * `'AES-GCM'`
5398
+ * * `'AES-KW'`
5399
+ * * `'AES-OCB'`
5400
+ * * `'ChaCha20-Poly1305'`
5401
+ * * `'RSA-OAEP'`
5402
+ * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`,
5403
+ * `'raw-public'`, or `'raw-seed'`.
4655
5404
  * @since v15.0.0
4656
5405
  */
4657
5406
  wrapKey(
4658
5407
  format: KeyFormat,
4659
5408
  key: CryptoKey,
4660
5409
  wrappingKey: CryptoKey,
4661
- wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
5410
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4662
5411
  ): Promise<ArrayBuffer>;
4663
5412
  }
4664
5413
  }
4665
-
4666
- global {
4667
- var crypto: typeof globalThis extends {
4668
- crypto: infer T;
4669
- onmessage: any;
4670
- } ? T
4671
- : webcrypto.Crypto;
4672
- }
4673
5414
  }
4674
5415
  declare module "node:crypto" {
4675
5416
  export * from "crypto";