@blockcast/mmt-container 0.1.0-main.149f78a4adae
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 +432 -0
- package/dist/.build-stamp +0 -0
- package/dist/__tests__/test-utils.d.ts +71 -0
- package/dist/__tests__/test-utils.d.ts.map +1 -0
- package/dist/align.d.ts +148 -0
- package/dist/align.d.ts.map +1 -0
- package/dist/align.js +88 -0
- package/dist/align.js.map +7 -0
- package/dist/audio-init-parser.d.ts +66 -0
- package/dist/audio-init-parser.d.ts.map +1 -0
- package/dist/audio-init-parser.js +118 -0
- package/dist/audio-init-parser.js.map +7 -0
- package/dist/audio-ring-buffer.d.ts +50 -0
- package/dist/audio-ring-buffer.d.ts.map +1 -0
- package/dist/audio-ring-buffer.js +93 -0
- package/dist/audio-ring-buffer.js.map +7 -0
- package/dist/authored-timing.d.ts +32 -0
- package/dist/authored-timing.d.ts.map +1 -0
- package/dist/authored-timing.js +32 -0
- package/dist/authored-timing.js.map +7 -0
- package/dist/browser-runtime.js +17109 -0
- package/dist/browser-runtime.js.map +7 -0
- package/dist/carp-catalog.d.ts +318 -0
- package/dist/carp-catalog.d.ts.map +1 -0
- package/dist/carp-catalog.js +549 -0
- package/dist/carp-catalog.js.map +7 -0
- package/dist/catalog-fec-params.d.ts +82 -0
- package/dist/catalog-fec-params.d.ts.map +1 -0
- package/dist/catalog-fec-params.js +66 -0
- package/dist/catalog-fec-params.js.map +7 -0
- package/dist/catalog-network-source.d.ts +19 -0
- package/dist/catalog-network-source.d.ts.map +1 -0
- package/dist/catalog-network-source.js +22 -0
- package/dist/catalog-network-source.js.map +7 -0
- package/dist/catalog-validator.d.ts +18 -0
- package/dist/catalog-validator.d.ts.map +1 -0
- package/dist/catalog-validator.js +7747 -0
- package/dist/catalog-validator.js.map +7 -0
- package/dist/cmaf-block-assembler.d.ts +168 -0
- package/dist/cmaf-block-assembler.d.ts.map +1 -0
- package/dist/cmaf-block-assembler.js +1755 -0
- package/dist/cmaf-block-assembler.js.map +7 -0
- package/dist/cmaf-group-batcher.d.ts +38 -0
- package/dist/cmaf-group-batcher.d.ts.map +1 -0
- package/dist/cmaf-group-batcher.js +195 -0
- package/dist/cmaf-group-batcher.js.map +7 -0
- package/dist/cmcd-producer.d.ts +104 -0
- package/dist/cmcd-producer.d.ts.map +1 -0
- package/dist/cmcd-producer.js +207 -0
- package/dist/cmcd-producer.js.map +7 -0
- package/dist/codec-utils.d.ts +235 -0
- package/dist/codec-utils.d.ts.map +1 -0
- package/dist/codec-utils.js +1225 -0
- package/dist/codec-utils.js.map +7 -0
- package/dist/fec-codec.d.ts +32 -0
- package/dist/fec-codec.d.ts.map +1 -0
- package/dist/fec-codec.js +47 -0
- package/dist/fec-codec.js.map +7 -0
- package/dist/fec-manager.d.ts +266 -0
- package/dist/fec-manager.d.ts.map +1 -0
- package/dist/fec-manager.js +1447 -0
- package/dist/fec-manager.js.map +7 -0
- package/dist/fec-starvation-detector.d.ts +59 -0
- package/dist/fec-starvation-detector.d.ts.map +1 -0
- package/dist/fec-starvation-detector.js +75 -0
- package/dist/fec-starvation-detector.js.map +7 -0
- package/dist/fec-worker-setup.d.ts +76 -0
- package/dist/fec-worker-setup.d.ts.map +1 -0
- package/dist/fec-worker-setup.js +603 -0
- package/dist/fec-worker-setup.js.map +7 -0
- package/dist/fmp4-completion.d.ts +30 -0
- package/dist/fmp4-completion.d.ts.map +1 -0
- package/dist/fmp4-completion.js +21 -0
- package/dist/fmp4-completion.js.map +7 -0
- package/dist/fmp4-reader.d.ts +37 -0
- package/dist/fmp4-reader.d.ts.map +1 -0
- package/dist/fmp4-reader.js +100 -0
- package/dist/fmp4-reader.js.map +7 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +330 -0
- package/dist/index.js.map +7 -0
- package/dist/iso-bmff-timing.d.ts +47 -0
- package/dist/iso-bmff-timing.d.ts.map +1 -0
- package/dist/iso-bmff-timing.js +526 -0
- package/dist/iso-bmff-timing.js.map +7 -0
- package/dist/loc.d.ts +68 -0
- package/dist/loc.d.ts.map +1 -0
- package/dist/loc.js +143 -0
- package/dist/loc.js.map +7 -0
- package/dist/manifest-auth-plan.d.ts +30 -0
- package/dist/manifest-auth-plan.d.ts.map +1 -0
- package/dist/manifest-auth-plan.js +1267 -0
- package/dist/manifest-auth-plan.js.map +7 -0
- package/dist/media-router.d.ts +338 -0
- package/dist/media-router.d.ts.map +1 -0
- package/dist/media-router.js +802 -0
- package/dist/media-router.js.map +7 -0
- package/dist/mfu-reassembler.d.ts +264 -0
- package/dist/mfu-reassembler.d.ts.map +1 -0
- package/dist/mfu-reassembler.js +2668 -0
- package/dist/mfu-reassembler.js.map +7 -0
- package/dist/mfu-reassembly-policy.d.ts +24 -0
- package/dist/mfu-reassembly-policy.d.ts.map +1 -0
- package/dist/mfu-reassembly-policy.js +99 -0
- package/dist/mfu-reassembly-policy.js.map +7 -0
- package/dist/mmtp-container-parser.d.ts +304 -0
- package/dist/mmtp-container-parser.d.ts.map +1 -0
- package/dist/mmtp-container-parser.js +5378 -0
- package/dist/mmtp-container-parser.js.map +7 -0
- package/dist/mmtp-container-parser.no-modules.js +7853 -0
- package/dist/mmtp-container-parser.no-modules.js.map +7 -0
- package/dist/mmtp-decode-pipeline.d.ts +96 -0
- package/dist/mmtp-decode-pipeline.d.ts.map +1 -0
- package/dist/mmtp-decode-pipeline.js +5589 -0
- package/dist/mmtp-decode-pipeline.js.map +7 -0
- package/dist/mmtp-router.d.ts +383 -0
- package/dist/mmtp-router.d.ts.map +1 -0
- package/dist/mmtp-router.js +8384 -0
- package/dist/mmtp-router.js.map +7 -0
- package/dist/mmtp-to-cmaf.d.ts +166 -0
- package/dist/mmtp-to-cmaf.d.ts.map +1 -0
- package/dist/mmtp-to-cmaf.js +781 -0
- package/dist/mmtp-to-cmaf.js.map +7 -0
- package/dist/multicast-auth-catalog.d.ts +115 -0
- package/dist/multicast-auth-catalog.d.ts.map +1 -0
- package/dist/multicast-auth-catalog.js +202 -0
- package/dist/multicast-auth-catalog.js.map +7 -0
- package/dist/multicast-input.d.ts +107 -0
- package/dist/multicast-input.d.ts.map +1 -0
- package/dist/multicast-input.js +256 -0
- package/dist/multicast-input.js.map +7 -0
- package/dist/multicast-manager.d.ts +330 -0
- package/dist/multicast-manager.d.ts.map +1 -0
- package/dist/multicast-manager.js +11032 -0
- package/dist/multicast-manager.js.map +7 -0
- package/dist/multicast-transport.d.ts +62 -0
- package/dist/multicast-transport.d.ts.map +1 -0
- package/dist/multicast-transport.js +338 -0
- package/dist/multicast-transport.js.map +7 -0
- package/dist/multicast-unwrap.d.ts +57 -0
- package/dist/multicast-unwrap.d.ts.map +1 -0
- package/dist/multicast-unwrap.js +384 -0
- package/dist/multicast-unwrap.js.map +7 -0
- package/dist/no-modules.d.ts +9 -0
- package/dist/no-modules.d.ts.map +1 -0
- package/dist/no-modules.js +7819 -0
- package/dist/no-modules.js.map +7 -0
- package/dist/phase14-catalog-override.d.ts +126 -0
- package/dist/phase14-catalog-override.d.ts.map +1 -0
- package/dist/phase14-catalog-override.js +155 -0
- package/dist/phase14-catalog-override.js.map +7 -0
- package/dist/repair-fetch.d.ts +58 -0
- package/dist/repair-fetch.d.ts.map +1 -0
- package/dist/repair-fetch.js +117 -0
- package/dist/repair-fetch.js.map +7 -0
- package/dist/sample-combiner.d.ts +182 -0
- package/dist/sample-combiner.d.ts.map +1 -0
- package/dist/sample-combiner.js +571 -0
- package/dist/sample-combiner.js.map +7 -0
- package/dist/signaling.d.ts +29 -0
- package/dist/signaling.d.ts.map +1 -0
- package/dist/signaling.js +232 -0
- package/dist/signaling.js.map +7 -0
- package/dist/source-auth.d.ts +2 -0
- package/dist/source-auth.d.ts.map +1 -0
- package/dist/source-auth.js +1220 -0
- package/dist/source-auth.js.map +7 -0
- package/dist/switching-set-alignment.d.ts +61 -0
- package/dist/switching-set-alignment.d.ts.map +1 -0
- package/dist/switching-set-alignment.js +85 -0
- package/dist/switching-set-alignment.js.map +7 -0
- package/dist/timestamp-codec.d.ts +34 -0
- package/dist/timestamp-codec.d.ts.map +1 -0
- package/dist/timestamp-codec.js +456 -0
- package/dist/timestamp-codec.js.map +7 -0
- package/dist/track-pipeline-setup.d.ts +72 -0
- package/dist/track-pipeline-setup.d.ts.map +1 -0
- package/dist/track-pipeline-setup.js +306 -0
- package/dist/track-pipeline-setup.js.map +7 -0
- package/dist/track-pipeline.d.ts +121 -0
- package/dist/track-pipeline.d.ts.map +1 -0
- package/dist/track-pipeline.js +229 -0
- package/dist/track-pipeline.js.map +7 -0
- package/dist/track-session.d.ts +269 -0
- package/dist/track-session.d.ts.map +1 -0
- package/dist/track-session.js +597 -0
- package/dist/track-session.js.map +7 -0
- package/dist/transport-pool.d.ts +69 -0
- package/dist/transport-pool.d.ts.map +1 -0
- package/dist/transport-pool.js +88 -0
- package/dist/transport-pool.js.map +7 -0
- package/dist/wasm-mfu-reassembler.d.ts +81 -0
- package/dist/wasm-mfu-reassembler.d.ts.map +1 -0
- package/dist/wasm-mfu-reassembler.js +1915 -0
- package/dist/wasm-mfu-reassembler.js.map +7 -0
- package/dist/wasm-mmtp-container-parser.d.ts +10 -0
- package/dist/wasm-mmtp-container-parser.d.ts.map +1 -0
- package/dist/wasm-mmtp-container-parser.js +5635 -0
- package/dist/wasm-mmtp-container-parser.js.map +7 -0
- package/node_modules/@blockcast/fec-worker/README.md +213 -0
- package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +80 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +270 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +252 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +11 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +14 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +565 -0
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +7 -0
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts +10 -0
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/index.js +8 -0
- package/node_modules/@blockcast/fec-worker/dist/index.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +20 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +349 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +7 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +104 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +181 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +179 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +47 -0
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +9 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +1 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.js +13 -0
- package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +1 -0
- package/node_modules/@blockcast/fec-worker/package.json +59 -0
- package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +309 -0
- package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +268 -0
- package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +1048 -0
- package/node_modules/@blockcast/fec-worker/src/index.ts +32 -0
- package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +558 -0
- package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +222 -0
- package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +194 -0
- package/node_modules/@blockcast/fec-worker/src/transfer.ts +12 -0
- package/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
- package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
- package/node_modules/@blockcast/mmt-base/README.md +120 -0
- package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts +2 -0
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/index.js +2 -0
- package/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +275 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js +644 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/package.json +49 -0
- package/node_modules/@blockcast/mmt-base/src/index.ts +1 -0
- package/node_modules/@blockcast/mmt-base/src/mmtp.ts +898 -0
- package/node_modules/@blockcast/mmt-fec/README.md +270 -0
- package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +80 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +294 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +72 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +192 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +46 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +96 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +33 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +57 -0
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +185 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +273 -0
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +22 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.js +22 -0
- package/node_modules/@blockcast/mmt-fec/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +20 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +28 -0
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +174 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.js +256 -0
- package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +41 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +81 -0
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +120 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +2 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +2 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +275 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +644 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +49 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +898 -0
- package/node_modules/@blockcast/mmt-fec/package.json +79 -0
- package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +369 -0
- package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +277 -0
- package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +127 -0
- package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +68 -0
- package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +332 -0
- package/node_modules/@blockcast/mmt-fec/src/index.ts +77 -0
- package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +34 -0
- package/node_modules/@blockcast/mmt-fec/src/oti.ts +319 -0
- package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +101 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +28 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +128 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +4 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +4 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +37 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +179 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +90 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +462 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +1 -0
- package/node_modules/@blockcast/mmt-manifest-verify/package.json +45 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +171 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +3 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +230 -0
- package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +636 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +521 -0
- package/node_modules/@noble/hashes/_assert.d.ts +17 -0
- package/node_modules/@noble/hashes/_assert.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_assert.js +18 -0
- package/node_modules/@noble/hashes/_assert.js.map +1 -0
- package/node_modules/@noble/hashes/_blake.d.ts +14 -0
- package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_blake.js +50 -0
- package/node_modules/@noble/hashes/_blake.js.map +1 -0
- package/node_modules/@noble/hashes/_md.d.ts +51 -0
- package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_md.js +162 -0
- package/node_modules/@noble/hashes/_md.js.map +1 -0
- package/node_modules/@noble/hashes/_u64.d.ts +55 -0
- package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_u64.js +90 -0
- package/node_modules/@noble/hashes/_u64.js.map +1 -0
- package/node_modules/@noble/hashes/argon2.d.ts +32 -0
- package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/argon2.js +401 -0
- package/node_modules/@noble/hashes/argon2.js.map +1 -0
- package/node_modules/@noble/hashes/blake1.d.ts +106 -0
- package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake1.js +459 -0
- package/node_modules/@noble/hashes/blake1.js.map +1 -0
- package/node_modules/@noble/hashes/blake2.d.ts +116 -0
- package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2.js +420 -0
- package/node_modules/@noble/hashes/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/blake2b.d.ts +11 -0
- package/node_modules/@noble/hashes/blake2b.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2b.js +14 -0
- package/node_modules/@noble/hashes/blake2b.js.map +1 -0
- package/node_modules/@noble/hashes/blake2s.d.ts +20 -0
- package/node_modules/@noble/hashes/blake2s.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2s.js +24 -0
- package/node_modules/@noble/hashes/blake2s.js.map +1 -0
- package/node_modules/@noble/hashes/blake3.d.ts +54 -0
- package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake3.js +255 -0
- package/node_modules/@noble/hashes/blake3.js.map +1 -0
- package/node_modules/@noble/hashes/crypto.d.ts +2 -0
- package/node_modules/@noble/hashes/crypto.d.ts.map +1 -0
- package/node_modules/@noble/hashes/crypto.js +5 -0
- package/node_modules/@noble/hashes/crypto.js.map +1 -0
- package/node_modules/@noble/hashes/cryptoNode.d.ts +2 -0
- package/node_modules/@noble/hashes/cryptoNode.d.ts.map +1 -0
- package/node_modules/@noble/hashes/cryptoNode.js +18 -0
- package/node_modules/@noble/hashes/cryptoNode.js.map +1 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +47 -0
- package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/eskdf.js +166 -0
- package/node_modules/@noble/hashes/eskdf.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_assert.d.ts +17 -0
- package/node_modules/@noble/hashes/esm/_assert.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_assert.js +15 -0
- package/node_modules/@noble/hashes/esm/_assert.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_blake.d.ts +14 -0
- package/node_modules/@noble/hashes/esm/_blake.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_blake.js +45 -0
- package/node_modules/@noble/hashes/esm/_blake.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_md.d.ts +51 -0
- package/node_modules/@noble/hashes/esm/_md.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_md.js +155 -0
- package/node_modules/@noble/hashes/esm/_md.js.map +1 -0
- package/node_modules/@noble/hashes/esm/_u64.d.ts +55 -0
- package/node_modules/@noble/hashes/esm/_u64.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/_u64.js +67 -0
- package/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
- package/node_modules/@noble/hashes/esm/argon2.d.ts +32 -0
- package/node_modules/@noble/hashes/esm/argon2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/argon2.js +392 -0
- package/node_modules/@noble/hashes/esm/argon2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake1.d.ts +106 -0
- package/node_modules/@noble/hashes/esm/blake1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake1.js +452 -0
- package/node_modules/@noble/hashes/esm/blake1.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2.d.ts +116 -0
- package/node_modules/@noble/hashes/esm/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2.js +413 -0
- package/node_modules/@noble/hashes/esm/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2b.d.ts +11 -0
- package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2b.js +11 -0
- package/node_modules/@noble/hashes/esm/blake2b.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2s.d.ts +20 -0
- package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2s.js +21 -0
- package/node_modules/@noble/hashes/esm/blake2s.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake3.d.ts +54 -0
- package/node_modules/@noble/hashes/esm/blake3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake3.js +251 -0
- package/node_modules/@noble/hashes/esm/blake3.js.map +1 -0
- package/node_modules/@noble/hashes/esm/crypto.d.ts +2 -0
- package/node_modules/@noble/hashes/esm/crypto.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/crypto.js +2 -0
- package/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +2 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.js +15 -0
- package/node_modules/@noble/hashes/esm/cryptoNode.js.map +1 -0
- package/node_modules/@noble/hashes/esm/eskdf.d.ts +47 -0
- package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/eskdf.js +160 -0
- package/node_modules/@noble/hashes/esm/eskdf.js.map +1 -0
- package/node_modules/@noble/hashes/esm/hkdf.d.ts +36 -0
- package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/hkdf.js +82 -0
- package/node_modules/@noble/hashes/esm/hkdf.js.map +1 -0
- package/node_modules/@noble/hashes/esm/hmac.d.ts +35 -0
- package/node_modules/@noble/hashes/esm/hmac.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/hmac.js +86 -0
- package/node_modules/@noble/hashes/esm/hmac.js.map +1 -0
- package/node_modules/@noble/hashes/esm/index.d.ts +2 -0
- package/node_modules/@noble/hashes/esm/index.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/index.js +33 -0
- package/node_modules/@noble/hashes/esm/index.js.map +1 -0
- package/node_modules/@noble/hashes/esm/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/esm/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/legacy.js +281 -0
- package/node_modules/@noble/hashes/esm/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/esm/package.json +10 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +23 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.js +97 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts +13 -0
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/ripemd160.js +13 -0
- package/node_modules/@noble/hashes/esm/ripemd160.js.map +1 -0
- package/node_modules/@noble/hashes/esm/scrypt.d.ts +34 -0
- package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/scrypt.js +228 -0
- package/node_modules/@noble/hashes/esm/scrypt.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha1.d.ts +11 -0
- package/node_modules/@noble/hashes/esm/sha1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha1.js +11 -0
- package/node_modules/@noble/hashes/esm/sha1.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha2.d.ts +159 -0
- package/node_modules/@noble/hashes/esm/sha2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha2.js +375 -0
- package/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha256.d.ts +20 -0
- package/node_modules/@noble/hashes/esm/sha256.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha256.js +20 -0
- package/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +142 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.js +393 -0
- package/node_modules/@noble/hashes/esm/sha3-addons.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3.d.ts +53 -0
- package/node_modules/@noble/hashes/esm/sha3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha3.js +234 -0
- package/node_modules/@noble/hashes/esm/sha3.js.map +1 -0
- package/node_modules/@noble/hashes/esm/sha512.d.ts +26 -0
- package/node_modules/@noble/hashes/esm/sha512.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/sha512.js +26 -0
- package/node_modules/@noble/hashes/esm/sha512.js.map +1 -0
- package/node_modules/@noble/hashes/esm/utils.d.ts +161 -0
- package/node_modules/@noble/hashes/esm/utils.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/utils.js +281 -0
- package/node_modules/@noble/hashes/esm/utils.js.map +1 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +36 -0
- package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hkdf.js +88 -0
- package/node_modules/@noble/hashes/hkdf.js.map +1 -0
- package/node_modules/@noble/hashes/hmac.d.ts +35 -0
- package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hmac.js +91 -0
- package/node_modules/@noble/hashes/hmac.js.map +1 -0
- package/node_modules/@noble/hashes/index.d.ts +1 -0
- package/node_modules/@noble/hashes/index.d.ts.map +1 -0
- package/node_modules/@noble/hashes/index.js +33 -0
- package/node_modules/@noble/hashes/index.js.map +1 -0
- package/node_modules/@noble/hashes/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/legacy.js +287 -0
- package/node_modules/@noble/hashes/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/package.json +266 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +23 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/pbkdf2.js +101 -0
- package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
- package/node_modules/@noble/hashes/ripemd160.d.ts +13 -0
- package/node_modules/@noble/hashes/ripemd160.d.ts.map +1 -0
- package/node_modules/@noble/hashes/ripemd160.js +16 -0
- package/node_modules/@noble/hashes/ripemd160.js.map +1 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +34 -0
- package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
- package/node_modules/@noble/hashes/scrypt.js +232 -0
- package/node_modules/@noble/hashes/scrypt.js.map +1 -0
- package/node_modules/@noble/hashes/sha1.d.ts +11 -0
- package/node_modules/@noble/hashes/sha1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha1.js +14 -0
- package/node_modules/@noble/hashes/sha1.js.map +1 -0
- package/node_modules/@noble/hashes/sha2.d.ts +159 -0
- package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha2.js +384 -0
- package/node_modules/@noble/hashes/sha2.js.map +1 -0
- package/node_modules/@noble/hashes/sha256.d.ts +20 -0
- package/node_modules/@noble/hashes/sha256.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha256.js +23 -0
- package/node_modules/@noble/hashes/sha256.js.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +142 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.js +402 -0
- package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
- package/node_modules/@noble/hashes/sha3.d.ts +53 -0
- package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3.js +239 -0
- package/node_modules/@noble/hashes/sha3.js.map +1 -0
- package/node_modules/@noble/hashes/sha512.d.ts +26 -0
- package/node_modules/@noble/hashes/sha512.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha512.js +29 -0
- package/node_modules/@noble/hashes/sha512.js.map +1 -0
- package/node_modules/@noble/hashes/src/_assert.ts +22 -0
- package/node_modules/@noble/hashes/src/_blake.ts +50 -0
- package/node_modules/@noble/hashes/src/_md.ts +176 -0
- package/node_modules/@noble/hashes/src/_u64.ts +91 -0
- package/node_modules/@noble/hashes/src/argon2.ts +497 -0
- package/node_modules/@noble/hashes/src/blake1.ts +534 -0
- package/node_modules/@noble/hashes/src/blake2.ts +486 -0
- package/node_modules/@noble/hashes/src/blake2b.ts +10 -0
- package/node_modules/@noble/hashes/src/blake2s.ts +20 -0
- package/node_modules/@noble/hashes/src/blake3.ts +272 -0
- package/node_modules/@noble/hashes/src/crypto.ts +9 -0
- package/node_modules/@noble/hashes/src/cryptoNode.ts +15 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +187 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +88 -0
- package/node_modules/@noble/hashes/src/hmac.ts +94 -0
- package/node_modules/@noble/hashes/src/index.ts +31 -0
- package/node_modules/@noble/hashes/src/legacy.ts +293 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +122 -0
- package/node_modules/@noble/hashes/src/ripemd160.ts +12 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +257 -0
- package/node_modules/@noble/hashes/src/sha1.ts +10 -0
- package/node_modules/@noble/hashes/src/sha2.ts +402 -0
- package/node_modules/@noble/hashes/src/sha256.ts +24 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +499 -0
- package/node_modules/@noble/hashes/src/sha3.ts +258 -0
- package/node_modules/@noble/hashes/src/sha512.ts +34 -0
- package/node_modules/@noble/hashes/src/utils.ts +395 -0
- package/node_modules/@noble/hashes/utils.d.ts +161 -0
- package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
- package/node_modules/@noble/hashes/utils.js +313 -0
- package/node_modules/@noble/hashes/utils.js.map +1 -0
- package/package.json +203 -0
- package/schemas/catalog.schema.json +283 -0
- package/src/align.ts +235 -0
- package/src/audio-init-parser.ts +189 -0
- package/src/audio-ring-buffer.ts +120 -0
- package/src/authored-timing.ts +63 -0
- package/src/carp-catalog.ts +776 -0
- package/src/catalog-fec-params.ts +167 -0
- package/src/catalog-network-source.ts +49 -0
- package/src/catalog-validator.ts +34 -0
- package/src/cmaf-block-assembler.ts +1058 -0
- package/src/cmaf-group-batcher.ts +104 -0
- package/src/cmcd-producer.ts +329 -0
- package/src/codec-utils.ts +1539 -0
- package/src/fec-codec.ts +61 -0
- package/src/fec-manager.ts +1939 -0
- package/src/fec-starvation-detector.ts +128 -0
- package/src/fec-worker-setup.ts +177 -0
- package/src/fmp4-completion.ts +47 -0
- package/src/fmp4-reader.ts +112 -0
- package/src/index.ts +443 -0
- package/src/iso-bmff-timing.ts +688 -0
- package/src/loc.ts +181 -0
- package/src/manifest-auth-plan.ts +107 -0
- package/src/media-router.ts +1185 -0
- package/src/mfu-reassembler.ts +2842 -0
- package/src/mfu-reassembly-policy.ts +134 -0
- package/src/mmtp-container-parser.ts +1498 -0
- package/src/mmtp-decode-pipeline.ts +315 -0
- package/src/mmtp-router.ts +3027 -0
- package/src/mmtp-to-cmaf.ts +956 -0
- package/src/multicast-auth-catalog.ts +340 -0
- package/src/multicast-input.ts +439 -0
- package/src/multicast-manager.ts +1503 -0
- package/src/multicast-transport.ts +320 -0
- package/src/multicast-unwrap.ts +132 -0
- package/src/no-modules.ts +20 -0
- package/src/phase14-catalog-override.ts +336 -0
- package/src/repair-fetch.ts +217 -0
- package/src/sample-combiner.ts +846 -0
- package/src/signaling.ts +78 -0
- package/src/source-auth.ts +1 -0
- package/src/switching-set-alignment.ts +109 -0
- package/src/timestamp-codec.ts +265 -0
- package/src/track-pipeline-setup.ts +189 -0
- package/src/track-pipeline.ts +332 -0
- package/src/track-session.ts +778 -0
- package/src/transport-pool.ts +128 -0
- package/src/wasm-mfu-reassembler.ts +372 -0
- package/src/wasm-mmtp-container-parser.ts +23 -0
- package/test-vectors/align.json +199 -0
- package/test-vectors/catalog/README.md +25 -0
- package/test-vectors/catalog/negative/legacy-selection-params.json +15 -0
- package/test-vectors/catalog/negative/missing-mmtp-fields.json +12 -0
- package/test-vectors/catalog/negative/multicast-auth-padded-key.json +37 -0
- package/test-vectors/catalog/negative/multicast-auth-reused-track-format.json +53 -0
- package/test-vectors/catalog/negative/multicast-auth-trailing-pad-bits.json +37 -0
- package/test-vectors/catalog/negative/multicast-endpoint-missing-protocol-and-source.json +24 -0
- package/test-vectors/catalog/negative/network-source-object.json +25 -0
- package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +26 -0
- package/test-vectors/catalog/negative/repair-track-legacy-shape.json +18 -0
- package/test-vectors/catalog/negative/track-role-empty.json +16 -0
- package/test-vectors/catalog/negative/track-role-non-string.json +16 -0
- package/test-vectors/catalog/positive/fec-multicast.json +51 -0
- package/test-vectors/catalog/positive/flat-av.json +30 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +55 -0
- package/test-vectors/catalog/positive/ticks-and-mixed-timescales.json +39 -0
- package/test-vectors/catalog/positive/track-role.json +49 -0
- package/test-vectors/catalog/releases/moqcast-native-v16-v1/catalog.json +65 -0
- package/test-vectors/catalog/releases/moqcast-native-v16-v1.archive.sha256 +1 -0
- package/test-vectors/catalog-multicast-auth-v1.json +26 -0
- package/test-vectors/catalog-validation.json +148 -0
- package/test-vectors/catalog-validator-public-api.mjs +25 -0
- package/test-vectors/generate-source-auth-fixture.mjs +114 -0
- package/test-vectors/source-auth-v1.json +61 -0
- package/test-vectors/subsample-placement-v1.json +230 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blake1 legacy hash function, one of SHA3 proposals.
|
|
3
|
+
* Rarely used. Check out blake2 or blake3 instead.
|
|
4
|
+
* 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.ts';
|
|
26
|
+
import { setBigUint64, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';
|
|
27
|
+
import * as u64 from './_u64.ts';
|
|
28
|
+
// prettier-ignore
|
|
29
|
+
import {
|
|
30
|
+
abytes, aexists, aoutput,
|
|
31
|
+
clean, createOptHasher,
|
|
32
|
+
createView, Hash, toBytes,
|
|
33
|
+
type CHashO, type Input,
|
|
34
|
+
} from './utils.ts';
|
|
35
|
+
|
|
36
|
+
/** Blake1 options. Basically just "salt" */
|
|
37
|
+
export type BlakeOpts = {
|
|
38
|
+
salt?: Uint8Array;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Empty zero-filled salt
|
|
42
|
+
const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8);
|
|
43
|
+
|
|
44
|
+
abstract class BLAKE1<T extends BLAKE1<T>> extends Hash<T> {
|
|
45
|
+
protected finished = false;
|
|
46
|
+
protected length = 0;
|
|
47
|
+
protected pos = 0;
|
|
48
|
+
protected destroyed = false;
|
|
49
|
+
// For partial updates less than block size
|
|
50
|
+
protected buffer: Uint8Array;
|
|
51
|
+
protected view: DataView;
|
|
52
|
+
protected salt: Uint32Array;
|
|
53
|
+
abstract compress(view: DataView, offset: number, withLength?: boolean): void;
|
|
54
|
+
protected abstract get(): number[];
|
|
55
|
+
protected abstract set(...args: number[]): void;
|
|
56
|
+
|
|
57
|
+
readonly blockLen: number;
|
|
58
|
+
readonly outputLen: number;
|
|
59
|
+
private lengthFlag: number;
|
|
60
|
+
private counterLen: number;
|
|
61
|
+
protected constants: Uint32Array;
|
|
62
|
+
|
|
63
|
+
constructor(
|
|
64
|
+
blockLen: number,
|
|
65
|
+
outputLen: number,
|
|
66
|
+
lengthFlag: number,
|
|
67
|
+
counterLen: number,
|
|
68
|
+
saltLen: number,
|
|
69
|
+
constants: Uint32Array,
|
|
70
|
+
opts: BlakeOpts = {}
|
|
71
|
+
) {
|
|
72
|
+
super();
|
|
73
|
+
const { salt } = opts;
|
|
74
|
+
this.blockLen = blockLen;
|
|
75
|
+
this.outputLen = outputLen;
|
|
76
|
+
this.lengthFlag = lengthFlag;
|
|
77
|
+
this.counterLen = counterLen;
|
|
78
|
+
this.buffer = new Uint8Array(blockLen);
|
|
79
|
+
this.view = createView(this.buffer);
|
|
80
|
+
if (salt) {
|
|
81
|
+
let slt = salt;
|
|
82
|
+
slt = toBytes(slt);
|
|
83
|
+
abytes(slt);
|
|
84
|
+
if (slt.length !== 4 * saltLen) throw new Error('wrong salt length');
|
|
85
|
+
const salt32 = (this.salt = new Uint32Array(saltLen));
|
|
86
|
+
const sv = createView(slt);
|
|
87
|
+
this.constants = constants.slice();
|
|
88
|
+
for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) {
|
|
89
|
+
salt32[i] = sv.getUint32(offset, false);
|
|
90
|
+
this.constants[i] ^= salt32[i];
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
this.salt = EMPTY_SALT;
|
|
94
|
+
this.constants = constants;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
update(data: Input): this {
|
|
98
|
+
aexists(this);
|
|
99
|
+
data = toBytes(data);
|
|
100
|
+
abytes(data);
|
|
101
|
+
// From _md, but update length before each compress
|
|
102
|
+
const { view, buffer, blockLen } = this;
|
|
103
|
+
const len = data.length;
|
|
104
|
+
let dataView;
|
|
105
|
+
for (let pos = 0; pos < len; ) {
|
|
106
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
107
|
+
// Fast path: we have at least one block in input, cast it to view and process
|
|
108
|
+
if (take === blockLen) {
|
|
109
|
+
if (!dataView) dataView = createView(data);
|
|
110
|
+
for (; blockLen <= len - pos; pos += blockLen) {
|
|
111
|
+
this.length += blockLen;
|
|
112
|
+
this.compress(dataView, pos);
|
|
113
|
+
}
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
117
|
+
this.pos += take;
|
|
118
|
+
pos += take;
|
|
119
|
+
if (this.pos === blockLen) {
|
|
120
|
+
this.length += blockLen;
|
|
121
|
+
this.compress(view, 0, true);
|
|
122
|
+
this.pos = 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
destroy(): void {
|
|
128
|
+
this.destroyed = true;
|
|
129
|
+
if (this.salt !== EMPTY_SALT) {
|
|
130
|
+
clean(this.salt, this.constants);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
_cloneInto(to?: T): T {
|
|
134
|
+
to ||= new (this.constructor as any)() as T;
|
|
135
|
+
to.set(...this.get());
|
|
136
|
+
const { buffer, length, finished, destroyed, constants, salt, pos } = this;
|
|
137
|
+
to.buffer.set(buffer);
|
|
138
|
+
to.constants = constants.slice();
|
|
139
|
+
to.destroyed = destroyed;
|
|
140
|
+
to.finished = finished;
|
|
141
|
+
to.length = length;
|
|
142
|
+
to.pos = pos;
|
|
143
|
+
to.salt = salt.slice();
|
|
144
|
+
return to;
|
|
145
|
+
}
|
|
146
|
+
clone(): T {
|
|
147
|
+
return this._cloneInto();
|
|
148
|
+
}
|
|
149
|
+
digestInto(out: Uint8Array): void {
|
|
150
|
+
aexists(this);
|
|
151
|
+
aoutput(out, this);
|
|
152
|
+
this.finished = true;
|
|
153
|
+
// Padding
|
|
154
|
+
const { buffer, blockLen, counterLen, lengthFlag, view } = this;
|
|
155
|
+
clean(buffer.subarray(this.pos)); // clean buf
|
|
156
|
+
const counter = BigInt((this.length + this.pos) * 8);
|
|
157
|
+
const counterPos = blockLen - counterLen - 1;
|
|
158
|
+
buffer[this.pos] |= 0b1000_0000; // End block flag
|
|
159
|
+
this.length += this.pos; // add unwritten length
|
|
160
|
+
// Not enough in buffer for length: write what we have.
|
|
161
|
+
if (this.pos > counterPos) {
|
|
162
|
+
this.compress(view, 0);
|
|
163
|
+
clean(buffer);
|
|
164
|
+
this.pos = 0;
|
|
165
|
+
}
|
|
166
|
+
// Difference with md: here we have lengthFlag!
|
|
167
|
+
buffer[counterPos] |= lengthFlag; // Length flag
|
|
168
|
+
// We always set 8 byte length flag. Because length will overflow significantly sooner.
|
|
169
|
+
setBigUint64(view, blockLen - 8, counter, false);
|
|
170
|
+
this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block?
|
|
171
|
+
// Write output
|
|
172
|
+
clean(buffer);
|
|
173
|
+
const v = createView(out);
|
|
174
|
+
const state = this.get();
|
|
175
|
+
for (let i = 0; i < this.outputLen / 4; ++i) v.setUint32(i * 4, state[i]);
|
|
176
|
+
}
|
|
177
|
+
digest(): Uint8Array {
|
|
178
|
+
const { buffer, outputLen } = this;
|
|
179
|
+
this.digestInto(buffer);
|
|
180
|
+
const res = buffer.slice(0, outputLen);
|
|
181
|
+
this.destroy();
|
|
182
|
+
return res;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Constants
|
|
187
|
+
const B64C = /* @__PURE__ */ Uint32Array.from([
|
|
188
|
+
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
|
|
189
|
+
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
|
|
190
|
+
0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
|
|
191
|
+
0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69,
|
|
192
|
+
]);
|
|
193
|
+
// first half of C512
|
|
194
|
+
const B32C = B64C.slice(0, 16);
|
|
195
|
+
|
|
196
|
+
const B256_IV = SHA256_IV.slice();
|
|
197
|
+
const B224_IV = SHA224_IV.slice();
|
|
198
|
+
const B384_IV = SHA384_IV.slice();
|
|
199
|
+
const B512_IV = SHA512_IV.slice();
|
|
200
|
+
|
|
201
|
+
function generateTBL256() {
|
|
202
|
+
const TBL = [];
|
|
203
|
+
for (let i = 0, j = 0; i < 14; i++, j += 16) {
|
|
204
|
+
for (let offset = 1; offset < 16; offset += 2) {
|
|
205
|
+
TBL.push(B32C[BSIGMA[j + offset]]);
|
|
206
|
+
TBL.push(B32C[BSIGMA[j + offset - 1]]);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return new Uint32Array(TBL);
|
|
210
|
+
}
|
|
211
|
+
const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute
|
|
212
|
+
|
|
213
|
+
// Reusable temporary buffer
|
|
214
|
+
const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16);
|
|
215
|
+
|
|
216
|
+
class Blake1_32 extends BLAKE1<Blake1_32> {
|
|
217
|
+
private v0: number;
|
|
218
|
+
private v1: number;
|
|
219
|
+
private v2: number;
|
|
220
|
+
private v3: number;
|
|
221
|
+
private v4: number;
|
|
222
|
+
private v5: number;
|
|
223
|
+
private v6: number;
|
|
224
|
+
private v7: number;
|
|
225
|
+
constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) {
|
|
226
|
+
super(64, outputLen, lengthFlag, 8, 4, B32C, opts);
|
|
227
|
+
this.v0 = IV[0] | 0;
|
|
228
|
+
this.v1 = IV[1] | 0;
|
|
229
|
+
this.v2 = IV[2] | 0;
|
|
230
|
+
this.v3 = IV[3] | 0;
|
|
231
|
+
this.v4 = IV[4] | 0;
|
|
232
|
+
this.v5 = IV[5] | 0;
|
|
233
|
+
this.v6 = IV[6] | 0;
|
|
234
|
+
this.v7 = IV[7] | 0;
|
|
235
|
+
}
|
|
236
|
+
protected get(): [number, number, number, number, number, number, number, number] {
|
|
237
|
+
const { v0, v1, v2, v3, v4, v5, v6, v7 } = this;
|
|
238
|
+
return [v0, v1, v2, v3, v4, v5, v6, v7];
|
|
239
|
+
}
|
|
240
|
+
// prettier-ignore
|
|
241
|
+
protected set(
|
|
242
|
+
v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number
|
|
243
|
+
): void {
|
|
244
|
+
this.v0 = v0 | 0;
|
|
245
|
+
this.v1 = v1 | 0;
|
|
246
|
+
this.v2 = v2 | 0;
|
|
247
|
+
this.v3 = v3 | 0;
|
|
248
|
+
this.v4 = v4 | 0;
|
|
249
|
+
this.v5 = v5 | 0;
|
|
250
|
+
this.v6 = v6 | 0;
|
|
251
|
+
this.v7 = v7 | 0;
|
|
252
|
+
}
|
|
253
|
+
destroy(): void {
|
|
254
|
+
super.destroy();
|
|
255
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
256
|
+
}
|
|
257
|
+
compress(view: DataView, offset: number, withLength = true): void {
|
|
258
|
+
for (let i = 0; i < 16; i++, offset += 4) BLAKE256_W[i] = view.getUint32(offset, false);
|
|
259
|
+
// NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]]
|
|
260
|
+
let v00 = this.v0 | 0;
|
|
261
|
+
let v01 = this.v1 | 0;
|
|
262
|
+
let v02 = this.v2 | 0;
|
|
263
|
+
let v03 = this.v3 | 0;
|
|
264
|
+
let v04 = this.v4 | 0;
|
|
265
|
+
let v05 = this.v5 | 0;
|
|
266
|
+
let v06 = this.v6 | 0;
|
|
267
|
+
let v07 = this.v7 | 0;
|
|
268
|
+
let v08 = this.constants[0] | 0;
|
|
269
|
+
let v09 = this.constants[1] | 0;
|
|
270
|
+
let v10 = this.constants[2] | 0;
|
|
271
|
+
let v11 = this.constants[3] | 0;
|
|
272
|
+
const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0));
|
|
273
|
+
let v12 = (this.constants[4] ^ l) >>> 0;
|
|
274
|
+
let v13 = (this.constants[5] ^ l) >>> 0;
|
|
275
|
+
let v14 = (this.constants[6] ^ h) >>> 0;
|
|
276
|
+
let v15 = (this.constants[7] ^ h) >>> 0;
|
|
277
|
+
// prettier-ignore
|
|
278
|
+
for (let i = 0, k = 0, j = 0; i < 14; i++) {
|
|
279
|
+
({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
280
|
+
({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
281
|
+
({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
282
|
+
({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
283
|
+
({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
284
|
+
({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
285
|
+
({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
286
|
+
({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
287
|
+
({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
288
|
+
({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
289
|
+
({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
290
|
+
({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
291
|
+
({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
292
|
+
({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
293
|
+
({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
294
|
+
({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
|
|
295
|
+
}
|
|
296
|
+
this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0;
|
|
297
|
+
this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0;
|
|
298
|
+
this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0;
|
|
299
|
+
this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0;
|
|
300
|
+
this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0;
|
|
301
|
+
this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0;
|
|
302
|
+
this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0;
|
|
303
|
+
this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0;
|
|
304
|
+
clean(BLAKE256_W);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const BBUF = /* @__PURE__ */ new Uint32Array(32);
|
|
309
|
+
const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32);
|
|
310
|
+
|
|
311
|
+
function generateTBL512() {
|
|
312
|
+
const TBL = [];
|
|
313
|
+
for (let r = 0, k = 0; r < 16; r++, k += 16) {
|
|
314
|
+
for (let offset = 1; offset < 16; offset += 2) {
|
|
315
|
+
TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]);
|
|
316
|
+
TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]);
|
|
317
|
+
TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]);
|
|
318
|
+
TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return new Uint32Array(TBL);
|
|
322
|
+
}
|
|
323
|
+
const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute
|
|
324
|
+
|
|
325
|
+
// Mixing function G splitted in two halfs
|
|
326
|
+
function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) {
|
|
327
|
+
const Xpos = 2 * BSIGMA[k];
|
|
328
|
+
const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore
|
|
329
|
+
let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore
|
|
330
|
+
let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore
|
|
331
|
+
let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore
|
|
332
|
+
let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore
|
|
333
|
+
// v[a] = (v[a] + v[b] + x) | 0;
|
|
334
|
+
let ll = u64.add3L(Al, Bl, Xl);
|
|
335
|
+
Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0;
|
|
336
|
+
Al = (ll | 0) >>> 0;
|
|
337
|
+
// v[d] = rotr(v[d] ^ v[a], 32)
|
|
338
|
+
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
|
|
339
|
+
({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) });
|
|
340
|
+
// v[c] = (v[c] + v[d]) | 0;
|
|
341
|
+
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
|
|
342
|
+
// v[b] = rotr(v[b] ^ v[c], 25)
|
|
343
|
+
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
|
|
344
|
+
({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) });
|
|
345
|
+
(BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah);
|
|
346
|
+
(BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh);
|
|
347
|
+
(BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch);
|
|
348
|
+
(BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) {
|
|
352
|
+
const Xpos = 2 * BSIGMA[k];
|
|
353
|
+
const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore
|
|
354
|
+
let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore
|
|
355
|
+
let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore
|
|
356
|
+
let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore
|
|
357
|
+
let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore
|
|
358
|
+
// v[a] = (v[a] + v[b] + x) | 0;
|
|
359
|
+
let ll = u64.add3L(Al, Bl, Xl);
|
|
360
|
+
Ah = u64.add3H(ll, Ah, Bh, Xh);
|
|
361
|
+
Al = ll | 0;
|
|
362
|
+
// v[d] = rotr(v[d] ^ v[a], 16)
|
|
363
|
+
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
|
|
364
|
+
({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) });
|
|
365
|
+
// v[c] = (v[c] + v[d]) | 0;
|
|
366
|
+
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
|
|
367
|
+
// v[b] = rotr(v[b] ^ v[c], 11)
|
|
368
|
+
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
|
|
369
|
+
({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) });
|
|
370
|
+
(BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah);
|
|
371
|
+
(BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh);
|
|
372
|
+
(BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch);
|
|
373
|
+
(BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
class Blake1_64 extends BLAKE1<Blake1_64> {
|
|
377
|
+
private v0l: number;
|
|
378
|
+
private v0h: number;
|
|
379
|
+
private v1l: number;
|
|
380
|
+
private v1h: number;
|
|
381
|
+
private v2l: number;
|
|
382
|
+
private v2h: number;
|
|
383
|
+
private v3l: number;
|
|
384
|
+
private v3h: number;
|
|
385
|
+
private v4l: number;
|
|
386
|
+
private v4h: number;
|
|
387
|
+
private v5l: number;
|
|
388
|
+
private v5h: number;
|
|
389
|
+
private v6l: number;
|
|
390
|
+
private v6h: number;
|
|
391
|
+
private v7l: number;
|
|
392
|
+
private v7h: number;
|
|
393
|
+
constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) {
|
|
394
|
+
super(128, outputLen, lengthFlag, 16, 8, B64C, opts);
|
|
395
|
+
this.v0l = IV[0] | 0;
|
|
396
|
+
this.v0h = IV[1] | 0;
|
|
397
|
+
this.v1l = IV[2] | 0;
|
|
398
|
+
this.v1h = IV[3] | 0;
|
|
399
|
+
this.v2l = IV[4] | 0;
|
|
400
|
+
this.v2h = IV[5] | 0;
|
|
401
|
+
this.v3l = IV[6] | 0;
|
|
402
|
+
this.v3h = IV[7] | 0;
|
|
403
|
+
this.v4l = IV[8] | 0;
|
|
404
|
+
this.v4h = IV[9] | 0;
|
|
405
|
+
this.v5l = IV[10] | 0;
|
|
406
|
+
this.v5h = IV[11] | 0;
|
|
407
|
+
this.v6l = IV[12] | 0;
|
|
408
|
+
this.v6h = IV[13] | 0;
|
|
409
|
+
this.v7l = IV[14] | 0;
|
|
410
|
+
this.v7h = IV[15] | 0;
|
|
411
|
+
}
|
|
412
|
+
// prettier-ignore
|
|
413
|
+
protected get(): [
|
|
414
|
+
number, number, number, number, number, number, number, number,
|
|
415
|
+
number, number, number, number, number, number, number, number
|
|
416
|
+
] {
|
|
417
|
+
let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
|
|
418
|
+
return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h];
|
|
419
|
+
}
|
|
420
|
+
// prettier-ignore
|
|
421
|
+
protected set(
|
|
422
|
+
v0l: number, v0h: number, v1l: number, v1h: number,
|
|
423
|
+
v2l: number, v2h: number, v3l: number, v3h: number,
|
|
424
|
+
v4l: number, v4h: number, v5l: number, v5h: number,
|
|
425
|
+
v6l: number, v6h: number, v7l: number, v7h: number
|
|
426
|
+
): void {
|
|
427
|
+
this.v0l = v0l | 0;
|
|
428
|
+
this.v0h = v0h | 0;
|
|
429
|
+
this.v1l = v1l | 0;
|
|
430
|
+
this.v1h = v1h | 0;
|
|
431
|
+
this.v2l = v2l | 0;
|
|
432
|
+
this.v2h = v2h | 0;
|
|
433
|
+
this.v3l = v3l | 0;
|
|
434
|
+
this.v3h = v3h | 0;
|
|
435
|
+
this.v4l = v4l | 0;
|
|
436
|
+
this.v4h = v4h | 0;
|
|
437
|
+
this.v5l = v5l | 0;
|
|
438
|
+
this.v5h = v5h | 0;
|
|
439
|
+
this.v6l = v6l | 0;
|
|
440
|
+
this.v6h = v6h | 0;
|
|
441
|
+
this.v7l = v7l | 0;
|
|
442
|
+
this.v7h = v7h | 0;
|
|
443
|
+
}
|
|
444
|
+
destroy(): void {
|
|
445
|
+
super.destroy();
|
|
446
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
447
|
+
}
|
|
448
|
+
compress(view: DataView, offset: number, withLength = true): void {
|
|
449
|
+
for (let i = 0; i < 32; i++, offset += 4) BLAKE512_W[i] = view.getUint32(offset, false);
|
|
450
|
+
|
|
451
|
+
this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state.
|
|
452
|
+
BBUF.set(this.constants.subarray(0, 16), 16);
|
|
453
|
+
if (withLength) {
|
|
454
|
+
const { h, l } = u64.fromBig(BigInt(this.length * 8));
|
|
455
|
+
BBUF[24] = (BBUF[24] ^ h) >>> 0;
|
|
456
|
+
BBUF[25] = (BBUF[25] ^ l) >>> 0;
|
|
457
|
+
BBUF[26] = (BBUF[26] ^ h) >>> 0;
|
|
458
|
+
BBUF[27] = (BBUF[27] ^ l) >>> 0;
|
|
459
|
+
}
|
|
460
|
+
for (let i = 0, k = 0; i < 16; i++) {
|
|
461
|
+
G1b(0, 4, 8, 12, BLAKE512_W, k++);
|
|
462
|
+
G2b(0, 4, 8, 12, BLAKE512_W, k++);
|
|
463
|
+
G1b(1, 5, 9, 13, BLAKE512_W, k++);
|
|
464
|
+
G2b(1, 5, 9, 13, BLAKE512_W, k++);
|
|
465
|
+
G1b(2, 6, 10, 14, BLAKE512_W, k++);
|
|
466
|
+
G2b(2, 6, 10, 14, BLAKE512_W, k++);
|
|
467
|
+
G1b(3, 7, 11, 15, BLAKE512_W, k++);
|
|
468
|
+
G2b(3, 7, 11, 15, BLAKE512_W, k++);
|
|
469
|
+
|
|
470
|
+
G1b(0, 5, 10, 15, BLAKE512_W, k++);
|
|
471
|
+
G2b(0, 5, 10, 15, BLAKE512_W, k++);
|
|
472
|
+
G1b(1, 6, 11, 12, BLAKE512_W, k++);
|
|
473
|
+
G2b(1, 6, 11, 12, BLAKE512_W, k++);
|
|
474
|
+
G1b(2, 7, 8, 13, BLAKE512_W, k++);
|
|
475
|
+
G2b(2, 7, 8, 13, BLAKE512_W, k++);
|
|
476
|
+
G1b(3, 4, 9, 14, BLAKE512_W, k++);
|
|
477
|
+
G2b(3, 4, 9, 14, BLAKE512_W, k++);
|
|
478
|
+
}
|
|
479
|
+
this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0];
|
|
480
|
+
this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1];
|
|
481
|
+
this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2];
|
|
482
|
+
this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3];
|
|
483
|
+
this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4];
|
|
484
|
+
this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5];
|
|
485
|
+
this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6];
|
|
486
|
+
this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7];
|
|
487
|
+
this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0];
|
|
488
|
+
this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1];
|
|
489
|
+
this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2];
|
|
490
|
+
this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3];
|
|
491
|
+
this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4];
|
|
492
|
+
this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5];
|
|
493
|
+
this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6];
|
|
494
|
+
this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7];
|
|
495
|
+
clean(BBUF, BLAKE512_W);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export class BLAKE224 extends Blake1_32 {
|
|
500
|
+
constructor(opts: BlakeOpts = {}) {
|
|
501
|
+
super(28, B224_IV, 0b0000_0000, opts);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
export class BLAKE256 extends Blake1_32 {
|
|
505
|
+
constructor(opts: BlakeOpts = {}) {
|
|
506
|
+
super(32, B256_IV, 0b0000_0001, opts);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
export class BLAKE384 extends Blake1_64 {
|
|
510
|
+
constructor(opts: BlakeOpts = {}) {
|
|
511
|
+
super(48, B384_IV, 0b0000_0000, opts);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
export class BLAKE512 extends Blake1_64 {
|
|
515
|
+
constructor(opts: BlakeOpts = {}) {
|
|
516
|
+
super(64, B512_IV, 0b0000_0001, opts);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
/** blake1-224 hash function */
|
|
520
|
+
export const blake224: CHashO = /* @__PURE__ */ createOptHasher<BLAKE224, BlakeOpts>(
|
|
521
|
+
(opts) => new BLAKE224(opts)
|
|
522
|
+
);
|
|
523
|
+
/** blake1-256 hash function */
|
|
524
|
+
export const blake256: CHashO = /* @__PURE__ */ createOptHasher<BLAKE256, BlakeOpts>(
|
|
525
|
+
(opts) => new BLAKE256(opts)
|
|
526
|
+
);
|
|
527
|
+
/** blake1-384 hash function */
|
|
528
|
+
export const blake384: CHashO = /* @__PURE__ */ createOptHasher<BLAKE512, BlakeOpts>(
|
|
529
|
+
(opts) => new BLAKE384(opts)
|
|
530
|
+
);
|
|
531
|
+
/** blake1-512 hash function */
|
|
532
|
+
export const blake512: CHashO = /* @__PURE__ */ createOptHasher<BLAKE512, BlakeOpts>(
|
|
533
|
+
(opts) => new BLAKE512(opts)
|
|
534
|
+
);
|