pi-codex-auto-review 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -10
- package/dist/approval-commands.d.ts +4 -0
- package/dist/approval-commands.js +103 -0
- package/dist/approval-commands.js.map +1 -0
- package/dist/approval-settings.d.ts +9 -0
- package/dist/approval-settings.js +40 -0
- package/dist/approval-settings.js.map +1 -0
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -34
- package/dist/index.js.map +1 -1
- package/dist/policy/index.d.ts +0 -1
- package/dist/policy/index.js +6 -32
- package/dist/policy/index.js.map +1 -1
- package/dist/review/investigation.d.ts +3 -3
- package/dist/review/investigation.js +1 -1
- package/dist/review/investigation.js.map +1 -1
- package/dist/review/policy.js +1 -1
- package/dist/tools/controller.d.ts +7 -4
- package/dist/tools/controller.js +51 -35
- package/dist/tools/controller.js.map +1 -1
- package/dist/tools/environment.d.ts +1 -0
- package/dist/tools/environment.js +6 -0
- package/dist/tools/environment.js.map +1 -0
- package/dist/tools/executor.d.ts +14 -0
- package/dist/tools/executor.js +75 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/mutation-queue.d.ts +1 -0
- package/dist/tools/mutation-queue.js +16 -0
- package/dist/tools/mutation-queue.js.map +1 -0
- package/docs/publishing.md +7 -7
- package/docs/security/dependencies.md +13 -3
- package/docs/testing/auto-review-protection.md +28 -8
- package/docs/usage.md +19 -16
- package/package.json +11 -14
- package/dist/sandbox/broker.d.ts +0 -1
- package/dist/sandbox/broker.js +0 -139
- package/dist/sandbox/broker.js.map +0 -1
- package/dist/sandbox/config.d.ts +0 -5
- package/dist/sandbox/config.js +0 -97
- package/dist/sandbox/config.js.map +0 -1
- package/dist/sandbox/directory-scan.d.ts +0 -1
- package/dist/sandbox/directory-scan.js +0 -32
- package/dist/sandbox/directory-scan.js.map +0 -1
- package/dist/sandbox/executor.d.ts +0 -20
- package/dist/sandbox/executor.js +0 -146
- package/dist/sandbox/executor.js.map +0 -1
- package/dist/sandbox/hard-links.d.ts +0 -4
- package/dist/sandbox/hard-links.js +0 -155
- package/dist/sandbox/hard-links.js.map +0 -1
- package/dist/sandbox/linux-read-paths.d.ts +0 -7
- package/dist/sandbox/linux-read-paths.js +0 -47
- package/dist/sandbox/linux-read-paths.js.map +0 -1
- package/dist/sandbox/paths.d.ts +0 -3
- package/dist/sandbox/paths.js +0 -10
- package/dist/sandbox/paths.js.map +0 -1
- package/dist/sandbox/runtime-write-paths.d.ts +0 -2
- package/dist/sandbox/runtime-write-paths.js +0 -8
- package/dist/sandbox/runtime-write-paths.js.map +0 -1
- package/dist/sandbox/seccomp.d.ts +0 -5
- package/dist/sandbox/seccomp.js +0 -16
- package/dist/sandbox/seccomp.js.map +0 -1
- package/dist/sandbox/worker.d.ts +0 -1
- package/dist/sandbox/worker.js +0 -78
- package/dist/sandbox/worker.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/LICENSE +0 -201
- package/node_modules/@anthropic-ai/sandbox-runtime/README.md +0 -901
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.d.ts +0 -3
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js +0 -472
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.d.ts +0 -19
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.js +0 -17
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.d.ts +0 -52
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.js +0 -153
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.d.ts +0 -164
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.js +0 -246
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.d.ts +0 -58
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.js +0 -128
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.d.ts +0 -124
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.js +0 -258
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.d.ts +0 -87
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.js +0 -138
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.d.ts +0 -67
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.js +0 -113
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.d.ts +0 -70
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.js +0 -171
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.d.ts +0 -120
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.js +0 -281
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.d.ts +0 -108
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.js +0 -208
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.d.ts +0 -82
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.js +0 -155
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.d.ts +0 -44
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js +0 -220
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.d.ts +0 -150
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js +0 -678
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.d.ts +0 -32
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.js +0 -111
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.d.ts +0 -305
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js +0 -2605
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.d.ts +0 -55
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.js +0 -152
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.d.ts +0 -12
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.js +0 -43
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.d.ts +0 -116
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js +0 -1195
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.d.ts +0 -200
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js +0 -443
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.d.ts +0 -28
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.js +0 -114
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.d.ts +0 -59
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.js +0 -159
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.d.ts +0 -147
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js +0 -445
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts +0 -17
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.js +0 -163
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.d.ts +0 -83
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.js +0 -212
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.d.ts +0 -76
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js +0 -221
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.d.ts +0 -1691
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js +0 -1233
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.d.ts +0 -97
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js +0 -1937
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.d.ts +0 -113
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.js +0 -3
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.d.ts +0 -411
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js +0 -1408
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.d.ts +0 -37
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js +0 -125
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.d.ts +0 -57
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js +0 -332
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.d.ts +0 -100
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.js +0 -546
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.d.ts +0 -923
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.js +0 -1419
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.d.ts +0 -31
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.js +0 -69
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.d.ts +0 -7
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js +0 -25
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.d.ts +0 -15
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js +0 -49
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.d.ts +0 -17
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js +0 -37
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.d.ts +0 -27
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.js +0 -47
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.d.ts +0 -9
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js +0 -25
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/package.json +0 -88
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/java-proxy-agent/build.ts +0 -95
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/java-proxy-agent/srt-proxy-agent.jar +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/seccomp/arm64/apply-seccomp +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/seccomp/build.ts +0 -69
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/seccomp/x64/apply-seccomp +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/srt-win/arm64/srt-win.exe +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/srt-win/build.ts +0 -28
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/srt-win/x64/srt-win.exe +0 -0
- package/node_modules/@pondwader/socks5-server/.github/workflows/ci.yml +0 -27
- package/node_modules/@pondwader/socks5-server/LICENSE +0 -20
- package/node_modules/@pondwader/socks5-server/README.md +0 -151
- package/node_modules/@pondwader/socks5-server/dist/index.d.mts +0 -87
- package/node_modules/@pondwader/socks5-server/dist/index.d.ts +0 -87
- package/node_modules/@pondwader/socks5-server/dist/index.js +0 -346
- package/node_modules/@pondwader/socks5-server/dist/index.mjs +0 -307
- package/node_modules/@pondwader/socks5-server/package.json +0 -31
- package/node_modules/commander/LICENSE +0 -22
- package/node_modules/commander/Readme.md +0 -1157
- package/node_modules/commander/esm.mjs +0 -16
- package/node_modules/commander/index.js +0 -24
- package/node_modules/commander/lib/argument.js +0 -149
- package/node_modules/commander/lib/command.js +0 -2509
- package/node_modules/commander/lib/error.js +0 -39
- package/node_modules/commander/lib/help.js +0 -520
- package/node_modules/commander/lib/option.js +0 -330
- package/node_modules/commander/lib/suggestSimilar.js +0 -101
- package/node_modules/commander/package-support.json +0 -16
- package/node_modules/commander/package.json +0 -84
- package/node_modules/commander/typings/esm.d.mts +0 -3
- package/node_modules/commander/typings/index.d.ts +0 -969
- package/node_modules/node-forge/.editorconfig +0 -17
- package/node_modules/node-forge/.eslintrc.js +0 -24
- package/node_modules/node-forge/.github/workflows/main.yaml +0 -96
- package/node_modules/node-forge/.istanbul.yml +0 -2
- package/node_modules/node-forge/.npmignore +0 -15
- package/node_modules/node-forge/CHANGELOG.md +0 -555
- package/node_modules/node-forge/CONTRIBUTING.md +0 -18
- package/node_modules/node-forge/LICENSE +0 -331
- package/node_modules/node-forge/README.md +0 -2071
- package/node_modules/node-forge/RELEASE.md +0 -19
- package/node_modules/node-forge/SECURITY.md +0 -5
- package/node_modules/node-forge/examples/create-cert.js +0 -110
- package/node_modules/node-forge/examples/create-csr.js +0 -66
- package/node_modules/node-forge/examples/create-pkcs12.js +0 -160
- package/node_modules/node-forge/examples/imap.js +0 -46
- package/node_modules/node-forge/examples/sign-p7.js +0 -115
- package/node_modules/node-forge/examples/tls.js +0 -189
- package/node_modules/node-forge/flash/PooledSocket.as +0 -18
- package/node_modules/node-forge/flash/README.md +0 -48
- package/node_modules/node-forge/flash/SocketEvent.as +0 -36
- package/node_modules/node-forge/flash/SocketPool.as +0 -754
- package/node_modules/node-forge/flash/mod_fsp/README +0 -135
- package/node_modules/node-forge/flash/mod_fsp/mod_fsp.c +0 -415
- package/node_modules/node-forge/flash/package.json +0 -28
- package/node_modules/node-forge/flash/policyserver.js +0 -65
- package/node_modules/node-forge/flash/policyserver.py +0 -112
- package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/node_modules/node-forge/karma-sauce.conf.js +0 -79
- package/node_modules/node-forge/karma.conf.js +0 -133
- package/node_modules/node-forge/lib/aes.js +0 -1091
- package/node_modules/node-forge/lib/aesCipherSuites.js +0 -282
- package/node_modules/node-forge/lib/asn1-validator.js +0 -91
- package/node_modules/node-forge/lib/asn1.js +0 -1503
- package/node_modules/node-forge/lib/baseN.js +0 -186
- package/node_modules/node-forge/lib/cipher.js +0 -230
- package/node_modules/node-forge/lib/cipherModes.js +0 -999
- package/node_modules/node-forge/lib/des.js +0 -496
- package/node_modules/node-forge/lib/ed25519.js +0 -1091
- package/node_modules/node-forge/lib/forge.js +0 -13
- package/node_modules/node-forge/lib/form.js +0 -149
- package/node_modules/node-forge/lib/hmac.js +0 -146
- package/node_modules/node-forge/lib/http.js +0 -1346
- package/node_modules/node-forge/lib/index.all.js +0 -16
- package/node_modules/node-forge/lib/index.js +0 -33
- package/node_modules/node-forge/lib/jsbn.js +0 -1294
- package/node_modules/node-forge/lib/kem.js +0 -168
- package/node_modules/node-forge/lib/log.js +0 -319
- package/node_modules/node-forge/lib/md.all.js +0 -13
- package/node_modules/node-forge/lib/md.js +0 -11
- package/node_modules/node-forge/lib/md5.js +0 -289
- package/node_modules/node-forge/lib/mgf.js +0 -12
- package/node_modules/node-forge/lib/mgf1.js +0 -57
- package/node_modules/node-forge/lib/oids.js +0 -180
- package/node_modules/node-forge/lib/pbe.js +0 -1023
- package/node_modules/node-forge/lib/pbkdf2.js +0 -211
- package/node_modules/node-forge/lib/pem.js +0 -237
- package/node_modules/node-forge/lib/pkcs1.js +0 -276
- package/node_modules/node-forge/lib/pkcs12.js +0 -1078
- package/node_modules/node-forge/lib/pkcs7.js +0 -1260
- package/node_modules/node-forge/lib/pkcs7asn1.js +0 -410
- package/node_modules/node-forge/lib/pki.js +0 -102
- package/node_modules/node-forge/lib/prime.js +0 -297
- package/node_modules/node-forge/lib/prime.worker.js +0 -168
- package/node_modules/node-forge/lib/prng.js +0 -419
- package/node_modules/node-forge/lib/pss.js +0 -241
- package/node_modules/node-forge/lib/random.js +0 -191
- package/node_modules/node-forge/lib/rc2.js +0 -410
- package/node_modules/node-forge/lib/rsa.js +0 -1973
- package/node_modules/node-forge/lib/sha1.js +0 -319
- package/node_modules/node-forge/lib/sha256.js +0 -327
- package/node_modules/node-forge/lib/sha512.js +0 -561
- package/node_modules/node-forge/lib/socket.js +0 -287
- package/node_modules/node-forge/lib/ssh.js +0 -236
- package/node_modules/node-forge/lib/tls.js +0 -4282
- package/node_modules/node-forge/lib/tlssocket.js +0 -249
- package/node_modules/node-forge/lib/util.js +0 -2652
- package/node_modules/node-forge/lib/x509.js +0 -3251
- package/node_modules/node-forge/lib/xhr.js +0 -738
- package/node_modules/node-forge/package.json +0 -123
- package/node_modules/node-forge/tests/.eslintrc.js +0 -5
- package/node_modules/node-forge/tests/README.md +0 -4
- package/node_modules/node-forge/tests/benchmarks/aes-speed.js +0 -62
- package/node_modules/node-forge/tests/benchmarks/so-44303784.js +0 -246
- package/node_modules/node-forge/tests/flash/README.md +0 -7
- package/node_modules/node-forge/tests/flash/Test.as +0 -96
- package/node_modules/node-forge/tests/flash/build-flash.xml +0 -7
- package/node_modules/node-forge/tests/flash/index.html +0 -28
- package/node_modules/node-forge/tests/index.html +0 -33
- package/node_modules/node-forge/tests/issues/heartbleed.js +0 -55
- package/node_modules/node-forge/tests/issues/issue-428.html +0 -95
- package/node_modules/node-forge/tests/issues/issue-428.js +0 -375
- package/node_modules/node-forge/tests/karma/index.js +0 -8
- package/node_modules/node-forge/tests/karma/testWorker.js +0 -65
- package/node_modules/node-forge/tests/karma/web-worker-rsa.js +0 -55
- package/node_modules/node-forge/tests/legacy/common.html +0 -65
- package/node_modules/node-forge/tests/legacy/common.js +0 -2199
- package/node_modules/node-forge/tests/legacy/form.html +0 -148
- package/node_modules/node-forge/tests/legacy/form.js +0 -40
- package/node_modules/node-forge/tests/legacy/http.html +0 -235
- package/node_modules/node-forge/tests/legacy/index.html +0 -70
- package/node_modules/node-forge/tests/legacy/keygen.html +0 -113
- package/node_modules/node-forge/tests/legacy/login.css +0 -26
- package/node_modules/node-forge/tests/legacy/loginDemo.html +0 -32
- package/node_modules/node-forge/tests/legacy/loginDemo.js +0 -149
- package/node_modules/node-forge/tests/legacy/performance.html +0 -533
- package/node_modules/node-forge/tests/legacy/result.txt +0 -1
- package/node_modules/node-forge/tests/legacy/socketPool.html +0 -302
- package/node_modules/node-forge/tests/legacy/tasks.html +0 -54
- package/node_modules/node-forge/tests/legacy/tasks.js +0 -378
- package/node_modules/node-forge/tests/legacy/tls.html +0 -389
- package/node_modules/node-forge/tests/legacy/webid.html +0 -89
- package/node_modules/node-forge/tests/legacy/webid.js +0 -313
- package/node_modules/node-forge/tests/legacy/ws-webid.js +0 -120
- package/node_modules/node-forge/tests/legacy/xhr.html +0 -67
- package/node_modules/node-forge/tests/legacy/xhr.js +0 -590
- package/node_modules/node-forge/tests/pocs/ghsa-2328-f5f3-gj25.js +0 -85
- package/node_modules/node-forge/tests/pocs/ghsa-ppp5-5v6c-4jwp.js +0 -166
- package/node_modules/node-forge/tests/pocs/ghsa-q67f-28xg-22rw.js +0 -103
- package/node_modules/node-forge/tests/security/cve-2025-12816.js +0 -75
- package/node_modules/node-forge/tests/security/ghsa-554w-wpv2-vw27.js +0 -81
- package/node_modules/node-forge/tests/security/index.js +0 -3
- package/node_modules/node-forge/tests/server.crt +0 -26
- package/node_modules/node-forge/tests/server.js +0 -87
- package/node_modules/node-forge/tests/server.key +0 -27
- package/node_modules/node-forge/tests/support/task.js +0 -718
- package/node_modules/node-forge/tests/tests.css +0 -61
- package/node_modules/node-forge/tests/unit/aes.js +0 -1498
- package/node_modules/node-forge/tests/unit/asn1.js +0 -1337
- package/node_modules/node-forge/tests/unit/csr.js +0 -129
- package/node_modules/node-forge/tests/unit/des.js +0 -231
- package/node_modules/node-forge/tests/unit/ed25519.js +0 -395
- package/node_modules/node-forge/tests/unit/forge.js +0 -2
- package/node_modules/node-forge/tests/unit/hmac.js +0 -64
- package/node_modules/node-forge/tests/unit/index.html +0 -20
- package/node_modules/node-forge/tests/unit/index.js +0 -27
- package/node_modules/node-forge/tests/unit/jsbn.js +0 -40
- package/node_modules/node-forge/tests/unit/kem.js +0 -167
- package/node_modules/node-forge/tests/unit/md5.js +0 -114
- package/node_modules/node-forge/tests/unit/mgf1.js +0 -16
- package/node_modules/node-forge/tests/unit/pbkdf2.js +0 -182
- package/node_modules/node-forge/tests/unit/pem.js +0 -159
- package/node_modules/node-forge/tests/unit/pkcs1.js +0 -1077
- package/node_modules/node-forge/tests/unit/pkcs12.js +0 -739
- package/node_modules/node-forge/tests/unit/pkcs7.js +0 -792
- package/node_modules/node-forge/tests/unit/random.js +0 -48
- package/node_modules/node-forge/tests/unit/rc2.js +0 -88
- package/node_modules/node-forge/tests/unit/rsa.js +0 -1278
- package/node_modules/node-forge/tests/unit/sha1.js +0 -72
- package/node_modules/node-forge/tests/unit/sha256.js +0 -79
- package/node_modules/node-forge/tests/unit/sha512.js +0 -200
- package/node_modules/node-forge/tests/unit/ssh.js +0 -175
- package/node_modules/node-forge/tests/unit/tls.js +0 -175
- package/node_modules/node-forge/tests/unit/util.js +0 -595
- package/node_modules/node-forge/tests/unit/x509.js +0 -1986
- package/node_modules/node-forge/tests/websockets/server-webid.js +0 -495
- package/node_modules/node-forge/tests/websockets/server-ws.js +0 -158
- package/node_modules/node-forge/webpack-tests.config.js +0 -26
- package/node_modules/node-forge/webpack.config.js +0 -130
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -4
- package/node_modules/zod/index.d.ts +0 -4
- package/node_modules/zod/index.js +0 -4
- package/node_modules/zod/package.json +0 -118
- package/node_modules/zod/src/index.ts +0 -4
- package/node_modules/zod/src/v3/ZodError.ts +0 -330
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5136
- package/node_modules/zod/src/v4/classic/checks.ts +0 -30
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -66
- package/node_modules/zod/src/v4/classic/errors.ts +0 -75
- package/node_modules/zod/src/v4/classic/external.ts +0 -50
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -90
- package/node_modules/zod/src/v4/classic/parse.ts +0 -33
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2054
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -296
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -313
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -619
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -527
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -91
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -268
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -829
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -92
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -86
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -247
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -563
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -123
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -147
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -37
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -298
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -342
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -356
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -532
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -109
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -881
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -66
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -758
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2314
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -250
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -94
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1594
- package/node_modules/zod/src/v4/core/checks.ts +0 -1283
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/core.ts +0 -134
- package/node_modules/zod/src/v4/core/doc.ts +0 -44
- package/node_modules/zod/src/v4/core/errors.ts +0 -424
- package/node_modules/zod/src/v4/core/function.ts +0 -176
- package/node_modules/zod/src/v4/core/index.ts +0 -15
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -143
- package/node_modules/zod/src/v4/core/parse.ts +0 -94
- package/node_modules/zod/src/v4/core/regexes.ts +0 -135
- package/node_modules/zod/src/v4/core/registries.ts +0 -96
- package/node_modules/zod/src/v4/core/schemas.ts +0 -3842
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -977
- package/node_modules/zod/src/v4/core/util.ts +0 -775
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -125
- package/node_modules/zod/src/v4/locales/az.ts +0 -121
- package/node_modules/zod/src/v4/locales/be.ts +0 -184
- package/node_modules/zod/src/v4/locales/ca.ts +0 -127
- package/node_modules/zod/src/v4/locales/cs.ts +0 -142
- package/node_modules/zod/src/v4/locales/de.ts +0 -124
- package/node_modules/zod/src/v4/locales/en.ts +0 -127
- package/node_modules/zod/src/v4/locales/eo.ts +0 -125
- package/node_modules/zod/src/v4/locales/es.ts +0 -125
- package/node_modules/zod/src/v4/locales/fa.ts +0 -134
- package/node_modules/zod/src/v4/locales/fi.ts +0 -131
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
- package/node_modules/zod/src/v4/locales/fr.ts +0 -124
- package/node_modules/zod/src/v4/locales/he.ts +0 -125
- package/node_modules/zod/src/v4/locales/hu.ts +0 -126
- package/node_modules/zod/src/v4/locales/id.ts +0 -125
- package/node_modules/zod/src/v4/locales/index.ts +0 -39
- package/node_modules/zod/src/v4/locales/it.ts +0 -125
- package/node_modules/zod/src/v4/locales/ja.ts +0 -122
- package/node_modules/zod/src/v4/locales/kh.ts +0 -126
- package/node_modules/zod/src/v4/locales/ko.ts +0 -131
- package/node_modules/zod/src/v4/locales/mk.ts +0 -127
- package/node_modules/zod/src/v4/locales/ms.ts +0 -124
- package/node_modules/zod/src/v4/locales/nl.ts +0 -126
- package/node_modules/zod/src/v4/locales/no.ts +0 -124
- package/node_modules/zod/src/v4/locales/ota.ts +0 -125
- package/node_modules/zod/src/v4/locales/pl.ts +0 -126
- package/node_modules/zod/src/v4/locales/ps.ts +0 -133
- package/node_modules/zod/src/v4/locales/pt.ts +0 -123
- package/node_modules/zod/src/v4/locales/ru.ts +0 -184
- package/node_modules/zod/src/v4/locales/sl.ts +0 -126
- package/node_modules/zod/src/v4/locales/sv.ts +0 -127
- package/node_modules/zod/src/v4/locales/ta.ts +0 -125
- package/node_modules/zod/src/v4/locales/th.ts +0 -126
- package/node_modules/zod/src/v4/locales/tr.ts +0 -121
- package/node_modules/zod/src/v4/locales/ua.ts +0 -126
- package/node_modules/zod/src/v4/locales/ur.ts +0 -126
- package/node_modules/zod/src/v4/locales/vi.ts +0 -125
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
- package/node_modules/zod/src/v4/mini/checks.ts +0 -32
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
- package/node_modules/zod/src/v4/mini/external.ts +0 -40
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -62
- package/node_modules/zod/src/v4/mini/parse.ts +0 -1
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -1579
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -871
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -185
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -299
- package/node_modules/zod/src/v4-mini/index.ts +0 -1
- package/node_modules/zod/v3/ZodError.cjs +0 -138
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -133
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -111
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3775
- package/node_modules/zod/v3/types.d.cts +0 -1031
- package/node_modules/zod/v3/types.d.ts +0 -1031
- package/node_modules/zod/v3/types.js +0 -3693
- package/node_modules/zod/v4/classic/checks.cjs +0 -32
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -57
- package/node_modules/zod/v4/classic/compat.d.cts +0 -46
- package/node_modules/zod/v4/classic/compat.d.ts +0 -46
- package/node_modules/zod/v4/classic/compat.js +0 -27
- package/node_modules/zod/v4/classic/errors.cjs +0 -67
- package/node_modules/zod/v4/classic/errors.d.cts +0 -30
- package/node_modules/zod/v4/classic/errors.d.ts +0 -30
- package/node_modules/zod/v4/classic/errors.js +0 -41
- package/node_modules/zod/v4/classic/external.cjs +0 -70
- package/node_modules/zod/v4/classic/external.d.cts +0 -13
- package/node_modules/zod/v4/classic/external.d.ts +0 -13
- package/node_modules/zod/v4/classic/external.js +0 -18
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -4
- package/node_modules/zod/v4/classic/index.d.ts +0 -4
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -60
- package/node_modules/zod/v4/classic/iso.d.cts +0 -22
- package/node_modules/zod/v4/classic/iso.d.ts +0 -22
- package/node_modules/zod/v4/classic/iso.js +0 -30
- package/node_modules/zod/v4/classic/parse.cjs +0 -32
- package/node_modules/zod/v4/classic/parse.d.cts +0 -23
- package/node_modules/zod/v4/classic/parse.d.ts +0 -23
- package/node_modules/zod/v4/classic/parse.js +0 -6
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1109
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -630
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -630
- package/node_modules/zod/v4/classic/schemas.js +0 -1006
- package/node_modules/zod/v4/core/api.cjs +0 -1039
- package/node_modules/zod/v4/core/api.d.cts +0 -284
- package/node_modules/zod/v4/core/api.d.ts +0 -284
- package/node_modules/zod/v4/core/api.js +0 -906
- package/node_modules/zod/v4/core/checks.cjs +0 -591
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -565
- package/node_modules/zod/v4/core/core.cjs +0 -67
- package/node_modules/zod/v4/core/core.d.cts +0 -49
- package/node_modules/zod/v4/core/core.d.ts +0 -49
- package/node_modules/zod/v4/core/core.js +0 -61
- package/node_modules/zod/v4/core/doc.cjs +0 -39
- package/node_modules/zod/v4/core/doc.d.cts +0 -14
- package/node_modules/zod/v4/core/doc.d.ts +0 -14
- package/node_modules/zod/v4/core/doc.js +0 -35
- package/node_modules/zod/v4/core/errors.cjs +0 -226
- package/node_modules/zod/v4/core/errors.d.cts +0 -208
- package/node_modules/zod/v4/core/errors.d.ts +0 -208
- package/node_modules/zod/v4/core/errors.js +0 -195
- package/node_modules/zod/v4/core/function.cjs +0 -102
- package/node_modules/zod/v4/core/function.d.cts +0 -52
- package/node_modules/zod/v4/core/function.d.ts +0 -52
- package/node_modules/zod/v4/core/function.js +0 -75
- package/node_modules/zod/v4/core/index.cjs +0 -44
- package/node_modules/zod/v4/core/index.d.cts +0 -15
- package/node_modules/zod/v4/core/index.d.ts +0 -15
- package/node_modules/zod/v4/core/index.js +0 -15
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -87
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -87
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/parse.cjs +0 -87
- package/node_modules/zod/v4/core/parse.d.cts +0 -25
- package/node_modules/zod/v4/core/parse.d.ts +0 -25
- package/node_modules/zod/v4/core/parse.js +0 -57
- package/node_modules/zod/v4/core/regexes.cjs +0 -103
- package/node_modules/zod/v4/core/regexes.d.cts +0 -62
- package/node_modules/zod/v4/core/regexes.d.ts +0 -62
- package/node_modules/zod/v4/core/regexes.js +0 -95
- package/node_modules/zod/v4/core/registries.cjs +0 -56
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -51
- package/node_modules/zod/v4/core/schemas.cjs +0 -1748
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1041
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1041
- package/node_modules/zod/v4/core/schemas.js +0 -1717
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -854
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -88
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -88
- package/node_modules/zod/v4/core/to-json-schema.js +0 -849
- package/node_modules/zod/v4/core/util.cjs +0 -539
- package/node_modules/zod/v4/core/util.d.cts +0 -183
- package/node_modules/zod/v4/core/util.d.ts +0 -183
- package/node_modules/zod/v4/core/util.js +0 -493
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/index.cjs +0 -22
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -3
- package/node_modules/zod/v4/locales/ar.cjs +0 -142
- package/node_modules/zod/v4/locales/ar.d.cts +0 -4
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -116
- package/node_modules/zod/v4/locales/az.cjs +0 -141
- package/node_modules/zod/v4/locales/az.d.cts +0 -4
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -115
- package/node_modules/zod/v4/locales/be.cjs +0 -190
- package/node_modules/zod/v4/locales/be.d.cts +0 -4
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -164
- package/node_modules/zod/v4/locales/ca.cjs +0 -144
- package/node_modules/zod/v4/locales/ca.d.cts +0 -4
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -118
- package/node_modules/zod/v4/locales/cs.cjs +0 -161
- package/node_modules/zod/v4/locales/cs.d.cts +0 -4
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -135
- package/node_modules/zod/v4/locales/de.cjs +0 -142
- package/node_modules/zod/v4/locales/de.d.cts +0 -4
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -116
- package/node_modules/zod/v4/locales/en.cjs +0 -145
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -5
- package/node_modules/zod/v4/locales/en.js +0 -117
- package/node_modules/zod/v4/locales/eo.cjs +0 -144
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -5
- package/node_modules/zod/v4/locales/eo.js +0 -116
- package/node_modules/zod/v4/locales/es.cjs +0 -143
- package/node_modules/zod/v4/locales/es.d.cts +0 -4
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -117
- package/node_modules/zod/v4/locales/fa.cjs +0 -148
- package/node_modules/zod/v4/locales/fa.d.cts +0 -4
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -122
- package/node_modules/zod/v4/locales/fi.cjs +0 -148
- package/node_modules/zod/v4/locales/fi.d.cts +0 -4
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -122
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -143
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -117
- package/node_modules/zod/v4/locales/fr.cjs +0 -142
- package/node_modules/zod/v4/locales/fr.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -116
- package/node_modules/zod/v4/locales/he.cjs +0 -143
- package/node_modules/zod/v4/locales/he.d.cts +0 -4
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -117
- package/node_modules/zod/v4/locales/hu.cjs +0 -143
- package/node_modules/zod/v4/locales/hu.d.cts +0 -4
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -117
- package/node_modules/zod/v4/locales/id.cjs +0 -142
- package/node_modules/zod/v4/locales/id.d.cts +0 -4
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -116
- package/node_modules/zod/v4/locales/index.cjs +0 -84
- package/node_modules/zod/v4/locales/index.d.cts +0 -39
- package/node_modules/zod/v4/locales/index.d.ts +0 -39
- package/node_modules/zod/v4/locales/index.js +0 -39
- package/node_modules/zod/v4/locales/it.cjs +0 -143
- package/node_modules/zod/v4/locales/it.d.cts +0 -4
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -117
- package/node_modules/zod/v4/locales/ja.cjs +0 -141
- package/node_modules/zod/v4/locales/ja.d.cts +0 -4
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -115
- package/node_modules/zod/v4/locales/kh.cjs +0 -143
- package/node_modules/zod/v4/locales/kh.d.cts +0 -4
- package/node_modules/zod/v4/locales/kh.d.ts +0 -4
- package/node_modules/zod/v4/locales/kh.js +0 -117
- package/node_modules/zod/v4/locales/ko.cjs +0 -147
- package/node_modules/zod/v4/locales/ko.d.cts +0 -4
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -121
- package/node_modules/zod/v4/locales/mk.cjs +0 -144
- package/node_modules/zod/v4/locales/mk.d.cts +0 -4
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -118
- package/node_modules/zod/v4/locales/ms.cjs +0 -142
- package/node_modules/zod/v4/locales/ms.d.cts +0 -4
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -116
- package/node_modules/zod/v4/locales/nl.cjs +0 -143
- package/node_modules/zod/v4/locales/nl.d.cts +0 -4
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -117
- package/node_modules/zod/v4/locales/no.cjs +0 -142
- package/node_modules/zod/v4/locales/no.d.cts +0 -4
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -116
- package/node_modules/zod/v4/locales/ota.cjs +0 -143
- package/node_modules/zod/v4/locales/ota.d.cts +0 -4
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -117
- package/node_modules/zod/v4/locales/pl.cjs +0 -143
- package/node_modules/zod/v4/locales/pl.d.cts +0 -4
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -117
- package/node_modules/zod/v4/locales/ps.cjs +0 -148
- package/node_modules/zod/v4/locales/ps.d.cts +0 -4
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -122
- package/node_modules/zod/v4/locales/pt.cjs +0 -142
- package/node_modules/zod/v4/locales/pt.d.cts +0 -4
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -116
- package/node_modules/zod/v4/locales/ru.cjs +0 -190
- package/node_modules/zod/v4/locales/ru.d.cts +0 -4
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -164
- package/node_modules/zod/v4/locales/sl.cjs +0 -143
- package/node_modules/zod/v4/locales/sl.d.cts +0 -4
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -117
- package/node_modules/zod/v4/locales/sv.cjs +0 -144
- package/node_modules/zod/v4/locales/sv.d.cts +0 -4
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -118
- package/node_modules/zod/v4/locales/ta.cjs +0 -143
- package/node_modules/zod/v4/locales/ta.d.cts +0 -4
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -117
- package/node_modules/zod/v4/locales/th.cjs +0 -143
- package/node_modules/zod/v4/locales/th.d.cts +0 -4
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -117
- package/node_modules/zod/v4/locales/tr.cjs +0 -143
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -5
- package/node_modules/zod/v4/locales/tr.js +0 -115
- package/node_modules/zod/v4/locales/ua.cjs +0 -143
- package/node_modules/zod/v4/locales/ua.d.cts +0 -4
- package/node_modules/zod/v4/locales/ua.d.ts +0 -4
- package/node_modules/zod/v4/locales/ua.js +0 -117
- package/node_modules/zod/v4/locales/ur.cjs +0 -143
- package/node_modules/zod/v4/locales/ur.d.cts +0 -4
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -117
- package/node_modules/zod/v4/locales/vi.cjs +0 -142
- package/node_modules/zod/v4/locales/vi.d.cts +0 -4
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -116
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -142
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -116
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -143
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -117
- package/node_modules/zod/v4/mini/checks.cjs +0 -34
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -47
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -17
- package/node_modules/zod/v4/mini/external.cjs +0 -62
- package/node_modules/zod/v4/mini/external.d.cts +0 -11
- package/node_modules/zod/v4/mini/external.d.ts +0 -11
- package/node_modules/zod/v4/mini/external.js +0 -13
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -60
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -30
- package/node_modules/zod/v4/mini/parse.cjs +0 -8
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -839
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -356
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -356
- package/node_modules/zod/v4/mini/schemas.js +0 -732
- package/node_modules/zod/v4-mini/index.cjs +0 -17
- package/node_modules/zod/v4-mini/index.d.cts +0 -1
- package/node_modules/zod/v4-mini/index.d.ts +0 -1
- package/node_modules/zod/v4-mini/index.js +0 -1
|
@@ -1,999 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported cipher modes.
|
|
3
|
-
*
|
|
4
|
-
* @author Dave Longley
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2010-2014 Digital Bazaar, Inc.
|
|
7
|
-
*/
|
|
8
|
-
var forge = require('./forge');
|
|
9
|
-
require('./util');
|
|
10
|
-
|
|
11
|
-
forge.cipher = forge.cipher || {};
|
|
12
|
-
|
|
13
|
-
// supported cipher modes
|
|
14
|
-
var modes = module.exports = forge.cipher.modes = forge.cipher.modes || {};
|
|
15
|
-
|
|
16
|
-
/** Electronic codebook (ECB) (Don't use this; it's not secure) **/
|
|
17
|
-
|
|
18
|
-
modes.ecb = function(options) {
|
|
19
|
-
options = options || {};
|
|
20
|
-
this.name = 'ECB';
|
|
21
|
-
this.cipher = options.cipher;
|
|
22
|
-
this.blockSize = options.blockSize || 16;
|
|
23
|
-
this._ints = this.blockSize / 4;
|
|
24
|
-
this._inBlock = new Array(this._ints);
|
|
25
|
-
this._outBlock = new Array(this._ints);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
modes.ecb.prototype.start = function(options) {};
|
|
29
|
-
|
|
30
|
-
modes.ecb.prototype.encrypt = function(input, output, finish) {
|
|
31
|
-
// not enough input to encrypt
|
|
32
|
-
if(input.length() < this.blockSize && !(finish && input.length() > 0)) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// get next block
|
|
37
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
38
|
-
this._inBlock[i] = input.getInt32();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// encrypt block
|
|
42
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
43
|
-
|
|
44
|
-
// write output
|
|
45
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
46
|
-
output.putInt32(this._outBlock[i]);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
modes.ecb.prototype.decrypt = function(input, output, finish) {
|
|
51
|
-
// not enough input to decrypt
|
|
52
|
-
if(input.length() < this.blockSize && !(finish && input.length() > 0)) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// get next block
|
|
57
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
58
|
-
this._inBlock[i] = input.getInt32();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// decrypt block
|
|
62
|
-
this.cipher.decrypt(this._inBlock, this._outBlock);
|
|
63
|
-
|
|
64
|
-
// write output
|
|
65
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
66
|
-
output.putInt32(this._outBlock[i]);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
modes.ecb.prototype.pad = function(input, options) {
|
|
71
|
-
// add PKCS#7 padding to block (each pad byte is the
|
|
72
|
-
// value of the number of pad bytes)
|
|
73
|
-
var padding = (input.length() === this.blockSize ?
|
|
74
|
-
this.blockSize : (this.blockSize - input.length()));
|
|
75
|
-
input.fillWithByte(padding, padding);
|
|
76
|
-
return true;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
modes.ecb.prototype.unpad = function(output, options) {
|
|
80
|
-
// check for error: input data not a multiple of blockSize
|
|
81
|
-
if(options.overflow > 0) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// ensure padding byte count is valid
|
|
86
|
-
var len = output.length();
|
|
87
|
-
var count = output.at(len - 1);
|
|
88
|
-
if(count > (this.blockSize << 2)) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// trim off padding bytes
|
|
93
|
-
output.truncate(count);
|
|
94
|
-
return true;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
/** Cipher-block Chaining (CBC) **/
|
|
98
|
-
|
|
99
|
-
modes.cbc = function(options) {
|
|
100
|
-
options = options || {};
|
|
101
|
-
this.name = 'CBC';
|
|
102
|
-
this.cipher = options.cipher;
|
|
103
|
-
this.blockSize = options.blockSize || 16;
|
|
104
|
-
this._ints = this.blockSize / 4;
|
|
105
|
-
this._inBlock = new Array(this._ints);
|
|
106
|
-
this._outBlock = new Array(this._ints);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
modes.cbc.prototype.start = function(options) {
|
|
110
|
-
// Note: legacy support for using IV residue (has security flaws)
|
|
111
|
-
// if IV is null, reuse block from previous processing
|
|
112
|
-
if(options.iv === null) {
|
|
113
|
-
// must have a previous block
|
|
114
|
-
if(!this._prev) {
|
|
115
|
-
throw new Error('Invalid IV parameter.');
|
|
116
|
-
}
|
|
117
|
-
this._iv = this._prev.slice(0);
|
|
118
|
-
} else if(!('iv' in options)) {
|
|
119
|
-
throw new Error('Invalid IV parameter.');
|
|
120
|
-
} else {
|
|
121
|
-
// save IV as "previous" block
|
|
122
|
-
this._iv = transformIV(options.iv, this.blockSize);
|
|
123
|
-
this._prev = this._iv.slice(0);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
modes.cbc.prototype.encrypt = function(input, output, finish) {
|
|
128
|
-
// not enough input to encrypt
|
|
129
|
-
if(input.length() < this.blockSize && !(finish && input.length() > 0)) {
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// get next block
|
|
134
|
-
// CBC XOR's IV (or previous block) with plaintext
|
|
135
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
136
|
-
this._inBlock[i] = this._prev[i] ^ input.getInt32();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// encrypt block
|
|
140
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
141
|
-
|
|
142
|
-
// write output, save previous block
|
|
143
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
144
|
-
output.putInt32(this._outBlock[i]);
|
|
145
|
-
}
|
|
146
|
-
this._prev = this._outBlock;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
modes.cbc.prototype.decrypt = function(input, output, finish) {
|
|
150
|
-
// not enough input to decrypt
|
|
151
|
-
if(input.length() < this.blockSize && !(finish && input.length() > 0)) {
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// get next block
|
|
156
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
157
|
-
this._inBlock[i] = input.getInt32();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// decrypt block
|
|
161
|
-
this.cipher.decrypt(this._inBlock, this._outBlock);
|
|
162
|
-
|
|
163
|
-
// write output, save previous ciphered block
|
|
164
|
-
// CBC XOR's IV (or previous block) with ciphertext
|
|
165
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
166
|
-
output.putInt32(this._prev[i] ^ this._outBlock[i]);
|
|
167
|
-
}
|
|
168
|
-
this._prev = this._inBlock.slice(0);
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
modes.cbc.prototype.pad = function(input, options) {
|
|
172
|
-
// add PKCS#7 padding to block (each pad byte is the
|
|
173
|
-
// value of the number of pad bytes)
|
|
174
|
-
var padding = (input.length() === this.blockSize ?
|
|
175
|
-
this.blockSize : (this.blockSize - input.length()));
|
|
176
|
-
input.fillWithByte(padding, padding);
|
|
177
|
-
return true;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
modes.cbc.prototype.unpad = function(output, options) {
|
|
181
|
-
// check for error: input data not a multiple of blockSize
|
|
182
|
-
if(options.overflow > 0) {
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// ensure padding byte count is valid
|
|
187
|
-
var len = output.length();
|
|
188
|
-
var count = output.at(len - 1);
|
|
189
|
-
if(count > (this.blockSize << 2)) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// trim off padding bytes
|
|
194
|
-
output.truncate(count);
|
|
195
|
-
return true;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
/** Cipher feedback (CFB) **/
|
|
199
|
-
|
|
200
|
-
modes.cfb = function(options) {
|
|
201
|
-
options = options || {};
|
|
202
|
-
this.name = 'CFB';
|
|
203
|
-
this.cipher = options.cipher;
|
|
204
|
-
this.blockSize = options.blockSize || 16;
|
|
205
|
-
this._ints = this.blockSize / 4;
|
|
206
|
-
this._inBlock = null;
|
|
207
|
-
this._outBlock = new Array(this._ints);
|
|
208
|
-
this._partialBlock = new Array(this._ints);
|
|
209
|
-
this._partialOutput = forge.util.createBuffer();
|
|
210
|
-
this._partialBytes = 0;
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
modes.cfb.prototype.start = function(options) {
|
|
214
|
-
if(!('iv' in options)) {
|
|
215
|
-
throw new Error('Invalid IV parameter.');
|
|
216
|
-
}
|
|
217
|
-
// use IV as first input
|
|
218
|
-
this._iv = transformIV(options.iv, this.blockSize);
|
|
219
|
-
this._inBlock = this._iv.slice(0);
|
|
220
|
-
this._partialBytes = 0;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
modes.cfb.prototype.encrypt = function(input, output, finish) {
|
|
224
|
-
// not enough input to encrypt
|
|
225
|
-
var inputLength = input.length();
|
|
226
|
-
if(inputLength === 0) {
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// encrypt block
|
|
231
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
232
|
-
|
|
233
|
-
// handle full block
|
|
234
|
-
if(this._partialBytes === 0 && inputLength >= this.blockSize) {
|
|
235
|
-
// XOR input with output, write input as output
|
|
236
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
237
|
-
this._inBlock[i] = input.getInt32() ^ this._outBlock[i];
|
|
238
|
-
output.putInt32(this._inBlock[i]);
|
|
239
|
-
}
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// handle partial block
|
|
244
|
-
var partialBytes = (this.blockSize - inputLength) % this.blockSize;
|
|
245
|
-
if(partialBytes > 0) {
|
|
246
|
-
partialBytes = this.blockSize - partialBytes;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// XOR input with output, write input as partial output
|
|
250
|
-
this._partialOutput.clear();
|
|
251
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
252
|
-
this._partialBlock[i] = input.getInt32() ^ this._outBlock[i];
|
|
253
|
-
this._partialOutput.putInt32(this._partialBlock[i]);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if(partialBytes > 0) {
|
|
257
|
-
// block still incomplete, restore input buffer
|
|
258
|
-
input.read -= this.blockSize;
|
|
259
|
-
} else {
|
|
260
|
-
// block complete, update input block
|
|
261
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
262
|
-
this._inBlock[i] = this._partialBlock[i];
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// skip any previous partial bytes
|
|
267
|
-
if(this._partialBytes > 0) {
|
|
268
|
-
this._partialOutput.getBytes(this._partialBytes);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if(partialBytes > 0 && !finish) {
|
|
272
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
273
|
-
partialBytes - this._partialBytes));
|
|
274
|
-
this._partialBytes = partialBytes;
|
|
275
|
-
return true;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
279
|
-
inputLength - this._partialBytes));
|
|
280
|
-
this._partialBytes = 0;
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
modes.cfb.prototype.decrypt = function(input, output, finish) {
|
|
284
|
-
// not enough input to decrypt
|
|
285
|
-
var inputLength = input.length();
|
|
286
|
-
if(inputLength === 0) {
|
|
287
|
-
return true;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// encrypt block (CFB always uses encryption mode)
|
|
291
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
292
|
-
|
|
293
|
-
// handle full block
|
|
294
|
-
if(this._partialBytes === 0 && inputLength >= this.blockSize) {
|
|
295
|
-
// XOR input with output, write input as output
|
|
296
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
297
|
-
this._inBlock[i] = input.getInt32();
|
|
298
|
-
output.putInt32(this._inBlock[i] ^ this._outBlock[i]);
|
|
299
|
-
}
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// handle partial block
|
|
304
|
-
var partialBytes = (this.blockSize - inputLength) % this.blockSize;
|
|
305
|
-
if(partialBytes > 0) {
|
|
306
|
-
partialBytes = this.blockSize - partialBytes;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// XOR input with output, write input as partial output
|
|
310
|
-
this._partialOutput.clear();
|
|
311
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
312
|
-
this._partialBlock[i] = input.getInt32();
|
|
313
|
-
this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if(partialBytes > 0) {
|
|
317
|
-
// block still incomplete, restore input buffer
|
|
318
|
-
input.read -= this.blockSize;
|
|
319
|
-
} else {
|
|
320
|
-
// block complete, update input block
|
|
321
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
322
|
-
this._inBlock[i] = this._partialBlock[i];
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// skip any previous partial bytes
|
|
327
|
-
if(this._partialBytes > 0) {
|
|
328
|
-
this._partialOutput.getBytes(this._partialBytes);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if(partialBytes > 0 && !finish) {
|
|
332
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
333
|
-
partialBytes - this._partialBytes));
|
|
334
|
-
this._partialBytes = partialBytes;
|
|
335
|
-
return true;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
339
|
-
inputLength - this._partialBytes));
|
|
340
|
-
this._partialBytes = 0;
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
/** Output feedback (OFB) **/
|
|
344
|
-
|
|
345
|
-
modes.ofb = function(options) {
|
|
346
|
-
options = options || {};
|
|
347
|
-
this.name = 'OFB';
|
|
348
|
-
this.cipher = options.cipher;
|
|
349
|
-
this.blockSize = options.blockSize || 16;
|
|
350
|
-
this._ints = this.blockSize / 4;
|
|
351
|
-
this._inBlock = null;
|
|
352
|
-
this._outBlock = new Array(this._ints);
|
|
353
|
-
this._partialOutput = forge.util.createBuffer();
|
|
354
|
-
this._partialBytes = 0;
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
modes.ofb.prototype.start = function(options) {
|
|
358
|
-
if(!('iv' in options)) {
|
|
359
|
-
throw new Error('Invalid IV parameter.');
|
|
360
|
-
}
|
|
361
|
-
// use IV as first input
|
|
362
|
-
this._iv = transformIV(options.iv, this.blockSize);
|
|
363
|
-
this._inBlock = this._iv.slice(0);
|
|
364
|
-
this._partialBytes = 0;
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
modes.ofb.prototype.encrypt = function(input, output, finish) {
|
|
368
|
-
// not enough input to encrypt
|
|
369
|
-
var inputLength = input.length();
|
|
370
|
-
if(input.length() === 0) {
|
|
371
|
-
return true;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// encrypt block (OFB always uses encryption mode)
|
|
375
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
376
|
-
|
|
377
|
-
// handle full block
|
|
378
|
-
if(this._partialBytes === 0 && inputLength >= this.blockSize) {
|
|
379
|
-
// XOR input with output and update next input
|
|
380
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
381
|
-
output.putInt32(input.getInt32() ^ this._outBlock[i]);
|
|
382
|
-
this._inBlock[i] = this._outBlock[i];
|
|
383
|
-
}
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// handle partial block
|
|
388
|
-
var partialBytes = (this.blockSize - inputLength) % this.blockSize;
|
|
389
|
-
if(partialBytes > 0) {
|
|
390
|
-
partialBytes = this.blockSize - partialBytes;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
// XOR input with output
|
|
394
|
-
this._partialOutput.clear();
|
|
395
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
396
|
-
this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
if(partialBytes > 0) {
|
|
400
|
-
// block still incomplete, restore input buffer
|
|
401
|
-
input.read -= this.blockSize;
|
|
402
|
-
} else {
|
|
403
|
-
// block complete, update input block
|
|
404
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
405
|
-
this._inBlock[i] = this._outBlock[i];
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// skip any previous partial bytes
|
|
410
|
-
if(this._partialBytes > 0) {
|
|
411
|
-
this._partialOutput.getBytes(this._partialBytes);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
if(partialBytes > 0 && !finish) {
|
|
415
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
416
|
-
partialBytes - this._partialBytes));
|
|
417
|
-
this._partialBytes = partialBytes;
|
|
418
|
-
return true;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
422
|
-
inputLength - this._partialBytes));
|
|
423
|
-
this._partialBytes = 0;
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt;
|
|
427
|
-
|
|
428
|
-
/** Counter (CTR) **/
|
|
429
|
-
|
|
430
|
-
modes.ctr = function(options) {
|
|
431
|
-
options = options || {};
|
|
432
|
-
this.name = 'CTR';
|
|
433
|
-
this.cipher = options.cipher;
|
|
434
|
-
this.blockSize = options.blockSize || 16;
|
|
435
|
-
this._ints = this.blockSize / 4;
|
|
436
|
-
this._inBlock = null;
|
|
437
|
-
this._outBlock = new Array(this._ints);
|
|
438
|
-
this._partialOutput = forge.util.createBuffer();
|
|
439
|
-
this._partialBytes = 0;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
modes.ctr.prototype.start = function(options) {
|
|
443
|
-
if(!('iv' in options)) {
|
|
444
|
-
throw new Error('Invalid IV parameter.');
|
|
445
|
-
}
|
|
446
|
-
// use IV as first input
|
|
447
|
-
this._iv = transformIV(options.iv, this.blockSize);
|
|
448
|
-
this._inBlock = this._iv.slice(0);
|
|
449
|
-
this._partialBytes = 0;
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
modes.ctr.prototype.encrypt = function(input, output, finish) {
|
|
453
|
-
// not enough input to encrypt
|
|
454
|
-
var inputLength = input.length();
|
|
455
|
-
if(inputLength === 0) {
|
|
456
|
-
return true;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// encrypt block (CTR always uses encryption mode)
|
|
460
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
461
|
-
|
|
462
|
-
// handle full block
|
|
463
|
-
if(this._partialBytes === 0 && inputLength >= this.blockSize) {
|
|
464
|
-
// XOR input with output
|
|
465
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
466
|
-
output.putInt32(input.getInt32() ^ this._outBlock[i]);
|
|
467
|
-
}
|
|
468
|
-
} else {
|
|
469
|
-
// handle partial block
|
|
470
|
-
var partialBytes = (this.blockSize - inputLength) % this.blockSize;
|
|
471
|
-
if(partialBytes > 0) {
|
|
472
|
-
partialBytes = this.blockSize - partialBytes;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// XOR input with output
|
|
476
|
-
this._partialOutput.clear();
|
|
477
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
478
|
-
this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
if(partialBytes > 0) {
|
|
482
|
-
// block still incomplete, restore input buffer
|
|
483
|
-
input.read -= this.blockSize;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// skip any previous partial bytes
|
|
487
|
-
if(this._partialBytes > 0) {
|
|
488
|
-
this._partialOutput.getBytes(this._partialBytes);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
if(partialBytes > 0 && !finish) {
|
|
492
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
493
|
-
partialBytes - this._partialBytes));
|
|
494
|
-
this._partialBytes = partialBytes;
|
|
495
|
-
return true;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
499
|
-
inputLength - this._partialBytes));
|
|
500
|
-
this._partialBytes = 0;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
// block complete, increment counter (input block)
|
|
504
|
-
inc32(this._inBlock);
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt;
|
|
508
|
-
|
|
509
|
-
/** Galois/Counter Mode (GCM) **/
|
|
510
|
-
|
|
511
|
-
modes.gcm = function(options) {
|
|
512
|
-
options = options || {};
|
|
513
|
-
this.name = 'GCM';
|
|
514
|
-
this.cipher = options.cipher;
|
|
515
|
-
this.blockSize = options.blockSize || 16;
|
|
516
|
-
this._ints = this.blockSize / 4;
|
|
517
|
-
this._inBlock = new Array(this._ints);
|
|
518
|
-
this._outBlock = new Array(this._ints);
|
|
519
|
-
this._partialOutput = forge.util.createBuffer();
|
|
520
|
-
this._partialBytes = 0;
|
|
521
|
-
|
|
522
|
-
// R is actually this value concatenated with 120 more zero bits, but
|
|
523
|
-
// we only XOR against R so the other zeros have no effect -- we just
|
|
524
|
-
// apply this value to the first integer in a block
|
|
525
|
-
this._R = 0xE1000000;
|
|
526
|
-
};
|
|
527
|
-
|
|
528
|
-
modes.gcm.prototype.start = function(options) {
|
|
529
|
-
if(!('iv' in options)) {
|
|
530
|
-
throw new Error('Invalid IV parameter.');
|
|
531
|
-
}
|
|
532
|
-
// ensure IV is a byte buffer
|
|
533
|
-
var iv = forge.util.createBuffer(options.iv);
|
|
534
|
-
|
|
535
|
-
// no ciphered data processed yet
|
|
536
|
-
this._cipherLength = 0;
|
|
537
|
-
|
|
538
|
-
// default additional data is none
|
|
539
|
-
var additionalData;
|
|
540
|
-
if('additionalData' in options) {
|
|
541
|
-
additionalData = forge.util.createBuffer(options.additionalData);
|
|
542
|
-
} else {
|
|
543
|
-
additionalData = forge.util.createBuffer();
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// default tag length is 128 bits
|
|
547
|
-
if('tagLength' in options) {
|
|
548
|
-
this._tagLength = options.tagLength;
|
|
549
|
-
} else {
|
|
550
|
-
this._tagLength = 128;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
// if tag is given, ensure tag matches tag length
|
|
554
|
-
this._tag = null;
|
|
555
|
-
if(options.decrypt) {
|
|
556
|
-
// save tag to check later
|
|
557
|
-
this._tag = forge.util.createBuffer(options.tag).getBytes();
|
|
558
|
-
if(this._tag.length !== (this._tagLength / 8)) {
|
|
559
|
-
throw new Error('Authentication tag does not match tag length.');
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// create tmp storage for hash calculation
|
|
564
|
-
this._hashBlock = new Array(this._ints);
|
|
565
|
-
|
|
566
|
-
// no tag generated yet
|
|
567
|
-
this.tag = null;
|
|
568
|
-
|
|
569
|
-
// generate hash subkey
|
|
570
|
-
// (apply block cipher to "zero" block)
|
|
571
|
-
this._hashSubkey = new Array(this._ints);
|
|
572
|
-
this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey);
|
|
573
|
-
|
|
574
|
-
// generate table M
|
|
575
|
-
// use 4-bit tables (32 component decomposition of a 16 byte value)
|
|
576
|
-
// 8-bit tables take more space and are known to have security
|
|
577
|
-
// vulnerabilities (in native implementations)
|
|
578
|
-
this.componentBits = 4;
|
|
579
|
-
this._m = this.generateHashTable(this._hashSubkey, this.componentBits);
|
|
580
|
-
|
|
581
|
-
// Note: support IV length different from 96 bits? (only supporting
|
|
582
|
-
// 96 bits is recommended by NIST SP-800-38D)
|
|
583
|
-
// generate J_0
|
|
584
|
-
var ivLength = iv.length();
|
|
585
|
-
if(ivLength === 12) {
|
|
586
|
-
// 96-bit IV
|
|
587
|
-
this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1];
|
|
588
|
-
} else {
|
|
589
|
-
// IV is NOT 96-bits
|
|
590
|
-
this._j0 = [0, 0, 0, 0];
|
|
591
|
-
while(iv.length() > 0) {
|
|
592
|
-
this._j0 = this.ghash(
|
|
593
|
-
this._hashSubkey, this._j0,
|
|
594
|
-
[iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]);
|
|
595
|
-
}
|
|
596
|
-
this._j0 = this.ghash(
|
|
597
|
-
this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8)));
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
// generate ICB (initial counter block)
|
|
601
|
-
this._inBlock = this._j0.slice(0);
|
|
602
|
-
inc32(this._inBlock);
|
|
603
|
-
this._partialBytes = 0;
|
|
604
|
-
|
|
605
|
-
// consume authentication data
|
|
606
|
-
additionalData = forge.util.createBuffer(additionalData);
|
|
607
|
-
// save additional data length as a BE 64-bit number
|
|
608
|
-
this._aDataLength = from64To32(additionalData.length() * 8);
|
|
609
|
-
// pad additional data to 128 bit (16 byte) block size
|
|
610
|
-
var overflow = additionalData.length() % this.blockSize;
|
|
611
|
-
if(overflow) {
|
|
612
|
-
additionalData.fillWithByte(0, this.blockSize - overflow);
|
|
613
|
-
}
|
|
614
|
-
this._s = [0, 0, 0, 0];
|
|
615
|
-
while(additionalData.length() > 0) {
|
|
616
|
-
this._s = this.ghash(this._hashSubkey, this._s, [
|
|
617
|
-
additionalData.getInt32(),
|
|
618
|
-
additionalData.getInt32(),
|
|
619
|
-
additionalData.getInt32(),
|
|
620
|
-
additionalData.getInt32()
|
|
621
|
-
]);
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
modes.gcm.prototype.encrypt = function(input, output, finish) {
|
|
626
|
-
// not enough input to encrypt
|
|
627
|
-
var inputLength = input.length();
|
|
628
|
-
if(inputLength === 0) {
|
|
629
|
-
return true;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
// encrypt block
|
|
633
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
634
|
-
|
|
635
|
-
// handle full block
|
|
636
|
-
if(this._partialBytes === 0 && inputLength >= this.blockSize) {
|
|
637
|
-
// XOR input with output
|
|
638
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
639
|
-
output.putInt32(this._outBlock[i] ^= input.getInt32());
|
|
640
|
-
}
|
|
641
|
-
this._cipherLength += this.blockSize;
|
|
642
|
-
} else {
|
|
643
|
-
// handle partial block
|
|
644
|
-
var partialBytes = (this.blockSize - inputLength) % this.blockSize;
|
|
645
|
-
if(partialBytes > 0) {
|
|
646
|
-
partialBytes = this.blockSize - partialBytes;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
// XOR input with output
|
|
650
|
-
this._partialOutput.clear();
|
|
651
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
652
|
-
this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
if(partialBytes <= 0 || finish) {
|
|
656
|
-
// handle overflow prior to hashing
|
|
657
|
-
if(finish) {
|
|
658
|
-
// get block overflow
|
|
659
|
-
var overflow = inputLength % this.blockSize;
|
|
660
|
-
this._cipherLength += overflow;
|
|
661
|
-
// truncate for hash function
|
|
662
|
-
this._partialOutput.truncate(this.blockSize - overflow);
|
|
663
|
-
} else {
|
|
664
|
-
this._cipherLength += this.blockSize;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
// get output block for hashing
|
|
668
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
669
|
-
this._outBlock[i] = this._partialOutput.getInt32();
|
|
670
|
-
}
|
|
671
|
-
this._partialOutput.read -= this.blockSize;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// skip any previous partial bytes
|
|
675
|
-
if(this._partialBytes > 0) {
|
|
676
|
-
this._partialOutput.getBytes(this._partialBytes);
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
if(partialBytes > 0 && !finish) {
|
|
680
|
-
// block still incomplete, restore input buffer, get partial output,
|
|
681
|
-
// and return early
|
|
682
|
-
input.read -= this.blockSize;
|
|
683
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
684
|
-
partialBytes - this._partialBytes));
|
|
685
|
-
this._partialBytes = partialBytes;
|
|
686
|
-
return true;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
output.putBytes(this._partialOutput.getBytes(
|
|
690
|
-
inputLength - this._partialBytes));
|
|
691
|
-
this._partialBytes = 0;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
// update hash block S
|
|
695
|
-
this._s = this.ghash(this._hashSubkey, this._s, this._outBlock);
|
|
696
|
-
|
|
697
|
-
// increment counter (input block)
|
|
698
|
-
inc32(this._inBlock);
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
modes.gcm.prototype.decrypt = function(input, output, finish) {
|
|
702
|
-
// not enough input to decrypt
|
|
703
|
-
var inputLength = input.length();
|
|
704
|
-
if(inputLength < this.blockSize && !(finish && inputLength > 0)) {
|
|
705
|
-
return true;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
// encrypt block (GCM always uses encryption mode)
|
|
709
|
-
this.cipher.encrypt(this._inBlock, this._outBlock);
|
|
710
|
-
|
|
711
|
-
// increment counter (input block)
|
|
712
|
-
inc32(this._inBlock);
|
|
713
|
-
|
|
714
|
-
// update hash block S
|
|
715
|
-
this._hashBlock[0] = input.getInt32();
|
|
716
|
-
this._hashBlock[1] = input.getInt32();
|
|
717
|
-
this._hashBlock[2] = input.getInt32();
|
|
718
|
-
this._hashBlock[3] = input.getInt32();
|
|
719
|
-
this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock);
|
|
720
|
-
|
|
721
|
-
// XOR hash input with output
|
|
722
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
723
|
-
output.putInt32(this._outBlock[i] ^ this._hashBlock[i]);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
// increment cipher data length
|
|
727
|
-
if(inputLength < this.blockSize) {
|
|
728
|
-
this._cipherLength += inputLength % this.blockSize;
|
|
729
|
-
} else {
|
|
730
|
-
this._cipherLength += this.blockSize;
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
|
|
734
|
-
modes.gcm.prototype.afterFinish = function(output, options) {
|
|
735
|
-
var rval = true;
|
|
736
|
-
|
|
737
|
-
// handle overflow
|
|
738
|
-
if(options.decrypt && options.overflow) {
|
|
739
|
-
output.truncate(this.blockSize - options.overflow);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
// handle authentication tag
|
|
743
|
-
this.tag = forge.util.createBuffer();
|
|
744
|
-
|
|
745
|
-
// concatenate additional data length with cipher length
|
|
746
|
-
var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8));
|
|
747
|
-
|
|
748
|
-
// include lengths in hash
|
|
749
|
-
this._s = this.ghash(this._hashSubkey, this._s, lengths);
|
|
750
|
-
|
|
751
|
-
// do GCTR(J_0, S)
|
|
752
|
-
var tag = [];
|
|
753
|
-
this.cipher.encrypt(this._j0, tag);
|
|
754
|
-
for(var i = 0; i < this._ints; ++i) {
|
|
755
|
-
this.tag.putInt32(this._s[i] ^ tag[i]);
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
// trim tag to length
|
|
759
|
-
this.tag.truncate(this.tag.length() % (this._tagLength / 8));
|
|
760
|
-
|
|
761
|
-
// check authentication tag
|
|
762
|
-
if(options.decrypt && this.tag.bytes() !== this._tag) {
|
|
763
|
-
rval = false;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
return rval;
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois
|
|
771
|
-
* field multiplication. The field, GF(2^128), is defined by the polynomial:
|
|
772
|
-
*
|
|
773
|
-
* x^128 + x^7 + x^2 + x + 1
|
|
774
|
-
*
|
|
775
|
-
* Which is represented in little-endian binary form as: 11100001 (0xe1). When
|
|
776
|
-
* the value of a coefficient is 1, a bit is set. The value R, is the
|
|
777
|
-
* concatenation of this value and 120 zero bits, yielding a 128-bit value
|
|
778
|
-
* which matches the block size.
|
|
779
|
-
*
|
|
780
|
-
* This function will multiply two elements (vectors of bytes), X and Y, in
|
|
781
|
-
* the field GF(2^128). The result is initialized to zero. For each bit of
|
|
782
|
-
* X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd)
|
|
783
|
-
* by the current value of Y. For each bit, the value of Y will be raised by
|
|
784
|
-
* a power of x (multiplied by the polynomial x). This can be achieved by
|
|
785
|
-
* shifting Y once to the right. If the current value of Y, prior to being
|
|
786
|
-
* multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial.
|
|
787
|
-
* Otherwise, we must divide by R after shifting to find the remainder.
|
|
788
|
-
*
|
|
789
|
-
* @param x the first block to multiply by the second.
|
|
790
|
-
* @param y the second block to multiply by the first.
|
|
791
|
-
*
|
|
792
|
-
* @return the block result of the multiplication.
|
|
793
|
-
*/
|
|
794
|
-
modes.gcm.prototype.multiply = function(x, y) {
|
|
795
|
-
var z_i = [0, 0, 0, 0];
|
|
796
|
-
var v_i = y.slice(0);
|
|
797
|
-
|
|
798
|
-
// calculate Z_128 (block has 128 bits)
|
|
799
|
-
for(var i = 0; i < 128; ++i) {
|
|
800
|
-
// if x_i is 0, Z_{i+1} = Z_i (unchanged)
|
|
801
|
-
// else Z_{i+1} = Z_i ^ V_i
|
|
802
|
-
// get x_i by finding 32-bit int position, then left shift 1 by remainder
|
|
803
|
-
var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32));
|
|
804
|
-
if(x_i) {
|
|
805
|
-
z_i[0] ^= v_i[0];
|
|
806
|
-
z_i[1] ^= v_i[1];
|
|
807
|
-
z_i[2] ^= v_i[2];
|
|
808
|
-
z_i[3] ^= v_i[3];
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
// if LSB(V_i) is 1, V_i = V_i >> 1
|
|
812
|
-
// else V_i = (V_i >> 1) ^ R
|
|
813
|
-
this.pow(v_i, v_i);
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
return z_i;
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
modes.gcm.prototype.pow = function(x, out) {
|
|
820
|
-
// if LSB(x) is 1, x = x >>> 1
|
|
821
|
-
// else x = (x >>> 1) ^ R
|
|
822
|
-
var lsb = x[3] & 1;
|
|
823
|
-
|
|
824
|
-
// always do x >>> 1:
|
|
825
|
-
// starting with the rightmost integer, shift each integer to the right
|
|
826
|
-
// one bit, pulling in the bit from the integer to the left as its top
|
|
827
|
-
// most bit (do this for the last 3 integers)
|
|
828
|
-
for(var i = 3; i > 0; --i) {
|
|
829
|
-
out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31);
|
|
830
|
-
}
|
|
831
|
-
// shift the first integer normally
|
|
832
|
-
out[0] = x[0] >>> 1;
|
|
833
|
-
|
|
834
|
-
// if lsb was not set, then polynomial had a degree of 127 and doesn't
|
|
835
|
-
// need to divided; otherwise, XOR with R to find the remainder; we only
|
|
836
|
-
// need to XOR the first integer since R technically ends w/120 zero bits
|
|
837
|
-
if(lsb) {
|
|
838
|
-
out[0] ^= this._R;
|
|
839
|
-
}
|
|
840
|
-
};
|
|
841
|
-
|
|
842
|
-
modes.gcm.prototype.tableMultiply = function(x) {
|
|
843
|
-
// assumes 4-bit tables are used
|
|
844
|
-
var z = [0, 0, 0, 0];
|
|
845
|
-
for(var i = 0; i < 32; ++i) {
|
|
846
|
-
var idx = (i / 8) | 0;
|
|
847
|
-
var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF;
|
|
848
|
-
var ah = this._m[i][x_i];
|
|
849
|
-
z[0] ^= ah[0];
|
|
850
|
-
z[1] ^= ah[1];
|
|
851
|
-
z[2] ^= ah[2];
|
|
852
|
-
z[3] ^= ah[3];
|
|
853
|
-
}
|
|
854
|
-
return z;
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
/**
|
|
858
|
-
* A continuing version of the GHASH algorithm that operates on a single
|
|
859
|
-
* block. The hash block, last hash value (Ym) and the new block to hash
|
|
860
|
-
* are given.
|
|
861
|
-
*
|
|
862
|
-
* @param h the hash block.
|
|
863
|
-
* @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash.
|
|
864
|
-
* @param x the block to hash.
|
|
865
|
-
*
|
|
866
|
-
* @return the hashed value (Ym).
|
|
867
|
-
*/
|
|
868
|
-
modes.gcm.prototype.ghash = function(h, y, x) {
|
|
869
|
-
y[0] ^= x[0];
|
|
870
|
-
y[1] ^= x[1];
|
|
871
|
-
y[2] ^= x[2];
|
|
872
|
-
y[3] ^= x[3];
|
|
873
|
-
return this.tableMultiply(y);
|
|
874
|
-
//return this.multiply(y, h);
|
|
875
|
-
};
|
|
876
|
-
|
|
877
|
-
/**
|
|
878
|
-
* Precomputes a table for multiplying against the hash subkey. This
|
|
879
|
-
* mechanism provides a substantial speed increase over multiplication
|
|
880
|
-
* performed without a table. The table-based multiplication this table is
|
|
881
|
-
* for solves X * H by multiplying each component of X by H and then
|
|
882
|
-
* composing the results together using XOR.
|
|
883
|
-
*
|
|
884
|
-
* This function can be used to generate tables with different bit sizes
|
|
885
|
-
* for the components, however, this implementation assumes there are
|
|
886
|
-
* 32 components of X (which is a 16 byte vector), therefore each component
|
|
887
|
-
* takes 4-bits (so the table is constructed with bits=4).
|
|
888
|
-
*
|
|
889
|
-
* @param h the hash subkey.
|
|
890
|
-
* @param bits the bit size for a component.
|
|
891
|
-
*/
|
|
892
|
-
modes.gcm.prototype.generateHashTable = function(h, bits) {
|
|
893
|
-
// TODO: There are further optimizations that would use only the
|
|
894
|
-
// first table M_0 (or some variant) along with a remainder table;
|
|
895
|
-
// this can be explored in the future
|
|
896
|
-
var multiplier = 8 / bits;
|
|
897
|
-
var perInt = 4 * multiplier;
|
|
898
|
-
var size = 16 * multiplier;
|
|
899
|
-
var m = new Array(size);
|
|
900
|
-
for(var i = 0; i < size; ++i) {
|
|
901
|
-
var tmp = [0, 0, 0, 0];
|
|
902
|
-
var idx = (i / perInt) | 0;
|
|
903
|
-
var shft = ((perInt - 1 - (i % perInt)) * bits);
|
|
904
|
-
tmp[idx] = (1 << (bits - 1)) << shft;
|
|
905
|
-
m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits);
|
|
906
|
-
}
|
|
907
|
-
return m;
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* Generates a table for multiplying against the hash subkey for one
|
|
912
|
-
* particular component (out of all possible component values).
|
|
913
|
-
*
|
|
914
|
-
* @param mid the pre-multiplied value for the middle key of the table.
|
|
915
|
-
* @param bits the bit size for a component.
|
|
916
|
-
*/
|
|
917
|
-
modes.gcm.prototype.generateSubHashTable = function(mid, bits) {
|
|
918
|
-
// compute the table quickly by minimizing the number of
|
|
919
|
-
// POW operations -- they only need to be performed for powers of 2,
|
|
920
|
-
// all other entries can be composed from those powers using XOR
|
|
921
|
-
var size = 1 << bits;
|
|
922
|
-
var half = size >>> 1;
|
|
923
|
-
var m = new Array(size);
|
|
924
|
-
m[half] = mid.slice(0);
|
|
925
|
-
var i = half >>> 1;
|
|
926
|
-
while(i > 0) {
|
|
927
|
-
// raise m0[2 * i] and store in m0[i]
|
|
928
|
-
this.pow(m[2 * i], m[i] = []);
|
|
929
|
-
i >>= 1;
|
|
930
|
-
}
|
|
931
|
-
i = 2;
|
|
932
|
-
while(i < half) {
|
|
933
|
-
for(var j = 1; j < i; ++j) {
|
|
934
|
-
var m_i = m[i];
|
|
935
|
-
var m_j = m[j];
|
|
936
|
-
m[i + j] = [
|
|
937
|
-
m_i[0] ^ m_j[0],
|
|
938
|
-
m_i[1] ^ m_j[1],
|
|
939
|
-
m_i[2] ^ m_j[2],
|
|
940
|
-
m_i[3] ^ m_j[3]
|
|
941
|
-
];
|
|
942
|
-
}
|
|
943
|
-
i *= 2;
|
|
944
|
-
}
|
|
945
|
-
m[0] = [0, 0, 0, 0];
|
|
946
|
-
/* Note: We could avoid storing these by doing composition during multiply
|
|
947
|
-
calculate top half using composition by speed is preferred. */
|
|
948
|
-
for(i = half + 1; i < size; ++i) {
|
|
949
|
-
var c = m[i ^ half];
|
|
950
|
-
m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]];
|
|
951
|
-
}
|
|
952
|
-
return m;
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
/** Utility functions */
|
|
956
|
-
|
|
957
|
-
function transformIV(iv, blockSize) {
|
|
958
|
-
if(typeof iv === 'string') {
|
|
959
|
-
// convert iv string into byte buffer
|
|
960
|
-
iv = forge.util.createBuffer(iv);
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
if(forge.util.isArray(iv) && iv.length > 4) {
|
|
964
|
-
// convert iv byte array into byte buffer
|
|
965
|
-
var tmp = iv;
|
|
966
|
-
iv = forge.util.createBuffer();
|
|
967
|
-
for(var i = 0; i < tmp.length; ++i) {
|
|
968
|
-
iv.putByte(tmp[i]);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
if(iv.length() < blockSize) {
|
|
973
|
-
throw new Error(
|
|
974
|
-
'Invalid IV length; got ' + iv.length() +
|
|
975
|
-
' bytes and expected ' + blockSize + ' bytes.');
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
if(!forge.util.isArray(iv)) {
|
|
979
|
-
// convert iv byte buffer into 32-bit integer array
|
|
980
|
-
var ints = [];
|
|
981
|
-
var blocks = blockSize / 4;
|
|
982
|
-
for(var i = 0; i < blocks; ++i) {
|
|
983
|
-
ints.push(iv.getInt32());
|
|
984
|
-
}
|
|
985
|
-
iv = ints;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
return iv;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
function inc32(block) {
|
|
992
|
-
// increment last 32 bits of block only
|
|
993
|
-
block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
function from64To32(num) {
|
|
997
|
-
// convert 64-bit number to two BE Int32s
|
|
998
|
-
return [(num / 0x100000000) | 0, num & 0xFFFFFFFF];
|
|
999
|
-
}
|