toolcraft 0.0.749 → 0.0.751
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/composition.json +23 -3
- package/dist/composition.json +23 -3
- package/dist/human-in-loop/approvals-commands.d.ts +1 -1
- package/dist/index.d.ts +1 -262
- package/dist/index.js +1 -573
- package/dist/runtime-platform.d.ts +2 -0
- package/dist/runtime-platform.js +2 -0
- package/dist/runtime-platform.workerd.d.ts +3 -0
- package/dist/runtime-platform.workerd.js +10 -0
- package/dist/runtime.d.ts +262 -0
- package/dist/runtime.js +576 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +478 -0
- package/node_modules/@noble/hashes/_blake.d.ts +20 -0
- package/node_modules/@noble/hashes/_blake.js +59 -0
- package/node_modules/@noble/hashes/_md.d.ts +95 -0
- package/node_modules/@noble/hashes/_md.js +209 -0
- package/node_modules/@noble/hashes/_u64.d.ts +36 -0
- package/node_modules/@noble/hashes/_u64.js +77 -0
- package/node_modules/@noble/hashes/argon2.d.ts +148 -0
- package/node_modules/@noble/hashes/argon2.js +577 -0
- package/node_modules/@noble/hashes/blake1.d.ts +162 -0
- package/node_modules/@noble/hashes/blake1.js +630 -0
- package/node_modules/@noble/hashes/blake2.d.ts +203 -0
- package/node_modules/@noble/hashes/blake2.js +573 -0
- package/node_modules/@noble/hashes/blake3.d.ts +68 -0
- package/node_modules/@noble/hashes/blake3.js +310 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +91 -0
- package/node_modules/@noble/hashes/eskdf.js +225 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +70 -0
- package/node_modules/@noble/hashes/hkdf.js +152 -0
- package/node_modules/@noble/hashes/hmac.d.ts +50 -0
- package/node_modules/@noble/hashes/hmac.js +93 -0
- package/node_modules/@noble/hashes/index.d.ts +1 -0
- package/node_modules/@noble/hashes/index.js +34 -0
- package/node_modules/@noble/hashes/legacy.d.ts +107 -0
- package/node_modules/@noble/hashes/legacy.js +348 -0
- package/node_modules/@noble/hashes/package.json +91 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +66 -0
- package/node_modules/@noble/hashes/pbkdf2.js +176 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +98 -0
- package/node_modules/@noble/hashes/scrypt.js +304 -0
- package/node_modules/@noble/hashes/sha2.d.ts +176 -0
- package/node_modules/@noble/hashes/sha2.js +446 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +533 -0
- package/node_modules/@noble/hashes/sha3-addons.js +973 -0
- package/node_modules/@noble/hashes/sha3.d.ts +208 -0
- package/node_modules/@noble/hashes/sha3.js +475 -0
- package/node_modules/@noble/hashes/src/_blake.ts +67 -0
- package/node_modules/@noble/hashes/src/_md.ts +227 -0
- package/node_modules/@noble/hashes/src/_u64.ts +111 -0
- package/node_modules/@noble/hashes/src/argon2.ts +693 -0
- package/node_modules/@noble/hashes/src/blake1.ts +677 -0
- package/node_modules/@noble/hashes/src/blake2.ts +648 -0
- package/node_modules/@noble/hashes/src/blake3.ts +344 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +265 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +161 -0
- package/node_modules/@noble/hashes/src/hmac.ts +130 -0
- package/node_modules/@noble/hashes/src/index.ts +33 -0
- package/node_modules/@noble/hashes/src/legacy.ts +361 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +219 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +375 -0
- package/node_modules/@noble/hashes/src/sha2.ts +486 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +1157 -0
- package/node_modules/@noble/hashes/src/sha3.ts +525 -0
- package/node_modules/@noble/hashes/src/utils.ts +978 -0
- package/node_modules/@noble/hashes/src/webcrypto.ts +283 -0
- package/node_modules/@noble/hashes/utils.d.ts +560 -0
- package/node_modules/@noble/hashes/utils.js +687 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts +121 -0
- package/node_modules/@noble/hashes/webcrypto.js +228 -0
- package/node_modules/@poe-code/agent-mcp-config/dist/apply.js +23 -9
- package/node_modules/@poe-code/config-mutations/README.md +2 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +4 -5
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +3 -4
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +3 -3
- package/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +2 -2
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +3 -6
- package/node_modules/@poe-code/config-mutations/dist/types.d.ts +4 -2
- package/node_modules/@poe-code/process-runner/README.md +2 -1
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.d.ts +1 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.js +1 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.d.ts +2 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.js +1 -0
- package/node_modules/@poe-code/process-runner/dist/types.d.ts +1 -1
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.d.ts +6 -5
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +67 -29
- package/node_modules/@poe-code/process-runner/package.json +13 -0
- package/node_modules/@poe-code/safe-fs/LICENSE +21 -0
- package/node_modules/@poe-code/safe-fs/PROVENANCE.json +428 -0
- package/node_modules/@poe-code/safe-fs/README.md +411 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.js +171 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.d.ts +93 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.js +453 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/index.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/index.js +19 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/stats.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/stats.js +37 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/types.d.ts +81 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/types.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/values.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/values.js +65 -0
- package/node_modules/@poe-code/safe-fs/dist/config/memory.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/config/memory.js +7 -0
- package/node_modules/@poe-code/safe-fs/dist/config/real.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/config/real.js +16 -0
- package/node_modules/@poe-code/safe-fs/dist/config/registry.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/config/registry.js +15 -0
- package/node_modules/@poe-code/safe-fs/dist/config.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/config.js +46 -0
- package/node_modules/@poe-code/safe-fs/dist/config.node.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/config.node.js +11 -0
- package/node_modules/@poe-code/safe-fs/dist/config.portable.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/config.portable.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/abort.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/abort.js +34 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.d.ts +38 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/errors.d.ts +53 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/errors.js +99 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.d.ts +379 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/index.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/index.js +6 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/io.d.ts +12 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/io.js +321 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/object.d.ts +134 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/object.js +97 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/path.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/path.js +2 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.d.ts +21 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.js +78 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.js +162 -0
- package/node_modules/@poe-code/safe-fs/dist/core.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/core.js +17 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.d.ts +10 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.js +216 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.js +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.d.ts +21 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.js +279 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.d.ts +59 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.js +875 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.js +250 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.js +136 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.js +14 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.d.ts +11 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.js +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.d.ts +186 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.js +3771 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.js +96 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.d.ts +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.js +26 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.js +144 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.js +118 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.js +29 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.d.ts +74 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.js +1291 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.d.ts +27 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.js +287 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.d.ts +45 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.js +531 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.d.ts +87 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.js +1185 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.d.ts +42 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.js +558 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.js +63 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.d.ts +12 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.js +520 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.d.ts +37 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.js +208 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.js +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/index.d.ts +105 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/index.js +1259 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.js +38 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.d.ts +130 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.js +1137 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.js +74 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.js +111 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.d.ts +17 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.js +89 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.d.ts +20 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.js +76 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.js +478 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.d.ts +30 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.d.ts +14 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.js +192 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.js +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.js +11 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.js +167 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.d.ts +48 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.js +249 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.d.ts +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.js +400 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.d.ts +10 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.js +73 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.d.ts +103 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.js +28 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.js +663 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.js +115 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.js +63 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.d.ts +18 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.js +109 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.d.ts +141 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.js +1377 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.js +59 -0
- package/node_modules/@poe-code/safe-fs/dist/index.d.ts +25 -0
- package/node_modules/@poe-code/safe-fs/dist/index.js +21 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/linux-x64-glibc.node +0 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.mjs +120 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/manifest.json +46 -0
- package/node_modules/@poe-code/safe-fs/dist/node/filesystem.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/node/filesystem.js +30 -0
- package/node_modules/@poe-code/safe-fs/dist/node/host.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/host.js +78 -0
- package/node_modules/@poe-code/safe-fs/dist/node/index.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/index.js +2 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.js +5 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek.js +54 -0
- package/node_modules/@poe-code/safe-fs/dist/node/stats.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/stats.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/values.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/values.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-host.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-host.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-unavailable.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-unavailable.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/package.json +29 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser.js +58 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node-path.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node-path.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node.js +64 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.d.ts +9 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.js +17 -0
- package/node_modules/@poe-code/safe-fs/dist/python/emscripten.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/python/emscripten.js +357 -0
- package/node_modules/@poe-code/safe-fs/dist/python/filesystem.d.ts +51 -0
- package/node_modules/@poe-code/safe-fs/dist/python/filesystem.js +243 -0
- package/node_modules/@poe-code/safe-fs/dist/python/flags.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/python/flags.js +14 -0
- package/node_modules/@poe-code/safe-fs/dist/python/index.d.ts +9 -0
- package/node_modules/@poe-code/safe-fs/dist/python/index.js +5 -0
- package/node_modules/@poe-code/safe-fs/dist/python/native.d.ts +18 -0
- package/node_modules/@poe-code/safe-fs/dist/python/native.js +446 -0
- package/node_modules/@poe-code/safe-fs/dist/python/request.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/python/request.js +61 -0
- package/node_modules/@poe-code/safe-fs/dist/python/stat.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/python/stat.js +34 -0
- package/node_modules/@poe-code/safe-fs/dist/runtime-core.d.ts +27 -0
- package/node_modules/@poe-code/safe-fs/dist/runtime-core.js +57 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.d.ts +16 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.js +496 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.d.ts +23 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.js +39 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.d.ts +31 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.js +143 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.js +209 -0
- package/node_modules/@poe-code/safe-fs/dist/xml.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/xml.js +1 -0
- package/node_modules/@poe-code/safe-fs/package.json +189 -0
- package/node_modules/@poe-code/task-list/README.md +2 -0
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.d.ts +1 -1
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.js +11 -4
- package/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +2 -2
- package/node_modules/@poe-code/task-list/dist/backends/utils.js +5 -7
- package/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +1 -1
- package/node_modules/@poe-code/task-list/dist/default-host.d.ts +2 -0
- package/node_modules/@poe-code/task-list/dist/default-host.js +2 -0
- package/node_modules/@poe-code/task-list/dist/default-host.workerd.d.ts +4 -0
- package/node_modules/@poe-code/task-list/dist/default-host.workerd.js +6 -0
- package/node_modules/@poe-code/task-list/dist/filesystem.d.ts +3 -0
- package/node_modules/@poe-code/task-list/dist/filesystem.js +32 -0
- package/node_modules/@poe-code/task-list/dist/move.js +3 -3
- package/node_modules/@poe-code/task-list/dist/open.js +2 -5
- package/node_modules/@poe-code/task-list/dist/paths.d.ts +12 -0
- package/node_modules/@poe-code/task-list/dist/paths.js +7 -0
- package/node_modules/@poe-code/task-list/dist/types.d.ts +6 -5
- package/node_modules/@poe-code/task-list/package.json +9 -0
- package/node_modules/@poe-code/terminal-text/LICENSE +21 -0
- package/node_modules/@poe-code/terminal-text/README.md +12 -0
- package/node_modules/@poe-code/terminal-text/dist/index.d.ts +2 -0
- package/node_modules/@poe-code/terminal-text/dist/index.js +20 -0
- package/node_modules/@poe-code/terminal-text/package.json +22 -0
- package/node_modules/@poe-code/xml-ast/LICENSE +21 -0
- package/node_modules/@poe-code/xml-ast/README.md +28 -0
- package/node_modules/@poe-code/xml-ast/dist/index.d.ts +47 -0
- package/node_modules/@poe-code/xml-ast/dist/index.js +635 -0
- package/node_modules/@poe-code/xml-ast/package.json +25 -0
- package/node_modules/auth-store/README.md +35 -0
- package/node_modules/auth-store/dist/index.browser.d.ts +4 -0
- package/node_modules/auth-store/dist/index.browser.js +2 -0
- package/node_modules/auth-store/dist/provider-store.d.ts +1 -1
- package/node_modules/auth-store/dist/safe-fs-secret-store.d.ts +21 -0
- package/node_modules/auth-store/dist/safe-fs-secret-store.js +119 -0
- package/node_modules/auth-store/dist/secret-store.d.ts +12 -0
- package/node_modules/auth-store/dist/secret-store.js +1 -0
- package/node_modules/auth-store/dist/transaction-lock.d.ts +2 -4
- package/node_modules/auth-store/dist/types.d.ts +2 -9
- package/node_modules/auth-store/package.json +16 -2
- package/node_modules/tiny-http-mcp-server/dist/composition.json +16 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +25 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-state.js +4 -4
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +6 -40
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.d.ts +10 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.js +20 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/pkce.js +4 -3
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.d.ts +14 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.js +53 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.d.ts +16 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.js +29 -9
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.d.ts +12 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.js +23 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-endpoint.js +6 -19
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-fetch.js +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.d.ts +6 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.js +5 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.d.ts +5 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.js +4 -1
- package/node_modules/tiny-http-mcp-server/package.json +4 -4
- package/node_modules/tiny-mcp-client/README.md +2 -0
- package/node_modules/tiny-mcp-client/dist/index.browser.d.ts +25 -23
- package/node_modules/tiny-mcp-client/dist/index.browser.js +116 -1
- package/node_modules/tiny-mcp-client/dist/index.d.ts +25 -23
- package/node_modules/tiny-mcp-client/dist/index.js +1034 -561
- package/node_modules/tiny-mcp-client/package.json +15 -0
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-design/dist/components/table.js +6 -0
- package/node_modules/toolcraft-design/dist/escape-terminal-text.d.ts +1 -2
- package/node_modules/toolcraft-design/dist/escape-terminal-text.js +1 -20
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +2 -1
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +2 -1
- package/node_modules/toolcraft-schema/dist/json-schema/utils.js +3 -0
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +32 -7
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blake1 legacy hash function, one of SHA3 proposals.
|
|
3
|
+
* Rarely used. Check out blake2 or blake3 instead.
|
|
4
|
+
* {@link https://www.aumasson.jp/blake/blake.pdf}
|
|
5
|
+
*
|
|
6
|
+
* In the best case, there are 0 allocations.
|
|
7
|
+
*
|
|
8
|
+
* Differences from blake2:
|
|
9
|
+
*
|
|
10
|
+
* - BE instead of LE
|
|
11
|
+
* - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but:
|
|
12
|
+
* - length flag is located before actual length
|
|
13
|
+
* - padding block is compressed differently (no lengths)
|
|
14
|
+
* Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]`
|
|
15
|
+
* (-1 for g1, g2 without -1)
|
|
16
|
+
* - Salt is XOR-ed into constants instead of state
|
|
17
|
+
* - Salt is XOR-ed with output in `compress`
|
|
18
|
+
* - Additional rows (+64 bytes) in SIGMA for new rounds
|
|
19
|
+
* - Different round count:
|
|
20
|
+
* - 14 / 10 rounds in blake256 / blake2s
|
|
21
|
+
* - 16 / 12 rounds in blake512 / blake2b
|
|
22
|
+
* - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { BSIGMA, G1s, G2s } from "./_blake.js";
|
|
26
|
+
import { SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js";
|
|
27
|
+
import * as u64 from "./_u64.js";
|
|
28
|
+
// prettier-ignore
|
|
29
|
+
import { abytes, aexists, aoutput, checkOpts, clean, createHasher, createView } from "./utils.js";
|
|
30
|
+
// Shared unsalted sentinel, sized for the 64-bit path and reused by the 32-bit path via prefix.
|
|
31
|
+
const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8);
|
|
32
|
+
class BLAKE1 {
|
|
33
|
+
canXOF = false;
|
|
34
|
+
finished = false;
|
|
35
|
+
length = 0;
|
|
36
|
+
pos = 0;
|
|
37
|
+
destroyed = false;
|
|
38
|
+
// For partial updates less than block size
|
|
39
|
+
buffer;
|
|
40
|
+
view;
|
|
41
|
+
salt;
|
|
42
|
+
blockLen;
|
|
43
|
+
outputLen;
|
|
44
|
+
lengthFlag;
|
|
45
|
+
counterLen;
|
|
46
|
+
constants;
|
|
47
|
+
constructor(blockLen, outputLen, lengthFlag, counterLen, saltLen, constants, opts = {}) {
|
|
48
|
+
opts = checkOpts({}, opts);
|
|
49
|
+
const { salt } = opts;
|
|
50
|
+
this.blockLen = blockLen;
|
|
51
|
+
this.outputLen = outputLen;
|
|
52
|
+
this.lengthFlag = lengthFlag;
|
|
53
|
+
this.counterLen = counterLen;
|
|
54
|
+
this.buffer = new Uint8Array(blockLen);
|
|
55
|
+
this.view = createView(this.buffer);
|
|
56
|
+
if (salt !== undefined) {
|
|
57
|
+
let slt = salt;
|
|
58
|
+
abytes(slt, 4 * saltLen, 'salt');
|
|
59
|
+
// if (slt.length !== 4 * saltLen) throw new Error('wrong salt length');
|
|
60
|
+
const salt32 = (this.salt = new Uint32Array(saltLen));
|
|
61
|
+
const sv = createView(slt);
|
|
62
|
+
this.constants = constants.slice();
|
|
63
|
+
for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) {
|
|
64
|
+
salt32[i] = sv.getUint32(offset, false);
|
|
65
|
+
this.constants[i] ^= salt32[i];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.salt = EMPTY_SALT;
|
|
70
|
+
this.constants = constants;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
update(data) {
|
|
74
|
+
aexists(this);
|
|
75
|
+
abytes(data);
|
|
76
|
+
// From _md, but update length before each compress
|
|
77
|
+
const { view, buffer, blockLen } = this;
|
|
78
|
+
const len = data.length;
|
|
79
|
+
let dataView;
|
|
80
|
+
for (let pos = 0; pos < len;) {
|
|
81
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
82
|
+
// Fast path only when there is no buffered partial block: `take === blockLen` implies
|
|
83
|
+
// `this.pos === 0`, so we can process full blocks directly from the input view.
|
|
84
|
+
if (take === blockLen) {
|
|
85
|
+
if (!dataView)
|
|
86
|
+
dataView = createView(data);
|
|
87
|
+
for (; blockLen <= len - pos; pos += blockLen) {
|
|
88
|
+
this.length += blockLen;
|
|
89
|
+
this.compress(dataView, pos);
|
|
90
|
+
}
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
// When the whole input is buffered in one go (common for short messages), passing `data`
|
|
94
|
+
// directly avoids allocating a subarray view.
|
|
95
|
+
buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
|
|
96
|
+
this.pos += take;
|
|
97
|
+
pos += take;
|
|
98
|
+
if (this.pos === blockLen) {
|
|
99
|
+
this.length += blockLen;
|
|
100
|
+
this.compress(view, 0, true);
|
|
101
|
+
this.pos = 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
destroy() {
|
|
107
|
+
this.destroyed = true;
|
|
108
|
+
clean(this.buffer);
|
|
109
|
+
this.length = 0;
|
|
110
|
+
this.pos = 0;
|
|
111
|
+
if (this.salt !== EMPTY_SALT) {
|
|
112
|
+
clean(this.salt, this.constants);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_cloneIntoMeta(to) {
|
|
116
|
+
const { buffer, length, finished, destroyed, constants, salt, pos } = this;
|
|
117
|
+
if (pos)
|
|
118
|
+
to.buffer.set(buffer);
|
|
119
|
+
// At pos=0 the source buffer is dead. Discard an unfinished destination's old message bytes;
|
|
120
|
+
// finished digestInto() workers are already clean, so hot KDF resets skip this fill.
|
|
121
|
+
else if (to.destroyed || (!to.finished && (to.length || to.pos)))
|
|
122
|
+
clean(to.buffer);
|
|
123
|
+
// Clone salt-derived arrays by value so destroying the clone cannot wipe the source instance.
|
|
124
|
+
if (salt === EMPTY_SALT) {
|
|
125
|
+
to.constants = constants; // Immutable; sentinel keeps destroy() from wiping it.
|
|
126
|
+
to.salt = EMPTY_SALT;
|
|
127
|
+
}
|
|
128
|
+
else if (to.salt === EMPTY_SALT) {
|
|
129
|
+
to.constants = constants.slice();
|
|
130
|
+
to.salt = salt.slice();
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
to.constants.set(constants); // Reuse independently owned salted arrays.
|
|
134
|
+
to.salt.set(salt);
|
|
135
|
+
}
|
|
136
|
+
to.destroyed = destroyed;
|
|
137
|
+
to.finished = finished;
|
|
138
|
+
to.length = length;
|
|
139
|
+
to.pos = pos;
|
|
140
|
+
return to;
|
|
141
|
+
}
|
|
142
|
+
clone() {
|
|
143
|
+
return this._cloneInto();
|
|
144
|
+
}
|
|
145
|
+
digestInto(out) {
|
|
146
|
+
aexists(this);
|
|
147
|
+
aoutput(out, this);
|
|
148
|
+
this.finished = true;
|
|
149
|
+
// Padding
|
|
150
|
+
const { buffer, blockLen, counterLen, lengthFlag, view } = this;
|
|
151
|
+
buffer.fill(0, this.pos); // clean buf
|
|
152
|
+
const counterBits = (this.length + this.pos) * 8;
|
|
153
|
+
const counterPos = blockLen - counterLen - 1;
|
|
154
|
+
buffer[this.pos] |= 0b1000_0000; // End block flag
|
|
155
|
+
this.length += this.pos; // add unwritten length
|
|
156
|
+
// Not enough in buffer for length: write what we have.
|
|
157
|
+
if (this.pos > counterPos) {
|
|
158
|
+
this.compress(view, 0);
|
|
159
|
+
clean(buffer);
|
|
160
|
+
this.pos = 0;
|
|
161
|
+
}
|
|
162
|
+
// Difference with md: here we have lengthFlag!
|
|
163
|
+
buffer[counterPos] |= lengthFlag; // Length flag
|
|
164
|
+
// We always set 8 byte length flag. Because length will overflow significantly sooner.
|
|
165
|
+
u64.setU64FromNum(view, blockLen - 8, counterBits, false);
|
|
166
|
+
// Blake1 omits the counter from the extra all-padding block; only the block that still carries
|
|
167
|
+
// message bytes mixes in the final bit length.
|
|
168
|
+
this.compress(view, 0, this.pos !== 0);
|
|
169
|
+
// Write output
|
|
170
|
+
clean(buffer);
|
|
171
|
+
// digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.
|
|
172
|
+
const v = out === buffer ? view : createView(out);
|
|
173
|
+
const state = this.get();
|
|
174
|
+
for (let i = 0; i < this.outputLen / 4; ++i)
|
|
175
|
+
v.setUint32(i * 4, state[i]);
|
|
176
|
+
}
|
|
177
|
+
digest() {
|
|
178
|
+
const { buffer, outputLen } = this;
|
|
179
|
+
this.digestInto(buffer);
|
|
180
|
+
// Return a copy so callers do not alias the instance scratch buffer used during finalization.
|
|
181
|
+
const res = buffer.slice(0, outputLen);
|
|
182
|
+
this.destroy();
|
|
183
|
+
return res;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Blake1-512 / Blake1-384 constant table `C512`.
|
|
187
|
+
// Stored as sixteen 64-bit constants split into `[high32, low32]` halves so
|
|
188
|
+
// the Blake1-64 path can reuse one layout for both `v8..v15` initialization
|
|
189
|
+
// and the permuted constant lookups.
|
|
190
|
+
const B64C = /* @__PURE__ */ Uint32Array.from([
|
|
191
|
+
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
|
|
192
|
+
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
|
|
193
|
+
0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
|
|
194
|
+
0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69,
|
|
195
|
+
]);
|
|
196
|
+
// Blake1-256 / Blake1-224 constant table `C256`, derived as the first half of `C512`.
|
|
197
|
+
const B32C = /* @__PURE__ */ B64C.slice(0, 16);
|
|
198
|
+
// Blake1-256 IV cloned from SHA-256.
|
|
199
|
+
const B256_IV = /* @__PURE__ */ SHA256_IV.slice();
|
|
200
|
+
// Blake1-224 IV cloned from SHA-224.
|
|
201
|
+
const B224_IV = /* @__PURE__ */ SHA224_IV.slice();
|
|
202
|
+
// Blake1-384 IV cloned from the SHA-384 high-then-low 32-bit halves.
|
|
203
|
+
const B384_IV = /* @__PURE__ */ SHA384_IV.slice();
|
|
204
|
+
// Blake1-512 IV cloned from the SHA-512 high-then-low 32-bit halves.
|
|
205
|
+
const B512_IV = /* @__PURE__ */ SHA512_IV.slice();
|
|
206
|
+
// Precompute the odd/even companion constants used by all 14 Blake1-32 rounds.
|
|
207
|
+
// Each pair stores `u[sigma[2i + 1]]` then `u[sigma[2i]]`, matching the `G1s` / `G2s` xor order.
|
|
208
|
+
function generateTBL256() {
|
|
209
|
+
const TBL = [];
|
|
210
|
+
for (let i = 0, j = 0; i < 14; i++, j += 16) {
|
|
211
|
+
for (let offset = 1; offset < 16; offset += 2) {
|
|
212
|
+
TBL.push(B32C[BSIGMA[j + offset]]);
|
|
213
|
+
TBL.push(B32C[BSIGMA[j + offset - 1]]);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return new Uint32Array(TBL);
|
|
217
|
+
}
|
|
218
|
+
// Full 14-round companion-constant table for Blake1-32.
|
|
219
|
+
const TBL256 = /* @__PURE__ */ generateTBL256();
|
|
220
|
+
// Shared synchronous message-word scratch for the 32-bit Blake1 path.
|
|
221
|
+
const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16);
|
|
222
|
+
class BLAKE1_32B extends BLAKE1 {
|
|
223
|
+
v0;
|
|
224
|
+
v1;
|
|
225
|
+
v2;
|
|
226
|
+
v3;
|
|
227
|
+
v4;
|
|
228
|
+
v5;
|
|
229
|
+
v6;
|
|
230
|
+
v7;
|
|
231
|
+
constructor(outputLen, IV, lengthFlag, opts = {}) {
|
|
232
|
+
super(64, outputLen, lengthFlag, 8, 4, B32C, opts);
|
|
233
|
+
this.v0 = IV[0] | 0;
|
|
234
|
+
this.v1 = IV[1] | 0;
|
|
235
|
+
this.v2 = IV[2] | 0;
|
|
236
|
+
this.v3 = IV[3] | 0;
|
|
237
|
+
this.v4 = IV[4] | 0;
|
|
238
|
+
this.v5 = IV[5] | 0;
|
|
239
|
+
this.v6 = IV[6] | 0;
|
|
240
|
+
this.v7 = IV[7] | 0;
|
|
241
|
+
}
|
|
242
|
+
get() {
|
|
243
|
+
const { v0, v1, v2, v3, v4, v5, v6, v7 } = this;
|
|
244
|
+
return [v0, v1, v2, v3, v4, v5, v6, v7];
|
|
245
|
+
}
|
|
246
|
+
// prettier-ignore
|
|
247
|
+
set(v0, v1, v2, v3, v4, v5, v6, v7) {
|
|
248
|
+
this.v0 = v0 | 0;
|
|
249
|
+
this.v1 = v1 | 0;
|
|
250
|
+
this.v2 = v2 | 0;
|
|
251
|
+
this.v3 = v3 | 0;
|
|
252
|
+
this.v4 = v4 | 0;
|
|
253
|
+
this.v5 = v5 | 0;
|
|
254
|
+
this.v6 = v6 | 0;
|
|
255
|
+
this.v7 = v7 | 0;
|
|
256
|
+
}
|
|
257
|
+
_cloneInto(to) {
|
|
258
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
259
|
+
return this._cloneIntoMeta(to);
|
|
260
|
+
}
|
|
261
|
+
destroy() {
|
|
262
|
+
super.destroy();
|
|
263
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
264
|
+
}
|
|
265
|
+
compress(view, offset, withLength = true) {
|
|
266
|
+
for (let i = 0; i < 16; i++, offset += 4)
|
|
267
|
+
BLAKE256_W[i] = view.getUint32(offset, false);
|
|
268
|
+
// Cannot reuse blake2s compress: Blake1 mixes each message word with the companion constants
|
|
269
|
+
// precomputed in `TBL256`, rather than using the raw schedule words directly.
|
|
270
|
+
let v00 = this.v0 | 0;
|
|
271
|
+
let v01 = this.v1 | 0;
|
|
272
|
+
let v02 = this.v2 | 0;
|
|
273
|
+
let v03 = this.v3 | 0;
|
|
274
|
+
let v04 = this.v4 | 0;
|
|
275
|
+
let v05 = this.v5 | 0;
|
|
276
|
+
let v06 = this.v6 | 0;
|
|
277
|
+
let v07 = this.v7 | 0;
|
|
278
|
+
let v08 = this.constants[0] | 0;
|
|
279
|
+
let v09 = this.constants[1] | 0;
|
|
280
|
+
let v10 = this.constants[2] | 0;
|
|
281
|
+
let v11 = this.constants[3] | 0;
|
|
282
|
+
// Blake1-32 injects the 64-bit bit counter as `[t0, t0, t1, t1]` across `v12..v15`; the
|
|
283
|
+
// final all-padding block passes `withLength = false`, leaving these lanes as raw constants.
|
|
284
|
+
const bits = withLength ? this.length * 8 : 0;
|
|
285
|
+
const h = u64.fromNumH(bits);
|
|
286
|
+
const l = u64.fromNumL(bits);
|
|
287
|
+
let v12 = (this.constants[4] ^ l) >>> 0;
|
|
288
|
+
let v13 = (this.constants[5] ^ l) >>> 0;
|
|
289
|
+
let v14 = (this.constants[6] ^ h) >>> 0;
|
|
290
|
+
let v15 = (this.constants[7] ^ h) >>> 0;
|
|
291
|
+
// prettier-ignore
|
|
292
|
+
for (let i = 0, k = 0, j = 0; i < 14; i++) {
|
|
293
|
+
({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
294
|
+
({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
295
|
+
({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
296
|
+
({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
297
|
+
({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
298
|
+
({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
299
|
+
({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
300
|
+
({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
301
|
+
({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
302
|
+
({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
303
|
+
({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
304
|
+
({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
305
|
+
({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
306
|
+
({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
307
|
+
({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
308
|
+
({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
309
|
+
}
|
|
310
|
+
this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0;
|
|
311
|
+
this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0;
|
|
312
|
+
this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0;
|
|
313
|
+
this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0;
|
|
314
|
+
this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0;
|
|
315
|
+
this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0;
|
|
316
|
+
this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0;
|
|
317
|
+
this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0;
|
|
318
|
+
clean(BLAKE256_W);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
// Shared Blake1-64 work vector storing 16 working words as adjacent high/low 32-bit halves.
|
|
322
|
+
const BBUF = /* @__PURE__ */ new Uint32Array(32);
|
|
323
|
+
// Shared synchronous message-word scratch for the 64-bit Blake1 path.
|
|
324
|
+
const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32);
|
|
325
|
+
// Precompute the high/low companion constants used by all 16 Blake1-64 rounds.
|
|
326
|
+
// Each quartet stores `u[sigma[2i + 1]]` high/low halves, then `u[sigma[2i]]` high/low halves.
|
|
327
|
+
function generateTBL512() {
|
|
328
|
+
const TBL = [];
|
|
329
|
+
for (let r = 0, k = 0; r < 16; r++, k += 16) {
|
|
330
|
+
for (let offset = 1; offset < 16; offset += 2) {
|
|
331
|
+
TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]);
|
|
332
|
+
TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]);
|
|
333
|
+
TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]);
|
|
334
|
+
TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return new Uint32Array(TBL);
|
|
338
|
+
}
|
|
339
|
+
// Full 16-round companion-constant table as high/low halves.
|
|
340
|
+
const TBL512 = /* @__PURE__ */ generateTBL512();
|
|
341
|
+
// Blake1-64 first half-round with rotations `32` and `25`; `k` is the half-call schedule index.
|
|
342
|
+
function G1b(a, b, c, d, msg, k) {
|
|
343
|
+
const Xpos = 2 * BSIGMA[k];
|
|
344
|
+
const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore
|
|
345
|
+
let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore
|
|
346
|
+
let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore
|
|
347
|
+
let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore
|
|
348
|
+
let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore
|
|
349
|
+
// v[a] = (v[a] + v[b] + x) | 0;
|
|
350
|
+
const ll = u64.add3L(Al, Bl, Xl);
|
|
351
|
+
Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0;
|
|
352
|
+
Al = (ll | 0) >>> 0;
|
|
353
|
+
// v[d] = rotr(v[d] ^ v[a], 32)
|
|
354
|
+
let xh = Dh ^ Ah, xl = Dl ^ Al; // prettier-ignore
|
|
355
|
+
Dh = u64.rotr32H(xh, xl);
|
|
356
|
+
Dl = u64.rotr32L(xh, xl);
|
|
357
|
+
// v[c] = (v[c] + v[d]) | 0;
|
|
358
|
+
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
|
|
359
|
+
// v[b] = rotr(v[b] ^ v[c], 25)
|
|
360
|
+
xh = Bh ^ Ch;
|
|
361
|
+
xl = Bl ^ Cl;
|
|
362
|
+
Bh = u64.rotrSH(xh, xl, 25);
|
|
363
|
+
Bl = u64.rotrSL(xh, xl, 25);
|
|
364
|
+
BBUF[2 * a + 1] = Al;
|
|
365
|
+
BBUF[2 * a] = Ah;
|
|
366
|
+
BBUF[2 * b + 1] = Bl;
|
|
367
|
+
BBUF[2 * b] = Bh;
|
|
368
|
+
BBUF[2 * c + 1] = Cl;
|
|
369
|
+
BBUF[2 * c] = Ch;
|
|
370
|
+
BBUF[2 * d + 1] = Dl;
|
|
371
|
+
BBUF[2 * d] = Dh;
|
|
372
|
+
}
|
|
373
|
+
// Blake1-64 second half-round with rotations `16` and `11`; `k` is the half-call schedule index.
|
|
374
|
+
function G2b(a, b, c, d, msg, k) {
|
|
375
|
+
const Xpos = 2 * BSIGMA[k];
|
|
376
|
+
const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore
|
|
377
|
+
let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore
|
|
378
|
+
let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore
|
|
379
|
+
let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore
|
|
380
|
+
let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore
|
|
381
|
+
// v[a] = (v[a] + v[b] + x) | 0;
|
|
382
|
+
const ll = u64.add3L(Al, Bl, Xl);
|
|
383
|
+
Ah = u64.add3H(ll, Ah, Bh, Xh);
|
|
384
|
+
Al = ll | 0;
|
|
385
|
+
// v[d] = rotr(v[d] ^ v[a], 16)
|
|
386
|
+
let xh = Dh ^ Ah, xl = Dl ^ Al; // prettier-ignore
|
|
387
|
+
Dh = u64.rotrSH(xh, xl, 16);
|
|
388
|
+
Dl = u64.rotrSL(xh, xl, 16);
|
|
389
|
+
// v[c] = (v[c] + v[d]) | 0;
|
|
390
|
+
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
|
|
391
|
+
// v[b] = rotr(v[b] ^ v[c], 11)
|
|
392
|
+
xh = Bh ^ Ch;
|
|
393
|
+
xl = Bl ^ Cl;
|
|
394
|
+
Bh = u64.rotrSH(xh, xl, 11);
|
|
395
|
+
Bl = u64.rotrSL(xh, xl, 11);
|
|
396
|
+
BBUF[2 * a + 1] = Al;
|
|
397
|
+
BBUF[2 * a] = Ah;
|
|
398
|
+
BBUF[2 * b + 1] = Bl;
|
|
399
|
+
BBUF[2 * b] = Bh;
|
|
400
|
+
BBUF[2 * c + 1] = Cl;
|
|
401
|
+
BBUF[2 * c] = Ch;
|
|
402
|
+
BBUF[2 * d + 1] = Dl;
|
|
403
|
+
BBUF[2 * d] = Dh;
|
|
404
|
+
}
|
|
405
|
+
// Legacy field names keep the local `l/h` spelling, but array/state order stays `[high, low]` to
|
|
406
|
+
// match the IV tables and `BBUF` layout.
|
|
407
|
+
class BLAKE1_64B extends BLAKE1 {
|
|
408
|
+
v0l;
|
|
409
|
+
v0h;
|
|
410
|
+
v1l;
|
|
411
|
+
v1h;
|
|
412
|
+
v2l;
|
|
413
|
+
v2h;
|
|
414
|
+
v3l;
|
|
415
|
+
v3h;
|
|
416
|
+
v4l;
|
|
417
|
+
v4h;
|
|
418
|
+
v5l;
|
|
419
|
+
v5h;
|
|
420
|
+
v6l;
|
|
421
|
+
v6h;
|
|
422
|
+
v7l;
|
|
423
|
+
v7h;
|
|
424
|
+
constructor(outputLen, IV, lengthFlag, opts = {}) {
|
|
425
|
+
super(128, outputLen, lengthFlag, 16, 8, B64C, opts);
|
|
426
|
+
this.v0l = IV[0] | 0;
|
|
427
|
+
this.v0h = IV[1] | 0;
|
|
428
|
+
this.v1l = IV[2] | 0;
|
|
429
|
+
this.v1h = IV[3] | 0;
|
|
430
|
+
this.v2l = IV[4] | 0;
|
|
431
|
+
this.v2h = IV[5] | 0;
|
|
432
|
+
this.v3l = IV[6] | 0;
|
|
433
|
+
this.v3h = IV[7] | 0;
|
|
434
|
+
this.v4l = IV[8] | 0;
|
|
435
|
+
this.v4h = IV[9] | 0;
|
|
436
|
+
this.v5l = IV[10] | 0;
|
|
437
|
+
this.v5h = IV[11] | 0;
|
|
438
|
+
this.v6l = IV[12] | 0;
|
|
439
|
+
this.v6h = IV[13] | 0;
|
|
440
|
+
this.v7l = IV[14] | 0;
|
|
441
|
+
this.v7h = IV[15] | 0;
|
|
442
|
+
}
|
|
443
|
+
// prettier-ignore
|
|
444
|
+
get() {
|
|
445
|
+
let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
|
|
446
|
+
return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h];
|
|
447
|
+
}
|
|
448
|
+
// prettier-ignore
|
|
449
|
+
set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) {
|
|
450
|
+
this.v0l = v0l | 0;
|
|
451
|
+
this.v0h = v0h | 0;
|
|
452
|
+
this.v1l = v1l | 0;
|
|
453
|
+
this.v1h = v1h | 0;
|
|
454
|
+
this.v2l = v2l | 0;
|
|
455
|
+
this.v2h = v2h | 0;
|
|
456
|
+
this.v3l = v3l | 0;
|
|
457
|
+
this.v3h = v3h | 0;
|
|
458
|
+
this.v4l = v4l | 0;
|
|
459
|
+
this.v4h = v4h | 0;
|
|
460
|
+
this.v5l = v5l | 0;
|
|
461
|
+
this.v5h = v5h | 0;
|
|
462
|
+
this.v6l = v6l | 0;
|
|
463
|
+
this.v6h = v6h | 0;
|
|
464
|
+
this.v7l = v7l | 0;
|
|
465
|
+
this.v7h = v7h | 0;
|
|
466
|
+
}
|
|
467
|
+
_cloneInto(to) {
|
|
468
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
469
|
+
return this._cloneIntoMeta(to);
|
|
470
|
+
}
|
|
471
|
+
destroy() {
|
|
472
|
+
super.destroy();
|
|
473
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
474
|
+
}
|
|
475
|
+
compress(view, offset, withLength = true) {
|
|
476
|
+
for (let i = 0; i < 32; i++, offset += 4)
|
|
477
|
+
BLAKE512_W[i] = view.getUint32(offset, false);
|
|
478
|
+
// First half from state. Direct writes: get() would allocate an array +
|
|
479
|
+
// closure per block (same reasoning as blake2b's compress).
|
|
480
|
+
// prettier-ignore
|
|
481
|
+
const { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
|
|
482
|
+
// prettier-ignore
|
|
483
|
+
{
|
|
484
|
+
BBUF[0] = v0l;
|
|
485
|
+
BBUF[1] = v0h;
|
|
486
|
+
BBUF[2] = v1l;
|
|
487
|
+
BBUF[3] = v1h;
|
|
488
|
+
BBUF[4] = v2l;
|
|
489
|
+
BBUF[5] = v2h;
|
|
490
|
+
BBUF[6] = v3l;
|
|
491
|
+
BBUF[7] = v3h;
|
|
492
|
+
BBUF[8] = v4l;
|
|
493
|
+
BBUF[9] = v4h;
|
|
494
|
+
BBUF[10] = v5l;
|
|
495
|
+
BBUF[11] = v5h;
|
|
496
|
+
BBUF[12] = v6l;
|
|
497
|
+
BBUF[13] = v6h;
|
|
498
|
+
BBUF[14] = v7l;
|
|
499
|
+
BBUF[15] = v7h;
|
|
500
|
+
}
|
|
501
|
+
BBUF.set(this.constants.subarray(0, 16), 16);
|
|
502
|
+
if (withLength) {
|
|
503
|
+
// Blake1-64 injects the 64-bit bit counter into `v12` and `v13`; the final all-padding
|
|
504
|
+
// block passes `withLength = false`, leaving the trailing constant lanes untouched.
|
|
505
|
+
const bits = this.length * 8;
|
|
506
|
+
const h = u64.fromNumH(bits);
|
|
507
|
+
const l = u64.fromNumL(bits);
|
|
508
|
+
BBUF[24] = (BBUF[24] ^ h) >>> 0;
|
|
509
|
+
BBUF[25] = (BBUF[25] ^ l) >>> 0;
|
|
510
|
+
BBUF[26] = (BBUF[26] ^ h) >>> 0;
|
|
511
|
+
BBUF[27] = (BBUF[27] ^ l) >>> 0;
|
|
512
|
+
}
|
|
513
|
+
for (let i = 0, k = 0; i < 16; i++) {
|
|
514
|
+
G1b(0, 4, 8, 12, BLAKE512_W, k++);
|
|
515
|
+
G2b(0, 4, 8, 12, BLAKE512_W, k++);
|
|
516
|
+
G1b(1, 5, 9, 13, BLAKE512_W, k++);
|
|
517
|
+
G2b(1, 5, 9, 13, BLAKE512_W, k++);
|
|
518
|
+
G1b(2, 6, 10, 14, BLAKE512_W, k++);
|
|
519
|
+
G2b(2, 6, 10, 14, BLAKE512_W, k++);
|
|
520
|
+
G1b(3, 7, 11, 15, BLAKE512_W, k++);
|
|
521
|
+
G2b(3, 7, 11, 15, BLAKE512_W, k++);
|
|
522
|
+
G1b(0, 5, 10, 15, BLAKE512_W, k++);
|
|
523
|
+
G2b(0, 5, 10, 15, BLAKE512_W, k++);
|
|
524
|
+
G1b(1, 6, 11, 12, BLAKE512_W, k++);
|
|
525
|
+
G2b(1, 6, 11, 12, BLAKE512_W, k++);
|
|
526
|
+
G1b(2, 7, 8, 13, BLAKE512_W, k++);
|
|
527
|
+
G2b(2, 7, 8, 13, BLAKE512_W, k++);
|
|
528
|
+
G1b(3, 4, 9, 14, BLAKE512_W, k++);
|
|
529
|
+
G2b(3, 4, 9, 14, BLAKE512_W, k++);
|
|
530
|
+
}
|
|
531
|
+
this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0];
|
|
532
|
+
this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1];
|
|
533
|
+
this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2];
|
|
534
|
+
this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3];
|
|
535
|
+
this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4];
|
|
536
|
+
this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5];
|
|
537
|
+
this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6];
|
|
538
|
+
this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7];
|
|
539
|
+
this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0];
|
|
540
|
+
this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1];
|
|
541
|
+
this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2];
|
|
542
|
+
this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3];
|
|
543
|
+
this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4];
|
|
544
|
+
this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5];
|
|
545
|
+
this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6];
|
|
546
|
+
this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7];
|
|
547
|
+
clean(BBUF, BLAKE512_W);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
/** Internal blake1-224 hash class. */
|
|
551
|
+
export class _BLAKE224 extends BLAKE1_32B {
|
|
552
|
+
constructor(opts = {}) {
|
|
553
|
+
super(28, B224_IV, 0b0000_0000, opts);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/** Internal blake1-256 hash class. */
|
|
557
|
+
export class _BLAKE256 extends BLAKE1_32B {
|
|
558
|
+
constructor(opts = {}) {
|
|
559
|
+
super(32, B256_IV, 0b0000_0001, opts);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
/** Internal blake1-384 hash class. */
|
|
563
|
+
export class _BLAKE384 extends BLAKE1_64B {
|
|
564
|
+
constructor(opts = {}) {
|
|
565
|
+
super(48, B384_IV, 0b0000_0000, opts);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
/** Internal blake1-512 hash class. */
|
|
569
|
+
export class _BLAKE512 extends BLAKE1_64B {
|
|
570
|
+
constructor(opts = {}) {
|
|
571
|
+
super(64, B512_IV, 0b0000_0001, opts);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Blake1-224 hash function.
|
|
576
|
+
* @param msg - message bytes to hash
|
|
577
|
+
* @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
|
|
578
|
+
* `opts.salt` must be exactly 16 bytes.
|
|
579
|
+
* @returns Digest bytes.
|
|
580
|
+
* @example
|
|
581
|
+
* Hash a message with Blake1-224.
|
|
582
|
+
* ```ts
|
|
583
|
+
* blake224(new Uint8Array([97, 98, 99]));
|
|
584
|
+
* ```
|
|
585
|
+
*/
|
|
586
|
+
export const blake224 = /* @__PURE__ */ createHasher((opts) => new _BLAKE224(opts));
|
|
587
|
+
/**
|
|
588
|
+
* Blake1-256 hash function.
|
|
589
|
+
* @param msg - message bytes to hash
|
|
590
|
+
* @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
|
|
591
|
+
* `opts.salt` must be exactly 16 bytes.
|
|
592
|
+
* @returns Digest bytes.
|
|
593
|
+
* @example
|
|
594
|
+
* Hash a message with Blake1-256.
|
|
595
|
+
* ```ts
|
|
596
|
+
* blake256(new Uint8Array([97, 98, 99]));
|
|
597
|
+
* ```
|
|
598
|
+
* @example
|
|
599
|
+
* Hash a message with Blake1-256 and a 16-byte salt.
|
|
600
|
+
* ```ts
|
|
601
|
+
* blake256(new Uint8Array([97, 98, 99]), { salt: new Uint8Array(16) });
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
export const blake256 = /* @__PURE__ */ createHasher((opts) => new _BLAKE256(opts));
|
|
605
|
+
/**
|
|
606
|
+
* Blake1-384 hash function.
|
|
607
|
+
* @param msg - message bytes to hash
|
|
608
|
+
* @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
|
|
609
|
+
* `opts.salt` must be exactly 32 bytes.
|
|
610
|
+
* @returns Digest bytes.
|
|
611
|
+
* @example
|
|
612
|
+
* Hash a message with Blake1-384.
|
|
613
|
+
* ```ts
|
|
614
|
+
* blake384(new Uint8Array([97, 98, 99]));
|
|
615
|
+
* ```
|
|
616
|
+
*/
|
|
617
|
+
export const blake384 = /* @__PURE__ */ createHasher((opts) => new _BLAKE384(opts));
|
|
618
|
+
/**
|
|
619
|
+
* Blake1-512 hash function.
|
|
620
|
+
* @param msg - message bytes to hash
|
|
621
|
+
* @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
|
|
622
|
+
* `opts.salt` must be exactly 32 bytes.
|
|
623
|
+
* @returns Digest bytes.
|
|
624
|
+
* @example
|
|
625
|
+
* Hash a message with Blake1-512.
|
|
626
|
+
* ```ts
|
|
627
|
+
* blake512(new Uint8Array([97, 98, 99]));
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
export const blake512 = /* @__PURE__ */ createHasher((opts) => new _BLAKE512(opts));
|