@blockcast/mmt-container 0.3.0 → 0.4.0-main.71d61b2a53f2
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 +33 -16
- package/dist/browser-runtime.js +14743 -14412
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +24 -19
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +29 -14
- package/dist/carp-catalog.js.map +4 -4
- package/dist/catalog-fec-params.d.ts +88 -28
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +60 -23
- package/dist/catalog-fec-params.js.map +4 -4
- package/dist/catalog-network-source.js +1 -7
- package/dist/catalog-network-source.js.map +4 -4
- package/dist/cmaf-block-assembler.d.ts +0 -2
- package/dist/cmaf-block-assembler.d.ts.map +1 -1
- package/dist/cmaf-block-assembler.js +0 -1
- package/dist/cmaf-block-assembler.js.map +2 -2
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js +0 -4
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.d.ts +124 -0
- package/dist/delivery-catalog.d.ts.map +1 -0
- package/dist/delivery-catalog.js +1857 -0
- package/dist/delivery-catalog.js.map +7 -0
- package/dist/delta-fallback-config.d.ts +42 -0
- package/dist/delta-fallback-config.d.ts.map +1 -0
- package/dist/delta-fallback-config.js +59 -0
- package/dist/delta-fallback-config.js.map +7 -0
- package/dist/fec-manager.d.ts +36 -30
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +303 -293
- package/dist/fec-manager.js.map +4 -4
- package/dist/fec-state.d.ts +19 -31
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +4 -10
- package/dist/fec-state.js.map +4 -4
- package/dist/fec-worker-setup.d.ts +18 -14
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +81 -96
- package/dist/fec-worker-setup.js.map +4 -4
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.js +1 -7
- package/dist/iso-block-locator.js.map +4 -4
- package/dist/media-router.d.ts +20 -8
- package/dist/media-router.d.ts.map +1 -1
- package/dist/media-router.js +46 -21
- package/dist/media-router.js.map +2 -2
- package/dist/mfu-reassembler.js +24 -30
- package/dist/mfu-reassembler.js.map +4 -4
- package/dist/mmtp-container-parser.d.ts +6 -11
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +56 -97
- package/dist/mmtp-container-parser.js.map +4 -4
- package/dist/mmtp-container-parser.no-modules.js +78 -105
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +56 -97
- package/dist/mmtp-decode-pipeline.js.map +4 -4
- package/dist/mmtp-router.d.ts +37 -26
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +162 -313
- package/dist/mmtp-router.js.map +4 -4
- package/dist/multicast-input.js +1 -7
- package/dist/multicast-input.js.map +4 -4
- package/dist/multicast-manager.d.ts +34 -6
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +709 -658
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +1 -1
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +44 -26
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +29 -35
- package/dist/multicast-unwrap.js.map +4 -4
- package/dist/no-modules.js +77 -104
- package/dist/no-modules.js.map +4 -4
- package/dist/repair-fetch.d.ts +30 -19
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +33 -24
- package/dist/repair-fetch.js.map +4 -4
- package/dist/repair-layers.d.ts +18 -7
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +12 -10
- package/dist/repair-layers.js.map +4 -4
- package/dist/signaling.js +2 -11
- package/dist/signaling.js.map +4 -4
- package/dist/timestamp-codec.js +24 -30
- package/dist/timestamp-codec.js.map +4 -4
- package/dist/track-session.d.ts +7 -0
- package/dist/track-session.d.ts.map +1 -1
- package/dist/track-session.js +15 -8
- package/dist/track-session.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js +1 -7
- package/dist/wasm-mfu-reassembler.js.map +4 -4
- package/dist/wasm-mmtp-container-parser.js +56 -97
- package/dist/wasm-mmtp-container-parser.js.map +4 -4
- package/package.json +7 -14
- package/schemas/catalog.schema.json +3 -3
- package/src/carp-catalog.ts +46 -24
- package/src/catalog-fec-params.ts +173 -64
- package/src/cmaf-block-assembler.ts +1 -4
- package/src/cmcd-producer.ts +0 -6
- package/src/delivery-catalog.ts +498 -0
- package/src/delta-fallback-config.ts +72 -0
- package/src/fec-manager.ts +414 -334
- package/src/fec-state.ts +20 -32
- package/src/fec-worker-setup.ts +109 -90
- package/src/index.ts +32 -0
- package/src/media-router.ts +59 -21
- package/src/mmtp-container-parser.ts +27 -18
- package/src/mmtp-router.ts +146 -313
- package/src/multicast-manager.ts +184 -83
- package/src/multicast-transport.ts +16 -9
- package/src/repair-fetch.ts +46 -27
- package/src/repair-layers.ts +28 -8
- package/src/track-session.ts +28 -9
- package/test-vectors/catalog/README.md +37 -17
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +52 -0
- package/test-vectors/catalog/negative/fec-enhancement-repair-removed.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-layer-geometry.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-layer-missing-symbols.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-multiple-depends.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-overlay-with-layer.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-priority-out-of-band.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-source-symbols-without-scope.json +1 -1
- package/test-vectors/catalog/negative/multicast-endpoint-relay-address.json +39 -0
- package/test-vectors/catalog/negative/multicast-network-source-empty.json +1 -1
- package/test-vectors/catalog/negative/raptorq-source-symbols-over-max.json +1 -1
- package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +1 -1
- package/test-vectors/catalog/positive/fec-layered-repair.json +2 -2
- package/test-vectors/catalog/positive/fec-multicast.json +2 -1
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +38 -0
- package/test-vectors/catalog/positive/multicast-native-ssm-no-network-source.json +2 -1
- package/test-vectors/catalog-timing.json +356 -0
- package/test-vectors/catalog-validation.json +40 -5
- package/test-vectors/delivery-catalog/README.md +11 -0
- package/test-vectors/delivery-catalog/negative/missing-block-profile.json +58 -0
- package/test-vectors/delivery-catalog/negative/packet-id-signaling.json +59 -0
- package/test-vectors/delivery-catalog/negative/retired-k-padded-block-profile.json +59 -0
- package/test-vectors/delivery-catalog/positive/dash.json +56 -0
- package/test-vectors/delivery-catalog/positive/mmtp-source-only.json +43 -0
- package/node_modules/@blockcast/fec-worker/README.md +0 -223
- package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts +0 -38
- package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/block-order.js +0 -78
- package/node_modules/@blockcast/fec-worker/dist/block-order.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +0 -93
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +0 -346
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +0 -380
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +0 -11
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +0 -14
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +0 -859
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +0 -7
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts +0 -10
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/index.js +0 -8
- package/node_modules/@blockcast/fec-worker/dist/index.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +0 -20
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +0 -370
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +0 -7
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +0 -104
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +0 -181
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +0 -194
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +0 -62
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +0 -9
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/transfer.js +0 -13
- package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/package.json +0 -59
- package/node_modules/@blockcast/fec-worker/src/block-order.ts +0 -93
- package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +0 -392
- package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +0 -399
- package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +0 -1502
- package/node_modules/@blockcast/fec-worker/src/index.ts +0 -35
- package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +0 -589
- package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +0 -222
- package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +0 -209
- package/node_modules/@blockcast/fec-worker/src/transfer.ts +0 -12
- package/node_modules/@blockcast/mmt-alta-parse/README.md +0 -181
- package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +0 -57
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +0 -115
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-alta-parse/package.json +0 -50
- package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +0 -136
- package/node_modules/@blockcast/mmt-base/README.md +0 -134
- package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +0 -55
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +0 -128
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts +0 -7
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/index.js +0 -7
- package/node_modules/@blockcast/mmt-base/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +0 -292
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js +0 -612
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +0 -18
- package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/net-constants.js +0 -18
- package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +0 -47
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +0 -54
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -57
- package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -98
- package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +0 -312
- package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/signalling.js +0 -637
- package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/package.json +0 -49
- package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +0 -145
- package/node_modules/@blockcast/mmt-base/src/index.ts +0 -6
- package/node_modules/@blockcast/mmt-base/src/mmtp.ts +0 -892
- package/node_modules/@blockcast/mmt-base/src/net-constants.ts +0 -17
- package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +0 -67
- package/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -107
- package/node_modules/@blockcast/mmt-base/src/signalling.ts +0 -862
- package/node_modules/@blockcast/mmt-fec/README.md +0 -271
- package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +0 -82
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +0 -296
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +0 -106
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +0 -288
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +0 -46
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +0 -96
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +0 -33
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +0 -57
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +0 -205
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +0 -240
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +0 -28
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/index.js +0 -28
- package/node_modules/@blockcast/mmt-fec/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +0 -20
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +0 -28
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +0 -258
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/oti.js +0 -382
- package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +0 -41
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +0 -81
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts +0 -82
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.js +0 -170
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +0 -181
- 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 +0 -57
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +0 -115
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +0 -50
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +0 -136
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +0 -134
- 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/fec-block-profile.d.ts +0 -55
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +0 -128
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +0 -7
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +0 -7
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +0 -292
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +0 -612
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +0 -18
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js +0 -18
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +0 -47
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js +0 -54
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -57
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -98
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +0 -312
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js +0 -637
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +0 -49
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +0 -145
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +0 -6
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +0 -892
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/net-constants.ts +0 -17
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/ntp-short.ts +0 -67
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -107
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/signalling.ts +0 -862
- package/node_modules/@blockcast/mmt-fec/package.json +0 -79
- package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +0 -371
- package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +0 -439
- package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +0 -127
- package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +0 -68
- package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +0 -310
- package/node_modules/@blockcast/mmt-fec/src/index.ts +0 -94
- package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +0 -34
- package/node_modules/@blockcast/mmt-fec/src/oti.ts +0 -463
- package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +0 -101
- package/node_modules/@blockcast/mmt-fec/src/repair-group.ts +0 -195
- package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +0 -28
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +0 -128
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +0 -4
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +0 -4
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +0 -37
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +0 -179
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +0 -99
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +0 -492
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/package.json +0 -45
- package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +0 -171
- package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +0 -3
- package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +0 -230
- package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +0 -669
- package/node_modules/@noble/hashes/LICENSE +0 -21
- package/node_modules/@noble/hashes/README.md +0 -521
- package/node_modules/@noble/hashes/_assert.d.ts +0 -17
- package/node_modules/@noble/hashes/_assert.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_assert.js +0 -18
- package/node_modules/@noble/hashes/_assert.js.map +0 -1
- package/node_modules/@noble/hashes/_blake.d.ts +0 -14
- package/node_modules/@noble/hashes/_blake.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_blake.js +0 -50
- package/node_modules/@noble/hashes/_blake.js.map +0 -1
- package/node_modules/@noble/hashes/_md.d.ts +0 -51
- package/node_modules/@noble/hashes/_md.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_md.js +0 -162
- package/node_modules/@noble/hashes/_md.js.map +0 -1
- package/node_modules/@noble/hashes/_u64.d.ts +0 -55
- package/node_modules/@noble/hashes/_u64.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_u64.js +0 -90
- package/node_modules/@noble/hashes/_u64.js.map +0 -1
- package/node_modules/@noble/hashes/argon2.d.ts +0 -32
- package/node_modules/@noble/hashes/argon2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/argon2.js +0 -401
- package/node_modules/@noble/hashes/argon2.js.map +0 -1
- package/node_modules/@noble/hashes/blake1.d.ts +0 -106
- package/node_modules/@noble/hashes/blake1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake1.js +0 -459
- package/node_modules/@noble/hashes/blake1.js.map +0 -1
- package/node_modules/@noble/hashes/blake2.d.ts +0 -116
- package/node_modules/@noble/hashes/blake2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake2.js +0 -420
- package/node_modules/@noble/hashes/blake2.js.map +0 -1
- package/node_modules/@noble/hashes/blake2b.d.ts +0 -11
- package/node_modules/@noble/hashes/blake2b.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake2b.js +0 -14
- package/node_modules/@noble/hashes/blake2b.js.map +0 -1
- package/node_modules/@noble/hashes/blake2s.d.ts +0 -20
- package/node_modules/@noble/hashes/blake2s.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake2s.js +0 -24
- package/node_modules/@noble/hashes/blake2s.js.map +0 -1
- package/node_modules/@noble/hashes/blake3.d.ts +0 -54
- package/node_modules/@noble/hashes/blake3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake3.js +0 -255
- package/node_modules/@noble/hashes/blake3.js.map +0 -1
- package/node_modules/@noble/hashes/crypto.d.ts +0 -2
- package/node_modules/@noble/hashes/crypto.d.ts.map +0 -1
- package/node_modules/@noble/hashes/crypto.js +0 -5
- package/node_modules/@noble/hashes/crypto.js.map +0 -1
- package/node_modules/@noble/hashes/cryptoNode.d.ts +0 -2
- package/node_modules/@noble/hashes/cryptoNode.d.ts.map +0 -1
- package/node_modules/@noble/hashes/cryptoNode.js +0 -18
- package/node_modules/@noble/hashes/cryptoNode.js.map +0 -1
- package/node_modules/@noble/hashes/eskdf.d.ts +0 -47
- package/node_modules/@noble/hashes/eskdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/eskdf.js +0 -166
- package/node_modules/@noble/hashes/eskdf.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_assert.d.ts +0 -17
- package/node_modules/@noble/hashes/esm/_assert.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_assert.js +0 -15
- package/node_modules/@noble/hashes/esm/_assert.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_blake.d.ts +0 -14
- package/node_modules/@noble/hashes/esm/_blake.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_blake.js +0 -45
- package/node_modules/@noble/hashes/esm/_blake.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_md.d.ts +0 -51
- package/node_modules/@noble/hashes/esm/_md.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_md.js +0 -155
- package/node_modules/@noble/hashes/esm/_md.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_u64.d.ts +0 -55
- package/node_modules/@noble/hashes/esm/_u64.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_u64.js +0 -67
- package/node_modules/@noble/hashes/esm/_u64.js.map +0 -1
- package/node_modules/@noble/hashes/esm/argon2.d.ts +0 -32
- package/node_modules/@noble/hashes/esm/argon2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/argon2.js +0 -392
- package/node_modules/@noble/hashes/esm/argon2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake1.d.ts +0 -106
- package/node_modules/@noble/hashes/esm/blake1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake1.js +0 -452
- package/node_modules/@noble/hashes/esm/blake1.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2.d.ts +0 -116
- package/node_modules/@noble/hashes/esm/blake2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2.js +0 -413
- package/node_modules/@noble/hashes/esm/blake2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2b.d.ts +0 -11
- package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2b.js +0 -11
- package/node_modules/@noble/hashes/esm/blake2b.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2s.d.ts +0 -20
- package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2s.js +0 -21
- package/node_modules/@noble/hashes/esm/blake2s.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake3.d.ts +0 -54
- package/node_modules/@noble/hashes/esm/blake3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake3.js +0 -251
- package/node_modules/@noble/hashes/esm/blake3.js.map +0 -1
- package/node_modules/@noble/hashes/esm/crypto.d.ts +0 -2
- package/node_modules/@noble/hashes/esm/crypto.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/crypto.js +0 -2
- package/node_modules/@noble/hashes/esm/crypto.js.map +0 -1
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +0 -2
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/cryptoNode.js +0 -15
- package/node_modules/@noble/hashes/esm/cryptoNode.js.map +0 -1
- package/node_modules/@noble/hashes/esm/eskdf.d.ts +0 -47
- package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/eskdf.js +0 -160
- package/node_modules/@noble/hashes/esm/eskdf.js.map +0 -1
- package/node_modules/@noble/hashes/esm/hkdf.d.ts +0 -36
- package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/hkdf.js +0 -82
- package/node_modules/@noble/hashes/esm/hkdf.js.map +0 -1
- package/node_modules/@noble/hashes/esm/hmac.d.ts +0 -35
- package/node_modules/@noble/hashes/esm/hmac.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/hmac.js +0 -86
- package/node_modules/@noble/hashes/esm/hmac.js.map +0 -1
- package/node_modules/@noble/hashes/esm/index.d.ts +0 -2
- package/node_modules/@noble/hashes/esm/index.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/index.js +0 -33
- package/node_modules/@noble/hashes/esm/index.js.map +0 -1
- package/node_modules/@noble/hashes/esm/legacy.d.ts +0 -71
- package/node_modules/@noble/hashes/esm/legacy.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/legacy.js +0 -281
- package/node_modules/@noble/hashes/esm/legacy.js.map +0 -1
- package/node_modules/@noble/hashes/esm/package.json +0 -10
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +0 -23
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/pbkdf2.js +0 -97
- package/node_modules/@noble/hashes/esm/pbkdf2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts +0 -13
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/ripemd160.js +0 -13
- package/node_modules/@noble/hashes/esm/ripemd160.js.map +0 -1
- package/node_modules/@noble/hashes/esm/scrypt.d.ts +0 -34
- package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/scrypt.js +0 -228
- package/node_modules/@noble/hashes/esm/scrypt.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha1.d.ts +0 -11
- package/node_modules/@noble/hashes/esm/sha1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha1.js +0 -11
- package/node_modules/@noble/hashes/esm/sha1.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha2.d.ts +0 -159
- package/node_modules/@noble/hashes/esm/sha2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha2.js +0 -375
- package/node_modules/@noble/hashes/esm/sha2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha256.d.ts +0 -20
- package/node_modules/@noble/hashes/esm/sha256.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha256.js +0 -20
- package/node_modules/@noble/hashes/esm/sha256.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +0 -142
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3-addons.js +0 -393
- package/node_modules/@noble/hashes/esm/sha3-addons.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3.d.ts +0 -53
- package/node_modules/@noble/hashes/esm/sha3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3.js +0 -234
- package/node_modules/@noble/hashes/esm/sha3.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha512.d.ts +0 -26
- package/node_modules/@noble/hashes/esm/sha512.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha512.js +0 -26
- package/node_modules/@noble/hashes/esm/sha512.js.map +0 -1
- package/node_modules/@noble/hashes/esm/utils.d.ts +0 -161
- package/node_modules/@noble/hashes/esm/utils.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/utils.js +0 -281
- package/node_modules/@noble/hashes/esm/utils.js.map +0 -1
- package/node_modules/@noble/hashes/hkdf.d.ts +0 -36
- package/node_modules/@noble/hashes/hkdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/hkdf.js +0 -88
- package/node_modules/@noble/hashes/hkdf.js.map +0 -1
- package/node_modules/@noble/hashes/hmac.d.ts +0 -35
- package/node_modules/@noble/hashes/hmac.d.ts.map +0 -1
- package/node_modules/@noble/hashes/hmac.js +0 -91
- package/node_modules/@noble/hashes/hmac.js.map +0 -1
- package/node_modules/@noble/hashes/index.d.ts +0 -1
- package/node_modules/@noble/hashes/index.d.ts.map +0 -1
- package/node_modules/@noble/hashes/index.js +0 -33
- package/node_modules/@noble/hashes/index.js.map +0 -1
- package/node_modules/@noble/hashes/legacy.d.ts +0 -71
- package/node_modules/@noble/hashes/legacy.d.ts.map +0 -1
- package/node_modules/@noble/hashes/legacy.js +0 -287
- package/node_modules/@noble/hashes/legacy.js.map +0 -1
- package/node_modules/@noble/hashes/package.json +0 -266
- package/node_modules/@noble/hashes/pbkdf2.d.ts +0 -23
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/pbkdf2.js +0 -101
- package/node_modules/@noble/hashes/pbkdf2.js.map +0 -1
- package/node_modules/@noble/hashes/ripemd160.d.ts +0 -13
- package/node_modules/@noble/hashes/ripemd160.d.ts.map +0 -1
- package/node_modules/@noble/hashes/ripemd160.js +0 -16
- package/node_modules/@noble/hashes/ripemd160.js.map +0 -1
- package/node_modules/@noble/hashes/scrypt.d.ts +0 -34
- package/node_modules/@noble/hashes/scrypt.d.ts.map +0 -1
- package/node_modules/@noble/hashes/scrypt.js +0 -232
- package/node_modules/@noble/hashes/scrypt.js.map +0 -1
- package/node_modules/@noble/hashes/sha1.d.ts +0 -11
- package/node_modules/@noble/hashes/sha1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha1.js +0 -14
- package/node_modules/@noble/hashes/sha1.js.map +0 -1
- package/node_modules/@noble/hashes/sha2.d.ts +0 -159
- package/node_modules/@noble/hashes/sha2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha2.js +0 -384
- package/node_modules/@noble/hashes/sha2.js.map +0 -1
- package/node_modules/@noble/hashes/sha256.d.ts +0 -20
- package/node_modules/@noble/hashes/sha256.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha256.js +0 -23
- package/node_modules/@noble/hashes/sha256.js.map +0 -1
- package/node_modules/@noble/hashes/sha3-addons.d.ts +0 -142
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha3-addons.js +0 -402
- package/node_modules/@noble/hashes/sha3-addons.js.map +0 -1
- package/node_modules/@noble/hashes/sha3.d.ts +0 -53
- package/node_modules/@noble/hashes/sha3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha3.js +0 -239
- package/node_modules/@noble/hashes/sha3.js.map +0 -1
- package/node_modules/@noble/hashes/sha512.d.ts +0 -26
- package/node_modules/@noble/hashes/sha512.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha512.js +0 -29
- package/node_modules/@noble/hashes/sha512.js.map +0 -1
- package/node_modules/@noble/hashes/src/_assert.ts +0 -22
- package/node_modules/@noble/hashes/src/_blake.ts +0 -50
- package/node_modules/@noble/hashes/src/_md.ts +0 -176
- package/node_modules/@noble/hashes/src/_u64.ts +0 -91
- package/node_modules/@noble/hashes/src/argon2.ts +0 -497
- package/node_modules/@noble/hashes/src/blake1.ts +0 -534
- package/node_modules/@noble/hashes/src/blake2.ts +0 -486
- package/node_modules/@noble/hashes/src/blake2b.ts +0 -10
- package/node_modules/@noble/hashes/src/blake2s.ts +0 -20
- package/node_modules/@noble/hashes/src/blake3.ts +0 -272
- package/node_modules/@noble/hashes/src/crypto.ts +0 -9
- package/node_modules/@noble/hashes/src/cryptoNode.ts +0 -15
- package/node_modules/@noble/hashes/src/eskdf.ts +0 -187
- package/node_modules/@noble/hashes/src/hkdf.ts +0 -88
- package/node_modules/@noble/hashes/src/hmac.ts +0 -94
- package/node_modules/@noble/hashes/src/index.ts +0 -31
- package/node_modules/@noble/hashes/src/legacy.ts +0 -293
- package/node_modules/@noble/hashes/src/pbkdf2.ts +0 -122
- package/node_modules/@noble/hashes/src/ripemd160.ts +0 -12
- package/node_modules/@noble/hashes/src/scrypt.ts +0 -257
- package/node_modules/@noble/hashes/src/sha1.ts +0 -10
- package/node_modules/@noble/hashes/src/sha2.ts +0 -402
- package/node_modules/@noble/hashes/src/sha256.ts +0 -24
- package/node_modules/@noble/hashes/src/sha3-addons.ts +0 -499
- package/node_modules/@noble/hashes/src/sha3.ts +0 -258
- package/node_modules/@noble/hashes/src/sha512.ts +0 -34
- package/node_modules/@noble/hashes/src/utils.ts +0 -395
- package/node_modules/@noble/hashes/utils.d.ts +0 -161
- package/node_modules/@noble/hashes/utils.d.ts.map +0 -1
- package/node_modules/@noble/hashes/utils.js +0 -313
- package/node_modules/@noble/hashes/utils.js.map +0 -1
|
@@ -1,534 +0,0 @@
|
|
|
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
|
-
);
|