From 5b0d7d3af9c72cff460f6d55ea1fb8890a7a77ea Mon Sep 17 00:00:00 2001 From: achingbrain Date: Sat, 25 Nov 2023 10:07:36 +0000 Subject: [PATCH] chore: use streaming hashes where possible --- .../crypto/dist/index.min.js | 45 ++ .../crypto/dist/src/aes/cipher-mode.d.ts | 2 + .../crypto/dist/src/aes/cipher-mode.d.ts.map | 1 + .../crypto/dist/src/aes/cipher-mode.js | 13 + .../crypto/dist/src/aes/cipher-mode.js.map | 1 + .../crypto/dist/src/aes/ciphers-browser.d.ts | 7 + .../dist/src/aes/ciphers-browser.d.ts.map | 1 + .../crypto/dist/src/aes/ciphers-browser.js | 26 + .../dist/src/aes/ciphers-browser.js.map | 1 + .../crypto/dist/src/aes/ciphers.d.ts | 5 + .../crypto/dist/src/aes/ciphers.d.ts.map | 1 + .../crypto/dist/src/aes/ciphers.js | 4 + .../crypto/dist/src/aes/ciphers.js.map | 1 + .../crypto/dist/src/aes/index.d.ts | 50 ++ .../crypto/dist/src/aes/index.d.ts.map | 1 + .../crypto/dist/src/aes/index.js | 61 ++ .../crypto/dist/src/aes/index.js.map | 1 + .../dist/src/ciphers/aes-gcm.browser.d.ts | 10 + .../dist/src/ciphers/aes-gcm.browser.d.ts.map | 1 + .../dist/src/ciphers/aes-gcm.browser.js | 99 +++ .../dist/src/ciphers/aes-gcm.browser.js.map | 1 + .../crypto/dist/src/ciphers/aes-gcm.d.ts | 3 + .../crypto/dist/src/ciphers/aes-gcm.d.ts.map | 1 + .../crypto/dist/src/ciphers/aes-gcm.js | 83 +++ .../crypto/dist/src/ciphers/aes-gcm.js.map | 1 + .../crypto/dist/src/ciphers/interface.d.ts | 14 + .../dist/src/ciphers/interface.d.ts.map | 1 + .../crypto/dist/src/ciphers/interface.js | 2 + .../crypto/dist/src/ciphers/interface.js.map | 1 + .../crypto/dist/src/hmac/index-browser.d.ts | 5 + .../dist/src/hmac/index-browser.d.ts.map | 1 + .../crypto/dist/src/hmac/index-browser.js | 25 + .../crypto/dist/src/hmac/index-browser.js.map | 1 + .../crypto/dist/src/hmac/index.d.ts | 22 + .../crypto/dist/src/hmac/index.d.ts.map | 1 + .../crypto/dist/src/hmac/index.js | 30 + .../crypto/dist/src/hmac/index.js.map | 1 + .../crypto/dist/src/hmac/lengths.d.ts | 7 + .../crypto/dist/src/hmac/lengths.d.ts.map | 1 + .../crypto/dist/src/hmac/lengths.js | 6 + .../crypto/dist/src/hmac/lengths.js.map | 1 + .../crypto/dist/src/index.d.ts | 20 + .../crypto/dist/src/index.d.ts.map | 1 + .../crypto/dist/src/index.js | 20 + .../crypto/dist/src/index.js.map | 1 + .../crypto/dist/src/keys/ecdh-browser.d.ts | 3 + .../dist/src/keys/ecdh-browser.d.ts.map | 1 + .../crypto/dist/src/keys/ecdh-browser.js | 96 +++ .../crypto/dist/src/keys/ecdh-browser.js.map | 1 + .../crypto/dist/src/keys/ecdh.d.ts | 8 + .../crypto/dist/src/keys/ecdh.d.ts.map | 1 + .../crypto/dist/src/keys/ecdh.js | 31 + .../crypto/dist/src/keys/ecdh.js.map | 1 + .../crypto/dist/src/keys/ed25519-browser.d.ts | 14 + .../dist/src/keys/ed25519-browser.d.ts.map | 1 + .../crypto/dist/src/keys/ed25519-browser.js | 52 ++ .../dist/src/keys/ed25519-browser.js.map | 1 + .../crypto/dist/src/keys/ed25519-class.d.ts | 41 ++ .../dist/src/keys/ed25519-class.d.ts.map | 1 + .../crypto/dist/src/keys/ed25519-class.js | 122 ++++ .../crypto/dist/src/keys/ed25519-class.js.map | 1 + .../crypto/dist/src/keys/ed25519.d.ts | 15 + .../crypto/dist/src/keys/ed25519.d.ts.map | 1 + .../crypto/dist/src/keys/ed25519.js | 120 ++++ .../crypto/dist/src/keys/ed25519.js.map | 1 + .../crypto/dist/src/keys/ephemeral-keys.d.ts | 9 + .../dist/src/keys/ephemeral-keys.d.ts.map | 1 + .../crypto/dist/src/keys/ephemeral-keys.js | 9 + .../dist/src/keys/ephemeral-keys.js.map | 1 + .../crypto/dist/src/keys/exporter.d.ts | 8 + .../crypto/dist/src/keys/exporter.d.ts.map | 1 + .../crypto/dist/src/keys/exporter.js | 13 + .../crypto/dist/src/keys/exporter.js.map | 1 + .../crypto/dist/src/keys/importer.d.ts | 7 + .../crypto/dist/src/keys/importer.d.ts.map | 1 + .../crypto/dist/src/keys/importer.js | 13 + .../crypto/dist/src/keys/importer.js.map | 1 + .../crypto/dist/src/keys/index.d.ts | 69 ++ .../crypto/dist/src/keys/index.d.ts.map | 1 + .../crypto/dist/src/keys/index.js | 136 ++++ .../crypto/dist/src/keys/index.js.map | 1 + .../crypto/dist/src/keys/interface.d.ts | 36 + .../crypto/dist/src/keys/interface.d.ts.map | 1 + .../crypto/dist/src/keys/interface.js | 2 + .../crypto/dist/src/keys/interface.js.map | 1 + .../crypto/dist/src/keys/jwk2pem.d.ts | 8 + .../crypto/dist/src/keys/jwk2pem.d.ts.map | 1 + .../crypto/dist/src/keys/jwk2pem.js | 14 + .../crypto/dist/src/keys/jwk2pem.js.map | 1 + .../crypto/dist/src/keys/key-stretcher.d.ts | 7 + .../dist/src/keys/key-stretcher.d.ts.map | 1 + .../crypto/dist/src/keys/key-stretcher.js | 65 ++ .../crypto/dist/src/keys/key-stretcher.js.map | 1 + .../crypto/dist/src/keys/keys.d.ts | 29 + .../crypto/dist/src/keys/keys.d.ts.map | 1 + .../crypto/dist/src/keys/keys.js | 122 ++++ .../crypto/dist/src/keys/keys.js.map | 1 + .../crypto/dist/src/keys/rsa-browser.d.ts | 14 + .../crypto/dist/src/keys/rsa-browser.d.ts.map | 1 + .../crypto/dist/src/keys/rsa-browser.js | 109 +++ .../crypto/dist/src/keys/rsa-browser.js.map | 1 + .../crypto/dist/src/keys/rsa-class.d.ts | 44 ++ .../crypto/dist/src/keys/rsa-class.d.ts.map | 1 + .../crypto/dist/src/keys/rsa-class.js | 142 ++++ .../crypto/dist/src/keys/rsa-class.js.map | 1 + .../crypto/dist/src/keys/rsa-utils.d.ts | 7 + .../crypto/dist/src/keys/rsa-utils.d.ts.map | 1 + .../crypto/dist/src/keys/rsa-utils.js | 65 ++ .../crypto/dist/src/keys/rsa-utils.js.map | 1 + .../crypto/dist/src/keys/rsa.d.ts | 14 + .../crypto/dist/src/keys/rsa.d.ts.map | 1 + .../crypto/dist/src/keys/rsa.js | 94 +++ .../crypto/dist/src/keys/rsa.js.map | 1 + .../dist/src/keys/secp256k1-browser.d.ts | 18 + .../dist/src/keys/secp256k1-browser.d.ts.map | 1 + .../crypto/dist/src/keys/secp256k1-browser.js | 66 ++ .../dist/src/keys/secp256k1-browser.js.map | 1 + .../crypto/dist/src/keys/secp256k1-class.d.ts | 38 + .../dist/src/keys/secp256k1-class.d.ts.map | 1 + .../crypto/dist/src/keys/secp256k1-class.js | 98 +++ .../dist/src/keys/secp256k1-class.js.map | 1 + .../crypto/dist/src/keys/secp256k1.d.ts | 18 + .../crypto/dist/src/keys/secp256k1.d.ts.map | 1 + .../crypto/dist/src/keys/secp256k1.js | 84 +++ .../crypto/dist/src/keys/secp256k1.js.map | 1 + .../crypto/dist/src/pbkdf2.d.ts | 5 + .../crypto/dist/src/pbkdf2.d.ts.map | 1 + .../crypto/dist/src/pbkdf2.js | 30 + .../crypto/dist/src/pbkdf2.js.map | 1 + .../crypto/dist/src/random-bytes.d.ts | 5 + .../crypto/dist/src/random-bytes.d.ts.map | 1 + .../crypto/dist/src/random-bytes.js | 12 + .../crypto/dist/src/random-bytes.js.map | 1 + .../crypto/dist/src/util.d.ts | 9 + .../crypto/dist/src/util.d.ts.map | 1 + .../crypto/dist/src/util.js | 37 + .../crypto/dist/src/util.js.map | 1 + .../crypto/dist/src/webcrypto.d.ts | 5 + .../crypto/dist/src/webcrypto.d.ts.map | 1 + .../crypto/dist/src/webcrypto.js | 17 + .../crypto/dist/src/webcrypto.js.map | 1 + .../crypto/dist/test/aes/aes.spec.d.ts | 2 + .../crypto/dist/test/aes/aes.spec.d.ts.map | 1 + .../crypto/dist/test/aes/aes.spec.js | 87 +++ .../crypto/dist/test/aes/aes.spec.js.map | 1 + .../crypto/dist/test/crypto.spec.d.ts | 2 + .../crypto/dist/test/crypto.spec.d.ts.map | 1 + .../crypto/dist/test/crypto.spec.js | 130 ++++ .../crypto/dist/test/crypto.spec.js.map | 1 + .../crypto/dist/test/fixtures/aes.d.ts | 12 + .../crypto/dist/test/fixtures/aes.d.ts.map | 1 + .../crypto/dist/test/fixtures/aes.js | 36 + .../crypto/dist/test/fixtures/aes.js.map | 1 + .../crypto/dist/test/fixtures/go-aes.d.ts | 8 + .../crypto/dist/test/fixtures/go-aes.d.ts.map | 1 + .../crypto/dist/test/fixtures/go-aes.js | 19 + .../crypto/dist/test/fixtures/go-aes.js.map | 1 + .../dist/test/fixtures/go-elliptic-key.d.ts | 9 + .../test/fixtures/go-elliptic-key.d.ts.map | 1 + .../dist/test/fixtures/go-elliptic-key.js | 12 + .../dist/test/fixtures/go-elliptic-key.js.map | 1 + .../dist/test/fixtures/go-key-ed25519.d.ts | 16 + .../test/fixtures/go-key-ed25519.d.ts.map | 1 + .../dist/test/fixtures/go-key-ed25519.js | 38 + .../dist/test/fixtures/go-key-ed25519.js.map | 1 + .../crypto/dist/test/fixtures/go-key-rsa.d.ts | 17 + .../dist/test/fixtures/go-key-rsa.d.ts.map | 1 + .../crypto/dist/test/fixtures/go-key-rsa.js | 30 + .../dist/test/fixtures/go-key-rsa.js.map | 1 + .../dist/test/fixtures/go-key-secp256k1.d.ts | 8 + .../test/fixtures/go-key-secp256k1.d.ts.map | 1 + .../dist/test/fixtures/go-key-secp256k1.js | 28 + .../test/fixtures/go-key-secp256k1.js.map | 1 + .../dist/test/fixtures/go-stretch-key.d.ts | 17 + .../test/fixtures/go-stretch-key.d.ts.map | 1 + .../dist/test/fixtures/go-stretch-key.js | 30 + .../dist/test/fixtures/go-stretch-key.js.map | 1 + .../crypto/dist/test/fixtures/rsa.d.ts | 6 + .../crypto/dist/test/fixtures/rsa.d.ts.map | 1 + .../crypto/dist/test/fixtures/rsa.js | 22 + .../crypto/dist/test/fixtures/rsa.js.map | 1 + .../crypto/dist/test/fixtures/secp256k1.d.ts | 6 + .../dist/test/fixtures/secp256k1.d.ts.map | 1 + .../crypto/dist/test/fixtures/secp256k1.js | 8 + .../dist/test/fixtures/secp256k1.js.map | 1 + .../helpers/test-garbage-error-handling.d.ts | 2 + .../test-garbage-error-handling.d.ts.map | 1 + .../helpers/test-garbage-error-handling.js | 27 + .../test-garbage-error-handling.js.map | 1 + .../crypto/dist/test/hmac/hmac.spec.d.ts | 2 + .../crypto/dist/test/hmac/hmac.spec.d.ts.map | 1 + .../crypto/dist/test/hmac/hmac.spec.js | 16 + .../crypto/dist/test/hmac/hmac.spec.js.map | 1 + .../crypto/dist/test/keys/ed25519.spec.d.ts | 2 + .../dist/test/keys/ed25519.spec.d.ts.map | 1 + .../crypto/dist/test/keys/ed25519.spec.js | 189 +++++ .../crypto/dist/test/keys/ed25519.spec.js.map | 1 + .../dist/test/keys/ephemeral-keys.spec.d.ts | 2 + .../test/keys/ephemeral-keys.spec.d.ts.map | 1 + .../dist/test/keys/ephemeral-keys.spec.js | 52 ++ .../dist/test/keys/ephemeral-keys.spec.js.map | 1 + .../crypto/dist/test/keys/importer.spec.d.ts | 2 + .../dist/test/keys/importer.spec.d.ts.map | 1 + .../crypto/dist/test/keys/importer.spec.js | 19 + .../dist/test/keys/importer.spec.js.map | 1 + .../dist/test/keys/key-stretcher.spec.d.ts | 2 + .../test/keys/key-stretcher.spec.d.ts.map | 1 + .../dist/test/keys/key-stretcher.spec.js | 51 ++ .../dist/test/keys/key-stretcher.spec.js.map | 1 + .../crypto/dist/test/keys/rsa.spec.d.ts | 2 + .../crypto/dist/test/keys/rsa.spec.d.ts.map | 1 + .../crypto/dist/test/keys/rsa.spec.js | 395 +++++++++++ .../crypto/dist/test/keys/rsa.spec.js.map | 1 + .../crypto/dist/test/keys/secp256k1.spec.d.ts | 2 + .../dist/test/keys/secp256k1.spec.d.ts.map | 1 + .../crypto/dist/test/keys/secp256k1.spec.js | 183 +++++ .../dist/test/keys/secp256k1.spec.js.map | 1 + .../crypto/dist/test/random-bytes.spec.d.ts | 2 + .../dist/test/random-bytes.spec.d.ts.map | 1 + .../crypto/dist/test/random-bytes.spec.js | 19 + .../crypto/dist/test/random-bytes.spec.js.map | 1 + .../crypto/dist/test/util.spec.d.ts | 2 + .../crypto/dist/test/util.spec.d.ts.map | 1 + .../crypto/dist/test/util.spec.js | 29 + .../crypto/dist/test/util.spec.js.map | 1 + .../crypto/dist/test/workaround.spec.d.ts | 2 + .../crypto/dist/test/workaround.spec.d.ts.map | 1 + .../crypto/dist/test/workaround.spec.js | 17 + .../crypto/dist/test/workaround.spec.js.map | 1 + .../crypto/dist/tsconfig.tsbuildinfo | 1 + .../crypto/package.json | 107 +++ .../crypto/src/aes/cipher-mode.ts | 15 + .../crypto/src/aes/ciphers-browser.ts | 31 + .../crypto/src/aes/ciphers.ts | 4 + .../crypto/src/aes/index.ts | 70 ++ .../crypto/src/ciphers/aes-gcm.browser.ts | 109 +++ .../crypto/src/ciphers/aes-gcm.ts | 102 +++ .../crypto/src/ciphers/interface.ts | 14 + .../crypto/src/hmac/index-browser.ts | 35 + .../crypto/src/hmac/index.ts | 37 + .../crypto/src/hmac/lengths.ts | 5 + .../crypto/src/index.ts | 21 + .../crypto/src/keys/ecdh-browser.ts | 137 ++++ .../crypto/src/keys/ecdh.ts | 38 + .../crypto/src/keys/ed25519-browser.ts | 65 ++ .../crypto/src/keys/ed25519-class.ts | 147 ++++ .../crypto/src/keys/ed25519.ts | 138 ++++ .../crypto/src/keys/ephemeral-keys.ts | 9 + .../crypto/src/keys/exporter.ts | 14 + .../crypto/src/keys/importer.ts | 13 + .../crypto/src/keys/index.ts | 155 ++++ .../crypto/src/keys/interface.ts | 34 + .../crypto/src/keys/jwk2pem.ts | 21 + .../crypto/src/keys/key-stretcher.ts | 78 +++ .../crypto/src/keys/keys.proto | 33 + .../crypto/src/keys/keys.ts | 156 +++++ .../crypto/src/keys/rsa-browser.ts | 168 +++++ .../crypto/src/keys/rsa-class.ts | 179 +++++ .../crypto/src/keys/rsa-utils.ts | 74 ++ .../crypto/src/keys/rsa.ts | 106 +++ .../crypto/src/keys/secp256k1-browser.ts | 71 ++ .../crypto/src/keys/secp256k1-class.ts | 120 ++++ .../crypto/src/keys/secp256k1.ts | 93 +++ .../crypto/src/pbkdf2.ts | 39 ++ .../crypto/src/random-bytes.ts | 12 + .../crypto/src/util.ts | 42 ++ .../crypto/src/webcrypto.ts | 24 + .../interface/dist/index.min.js | 3 + .../dist/src/connection-encrypter/index.d.ts | 29 + .../src/connection-encrypter/index.d.ts.map | 1 + .../dist/src/connection-encrypter/index.js | 2 + .../src/connection-encrypter/index.js.map | 1 + .../dist/src/connection-gater/index.d.ts | 117 ++++ .../dist/src/connection-gater/index.d.ts.map | 1 + .../dist/src/connection-gater/index.js | 2 + .../dist/src/connection-gater/index.js.map | 1 + .../interface/dist/src/connection/index.d.ts | 291 ++++++++ .../dist/src/connection/index.d.ts.map | 1 + .../interface/dist/src/connection/index.js | 5 + .../dist/src/connection/index.js.map | 1 + .../dist/src/content-routing/index.d.ts | 79 +++ .../dist/src/content-routing/index.d.ts.map | 1 + .../dist/src/content-routing/index.js | 21 + .../dist/src/content-routing/index.js.map | 1 + .../interface/dist/src/errors.d.ts | 37 + .../interface/dist/src/errors.d.ts.map | 1 + .../interface/dist/src/errors.js | 56 ++ .../interface/dist/src/errors.js.map | 1 + .../interface/dist/src/events.browser.d.ts | 3 + .../dist/src/events.browser.d.ts.map | 1 + .../interface/dist/src/events.browser.js | 3 + .../interface/dist/src/events.browser.js.map | 1 + .../interface/dist/src/events.d.ts | 43 ++ .../interface/dist/src/events.d.ts.map | 1 + .../interface/dist/src/events.js | 78 +++ .../interface/dist/src/events.js.map | 1 + .../interface/dist/src/index.d.ts | 604 ++++++++++++++++ .../interface/dist/src/index.d.ts.map | 1 + .../interface/dist/src/index.js | 17 + .../interface/dist/src/index.js.map | 1 + .../interface/dist/src/keys/index.d.ts | 36 + .../interface/dist/src/keys/index.d.ts.map | 1 + .../interface/dist/src/keys/index.js | 4 + .../interface/dist/src/keys/index.js.map | 1 + .../interface/dist/src/metrics/index.d.ts | 165 +++++ .../interface/dist/src/metrics/index.d.ts.map | 1 + .../interface/dist/src/metrics/index.js | 2 + .../interface/dist/src/metrics/index.js.map | 1 + .../dist/src/metrics/tracked-map.d.ts | 17 + .../dist/src/metrics/tracked-map.d.ts.map | 1 + .../interface/dist/src/metrics/tracked-map.js | 38 + .../dist/src/metrics/tracked-map.js.map | 1 + .../dist/src/peer-discovery/index.d.ts | 28 + .../dist/src/peer-discovery/index.d.ts.map | 1 + .../dist/src/peer-discovery/index.js | 21 + .../dist/src/peer-discovery/index.js.map | 1 + .../interface/dist/src/peer-id/index.d.ts | 30 + .../interface/dist/src/peer-id/index.d.ts.map | 1 + .../interface/dist/src/peer-id/index.js | 5 + .../interface/dist/src/peer-id/index.js.map | 1 + .../interface/dist/src/peer-info/index.d.ts | 19 + .../dist/src/peer-info/index.d.ts.map | 1 + .../interface/dist/src/peer-info/index.js | 2 + .../interface/dist/src/peer-info/index.js.map | 1 + .../dist/src/peer-routing/index.d.ts | 51 ++ .../dist/src/peer-routing/index.d.ts.map | 1 + .../interface/dist/src/peer-routing/index.js | 21 + .../dist/src/peer-routing/index.js.map | 1 + .../interface/dist/src/peer-store/index.d.ts | 247 +++++++ .../dist/src/peer-store/index.d.ts.map | 1 + .../interface/dist/src/peer-store/index.js | 2 + .../dist/src/peer-store/index.js.map | 1 + .../interface/dist/src/peer-store/tags.d.ts | 2 + .../dist/src/peer-store/tags.d.ts.map | 1 + .../interface/dist/src/peer-store/tags.js | 2 + .../interface/dist/src/peer-store/tags.js.map | 1 + .../interface/dist/src/pubsub/index.d.ts | 236 +++++++ .../interface/dist/src/pubsub/index.d.ts.map | 1 + .../interface/dist/src/pubsub/index.js | 36 + .../interface/dist/src/pubsub/index.js.map | 1 + .../interface/dist/src/record/index.d.ts | 33 + .../interface/dist/src/record/index.d.ts.map | 1 + .../interface/dist/src/record/index.js | 2 + .../interface/dist/src/record/index.js.map | 1 + .../interface/dist/src/startable.d.ts | 45 ++ .../interface/dist/src/startable.d.ts.map | 1 + .../interface/dist/src/startable.js | 46 ++ .../interface/dist/src/startable.js.map | 1 + .../dist/src/stream-handler/index.d.ts | 28 + .../dist/src/stream-handler/index.d.ts.map | 1 + .../dist/src/stream-handler/index.js | 2 + .../dist/src/stream-handler/index.js.map | 1 + .../dist/src/stream-muxer/index.d.ts | 55 ++ .../dist/src/stream-muxer/index.d.ts.map | 1 + .../interface/dist/src/stream-muxer/index.js | 2 + .../dist/src/stream-muxer/index.js.map | 1 + .../dist/src/stream-muxer/stream.d.ts | 3 + .../dist/src/stream-muxer/stream.d.ts.map | 1 + .../interface/dist/src/stream-muxer/stream.js | 9 + .../dist/src/stream-muxer/stream.js.map | 1 + .../interface/dist/src/topology/index.d.ts | 20 + .../dist/src/topology/index.d.ts.map | 1 + .../interface/dist/src/topology/index.js | 2 + .../interface/dist/src/topology/index.js.map | 1 + .../interface/dist/src/transport/index.d.ts | 101 +++ .../dist/src/transport/index.d.ts.map | 1 + .../interface/dist/src/transport/index.js | 19 + .../interface/dist/src/transport/index.js.map | 1 + .../interface/dist/test/fixtures/logger.d.ts | 9 + .../dist/test/fixtures/logger.d.ts.map | 1 + .../interface/dist/test/fixtures/logger.js | 8 + .../dist/test/fixtures/logger.js.map | 1 + .../dist/test/metrics/tracked-map.spec.d.ts | 2 + .../test/metrics/tracked-map.spec.d.ts.map | 1 + .../dist/test/metrics/tracked-map.spec.js | 68 ++ .../dist/test/metrics/tracked-map.spec.js.map | 1 + .../interface/dist/tsconfig.tsbuildinfo | 1 + .../interface/package.json | 170 +++++ .../src/connection-encrypter/index.ts | 32 + .../interface/src/connection-gater/index.ts | 128 ++++ .../interface/src/connection/index.ts | 347 +++++++++ .../interface/src/content-routing/index.ts | 83 +++ .../interface/src/errors.ts | 74 ++ .../interface/src/events.browser.ts | 2 + .../interface/src/events.ts | 130 ++++ .../interface/src/index.ts | 662 ++++++++++++++++++ .../interface/src/keys/index.ts | 39 ++ .../interface/src/metrics/index.ts | 187 +++++ .../interface/src/metrics/tracked-map.ts | 65 ++ .../interface/src/peer-discovery/index.ts | 29 + .../interface/src/peer-id/index.ts | 39 ++ .../interface/src/peer-info/index.ts | 20 + .../interface/src/peer-routing/index.ts | 53 ++ .../interface/src/peer-store/index.ts | 272 +++++++ .../interface/src/peer-store/tags.ts | 1 + .../interface/src/pubsub/index.ts | 269 +++++++ .../interface/src/record/index.ts | 35 + .../interface/src/startable.ts | 114 +++ .../interface/src/stream-handler/index.ts | 33 + .../interface/src/stream-muxer/index.ts | 63 ++ .../interface/src/stream-muxer/stream.ts | 11 + .../interface/src/topology/index.ts | 22 + .../interface/src/transport/index.ts | 117 ++++ .../libp2p/package.json | 48 +- .../noise/dist/index.min.js | 10 +- .../dist/src/@types/handshake-interface.d.ts | 8 +- .../src/@types/handshake-interface.d.ts.map | 2 +- .../noise/dist/src/@types/handshake.d.ts | 7 +- .../noise/dist/src/@types/handshake.d.ts.map | 2 +- .../noise/dist/src/crypto.d.ts | 11 +- .../noise/dist/src/crypto.d.ts.map | 2 +- .../noise/dist/src/crypto.js | 2 +- .../noise/dist/src/crypto.js.map | 2 +- .../noise/dist/src/crypto/index.d.ts.map | 2 +- .../noise/dist/src/crypto/index.js | 92 ++- .../noise/dist/src/crypto/index.js.map | 2 +- .../noise/dist/src/crypto/js.d.ts.map | 2 +- .../noise/dist/src/crypto/js.js | 8 +- .../noise/dist/src/crypto/js.js.map | 2 +- .../noise/dist/src/crypto/streaming.d.ts | 2 +- .../noise/dist/src/crypto/streaming.d.ts.map | 2 +- .../noise/dist/src/crypto/streaming.js | 8 +- .../noise/dist/src/crypto/streaming.js.map | 2 +- .../noise/dist/src/handshake-xx.d.ts | 9 +- .../noise/dist/src/handshake-xx.d.ts.map | 2 +- .../noise/dist/src/handshake-xx.js.map | 2 +- .../src/handshakes/abstract-handshake.d.ts | 21 +- .../handshakes/abstract-handshake.d.ts.map | 2 +- .../dist/src/handshakes/abstract-handshake.js | 4 +- .../src/handshakes/abstract-handshake.js.map | 2 +- .../noise/dist/src/handshakes/xx.d.ts.map | 2 +- .../noise/dist/src/handshakes/xx.js.map | 2 +- .../noise/dist/src/logger.d.ts | 5 +- .../noise/dist/src/logger.d.ts.map | 2 +- .../noise/dist/src/logger.js | 19 +- .../noise/dist/src/logger.js.map | 2 +- .../noise/dist/src/utils.d.ts | 11 +- .../noise/dist/src/utils.d.ts.map | 2 +- .../noise/dist/src/utils.js | 13 +- .../noise/dist/src/utils.js.map | 2 +- .../noise/dist/test/handshakes/xx.spec.js | 8 +- .../noise/dist/test/handshakes/xx.spec.js.map | 2 +- .../noise/dist/test/noise.spec.js | 4 +- .../noise/dist/test/noise.spec.js.map | 2 +- .../noise/dist/test/xx-handshake.spec.js | 2 +- .../noise/dist/test/xx-handshake.spec.js.map | 2 +- .../noise/dist/tsconfig.tsbuildinfo | 2 +- .../noise/package.json | 30 +- .../noise/src/@types/handshake-interface.ts | 6 +- .../noise/src/@types/handshake.ts | 7 +- .../noise/src/crypto.ts | 11 +- .../noise/src/crypto/index.ts | 114 ++- .../noise/src/crypto/js.ts | 19 +- .../noise/src/crypto/streaming.ts | 12 +- .../noise/src/handshake-xx.ts | 7 +- .../src/handshakes/abstract-handshake.ts | 27 +- .../noise/src/handshakes/xx.ts | 5 +- .../noise/src/logger.ts | 29 +- .../noise/src/utils.ts | 24 +- .../package-lock.json | 257 +++---- .../package.json | 2 +- .../tcp/package.json | 14 +- .../utils/dist/index.min.js | 3 + .../utils/dist/src/abstract-stream.d.ts | 145 ++++ .../utils/dist/src/abstract-stream.d.ts.map | 1 + .../utils/dist/src/abstract-stream.js | 340 +++++++++ .../utils/dist/src/abstract-stream.js.map | 1 + .../utils/dist/src/address-sort.d.ts | 39 ++ .../utils/dist/src/address-sort.d.ts.map | 1 + .../utils/dist/src/address-sort.js | 79 +++ .../utils/dist/src/address-sort.js.map | 1 + .../utils/dist/src/array-equals.d.ts | 24 + .../utils/dist/src/array-equals.d.ts.map | 1 + .../utils/dist/src/array-equals.js | 31 + .../utils/dist/src/array-equals.js.map | 1 + .../utils/dist/src/close-source.d.ts | 4 + .../utils/dist/src/close-source.d.ts.map | 1 + .../utils/dist/src/close-source.js | 11 + .../utils/dist/src/close-source.js.map | 1 + .../utils/dist/src/index.d.ts | 22 + .../utils/dist/src/index.d.ts.map | 1 + .../utils/dist/src/index.js | 22 + .../utils/dist/src/index.js.map | 1 + .../utils/dist/src/ip-port-to-multiaddr.d.ts | 11 + .../dist/src/ip-port-to-multiaddr.d.ts.map | 1 + .../utils/dist/src/ip-port-to-multiaddr.js | 30 + .../dist/src/ip-port-to-multiaddr.js.map | 1 + .../utils/dist/src/is-promise.d.ts | 2 + .../utils/dist/src/is-promise.d.ts.map | 1 + .../utils/dist/src/is-promise.js | 9 + .../utils/dist/src/is-promise.js.map | 1 + .../utils/dist/src/multiaddr/is-loopback.d.ts | 6 + .../dist/src/multiaddr/is-loopback.d.ts.map | 1 + .../utils/dist/src/multiaddr/is-loopback.js | 9 + .../dist/src/multiaddr/is-loopback.js.map | 1 + .../utils/dist/src/multiaddr/is-private.d.ts | 6 + .../dist/src/multiaddr/is-private.d.ts.map | 1 + .../utils/dist/src/multiaddr/is-private.js | 14 + .../dist/src/multiaddr/is-private.js.map | 1 + .../utils/dist/src/peer-job-queue.d.ts | 33 + .../utils/dist/src/peer-job-queue.d.ts.map | 1 + .../utils/dist/src/peer-job-queue.js | 81 +++ .../utils/dist/src/peer-job-queue.js.map | 1 + .../utils/dist/src/stream-to-ma-conn.d.ts | 15 + .../utils/dist/src/stream-to-ma-conn.d.ts.map | 1 + .../utils/dist/src/stream-to-ma-conn.js | 77 ++ .../utils/dist/src/stream-to-ma-conn.js.map | 1 + .../utils/dist/test/abstract-stream.spec.d.ts | 2 + .../dist/test/abstract-stream.spec.d.ts.map | 1 + .../utils/dist/test/abstract-stream.spec.js | 147 ++++ .../dist/test/abstract-stream.spec.js.map | 1 + .../utils/dist/test/address-sort.spec.d.ts | 2 + .../dist/test/address-sort.spec.d.ts.map | 1 + .../utils/dist/test/address-sort.spec.js | 162 +++++ .../utils/dist/test/address-sort.spec.js.map | 1 + .../utils/dist/test/array-equals.spec.d.ts | 2 + .../dist/test/array-equals.spec.d.ts.map | 1 + .../utils/dist/test/array-equals.spec.js | 58 ++ .../utils/dist/test/array-equals.spec.js.map | 1 + .../utils/dist/test/close-source.spec.d.ts | 2 + .../dist/test/close-source.spec.d.ts.map | 1 + .../utils/dist/test/close-source.spec.js | 22 + .../utils/dist/test/close-source.spec.js.map | 1 + .../dist/test/ip-port-to-multiaddr.spec.d.ts | 2 + .../test/ip-port-to-multiaddr.spec.d.ts.map | 1 + .../dist/test/ip-port-to-multiaddr.spec.js | 40 ++ .../test/ip-port-to-multiaddr.spec.js.map | 1 + .../utils/dist/test/is-promise.spec.d.ts | 2 + .../utils/dist/test/is-promise.spec.d.ts.map | 1 + .../utils/dist/test/is-promise.spec.js | 28 + .../utils/dist/test/is-promise.spec.js.map | 1 + .../dist/test/multiaddr/is-loopback.spec.d.ts | 2 + .../test/multiaddr/is-loopback.spec.d.ts.map | 1 + .../dist/test/multiaddr/is-loopback.spec.js | 50 ++ .../test/multiaddr/is-loopback.spec.js.map | 1 + .../dist/test/multiaddr/is-private.spec.d.ts | 2 + .../test/multiaddr/is-private.spec.d.ts.map | 1 + .../dist/test/multiaddr/is-private.spec.js | 60 ++ .../test/multiaddr/is-private.spec.js.map | 1 + .../utils/dist/test/peer-job-queue.spec.d.ts | 2 + .../dist/test/peer-job-queue.spec.d.ts.map | 1 + .../utils/dist/test/peer-job-queue.spec.js | 31 + .../dist/test/peer-job-queue.spec.js.map | 1 + .../dist/test/stream-to-ma-conn.spec.d.ts | 2 + .../dist/test/stream-to-ma-conn.spec.d.ts.map | 1 + .../utils/dist/test/stream-to-ma-conn.spec.js | 68 ++ .../dist/test/stream-to-ma-conn.spec.js.map | 1 + .../utils/dist/tsconfig.tsbuildinfo | 1 + .../utils/package.json | 118 ++++ .../utils/src/abstract-stream.ts | 509 ++++++++++++++ .../utils/src/address-sort.ts | 91 +++ .../utils/src/array-equals.ts | 34 + .../utils/src/close-source.ts | 14 + .../utils/src/index.ts | 22 + .../utils/src/ip-port-to-multiaddr.ts | 36 + .../utils/src/is-promise.ts | 9 + .../utils/src/multiaddr/is-loopback.ts | 11 + .../utils/src/multiaddr/is-private.ts | 15 + .../utils/src/peer-job-queue.ts | 118 ++++ .../utils/src/stream-to-ma-conn.ts | 91 +++ .../yamux/package.json | 12 +- 561 files changed, 15900 insertions(+), 418 deletions(-) create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/index.min.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/tsconfig.tsbuildinfo create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/package.json create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/cipher-mode.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers-browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/interface.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index-browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/lengths.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh-browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-class.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ephemeral-keys.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/exporter.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/importer.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/interface.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/jwk2pem.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/key-stretcher.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.proto create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-class.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-utils.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-class.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/pbkdf2.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/random-bytes.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/util.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/webcrypto.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/index.min.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/tsconfig.tsbuildinfo create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/package.json create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-encrypter/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-gater/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/content-routing/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/errors.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.browser.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/keys/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/tracked-map.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-discovery/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-id/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-info/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-routing/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/tags.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/pubsub/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/record/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/startable.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-handler/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/stream.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/topology/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/transport/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/index.min.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.d.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.d.ts.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js.map create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/tsconfig.tsbuildinfo create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/package.json create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/abstract-stream.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/address-sort.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/array-equals.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/close-source.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/index.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/ip-port-to-multiaddr.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/is-promise.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-loopback.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-private.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/peer-job-queue.ts create mode 100644 perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/stream-to-ma-conn.ts diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/index.min.js new file mode 100644 index 000000000..a4b49c25b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/index.min.js @@ -0,0 +1,45 @@ +(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PCrypto = factory()}(typeof self !== 'undefined' ? self : this, function () { +"use strict";var Libp2PCrypto=(()=>{var j0=Object.create;var Wr=Object.defineProperty;var tf=Object.getOwnPropertyDescriptor;var ef=Object.getOwnPropertyNames;var rf=Object.getPrototypeOf,nf=Object.prototype.hasOwnProperty;var ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gt=(t,e)=>{for(var r in e)Wr(t,r,{get:e[r],enumerable:!0})},Ka=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ef(e))!nf.call(t,i)&&i!==r&&Wr(t,i,{get:()=>e[i],enumerable:!(n=tf(e,i))||n.enumerable});return t};var Nt=(t,e,r)=>(r=t!=null?j0(rf(t)):{},Ka(e||!t||!t.__esModule?Wr(r,"default",{value:t,enumerable:!0}):r,t)),af=t=>Ka(Wr({},"__esModule",{value:!0}),t);var it=ft((Vd,Va)=>{Va.exports={options:{usePureJavaScript:!1}}});var Ha=ft((qd,Fa)=>{var Fn={};Fa.exports=Fn;var qa={};Fn.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=sf(t,e);else{var i=0,a=e.length,o=e.charAt(0),s=[0];for(i=0;i0;)s.push(c%a),c=c/a|0}for(i=0;t[i]===0&&i=0;--i)n+=e[s[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r +`)}return n};Fn.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=qa[e];if(!r){r=qa[e]=[];for(var n=0;n>=8;for(;c>0;)o.push(c&255),c>>=8}for(var u=0;t[u]===a&&u0;)a.push(s%n),s=s/n|0}var f="";for(r=0;t.at(r)===0&&r=0;--r)f+=e[a[r]];return f}});var bt=ft((Fd,Ya)=>{var za=it(),Ga=Ha(),g=Ya.exports=za.util=za.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){g.nextTick=process.nextTick,typeof setImmediate=="function"?g.setImmediate=setImmediate:g.setImmediate=g.nextTick;return}if(typeof setImmediate=="function"){g.setImmediate=function(){return setImmediate.apply(void 0,arguments)},g.nextTick=function(s){return setImmediate(s)};return}if(g.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(f){if(f.source===window&&f.data===t){f.stopPropagation();var c=e.slice();e.length=0,c.forEach(function(u){u()})}};var o=s,t="forge.setImmediate",e=[];g.setImmediate=function(f){e.push(f),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var f=e.slice();e.length=0,f.forEach(function(c){c()})}).observe(i,{attributes:!0});var a=g.setImmediate;g.setImmediate=function(f){Date.now()-r>15?(r=Date.now(),a(f)):(e.push(f),e.length===1&&i.setAttribute("a",n=!n))}}g.nextTick=g.setImmediate})();g.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;g.globalScope=function(){return g.isNodejs?globalThis:typeof self>"u"?window:self}();g.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};g.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};g.isArrayBufferView=function(t){return t&&g.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function Er(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}g.ByteBuffer=Hn;function Hn(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(g.isArrayBuffer(t)||g.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rof&&(this.data.substr(0,1),this._constructedStringLength=0)};g.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};g.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};g.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};g.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};g.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};g.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(g.encodeUtf8(t))};g.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};g.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};g.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};g.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};g.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};g.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};g.ByteStringBuffer.prototype.putInt=function(t,e){Er(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};g.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};g.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};g.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};g.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};g.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};g.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};g.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};g.ByteStringBuffer.prototype.copy=function(){var t=g.createBuffer(this.data);return t.read=this.read,t};g.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};g.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};g.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};g.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};g.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};g.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};g.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};g.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};g.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};g.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};g.DataBuffer.prototype.putInt=function(t,e){Er(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};g.DataBuffer.prototype.putSignedInt=function(t,e){return Er(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};g.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};g.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};g.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};g.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};g.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};g.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};g.DataBuffer.prototype.copy=function(){return new g.DataBuffer(this)};g.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};g.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};g.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};g.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};g.xorBytes=function(t,e,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a,n};g.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var Se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ae=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Wa="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";g.encode64=function(t,e){for(var r="",n="",i,a,o,s=0;s>2),r+=Se.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Se.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":Se.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};g.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,a,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),a!==64&&(e+=String.fromCharCode((i&3)<<6|a)));return e};g.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};g.decodeUtf8=function(t){return decodeURIComponent(escape(t))};g.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Ga.encode,decode:Ga.decode}};g.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};g.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a>2),r+=Se.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Se.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":Se.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};g.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,o,s,f=0,c=r;f>4,o!==64&&(n[c++]=(a&15)<<4|o>>2,s!==64&&(n[c++]=(o&3)<<6|s));return e?c-r:n.subarray(0,c)};g.binary.base58.encode=function(t,e){return g.binary.baseN.encode(t,Wa,e)};g.binary.base58.decode=function(t,e){return g.binary.baseN.decode(t,Wa,e)};g.text={utf8:{},utf16:{}};g.text.utf8.encode=function(t,e,r){t=g.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a"u"&&(r=["web","flash"]);var i,a=!1,o=null;for(var s in r){i=r[s];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),a=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),a=!0)}catch(f){o=f}if(a)break}if(!a)throw o;return n};g.setItem=function(t,e,r,n,i){Yr(cf,arguments,i)};g.getItem=function(t,e,r,n){return Yr(uf,arguments,n)};g.removeItem=function(t,e,r,n){Yr(hf,arguments,n)};g.clearItems=function(t,e,r){Yr(lf,arguments,r)};g.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};g.format=function(t){for(var e=/%./g,r,n,i=0,a=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&a.push(n),o=e.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(t.substring(o)),a.join("")};g.formatNumber=function(t,e,r,n){var i=t,a=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,s=n===void 0?".":n,f=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",u=c.length>3?c.length%3:0;return f+(u?c.substr(0,u)+s:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")};g.formatSize=function(t){return t>=1073741824?t=g.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=g.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=g.formatNumber(t/1024,0)+" KiB":t=g.formatNumber(t,0)+" bytes",t};g.bytesFromIP=function(t){return t.indexOf(".")!==-1?g.bytesFromIPv4(t):t.indexOf(":")!==-1?g.bytesFromIPv6(t):null};g.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=g.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(a)}if(r.length>0){var f=r[n];f.end-f.start>0&&(e.splice(f.start,f.end-f.start+1,""),f.start===0&&e.unshift(""),f.end===7&&e.push(""))}return e.join(":")};g.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in g&&!t.update)return e(null,g.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return g.cores=navigator.hardwareConcurrency,e(null,g.cores);if(typeof Worker>"u")return g.cores=1,e(null,g.cores);if(typeof Blob>"u")return g.cores=2,e(null,g.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var s=Date.now(),f=s+4;Date.now()x.st&&u.stu.st&&x.st{var Ct=it();bt();Za.exports=Ct.cipher=Ct.cipher||{};Ct.cipher.algorithms=Ct.cipher.algorithms||{};Ct.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Ct.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Ct.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Ct.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Ct.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Ct.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Ct.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Ct.cipher.algorithms[t]=e};Ct.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Ct.cipher.algorithms?Ct.cipher.algorithms[t]:null};var Wn=Ct.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Wn.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Ct.util.createBuffer(),this.output=t.output||Ct.util.createBuffer(),this.mode.start(e)};Wn.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Wn.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var $n=ft((zd,$a)=>{var It=it();bt();It.cipher=It.cipher||{};var $=$a.exports=It.cipher.modes=It.cipher.modes||{};$.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};$.ecb.prototype.start=function(t){};$.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};$.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};$.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=Zr(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};$.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};$.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=It.util.createBuffer(),this._partialBytes=0};$.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Zr(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};$.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};$.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};$.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=It.util.createBuffer(),this._partialBytes=0};$.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Zr(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};$.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};$.ofb.prototype.decrypt=$.ofb.prototype.encrypt;$.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=It.util.createBuffer(),this._partialBytes=0};$.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Zr(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};$.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}$r(this._inBlock)};$.ctr.prototype.decrypt=$.ctr.prototype.encrypt;$.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=It.util.createBuffer(),this._partialBytes=0,this._R=3774873600};$.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=It.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=It.util.createBuffer(t.additionalData):r=It.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=It.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Zn(n*8)))}this._inBlock=this._j0.slice(0),$r(this._inBlock),this._partialBytes=0,r=It.util.createBuffer(r),this._aDataLength=Zn(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};$.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),$r(this._inBlock)};$.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),$r(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};$.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,a=this._m[r][i];e[0]^=a[0],e[1]^=a[1],e[2]^=a[2],e[3]^=a[3]}return e};$.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};$.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,a=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a4){var r=t;t=It.util.createBuffer();for(var n=0;n{var ot=it();Yn();$n();bt();ja.exports=ot.aes=ot.aes||{};ot.aes.startEncrypting=function(t,e,r,n){var i=Qr({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};ot.aes.createEncryptionCipher=function(t,e){return Qr({key:t,output:null,decrypt:!1,mode:e})};ot.aes.startDecrypting=function(t,e,r,n){var i=Qr({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};ot.aes.createDecryptionCipher=function(t,e){return Qr({key:t,output:null,decrypt:!0,mode:e})};ot.aes.Algorithm=function(t,e){Jn||Xa();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return Xn(r._w,n,i,!1)},decrypt:function(n,i){return Xn(r._w,n,i,!0)}}}),r._init=!1};ot.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=ot.util.createBuffer(e);else if(ot.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=ot.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^s&255^99,Pt[r]=s,Qn[s]=r,f=t[s],i=t[r],a=t[i],o=t[a],c=f<<24^s<<16^s<<8^(s^f),u=(i^a^o)<<24^(r^o)<<16^(r^a^o)<<8^(r^i^o);for(var h=0;h<4;++h)Ke[h][r]=c,Wt[h][s]=u,c=c<<24|c>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function Ja(t,e){for(var r=t.slice(0),n,i=1,a=r.length,o=a+6+1,s=Je*o,f=a;f>>16&255]<<24^Pt[n>>>8&255]<<16^Pt[n&255]<<8^Pt[n>>>24]^Qa[i]<<24,i++):a>6&&f%a===4&&(n=Pt[n>>>24]<<24^Pt[n>>>16&255]<<16^Pt[n>>>8&255]<<8^Pt[n&255]),r[f]=r[f-a]^n;if(e){var c,u=Wt[0],h=Wt[1],d=Wt[2],x=Wt[3],l=r.slice(0);s=r.length;for(var f=0,p=s-Je;f>>24]]^h[Pt[c>>>16&255]]^d[Pt[c>>>8&255]]^x[Pt[c&255]];r=l}return r}function Xn(t,e,r,n){var i=t.length/4-1,a,o,s,f,c;n?(a=Wt[0],o=Wt[1],s=Wt[2],f=Wt[3],c=Qn):(a=Ke[0],o=Ke[1],s=Ke[2],f=Ke[3],c=Pt);var u,h,d,x,l,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],d=e[2]^t[2],x=e[n?1:3]^t[3];for(var m=3,E=1;E>>24]^o[h>>>16&255]^s[d>>>8&255]^f[x&255]^t[++m],p=a[h>>>24]^o[d>>>16&255]^s[x>>>8&255]^f[u&255]^t[++m],y=a[d>>>24]^o[x>>>16&255]^s[u>>>8&255]^f[h&255]^t[++m],x=a[x>>>24]^o[u>>>16&255]^s[h>>>8&255]^f[d&255]^t[++m],u=l,h=p,d=y;r[0]=c[u>>>24]<<24^c[h>>>16&255]<<16^c[d>>>8&255]<<8^c[x&255]^t[++m],r[n?3:1]=c[h>>>24]<<24^c[d>>>16&255]<<16^c[x>>>8&255]<<8^c[u&255]^t[++m],r[2]=c[d>>>24]<<24^c[x>>>16&255]<<16^c[u>>>8&255]<<8^c[h&255]^t[++m],r[n?1:3]=c[x>>>24]<<24^c[u>>>16&255]<<16^c[h>>>8&255]<<8^c[d&255]^t[++m]}function Qr(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=ot.cipher.createDecipher(r,t.key):n=ot.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof ot.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var rn=ft((Wp,Ss)=>{var Tr=it();Tr.pki=Tr.pki||{};var Si=Ss.exports=Tr.pki.oids=Tr.oids=Tr.oids||{};function T(t,e){Si[t]=e,Si[e]=t}function rt(t,e){Si[t]=e}T("1.2.840.113549.1.1.1","rsaEncryption");T("1.2.840.113549.1.1.4","md5WithRSAEncryption");T("1.2.840.113549.1.1.5","sha1WithRSAEncryption");T("1.2.840.113549.1.1.7","RSAES-OAEP");T("1.2.840.113549.1.1.8","mgf1");T("1.2.840.113549.1.1.9","pSpecified");T("1.2.840.113549.1.1.10","RSASSA-PSS");T("1.2.840.113549.1.1.11","sha256WithRSAEncryption");T("1.2.840.113549.1.1.12","sha384WithRSAEncryption");T("1.2.840.113549.1.1.13","sha512WithRSAEncryption");T("1.3.101.112","EdDSA25519");T("1.2.840.10040.4.3","dsa-with-sha1");T("1.3.14.3.2.7","desCBC");T("1.3.14.3.2.26","sha1");T("1.3.14.3.2.29","sha1WithRSASignature");T("2.16.840.1.101.3.4.2.1","sha256");T("2.16.840.1.101.3.4.2.2","sha384");T("2.16.840.1.101.3.4.2.3","sha512");T("2.16.840.1.101.3.4.2.4","sha224");T("2.16.840.1.101.3.4.2.5","sha512-224");T("2.16.840.1.101.3.4.2.6","sha512-256");T("1.2.840.113549.2.2","md2");T("1.2.840.113549.2.5","md5");T("1.2.840.113549.1.7.1","data");T("1.2.840.113549.1.7.2","signedData");T("1.2.840.113549.1.7.3","envelopedData");T("1.2.840.113549.1.7.4","signedAndEnvelopedData");T("1.2.840.113549.1.7.5","digestedData");T("1.2.840.113549.1.7.6","encryptedData");T("1.2.840.113549.1.9.1","emailAddress");T("1.2.840.113549.1.9.2","unstructuredName");T("1.2.840.113549.1.9.3","contentType");T("1.2.840.113549.1.9.4","messageDigest");T("1.2.840.113549.1.9.5","signingTime");T("1.2.840.113549.1.9.6","counterSignature");T("1.2.840.113549.1.9.7","challengePassword");T("1.2.840.113549.1.9.8","unstructuredAddress");T("1.2.840.113549.1.9.14","extensionRequest");T("1.2.840.113549.1.9.20","friendlyName");T("1.2.840.113549.1.9.21","localKeyId");T("1.2.840.113549.1.9.22.1","x509Certificate");T("1.2.840.113549.1.12.10.1.1","keyBag");T("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");T("1.2.840.113549.1.12.10.1.3","certBag");T("1.2.840.113549.1.12.10.1.4","crlBag");T("1.2.840.113549.1.12.10.1.5","secretBag");T("1.2.840.113549.1.12.10.1.6","safeContentsBag");T("1.2.840.113549.1.5.13","pkcs5PBES2");T("1.2.840.113549.1.5.12","pkcs5PBKDF2");T("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");T("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");T("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");T("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");T("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");T("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");T("1.2.840.113549.2.7","hmacWithSHA1");T("1.2.840.113549.2.8","hmacWithSHA224");T("1.2.840.113549.2.9","hmacWithSHA256");T("1.2.840.113549.2.10","hmacWithSHA384");T("1.2.840.113549.2.11","hmacWithSHA512");T("1.2.840.113549.3.7","des-EDE3-CBC");T("2.16.840.1.101.3.4.1.2","aes128-CBC");T("2.16.840.1.101.3.4.1.22","aes192-CBC");T("2.16.840.1.101.3.4.1.42","aes256-CBC");T("2.5.4.3","commonName");T("2.5.4.4","surname");T("2.5.4.5","serialNumber");T("2.5.4.6","countryName");T("2.5.4.7","localityName");T("2.5.4.8","stateOrProvinceName");T("2.5.4.9","streetAddress");T("2.5.4.10","organizationName");T("2.5.4.11","organizationalUnitName");T("2.5.4.12","title");T("2.5.4.13","description");T("2.5.4.15","businessCategory");T("2.5.4.17","postalCode");T("2.5.4.42","givenName");T("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");T("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");T("2.16.840.1.113730.1.1","nsCertType");T("2.16.840.1.113730.1.13","nsComment");rt("2.5.29.1","authorityKeyIdentifier");rt("2.5.29.2","keyAttributes");rt("2.5.29.3","certificatePolicies");rt("2.5.29.4","keyUsageRestriction");rt("2.5.29.5","policyMapping");rt("2.5.29.6","subtreesConstraint");rt("2.5.29.7","subjectAltName");rt("2.5.29.8","issuerAltName");rt("2.5.29.9","subjectDirectoryAttributes");rt("2.5.29.10","basicConstraints");rt("2.5.29.11","nameConstraints");rt("2.5.29.12","policyConstraints");rt("2.5.29.13","basicConstraints");T("2.5.29.14","subjectKeyIdentifier");T("2.5.29.15","keyUsage");rt("2.5.29.16","privateKeyUsagePeriod");T("2.5.29.17","subjectAltName");T("2.5.29.18","issuerAltName");T("2.5.29.19","basicConstraints");rt("2.5.29.20","cRLNumber");rt("2.5.29.21","cRLReason");rt("2.5.29.22","expirationDate");rt("2.5.29.23","instructionCode");rt("2.5.29.24","invalidityDate");rt("2.5.29.25","cRLDistributionPoints");rt("2.5.29.26","issuingDistributionPoint");rt("2.5.29.27","deltaCRLIndicator");rt("2.5.29.28","issuingDistributionPoint");rt("2.5.29.29","certificateIssuer");rt("2.5.29.30","nameConstraints");T("2.5.29.31","cRLDistributionPoints");T("2.5.29.32","certificatePolicies");rt("2.5.29.33","policyMappings");rt("2.5.29.34","policyConstraints");T("2.5.29.35","authorityKeyIdentifier");rt("2.5.29.36","policyConstraints");T("2.5.29.37","extKeyUsage");rt("2.5.29.46","freshestCRL");rt("2.5.29.54","inhibitAnyPolicy");T("1.3.6.1.4.1.11129.2.4.2","timestampList");T("1.3.6.1.5.5.7.1.1","authorityInfoAccess");T("1.3.6.1.5.5.7.3.1","serverAuth");T("1.3.6.1.5.5.7.3.2","clientAuth");T("1.3.6.1.5.5.7.3.3","codeSigning");T("1.3.6.1.5.5.7.3.4","emailProtection");T("1.3.6.1.5.5.7.3.8","timeStamping")});var Rr=ft((Yp,Cs)=>{var ct=it();bt();rn();var P=Cs.exports=ct.asn1=ct.asn1||{};P.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};P.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};P.create=function(t,e,r,n,i){if(ct.util.isArray(n)){for(var a=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var wc=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var a=r&127;_r(t,e,a),n=t.getInt(a<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};P.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=ct.util.createBuffer(t));var r=t.length(),n=nn(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function nn(t,e,r,n){var i;_r(t,e,2);var a=t.getByte();e--;var o=a&192,s=a&31;i=t.length();var f=wc(t,e);if(e-=i-t.length(),f!==void 0&&f>e){if(n.strict){var c=new Error("Too few bytes to read ASN.1 value.");throw c.available=t.length(),c.remaining=e,c.requested=f,c}f=e}var u,h,d=(a&32)===32;if(d)if(u=[],f===void 0)for(;;){if(_r(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(nn(t,e,r+1,n)),e-=i-t.length()}else for(;f>0;)i=t.length(),u.push(nn(t,f,r+1,n)),e-=i-t.length(),f-=i-t.length();if(u===void 0&&o===P.Class.UNIVERSAL&&s===P.Type.BITSTRING&&(h=t.bytes(f)),u===void 0&&n.decodeBitStrings&&o===P.Class.UNIVERSAL&&s===P.Type.BITSTRING&&f>1){var x=t.read,l=e,p=0;if(s===P.Type.BITSTRING&&(_r(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},m=nn(t,e,r+1,y),E=i-t.length();e-=E,s==P.Type.BITSTRING&&E++;var b=m.tagClass;E===f&&(b===P.Class.UNIVERSAL||b===P.Class.CONTEXT_SPECIFIC)&&(u=[m])}catch{}u===void 0&&(t.read=x,e=l)}if(u===void 0){if(f===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=e}if(s===P.Type.BMPSTRING)for(u="";f>0;f-=2)_r(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(f),e-=f}var R=h===void 0?null:{bitStringContents:h};return P.create(o,s,d,u,R)}P.toDer=function(t){var e=ct.util.createBuffer(),r=t.tagClass|t.type,n=ct.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=P.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var a=0;a1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),s="";do s+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(s.length|128);for(var a=s.length-1;a>=0;--a)e.putByte(s.charCodeAt(a))}return e.putBuffer(n),e};P.oidToDer=function(t){var e=t.split("."),r=ct.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,a,o,s=2;s>>7,n||(o|=128),i.push(o),n=!1;while(a>0);for(var f=i.length-1;f>=0;--f)r.putByte(i[f])}return r};P.derToOid=function(t){var e;typeof t=="string"&&(t=ct.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};P.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),a=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var f=t.charAt(10),c=10;f!=="+"&&f!=="-"&&(s=parseInt(t.substr(10,2),10),c+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,0),c&&(f=t.charAt(c),f==="+"||f==="-")){var u=parseInt(t.substr(c+1,2),10),h=parseInt(t.substr(c+4,2),10),d=u*60+h;d*=6e4,f==="+"?e.setTime(+e-d):e.setTime(+e+d)}return e};P.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),f=0,c=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,d=t.charAt(h);if(d==="+"||d==="-"){var x=parseInt(t.substr(h+1,2),10),l=parseInt(t.substr(h+4,2),10);c=x*60+l,c*=6e4,d==="+"&&(c*=-1),u=!0}return t.charAt(14)==="."&&(f=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,f),e.setTime(+e+c)):(e.setFullYear(r,n,i),e.setHours(a,o,s,f)),e};P.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};P.derToInteger=function(t){typeof t=="string"&&(t=ct.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};P.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&ct.util.isArray(e.value))for(var a=0,o=0;i&&o0&&(n+=` +`);for(var i="",a=0;a1?n+="0x"+ct.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var c=t.value.charCodeAt(0);c==1?n+=" (1 unused bit shown)":c>1&&(n+=" ("+c+" unused bits shown)")}}else if(t.type===P.Type.OCTETSTRING)As.test(t.value)||(n+="("+t.value+") "),n+="0x"+ct.util.bytesToHex(t.value);else if(t.type===P.Type.UTF8)try{n+=ct.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+ct.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===P.Type.PRINTABLESTRING||t.type===P.Type.IA5String?n+=t.value:As.test(t.value)?n+="0x"+ct.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var _s=ft((Zp,Ts)=>{var lt=it();Yn();$n();bt();Ts.exports=lt.des=lt.des||{};lt.des.startEncrypting=function(t,e,r,n){var i=an({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};lt.des.createEncryptionCipher=function(t,e){return an({key:t,output:null,decrypt:!1,mode:e})};lt.des.startDecrypting=function(t,e,r,n){var i=an({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};lt.des.createDecryptionCipher=function(t,e){return an({key:t,output:null,decrypt:!0,mode:e})};lt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return Is(r._keys,n,i,!1)},decrypt:function(n,i){return Is(r._keys,n,i,!0)}}}),r._init=!1};lt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=lt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=Lc(e),this._init=!0}};ee("DES-ECB",lt.cipher.modes.ecb);ee("DES-CBC",lt.cipher.modes.cbc);ee("DES-CFB",lt.cipher.modes.cfb);ee("DES-OFB",lt.cipher.modes.ofb);ee("DES-CTR",lt.cipher.modes.ctr);ee("3DES-ECB",lt.cipher.modes.ecb);ee("3DES-CBC",lt.cipher.modes.cbc);ee("3DES-CFB",lt.cipher.modes.cfb);ee("3DES-OFB",lt.cipher.modes.ofb);ee("3DES-CTR",lt.cipher.modes.ctr);function ee(t,e){var r=function(){return new lt.des.Algorithm(t,e)};lt.cipher.registerAlgorithm(t,r)}var Bc=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],Sc=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],Ac=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],Cc=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],Ic=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],Tc=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],_c=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],Rc=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function Lc(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],f=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],x=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],l=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],E=0,b,R=0;R>>4^B)&252645135,B^=b,w^=b<<4,b=(B>>>-16^w)&65535,w^=b,B^=b<<-16,b=(w>>>2^B)&858993459,B^=b,w^=b<<2,b=(B>>>-16^w)&65535,w^=b,B^=b<<-16,b=(w>>>1^B)&1431655765,B^=b,w^=b<<1,b=(B>>>8^w)&16711935,w^=b,B^=b<<8,b=(w>>>1^B)&1431655765,B^=b,w^=b<<1,b=w<<8|B>>>20&240,w=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=b;for(var L=0;L>>26,B=B<<2|B>>>26):(w=w<<1|w>>>27,B=B<<1|B>>>27),w&=-15,B&=-15;var N=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|i[w>>>16&15]|a[w>>>12&15]|o[w>>>8&15]|s[w>>>4&15],z=f[B>>>28]|c[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|d[B>>>12&15]|x[B>>>8&15]|l[B>>>4&15];b=(z>>>16^N)&65535,y[E++]=N^b,y[E++]=z^b<<16}}return y}function Is(t,e,r,n){var i=t.length===32?3:9,a;i===3?a=n?[30,-2,-2]:[0,32,2]:a=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=e[0],f=e[1];o=(s>>>4^f)&252645135,f^=o,s^=o<<4,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,s=s<<1|s>>>31,f=f<<1|f>>>31;for(var c=0;c>>4|f<<28)^t[d+1];o=s,s=f,f=o^(Sc[x>>>24&63]|Cc[x>>>16&63]|Tc[x>>>8&63]|Rc[x&63]|Bc[l>>>24&63]|Ac[l>>>16&63]|Ic[l>>>8&63]|_c[l&63])}o=s,s=f,f=o}s=s>>>1|s<<31,f=f>>>1|f<<31,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(s>>>4^f)&252645135,f^=o,s^=o<<4,r[0]=s,r[1]=f}function an(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=lt.cipher.createDecipher(r,t.key):n=lt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof lt.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var Me=ft(($p,Rs)=>{var sn=it();Rs.exports=sn.md=sn.md||{};sn.md.algorithms=sn.md.algorithms||{}});var Ns=ft((Qp,Ls)=>{var de=it();Me();bt();var Nc=Ls.exports=de.hmac=de.hmac||{};Nc.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(a,o){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in de.md.algorithms)e=de.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else e=a;if(o===null)o=t;else{if(typeof o=="string")o=de.util.createBuffer(o);else if(de.util.isArray(o)){var s=o;o=de.util.createBuffer();for(var f=0;fe.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=de.util.createBuffer(),n=de.util.createBuffer(),c=o.length();for(var f=0;f{});var Ai=ft((jp,Ds)=>{var Ut=it();Ns();Me();bt();var Dc=Ut.pkcs5=Ut.pkcs5||{},pe;Ut.util.isNodejs&&!Ut.options.usePureJavaScript&&(pe=on());Ds.exports=Ut.pbkdf2=Dc.pbkdf2=function(t,e,r,n,i,a){if(typeof i=="function"&&(a=i,i=null),Ut.util.isNodejs&&!Ut.options.usePureJavaScript&&pe.pbkdf2&&(i===null||typeof i!="object")&&(pe.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),a?pe.pbkdf2Sync.length===4?pe.pbkdf2(t,e,r,n,function(b,R){if(b)return a(b);a(null,R.toString("binary"))}):pe.pbkdf2(t,e,r,n,i,function(b,R){if(b)return a(b);a(null,R.toString("binary"))}):pe.pbkdf2Sync.length===4?pe.pbkdf2Sync(t,e,r,n).toString("binary"):pe.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Ut.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Ut.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var f=Math.ceil(n/o),c=n-(f-1)*o,u=Ut.hmac.create();u.start(i,t);var h="",d,x,l;if(!a){for(var p=1;p<=f;++p){u.start(null,null),u.update(e),u.update(Ut.util.int32ToBytes(p)),d=l=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(l),x=u.digest().getBytes(),d=Ut.util.xorBytes(d,x,o),l=x;h+=pf)return a(null,h);u.start(null,null),u.update(e),u.update(Ut.util.int32ToBytes(p)),d=l=u.digest().getBytes(),y=2,E()}function E(){if(y<=r)return u.start(null,null),u.update(l),x=u.digest().getBytes(),d=Ut.util.xorBytes(d,x,o),l=x,++y,Ut.util.setImmediate(E);h+=p{var cn=it();bt();var ks=Ps.exports=cn.pem=cn.pem||{};ks.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r +`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=fn(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=fn(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=fn(n)),t.headers)for(var i=0;i65&&o!==-1){var s=e[o];s===","?(++o,e=e.substr(0,o)+`\r + `+e.substr(o)):e=e.substr(0,o)+`\r +`+s+e.substr(o+1),a=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function kc(t){return t.replace(/^\s+/,"")}});var Fs=ft((e1,qs)=>{var re=it();Me();bt();var Os=qs.exports=re.sha256=re.sha256||{};re.md.sha256=re.md.algorithms.sha256=Os;Os.create=function(){Ms||Pc();var t=null,e=re.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Ks(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=re.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(Ci.substr(0,n.blockLength-o));for(var s,f,c=n.fullMessageLength[0]*8,u=0;u>>0,c+=f,i.putInt32(c>>>0),c=s>>>0;i.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Ks(h,r,i);var d=re.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d.putInt32(h.h5),d.putInt32(h.h6),d.putInt32(h.h7),d},n};var Ci=null,Ms=!1,Vs=null;function Pc(){Ci="\x80",Ci+=re.util.fillString("\0",64),Vs=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ms=!0}function Ks(t,e,r){for(var n,i,a,o,s,f,c,u,h,d,x,l,p,y,m,E=r.length();E>=64;){for(c=0;c<16;++c)e[c]=r.getInt32();for(;c<64;++c)n=e[c-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[c-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[c]=n+e[c-7]+i+e[c-16]|0;for(u=t.h0,h=t.h1,d=t.h2,x=t.h3,l=t.h4,p=t.h5,y=t.h6,m=t.h7,c=0;c<64;++c)o=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),s=y^l&(p^y),a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),f=u&h|d&(u^h),n=m+o+s+Vs[c]+e[c],i=a+f,m=y,y=p,p=l,l=x+n>>>0,x=d,d=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+d|0,t.h3=t.h3+x|0,t.h4=t.h4+l|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+m|0,E-=64}}});var zs=ft((r1,Hs)=>{var ne=it();bt();var un=null;ne.util.isNodejs&&!ne.options.usePureJavaScript&&!process.versions["node-webkit"]&&(un=on());var Uc=Hs.exports=ne.prng=ne.prng||{};Uc.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(c,u){if(!u)return e.generateSync(c);var h=e.plugin.cipher,d=e.plugin.increment,x=e.plugin.formatKey,l=e.plugin.formatSeed,p=ne.util.createBuffer();e.key=null,y();function y(m){if(m)return u(m);if(p.length()>=c)return u(null,p.getBytes(c));if(e.generated>1048575&&(e.key=null),e.key===null)return ne.util.nextTick(function(){a(y)});var E=h(e.key,e.seed);e.generated+=E.length,p.putBytes(E),e.key=x(h(e.key,d(e.seed))),e.seed=l(h(e.key,e.seed)),ne.util.setImmediate(y)}},e.generateSync=function(c){var u=e.plugin.cipher,h=e.plugin.increment,d=e.plugin.formatKey,x=e.plugin.formatSeed;e.key=null;for(var l=ne.util.createBuffer();l.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,l.putBytes(p),e.key=d(u(e.key,h(e.seed))),e.seed=x(u(e.key,e.seed))}return l.getBytes(c)};function a(c){if(e.pools[0].messageLength>=32)return s(),c();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,d){if(h)return c(h);e.collect(d),s(),c()})}function o(){if(e.pools[0].messageLength>=32)return s();var c=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(c)),s()}function s(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var c=e.plugin.md.create();c.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(c.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=c.digest().getBytes(),c.start(),c.update(e.keyBytes);var d=c.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(d),e.generated=0}function f(c){var u=null,h=ne.util.globalScope,d=h.crypto||h.msCrypto;d&&d.getRandomValues&&(u=function(w){return d.getRandomValues(w)});var x=ne.util.createBuffer();if(u)for(;x.length()>16),E+=(m&32767)<<16,E+=m>>15,E=(E&2147483647)+(E>>31),R=E&4294967295;for(var y=0;y<3;++y)b=R>>>(y<<3),b^=Math.floor(Math.random()*256),x.putByte(b&255)}return x.getBytes(c)}return un?(e.seedFile=function(c,u){un.randomBytes(c,function(h,d){if(h)return u(h);u(null,d.toString())})},e.seedFileSync=function(c){return un.randomBytes(c).toString()}):(e.seedFile=function(c,u){try{u(null,f(c))}catch(h){u(h)}},e.seedFileSync=f),e.collect=function(c){for(var u=c.length,h=0;h>d&255);e.collect(h)},e.registerWorker=function(c){if(c===self)e.seedFile=function(h,d){function x(l){var p=l.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",x),d(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",x),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var d=h.data;d.forge&&d.forge.prng&&e.seedFile(d.forge.prng.needed,function(x,l){c.postMessage({forge:{prng:{err:x,bytes:l}}})})};c.addEventListener("message",u)}},e}});var Lr=ft((n1,Ii)=>{var Tt=it();Xr();Fs();zs();bt();(function(){if(Tt.random&&Tt.random.getBytes){Ii.exports=Tt.random;return}(function(t){var e={},r=new Array(4),n=Tt.util.createBuffer();e.formatKey=function(h){var d=Tt.util.createBuffer(h);return h=new Array(4),h[0]=d.getInt32(),h[1]=d.getInt32(),h[2]=d.getInt32(),h[3]=d.getInt32(),Tt.aes._expandKey(h,!1)},e.formatSeed=function(h){var d=Tt.util.createBuffer(h);return h=new Array(4),h[0]=d.getInt32(),h[1]=d.getInt32(),h[2]=d.getInt32(),h[3]=d.getInt32(),h},e.cipher=function(h,d){return Tt.aes._updateBlock(h,d,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=Tt.md.sha256;function i(){var h=Tt.prng.create(e);return h.getBytes=function(d,x){return h.generate(d,x)},h.getBytesSync=function(d){return h.generate(d)},h}var a=i(),o=null,s=Tt.util.globalScope,f=s.crypto||s.msCrypto;if(f&&f.getRandomValues&&(o=function(h){return f.getRandomValues(h)}),Tt.options.usePureJavaScript||!Tt.util.isNodejs&&!o){if(typeof window>"u"||window.document,a.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var u in navigator)try{typeof navigator[u]=="string"&&(c+=navigator[u])}catch{}a.collect(c),c=null}t&&(t().mousemove(function(h){a.collectInt(h.clientX,16),a.collectInt(h.clientY,16)}),t().keypress(function(h){a.collectInt(h.charCode,8)}))}if(!Tt.random)Tt.random=a;else for(var u in a)Tt.random[u]=a[u];Tt.random.createInstance=i,Ii.exports=Tt.random})(typeof jQuery<"u"?jQuery:null)})()});var Zs=ft((i1,Ys)=>{var Kt=it();bt();var Ti=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],Gs=[1,2,3,5],Kc=function(t,e){return t<>16-e},Oc=function(t,e){return(t&65535)>>e|t<<16-e&65535};Ys.exports=Kt.rc2=Kt.rc2||{};Kt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Kt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=n;s<128;s++)r.putByte(Ti[r.at(s-1)+r.at(s-n)&255]);for(r.setAt(128-a,Ti[r.at(128-a)&o]),s=127-a;s>=0;s--)r.setAt(s,Ti[r.at(s+1)^r.at(s+a)]);return r};var Ws=function(t,e,r){var n=!1,i=null,a=null,o=null,s,f,c,u,h=[];for(t=Kt.rc2.expandKey(t,e),c=0;c<64;c++)h.push(t.getInt16Le());r?(s=function(l){for(c=0;c<4;c++)l[c]+=h[u]+(l[(c+3)%4]&l[(c+2)%4])+(~l[(c+3)%4]&l[(c+1)%4]),l[c]=Kc(l[c],Gs[c]),u++},f=function(l){for(c=0;c<4;c++)l[c]+=h[l[(c+3)%4]&63]}):(s=function(l){for(c=3;c>=0;c--)l[c]=Oc(l[c],Gs[c]),l[c]-=h[u]+(l[(c+3)%4]&l[(c+2)%4])+(~l[(c+3)%4]&l[(c+1)%4]),u--},f=function(l){for(c=3;c>=0;c--)l[c]-=h[l[(c+3)%4]&63]});var d=function(l){var p=[];for(c=0;c<4;c++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var m=0;m=8;)d([[5,s],[1,f],[6,s],[1,f],[5,s]])},finish:function(l){var p=!0;if(r)if(l)p=l(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,x.update()),!r&&(p=i.length()===0,p))if(l)p=l(8,a,!r);else{var m=a.length(),E=a.at(m-1);E>m?p=!1:a.truncate(E)}return p}},x};Kt.rc2.startEncrypting=function(t,e,r){var n=Kt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Kt.rc2.createEncryptionCipher=function(t,e){return Ws(t,e,!0)};Kt.rc2.startDecrypting=function(t,e,r){var n=Kt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Kt.rc2.createDecryptionCipher=function(t,e){return Ws(t,e,!1)}});var dn=ft((a1,ro)=>{var _i=it();ro.exports=_i.jsbn=_i.jsbn||{};var ye,Mc=0xdeadbeefcafe,$s=(Mc&16777215)==15715070;function C(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}_i.jsbn.BigInteger=C;function tt(){return new C(null)}function Vc(t,e,r,n,i,a){for(;--a>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function qc(t,e,r,n,i,a){for(var o=e&32767,s=e>>15;--a>=0;){var f=this.data[t]&32767,c=this.data[t++]>>15,u=s*f+c*o;f=o*f+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(f>>>30)+(u>>>15)+s*c+(i>>>30),r.data[n++]=f&1073741823}return i}function Qs(t,e,r,n,i,a){for(var o=e&16383,s=e>>14;--a>=0;){var f=this.data[t]&16383,c=this.data[t++]>>14,u=s*f+c*o;f=o*f+((u&16383)<<14)+r.data[n]+i,i=(f>>28)+(u>>14)+s*c,r.data[n++]=f&268435455}return i}typeof navigator>"u"?(C.prototype.am=Qs,ye=28):$s&&navigator.appName=="Microsoft Internet Explorer"?(C.prototype.am=qc,ye=30):$s&&navigator.appName!="Netscape"?(C.prototype.am=Vc,ye=26):(C.prototype.am=Qs,ye=28);C.prototype.DB=ye;C.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function zc(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ie(t){var e=tt();return e.fromInt(t),e}function Gc(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var o=r==8?t[n]&255:Js(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-a):this.data[this.t-1]|=o<=this.DB&&(a-=this.DB)}r==8&&t[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Yc(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(s>s)>0&&(i=!0,a=Xs(n));o>=0;)s>(s+=this.DB-e)):(n=this.data[o]>>(s-=e)&r,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(a+=Xs(n));return i?a:"0"}function Zc(){var t=tt();return C.ZERO.subTo(this,t),t}function $c(){return this.s<0?this.negate():this}function Qc(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function ln(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Xc(){return this.t<=0?0:this.DB*(this.t-1)+ln(this.data[this.t-1]^this.s&this.DM)}function Jc(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function jc(t,e){for(var r=t;r=0;--s)e.data[s+a+1]=this.data[s]>>n|o,o=(this.data[s]&i)<=0;--s)e.data[s]=0;e.data[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()}function eu(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,a=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function nu(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function au(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(f,a),i.lShiftTo(f,r)):(n.copyTo(a),i.copyTo(r));var c=a.t,u=a.data[c-1];if(u!=0){var h=u*(1<1?a.data[c-2]>>this.F2:0),d=this.FV/h,x=(1<=0&&(r.data[r.t++]=1,r.subTo(m,r)),C.ONE.dlShiftTo(c,m),m.subTo(a,a);a.t=0;){var E=r.data[--p]==u?this.DM:Math.floor(r.data[p]*d+(r.data[p-1]+l)*x);if((r.data[p]+=a.am(0,E,r,y,0,c))0&&r.rShiftTo(f,r),o<0&&C.ZERO.subTo(r,r)}}}function su(t){var e=tt();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(C.ZERO)>0&&t.subTo(e,e),e}function Ve(t){this.m=t}function ou(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function fu(t){return t}function cu(t){t.divRemTo(this.m,null,t)}function uu(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function hu(t,e){t.squareTo(e),this.reduce(e)}Ve.prototype.convert=ou;Ve.prototype.revert=fu;Ve.prototype.reduce=cu;Ve.prototype.mulTo=uu;Ve.prototype.sqrTo=hu;function lu(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function qe(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function pu(t){var e=tt();return t.copyTo(e),this.reduce(e),e}function yu(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function xu(t,e){t.squareTo(e),this.reduce(e)}function gu(t,e,r){t.multiplyTo(e,r),this.reduce(r)}qe.prototype.convert=du;qe.prototype.revert=pu;qe.prototype.reduce=yu;qe.prototype.mulTo=gu;qe.prototype.sqrTo=xu;function mu(){return(this.t>0?this.data[0]&1:this.s)==0}function vu(t,e){if(t>4294967295||t<1)return C.ONE;var r=tt(),n=tt(),i=e.convert(this),a=ln(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function bu(t,e){var r;return t<256||e.isEven()?r=new Ve(e):r=new qe(e),this.exp(t,r)}C.prototype.copyTo=Hc;C.prototype.fromInt=zc;C.prototype.fromString=Gc;C.prototype.clamp=Wc;C.prototype.dlShiftTo=Jc;C.prototype.drShiftTo=jc;C.prototype.lShiftTo=tu;C.prototype.rShiftTo=eu;C.prototype.subTo=ru;C.prototype.multiplyTo=nu;C.prototype.squareTo=iu;C.prototype.divRemTo=au;C.prototype.invDigit=lu;C.prototype.isEven=mu;C.prototype.exp=vu;C.prototype.toString=Yc;C.prototype.negate=Zc;C.prototype.abs=$c;C.prototype.compareTo=Qc;C.prototype.bitLength=Xc;C.prototype.mod=su;C.prototype.modPowInt=bu;C.ZERO=Ie(0);C.ONE=Ie(1);function Eu(){var t=tt();return this.copyTo(t),t}function wu(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function Su(){return this.t==0?this.s:this.data[0]<<16>>16}function Au(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function Cu(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Iu(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ie(r),i=tt(),a=tt(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o}function Tu(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,o=0,s=0;s=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(o,0)),i&&C.ZERO.subTo(this,this)}function _u(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(C.ONE.shiftLeft(t-1),Li,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(C.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function Lu(t){return this.compareTo(t)==0}function Nu(t){return this.compareTo(t)<0?this:t}function Du(t){return this.compareTo(t)>0?this:t}function ku(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function zu(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function ju(t){var e=tt();return this.addTo(t,e),e}function th(t){var e=tt();return this.subTo(t,e),e}function eh(t){var e=tt();return this.multiplyTo(t,e),e}function rh(t){var e=tt();return this.divRemTo(t,e,null),e}function nh(t){var e=tt();return this.divRemTo(t,null,e),e}function ih(t){var e=tt(),r=tt();return this.divRemTo(t,e,r),new Array(e,r)}function ah(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function sh(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function Nr(){}function eo(t){return t}function oh(t,e,r){t.multiplyTo(e,r)}function fh(t,e){t.squareTo(e)}Nr.prototype.convert=eo;Nr.prototype.revert=eo;Nr.prototype.mulTo=oh;Nr.prototype.sqrTo=fh;function ch(t){return this.exp(t,new Nr)}function uh(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=tt();return t.copyTo(e),this.reduce(e),e}function dh(t){return t}function ph(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function yh(t,e){t.squareTo(e),this.reduce(e)}function xh(t,e,r){t.multiplyTo(e,r),this.reduce(r)}or.prototype.convert=lh;or.prototype.revert=dh;or.prototype.reduce=ph;or.prototype.mulTo=xh;or.prototype.sqrTo=yh;function gh(t,e){var r=t.bitLength(),n,i=Ie(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new Ve(e):e.isEven()?a=new or(e):a=new qe(e);var o=new Array,s=3,f=n-1,c=(1<1){var u=tt();for(a.sqrTo(o[1],u);s<=c;)o[s]=tt(),a.mulTo(u,o[s-2],o[s]),s+=2}var h=t.t-1,d,x=!0,l=tt(),p;for(r=ln(t.data[h])-1;h>=0;){for(r>=f?d=t.data[h]>>r-f&c:(d=(t.data[h]&(1<0&&(d|=t.data[h-1]>>this.DB+r-f)),s=n;!(d&1);)d>>=1,--s;if((r-=s)<0&&(r+=this.DB,--h),x)o[d].copyTo(i),x=!1;else{for(;s>1;)a.sqrTo(i,l),a.sqrTo(l,i),s-=2;s>0?a.sqrTo(i,l):(p=i,i=l,l=p),a.mulTo(l,o[d],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function vh(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function bh(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return C.ZERO;for(var r=t.clone(),n=this.clone(),i=Ie(1),a=Ie(0),o=Ie(0),s=Ie(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),e&&o.subTo(i,o),s.subTo(a,s))}if(n.compareTo(C.ONE)!=0)return C.ZERO;if(s.compareTo(t)>=0)return s.subtract(t);if(s.signum()<0)s.addTo(t,s);else return s;return s.signum()<0?s.add(t):s}var Yt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Eh=(1<<26)/Yt[Yt.length-1];function wh(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Yt[Yt.length-1]){for(e=0;e=0);var s=a.modPow(n,this);if(s.compareTo(C.ONE)!=0&&s.compareTo(e)!=0){for(var f=1;f++{var ie=it();Me();bt();var io=so.exports=ie.sha1=ie.sha1||{};ie.md.sha1=ie.md.algorithms.sha1=io;io.create=function(){ao||Ah();var t=null,e=ie.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),no(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ie.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(Ni.substr(0,n.blockLength-o));for(var s,f,c=n.fullMessageLength[0]*8,u=0;u>>0,c+=f,i.putInt32(c>>>0),c=s>>>0;i.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};no(h,r,i);var d=ie.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d},n};var Ni=null,ao=!1;function Ah(){Ni="\x80",Ni+=ie.util.fillString("\0",64),ao=!0}function no(t,e,r){for(var n,i,a,o,s,f,c,u,h=r.length();h>=64;){for(i=t.h0,a=t.h1,o=t.h2,s=t.h3,f=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,c=s^a&(o^s),n=(i<<5|i>>>27)+c+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,c=s^a&(o^s),n=(i<<5|i>>>27)+c+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,c=a&o|s&(a^o),n=(i<<5|i>>>27)+c+f+2400959708+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+3395469782+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+a|0,t.h2=t.h2+o|0,t.h3=t.h3+s|0,t.h4=t.h4+f|0,h-=64}}});var uo=ft((o1,co)=>{var ae=it();bt();Lr();oo();var fo=co.exports=ae.pkcs1=ae.pkcs1||{};fo.encode_rsa_oaep=function(t,e,r){var n,i,a,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),a?a.start():a=ae.md.sha1.create(),o||(o=a);var s=Math.ceil(t.n.bitLength()/8),f=s-2*a.digestLength-2;if(e.length>f){var c=new Error("RSAES-OAEP input message length is too long.");throw c.length=e.length,c.maxLength=f,c}n||(n=""),a.update(n,"raw");for(var u=a.digest(),h="",d=f-e.length,x=0;x>24&255,a>>16&255,a>>8&255,a&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var ho=ft((f1,Di)=>{var Te=it();bt();dn();Lr();(function(){if(Te.prime){Di.exports=Te.prime;return}var t=Di.exports=Te.prime=Te.prime||{},e=Te.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,d){return h|d};t.generateProbablePrime=function(h,d,x){typeof d=="function"&&(x=d,d={}),d=d||{};var l=d.algorithm||"PRIMEINC";typeof l=="string"&&(l={name:l}),l.options=l.options||{};var p=d.prng||Te.random,y={nextBytes:function(m){for(var E=p.getBytesSync(m.length),b=0;bd&&(h=c(d,x)),h.isProbablePrime(p))return m(null,h);h.dAddOffset(r[l++%8],0)}while(y<0||+new Date-E"u")return o(h,d,x,l);var p=c(h,d),y=x.workers,m=x.workLoad||100,E=m*30/8,b=x.workerScript||"forge/prime.worker.js";if(y===-1)return Te.util.estimateCores(function(w,B){w&&(B=2),y=B-1,R()});R();function R(){y=Math.max(1,y);for(var w=[],B=0;Bh&&(p=c(h,d));var at=p.toString(16);H.target.postMessage({hex:at,workLoad:m}),p.dAddOffset(E,0)}}}}function c(h,d){var x=new e(h,d),l=h-1;return x.testBit(l)||x.bitwiseTo(e.ONE.shiftLeft(l),i,x),x.dAddOffset(31-x.mod(n).byteValue(),0),x}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var xn=ft((c1,vo)=>{var M=it();Rr();dn();rn();uo();ho();Lr();bt();typeof j>"u"&&(j=M.jsbn.BigInteger);var j,ki=M.util.isNodejs?on():null,v=M.asn1,zt=M.util;M.pki=M.pki||{};vo.exports=M.pki.rsa=M.rsa=M.rsa||{};var G=M.pki,Ch=[6,4,2,4,2,4,6,2],Ih={name:"PrivateKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Th={name:"RSAPrivateKey",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},_h={name:"RSAPublicKey",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Rh=M.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:v.Class.UNIVERSAL,type:v.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Lh={name:"DigestInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:v.Class.UNIVERSAL,type:v.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},Nh=function(t){var e;if(t.algorithm in G.oids)e=G.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=v.oidToDer(e).getBytes(),i=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[]),a=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[]);a.value.push(v.create(v.Class.UNIVERSAL,v.Type.OID,!1,n)),a.value.push(v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,""));var o=v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(a),i.value.push(o),v.toDer(i).getBytes()},go=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(j.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(j.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new j(M.util.bytesToHex(M.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(j.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(a)<0;)i=i.add(e.p);var o=i.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};G.rsa.encrypt=function(t,e,r){var n=r,i,a=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=mo(t,e,r)):(i=M.util.createBuffer(),i.putBytes(t));for(var o=new j(i.toHex(),16),s=go(o,e,n),f=s.toString(16),c=M.util.createBuffer(),u=a-Math.ceil(f.length/2);u>0;)c.putByte(0),--u;return c.putBytes(M.util.hexToBytes(f)),c.getBytes()};G.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=i,a}var o=new j(M.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=go(o,e,r),f=s.toString(16),c=M.util.createBuffer(),u=i-Math.ceil(f.length/2);u>0;)c.putByte(0),--u;return c.putBytes(M.util.hexToBytes(f)),n!==!1?yn(c.getBytes(),e,r):c.getBytes()};G.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||M.random,i={nextBytes:function(s){for(var f=n.getBytesSync(s.length),c=0;c>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};G.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new j(null);r.fromInt(30);for(var n=0,i=function(h,d){return h|d},a=+new Date,o,s=0;t.keys===null&&(e<=0||sf?t.pqState=0:t.num.isProbablePrime(kh(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(Ch[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(j.ONE).gcd(t.e).compareTo(j.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(j.ONE),t.q1=t.q.subtract(j.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(j.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:G.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:G.rsa.setPublicKey(t.n,t.e)}}o=+new Date,s+=o-a,a=o}return t.keys!==null};G.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!M.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(lo("generateKeyPair"))return ki.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,f,c){if(s)return n(s);n(null,{privateKey:G.privateKeyFromPem(c),publicKey:G.publicKeyFromPem(f)})});if(po("generateKey")&&po("exportKey"))return zt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:xo(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return zt.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){n(s)}).then(function(s){if(s){var f=G.privateKeyFromAsn1(v.fromDer(M.util.createBuffer(s)));n(null,{privateKey:f,publicKey:G.setRsaPublicKey(f.n,f.e)})}});if(yo("generateKey")&&yo("exportKey")){var i=zt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:xo(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var f=s.target.result,c=zt.globalScope.msCrypto.subtle.exportKey("pkcs8",f.privateKey);c.oncomplete=function(u){var h=u.target.result,d=G.privateKeyFromAsn1(v.fromDer(M.util.createBuffer(h)));n(null,{privateKey:d,publicKey:G.setRsaPublicKey(d.n,d.e)})},c.onerror=function(u){n(u)}},i.onerror=function(s){n(s)};return}}else if(lo("generateKeyPairSync")){var a=ki.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:G.privateKeyFromPem(a.privateKey),publicKey:G.publicKeyFromPem(a.publicKey)}}}var o=G.rsa.createKeyPairGenerationState(t,e,r);if(!n)return G.rsa.stepKeyPairGenerationState(o,0),o.keys;Dh(o,r,n)};G.setRsaPublicKey=G.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,f,c){return mo(s,f,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,f){return M.pkcs1.encode_rsa_oaep(f,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return G.rsa.encrypt(o,r,!0)},r.verify=function(n,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(f,c){c=yn(c,r,!0);var u=v.fromDer(c,{parseAllBytes:o._parseAllDigestBytes}),h={},d=[];if(!v.validate(u,Lh,h,d)){var x=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw x.errors=d,x}var l=v.derToOid(h.algorithmIdentifier);if(!(l===M.oids.md2||l===M.oids.md5||l===M.oids.sha1||l===M.oids.sha224||l===M.oids.sha256||l===M.oids.sha384||l===M.oids.sha512||l===M.oids["sha512-224"]||l===M.oids["sha512-256"])){var x=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw x.oid=l,x}if((l===M.oids.md2||l===M.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return f===h.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(f,c){return c=yn(c,r,!0),f===c}});var s=G.rsa.decrypt(i,r,!0,!1);return a.verify(n,s,r.n.bitLength())},r};G.setRsaPrivateKey=G.rsa.setPrivateKey=function(t,e,r,n,i,a,o,s){var f={n:t,e,d:r,p:n,q:i,dP:a,dQ:o,qInv:s};return f.decrypt=function(c,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var d=G.rsa.decrypt(c,f,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:yn};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(x,l){return M.pkcs1.decode_rsa_oaep(l,x,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(x){return x}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(d,f,!1)},f.sign=function(c,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:Nh},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return c}},h=1);var d=u.encode(c,f.n.bitLength());return G.rsa.encrypt(d,f,h)},f};G.wrapRsaPrivateKey=function(t){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,v.integerToDer(0).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(G.oids.rsaEncryption).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,"")]),v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,v.toDer(t).getBytes())])};G.privateKeyFromAsn1=function(t){var e={},r=[];if(v.validate(t,Ih,e,r)&&(t=v.fromDer(M.util.createBuffer(e.privateKey))),e={},r=[],!v.validate(t,Th,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,o,s,f,c,u,h;return i=M.util.createBuffer(e.privateKeyModulus).toHex(),a=M.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=M.util.createBuffer(e.privateKeyPrivateExponent).toHex(),s=M.util.createBuffer(e.privateKeyPrime1).toHex(),f=M.util.createBuffer(e.privateKeyPrime2).toHex(),c=M.util.createBuffer(e.privateKeyExponent1).toHex(),u=M.util.createBuffer(e.privateKeyExponent2).toHex(),h=M.util.createBuffer(e.privateKeyCoefficient).toHex(),G.setRsaPrivateKey(new j(i,16),new j(a,16),new j(o,16),new j(s,16),new j(f,16),new j(c,16),new j(u,16),new j(h,16))};G.privateKeyToAsn1=G.privateKeyToRSAPrivateKey=function(t){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,v.integerToDer(0).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.n)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.e)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.d)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.p)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.q)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.dP)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.dQ)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.qInv))])};G.publicKeyFromAsn1=function(t){var e={},r=[];if(v.validate(t,Rh,e,r)){var n=v.derToOid(e.publicKeyOid);if(n!==G.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!v.validate(t,_h,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=M.util.createBuffer(e.publicKeyModulus).toHex(),o=M.util.createBuffer(e.publicKeyExponent).toHex();return G.setRsaPublicKey(new j(a,16),new j(o,16))};G.publicKeyToAsn1=G.publicKeyToSubjectPublicKeyInfo=function(t){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(G.oids.rsaEncryption).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,"")]),v.create(v.Class.UNIVERSAL,v.Type.BITSTRING,!1,[G.publicKeyToRSAPublicKey(t)])])};G.publicKeyToRSAPublicKey=function(t){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.n)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,se(t.e))])};function mo(t,e,r){var n=M.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o=i-3-t.length,s;if(r===0||r===1){s=r===0?0:255;for(var f=0;f0;){for(var c=0,u=M.random.getBytes(o),f=0;f"u")throw new Error("Encryption block is invalid.");var f=0;if(s===0){f=i-3-n;for(var c=0;c1;){if(a.getByte()!==255){--a.read;break}++f}else if(s===2)for(f=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++f}var u=a.getByte();if(u!==0||f!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function Dh(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){a(t.pBits,function(s,f){if(s)return r(s);if(t.p=f,t.q!==null)return o(s,t.q);a(t.qBits,o)})}function a(s,f){M.prime.generateProbablePrime(s,n,f)}function o(s,f){if(s)return r(s);if(t.q=f,t.p.compareTo(t.q)<0){var c=t.p;t.p=t.q,t.q=c}if(t.p.subtract(j.ONE).gcd(t.e).compareTo(j.ONE)!==0){t.p=null,i();return}if(t.q.subtract(j.ONE).gcd(t.e).compareTo(j.ONE)!==0){t.q=null,a(t.qBits,o);return}if(t.p1=t.p.subtract(j.ONE),t.q1=t.q.subtract(j.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(j.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,a(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:G.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:G.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function se(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=M.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function kh(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function lo(t){return M.util.isNodejs&&typeof ki[t]=="function"}function po(t){return typeof zt.globalScope<"u"&&typeof zt.globalScope.crypto=="object"&&typeof zt.globalScope.crypto.subtle=="object"&&typeof zt.globalScope.crypto.subtle[t]=="function"}function yo(t){return typeof zt.globalScope<"u"&&typeof zt.globalScope.msCrypto=="object"&&typeof zt.globalScope.msCrypto.subtle=="object"&&typeof zt.globalScope.msCrypto.subtle[t]=="function"}function xo(t){for(var e=M.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var U=it();Xr();Rr();_s();Me();rn();Ai();Us();Lr();Zs();xn();bt();typeof bo>"u"&&(bo=U.jsbn.BigInteger);var bo,S=U.asn1,W=U.pki=U.pki||{};So.exports=W.pbe=U.pbe=U.pbe||{};var Fe=W.oids,Ph={name:"EncryptedPrivateKeyInfo",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:S.Class.UNIVERSAL,type:S.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Uh={name:"PBES2Algorithms",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:S.Class.UNIVERSAL,type:S.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:S.Class.UNIVERSAL,type:S.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:S.Class.UNIVERSAL,type:S.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:S.Class.UNIVERSAL,type:S.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:S.Class.UNIVERSAL,type:S.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Kh={name:"pkcs-12PbeParams",tagClass:S.Class.UNIVERSAL,type:S.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:S.Class.UNIVERSAL,type:S.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:S.Class.UNIVERSAL,type:S.Type.INTEGER,constructed:!1,capture:"iterations"}]};W.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=U.random.getBytesSync(r.saltSize),i=r.count,a=S.integerToDer(i),o,s,f;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var c,u,h;switch(r.algorithm){case"aes128":o=16,c=16,u=Fe["aes128-CBC"],h=U.aes.createEncryptionCipher;break;case"aes192":o=24,c=16,u=Fe["aes192-CBC"],h=U.aes.createEncryptionCipher;break;case"aes256":o=32,c=16,u=Fe["aes256-CBC"],h=U.aes.createEncryptionCipher;break;case"des":o=8,c=8,u=Fe.desCBC,h=U.des.createEncryptionCipher;break;default:var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=r.algorithm,d}var x="hmacWith"+r.prfAlgorithm.toUpperCase(),l=Bo(x),p=U.pkcs5.pbkdf2(e,n,i,o,l),y=U.random.getBytesSync(c),m=h(p);m.start(y),m.update(S.toDer(t)),m.finish(),f=m.output.getBytes();var E=Oh(n,a,o,x);s=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(Fe.pkcs5PBES2).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(Fe.pkcs5PBKDF2).getBytes()),E]),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(u).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var b=new U.util.ByteBuffer(n),p=W.pbe.generatePkcs12Key(e,b,1,i,o),y=W.pbe.generatePkcs12Key(e,b,2,i,o),m=U.des.createEncryptionCipher(p);m.start(y),m.update(S.toDer(t)),m.finish(),f=m.output.getBytes(),s=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OID,!1,S.oidToDer(Fe["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,n),S.create(S.Class.UNIVERSAL,S.Type.INTEGER,!1,a.getBytes())])])}else{var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=r.algorithm,d}var R=S.create(S.Class.UNIVERSAL,S.Type.SEQUENCE,!0,[s,S.create(S.Class.UNIVERSAL,S.Type.OCTETSTRING,!1,f)]);return R};W.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!S.validate(t,Ph,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=S.derToOid(n.encryptionOid),s=W.pbe.getCipher(o,n.encryptionParams,e),f=U.util.createBuffer(n.encryptedData);return s.update(f),s.finish()&&(r=S.fromDer(s.output)),r};W.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:S.toDer(t).getBytes()};return U.pem.encode(r,{maxline:e})};W.encryptedPrivateKeyFromPem=function(t){var e=U.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return S.fromDer(e.body)};W.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=W.wrapRsaPrivateKey(W.privateKeyToAsn1(t));return n=W.encryptPrivateKeyInfo(n,e,r),W.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=U.random.getBytesSync(16),s=U.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=U.random.getBytesSync(16),s=U.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=U.random.getBytesSync(16),s=U.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=U.random.getBytesSync(8),s=U.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=U.random.getBytesSync(8),s=U.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var c=U.pbe.opensslDeriveBytes(e,a.substr(0,8),o),u=s(c);u.start(a),u.update(S.toDer(W.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:U.util.bytesToHex(a).toUpperCase()},body:u.output.getBytes()};return U.pem.encode(h)};W.decryptRsaPrivateKey=function(t,e){var r=null,n=U.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var a,o;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,o=U.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=U.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=U.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=U.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=U.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(h){return U.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":a=8,o=function(h){return U.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":a=16,o=function(h){return U.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var s=U.util.hexToBytes(n.dekInfo.parameters),f=U.pbe.opensslDeriveBytes(e,s.substr(0,8),a),c=o(f);if(c.start(s),c.update(U.util.createBuffer(n.body)),c.finish())r=c.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=W.decryptPrivateKeyInfo(S.fromDer(r),e):r=S.fromDer(r),r!==null&&(r=W.privateKeyFromAsn1(r)),r};W.pbe.generatePkcs12Key=function(t,e,r,n,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in U.md))throw new Error('"sha1" hash algorithm unavailable.');a=U.md.sha1.create()}var f=a.digestLength,c=a.blockLength,u=new U.util.ByteBuffer,h=new U.util.ByteBuffer;if(t!=null){for(s=0;s=0;s--)Q=Q>>8,Q+=N.at(s)+V.at(s),V.setAt(s,Q&255);H.putBuffer(V)}b=H,u.putBuffer(B)}return u.truncate(u.length()-i),u};W.pbe.getCipher=function(t,e,r){switch(t){case W.oids.pkcs5PBES2:return W.pbe.getCipherForPBES2(t,e,r);case W.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case W.oids["pbewithSHAAnd40BitRC2-CBC"]:return W.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};W.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!S.validate(e,Uh,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(t=S.derToOid(n.kdfOid),t!==W.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=t,a.supportedOids=["pkcs5PBKDF2"],a}if(t=S.derToOid(n.encOid),t!==W.oids["aes128-CBC"]&&t!==W.oids["aes192-CBC"]&&t!==W.oids["aes256-CBC"]&&t!==W.oids["des-EDE3-CBC"]&&t!==W.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=t,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=n.kdfSalt,s=U.util.createBuffer(n.kdfIterationCount);s=s.getInt(s.length()<<3);var f,c;switch(W.oids[t]){case"aes128-CBC":f=16,c=U.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,c=U.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,c=U.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,c=U.des.createDecryptionCipher;break;case"desCBC":f=8,c=U.des.createDecryptionCipher;break}var u=wo(n.prfOid),h=U.pkcs5.pbkdf2(r,o,s,f,u),d=n.encIv,x=c(h);return x.start(d),x};W.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!S.validate(e,Kh,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=U.util.createBuffer(n.salt),s=U.util.createBuffer(n.iterations);s=s.getInt(s.length()<<3);var f,c,u;switch(t){case W.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,c=8,u=U.des.startDecrypting;break;case W.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,c=8,u=function(p,y){var m=U.rc2.createDecryptionCipher(p,40);return m.start(y,null),m};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=t,a}var h=wo(n.prfOid),d=W.pbe.generatePkcs12Key(r,o,1,s,f,h);h.start();var x=W.pbe.generatePkcs12Key(r,o,2,s,c,h);return u(d,x)};W.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in U.md))throw new Error('"md5" hash algorithm unavailable.');n=U.md.md5.create()}e===null&&(e="");for(var i=[Eo(n,t+e)],a=16,o=1;a{var ht=it();Me();bt();var Vr=x0.exports=ht.sha512=ht.sha512||{};ht.md.sha512=ht.md.algorithms.sha512=Vr;var p0=ht.sha384=ht.sha512.sha384=ht.sha512.sha384||{};p0.create=function(){return Vr.create("SHA-384")};ht.md.sha384=ht.md.algorithms.sha384=p0;ht.sha512.sha256=ht.sha512.sha256||{create:function(){return Vr.create("SHA-512/256")}};ht.md["sha512/256"]=ht.md.algorithms["sha512/256"]=ht.sha512.sha256;ht.sha512.sha224=ht.sha512.sha224||{create:function(){return Vr.create("SHA-512/224")}};ht.md["sha512/224"]=ht.md.algorithms["sha512/224"]=ht.sha512.sha224;Vr.create=function(t){if(y0||nd(),typeof t>"u"&&(t="SHA-512"),!(t in $e))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=$e[t],r=null,n=ht.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var f=s.messageLengthSize/4,c=0;c>>0,u>>>0];for(var h=s.fullMessageLength.length-1;h>=0;--h)s.fullMessageLength[h]+=u[1],u[1]=u[0]+(s.fullMessageLength[h]/4294967296>>>0),s.fullMessageLength[h]=s.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(f),d0(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),s},s.digest=function(){var f=ht.util.createBuffer();f.putBytes(n.bytes());var c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,u=c&s.blockLength-1;f.putBytes(pa.substr(0,s.blockLength-u));for(var h,d,x=s.fullMessageLength[0]*8,l=0;l>>0,x+=d,f.putInt32(x>>>0),x=h>>>0;f.putInt32(x);for(var p=new Array(r.length),l=0;l=128;){for(I=0;I<16;++I)e[I][0]=r.getInt32()>>>0,e[I][1]=r.getInt32()>>>0;for(;I<80;++I)D=e[I-2],k=D[0],_=D[1],n=((k>>>19|_<<13)^(_>>>29|k<<3)^k>>>6)>>>0,i=((k<<13|_>>>19)^(_<<3|k>>>29)^(k<<26|_>>>6))>>>0,K=e[I-15],k=K[0],_=K[1],a=((k>>>1|_<<31)^(k>>>8|_<<24)^k>>>7)>>>0,o=((k<<31|_>>>1)^(k<<24|_>>>8)^(k<<25|_>>>7))>>>0,A=e[I-7],O=e[I-16],_=i+A[1]+o+O[1],e[I][0]=n+A[0]+a+O[0]+(_/4294967296>>>0)>>>0,e[I][1]=_>>>0;for(p=t[0][0],y=t[0][1],m=t[1][0],E=t[1][1],b=t[2][0],R=t[2][1],w=t[3][0],B=t[3][1],L=t[4][0],N=t[4][1],z=t[5][0],H=t[5][1],V=t[6][0],Q=t[6][1],at=t[7][0],_t=t[7][1],I=0;I<80;++I)c=((L>>>14|N<<18)^(L>>>18|N<<14)^(N>>>9|L<<23))>>>0,u=((L<<18|N>>>14)^(L<<14|N>>>18)^(N<<23|L>>>9))>>>0,h=(V^L&(z^V))>>>0,d=(Q^N&(H^Q))>>>0,s=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,f=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,x=(p&m|b&(p^m))>>>0,l=(y&E|R&(y^E))>>>0,_=_t+u+d+ya[I][1]+e[I][1],n=at+c+h+ya[I][0]+e[I][0]+(_/4294967296>>>0)>>>0,i=_>>>0,_=f+l,a=s+x+(_/4294967296>>>0)>>>0,o=_>>>0,at=V,_t=Q,V=z,Q=H,z=L,H=N,_=B+i,L=w+n+(_/4294967296>>>0)>>>0,N=_>>>0,w=b,B=R,b=m,R=E,m=p,E=y,_=i+o,p=n+a+(_/4294967296>>>0)>>>0,y=_>>>0;_=t[0][1]+y,t[0][0]=t[0][0]+p+(_/4294967296>>>0)>>>0,t[0][1]=_>>>0,_=t[1][1]+E,t[1][0]=t[1][0]+m+(_/4294967296>>>0)>>>0,t[1][1]=_>>>0,_=t[2][1]+R,t[2][0]=t[2][0]+b+(_/4294967296>>>0)>>>0,t[2][1]=_>>>0,_=t[3][1]+B,t[3][0]=t[3][0]+w+(_/4294967296>>>0)>>>0,t[3][1]=_>>>0,_=t[4][1]+N,t[4][0]=t[4][0]+L+(_/4294967296>>>0)>>>0,t[4][1]=_>>>0,_=t[5][1]+H,t[5][0]=t[5][0]+z+(_/4294967296>>>0)>>>0,t[5][1]=_>>>0,_=t[6][1]+Q,t[6][0]=t[6][0]+V+(_/4294967296>>>0)>>>0,t[6][1]=_>>>0,_=t[7][1]+_t,t[7][0]=t[7][0]+at+(_/4294967296>>>0)>>>0,t[7][1]=_>>>0,q-=128}}});var Pd={};gt(Pd,{aes:()=>wi,hmac:()=>en,keys:()=>Ia,pbkdf2:()=>Ta,randomBytes:()=>mr});var wi={};gt(wi,{create:()=>vc});var F=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var Oa={16:"aes-128-ctr",32:"aes-256-ctr"};function Ma(t){if(t.length===16||t.length===32)return Oa[t.length];let e=Object.entries(Oa).map(([r,n])=>`${r} (${n})`).join(" / ");throw new F(`Invalid key length ${t.length} bytes. Must be ${e}`,"ERR_INVALID_KEY_LENGTH")}var Op=Nt(Xr(),1),Ir=Nt(it(),1);function tr(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var ni={};gt(ni,{base10:()=>mf});function df(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,R=new Uint8Array(b);m!==E;){for(var w=l[m],B=0,L=b-1;(w!==0||B>>0,R[L]=w%s>>>0,w=w/s>>>0;if(w!==0)throw new Error("Non-zero carry");y=B,m++}for(var N=b-y;N!==b&&R[N]===0;)N++;for(var z=f.repeat(p);N>>0,b=new Uint8Array(E);l[p];){var R=r[l.charCodeAt(p)];if(R===255)return;for(var w=0,B=E-1;(R!==0||w>>0,b[B]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");m=w,p++}if(l[p]!==" "){for(var L=E-m;L!==E&&b[L]===0;)L++;for(var N=new Uint8Array(y+(E-L)),z=y;L!==E;)N[z++]=b[L++];return N}}}function x(l){var p=d(l);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:d,decode:x}}var pf=df,yf=pf,ts=yf;var Zd=new Uint8Array(0);var es=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var rs=t=>new TextEncoder().encode(t),ns=t=>new TextDecoder().decode(t);var jn=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ti=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return as(this,e)}},ei=class{constructor(e){this.decoders=e}or(e){return as(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},as=(t,e)=>new ei({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),ri=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new jn(e,r,n),this.decoder=new ti(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},er=({name:t,prefix:e,encode:r,decode:n})=>new ri(t,e,r,n),Ce=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=ts(r,e);return er({prefix:t,name:e,encode:n,decode:a=>he(i(a))})},xf=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},gf=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<er({prefix:e,name:t,encode(i){return gf(i,n,r)},decode(i){return xf(i,n,r,t)}});var mf=Ce({prefix:"9",name:"base10",alphabet:"0123456789"});var ii={};gt(ii,{base16:()=>vf,base16upper:()=>bf});var vf=mt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),bf=mt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ai={};gt(ai,{base2:()=>Ef});var Ef=mt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var si={};gt(si,{base256emoji:()=>Cf});var ss=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),wf=ss.reduce((t,e,r)=>(t[r]=e,t),[]),Bf=ss.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Sf(t){return t.reduce((e,r)=>(e+=wf[r],e),"")}function Af(t){let e=[];for(let r of t){let n=Bf[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Cf=er({prefix:"\u{1F680}",name:"base256emoji",encode:Sf,decode:Af});var oi={};gt(oi,{base32:()=>rr,base32hex:()=>Rf,base32hexpad:()=>Nf,base32hexpadupper:()=>Df,base32hexupper:()=>Lf,base32pad:()=>Tf,base32padupper:()=>_f,base32upper:()=>If,base32z:()=>kf});var rr=mt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),If=mt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Tf=mt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_f=mt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Rf=mt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Lf=mt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Nf=mt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Df=mt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kf=mt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var fi={};gt(fi,{base36:()=>Pf,base36upper:()=>Uf});var Pf=Ce({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Uf=Ce({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ci={};gt(ci,{base58btc:()=>Ft,base58flickr:()=>Kf});var Ft=Ce({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Kf=Ce({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var ui={};gt(ui,{base64:()=>wr,base64pad:()=>Of,base64url:()=>Mf,base64urlpad:()=>Vf});var wr=mt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Of=mt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Mf=mt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Vf=mt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hi={};gt(hi,{base8:()=>qf});var qf=mt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var li={};gt(li,{identity:()=>Ff});var Ff=er({prefix:"\0",name:"identity",encode:t=>ns(t),decode:t=>rs(t)});var cp=new TextEncoder,up=new TextDecoder;var yi={};gt(yi,{identity:()=>pi});var Gf=cs,os=128,Wf=127,Yf=~Wf,Zf=Math.pow(2,31);function cs(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Zf;)e[r++]=t&255|os,t/=128;for(;t&Yf;)e[r++]=t&255|os,t>>>=7;return e[r]=t|0,cs.bytes=r-n+1,e}var $f=di,Qf=128,fs=127;function di(t,n){var r=0,n=n||0,i=0,a=n,o,s=t.length;do{if(a>=s)throw di.bytes=0,new RangeError("Could not decode varint");o=t[a++],r+=i<28?(o&fs)<=Qf);return di.bytes=a-n,r}var Xf=Math.pow(2,7),Jf=Math.pow(2,14),jf=Math.pow(2,21),tc=Math.pow(2,28),ec=Math.pow(2,35),rc=Math.pow(2,42),nc=Math.pow(2,49),ic=Math.pow(2,56),ac=Math.pow(2,63),sc=function(t){return t[Br.decode(t,e),Br.decode.bytes],nr=(t,e,r=0)=>(Br.encode(t,e,r),e),ir=t=>Br.encodingLength(t);var Oe=(t,e)=>{let r=e.byteLength,n=ir(t),i=n+ir(r),a=new Uint8Array(i+r);return nr(t,a,0),nr(r,a,n),a.set(e,i),new ar(t,r,e,a)},us=t=>{let e=he(t),[r,n]=Sr(e),[i,a]=Sr(e.subarray(n)),o=e.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new ar(r,i,o,e)},hs=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&es(t.bytes,r.bytes)}},ar=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var ls=0,cc="identity",ds=he,uc=t=>Oe(ls,ds(t)),pi={code:ls,name:cc,encode:ds,digest:uc};var mi={};gt(mi,{sha256:()=>Mt,sha512:()=>hc});var gi=({name:t,code:e,encode:r})=>new xi(t,e,r),xi=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Oe(this.code,r):r.then(n=>Oe(this.code,n))}else throw Error("Unknown type, must be binary type")}};var ys=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Mt=gi({name:"sha2-256",code:18,encode:ys("SHA-256")}),hc=gi({name:"sha2-512",code:19,encode:ys("SHA-512")});var xs=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return dc(r,vi(t),e||Ft.encoder);default:return pc(r,vi(t),e||rr.encoder)}};var gs=new WeakMap,vi=t=>{let e=gs.get(t);if(e==null){let r=new Map;return gs.set(t,r),r}return e},jr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Cr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==yc)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Oe(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&hs(e.multihash,n.multihash)}toString(e){return xs(this,e)}toJSON(){return{"/":xs(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new t(n,i,a,o||ms(n,i,a.bytes))}else if(r[xc]===!0){let{version:n,multihash:i,code:a}=r,o=us(i);return t.create(n,a,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Cr)throw new Error(`Version 0 CID must use dag-pb (code: ${Cr}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=ms(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Cr,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=he(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new ar(r.multihashCode,r.digestSize,a,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,d]=Sr(e.subarray(r));return r+=d,h},i=n(),a=Cr;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),c=r+f,u=c-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:u,size:c}}static parse(e,r){let[n,i]=lc(e,r),a=t.decode(i);if(a.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return vi(a).set(n,e),a}},lc=(t,e)=>{switch(t[0]){case"Q":{let r=e||Ft;return[Ft.prefix,r.decode(`${Ft.prefix}${t}`)]}case Ft.prefix:{let r=e||Ft;return[Ft.prefix,r.decode(t)]}case rr.prefix:{let r=e||rr;return[rr.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},dc=(t,e,r)=>{let{prefix:n}=r;if(n!==Ft.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i},pc=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i},Cr=112,yc=18,ms=(t,e,r)=>{let n=ir(t),i=n+ir(e),a=new Uint8Array(i+r.byteLength);return nr(t,a,0),nr(e,a,n),a.set(r,i),a},xc=Symbol.for("@ipld/js-cid/CID");var bi={...li,...ai,...hi,...ni,...ii,...oi,...fi,...ci,...ui,...si},Cp={...mi,...yi};function le(t=0){return globalThis.Buffer?.allocUnsafe!=null?tr(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function bs(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var vs=bs("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ei=bs("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=le(t.length);for(let r=0;r(n.update(Ir.default.util.createBuffer(yt(i,"ascii"))),Bt(n.output.getBytes(),"ascii"))}}function ws(t,e,r){let n=Ir.default.cipher.createDecipher("AES-CTR",yt(e,"ascii"));return n.start({iv:yt(r,"ascii")}),{update:i=>(n.update(Ir.default.util.createBuffer(yt(i,"ascii"))),Bt(n.output.getBytes(),"ascii"))}}async function vc(t,e){let r=Ma(t),n=Es(r,t,e),i=ws(r,t,e);return{async encrypt(o){return n.update(o)},async decrypt(o){return i.update(o)}}}var en={};gt(en,{create:()=>Bi});var Et={get(t=globalThis){let e=t.crypto;if(e==null||e.subtle==null)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}};var Bs={SHA1:20,SHA256:32,SHA512:64};var bc={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"},Ec=async(t,e)=>{let r=await Et.get().subtle.sign({name:"HMAC"},t,e);return new Uint8Array(r,0,r.byteLength)};async function Bi(t,e){let r=bc[t],n=await Et.get().subtle.importKey("raw",e,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{async digest(i){return Ec(n,i)},length:Bs[t]}}var Ia={};gt(Ia,{generateEphemeralKeyPair:()=>c0,generateKeyPair:()=>_d,generateKeyPairFromSeed:()=>Rd,importKey:()=>kd,keyStretcher:()=>l0,keysPBM:()=>xr,marshalPrivateKey:()=>Dd,marshalPublicKey:()=>Nd,supportedKeys:()=>ce,unmarshalPrivateKey:()=>q0,unmarshalPublicKey:()=>Ld});var ux=Nt(Rr(),1),hx=Nt(Ao(),1);var Vn=Nt(it(),1);var la={};gt(la,{Ed25519PrivateKey:()=>Ze,Ed25519PublicKey:()=>Mr,generateKeyPair:()=>jl,generateKeyPairFromSeed:()=>ha,unmarshalEd25519PrivateKey:()=>Xl,unmarshalEd25519PublicKey:()=>Jl});function Zt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Io(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Co(t.outputLen),Co(t.blockLen)}function fr(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function To(t,e){Pi(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var mn=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),$t=(t,e)=>t<<32-e|t>>>e,Mh=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Mh)throw new Error("Non little-endian hardware is not supported");function Ui(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Dr(t){if(typeof t=="string"&&(t=Ui(t)),!_o(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function vn(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!_o(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var cr=class{clone(){return this._cloneInto()}},y1={}.toString;function bn(t){let e=n=>t().update(Dr(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function ur(t=32){if(gn&&typeof gn.getRandomValues=="function")return gn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function Vh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),a=BigInt(4294967295),o=Number(r>>i&a),s=Number(r&a),f=n?4:0,c=n?0:4;t.setUint32(e+f,o,n),t.setUint32(e+c,s,n)}var hr=class extends cr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=mn(this.buffer)}update(e){fr(this);let{view:r,buffer:n,blockLen:i}=this;e=Dr(e);let a=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>Ki&En)}:{h:Number(t>>Ki&En)|0,l:Number(t&En)|0}}function qh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),Hh=(t,e,r)=>t>>>r,zh=(t,e,r)=>t<<32-r|e>>>r,Gh=(t,e,r)=>t>>>r|e<<32-r,Wh=(t,e,r)=>t<<32-r|e>>>r,Yh=(t,e,r)=>t<<64-r|e>>>r-32,Zh=(t,e,r)=>t>>>r-32|e<<64-r,$h=(t,e)=>e,Qh=(t,e)=>t,Xh=(t,e,r)=>t<>>32-r,Jh=(t,e,r)=>e<>>32-r,jh=(t,e,r)=>e<>>64-r,tl=(t,e,r)=>t<>>64-r;function el(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var rl=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),nl=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,il=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),al=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,sl=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),ol=(t,e,r,n,i,a)=>e+r+n+i+a+(t/2**32|0)|0;var fl={fromBig:Ro,split:qh,toBig:Fh,shrSH:Hh,shrSL:zh,rotrSH:Gh,rotrSL:Wh,rotrBH:Yh,rotrBL:Zh,rotr32H:$h,rotr32L:Qh,rotlSH:Xh,rotlSL:Jh,rotlBH:jh,rotlBL:tl,add:el,add3L:rl,add3H:nl,add4L:il,add4H:al,add5H:ol,add5L:sl},Y=fl;var[cl,ul]=Y.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),_e=new Uint32Array(80),Re=new Uint32Array(80),Oi=class extends hr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:a,Cl:o,Dh:s,Dl:f,Eh:c,El:u,Fh:h,Fl:d,Gh:x,Gl:l,Hh:p,Hl:y}=this;return[e,r,n,i,a,o,s,f,c,u,h,d,x,l,p,y]}set(e,r,n,i,a,o,s,f,c,u,h,d,x,l,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=a|0,this.Cl=o|0,this.Dh=s|0,this.Dl=f|0,this.Eh=c|0,this.El=u|0,this.Fh=h|0,this.Fl=d|0,this.Gh=x|0,this.Gl=l|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let b=0;b<16;b++,r+=4)_e[b]=e.getUint32(r),Re[b]=e.getUint32(r+=4);for(let b=16;b<80;b++){let R=_e[b-15]|0,w=Re[b-15]|0,B=Y.rotrSH(R,w,1)^Y.rotrSH(R,w,8)^Y.shrSH(R,w,7),L=Y.rotrSL(R,w,1)^Y.rotrSL(R,w,8)^Y.shrSL(R,w,7),N=_e[b-2]|0,z=Re[b-2]|0,H=Y.rotrSH(N,z,19)^Y.rotrBH(N,z,61)^Y.shrSH(N,z,6),V=Y.rotrSL(N,z,19)^Y.rotrBL(N,z,61)^Y.shrSL(N,z,6),Q=Y.add4L(L,V,Re[b-7],Re[b-16]),at=Y.add4H(Q,B,H,_e[b-7],_e[b-16]);_e[b]=at|0,Re[b]=Q|0}let{Ah:n,Al:i,Bh:a,Bl:o,Ch:s,Cl:f,Dh:c,Dl:u,Eh:h,El:d,Fh:x,Fl:l,Gh:p,Gl:y,Hh:m,Hl:E}=this;for(let b=0;b<80;b++){let R=Y.rotrSH(h,d,14)^Y.rotrSH(h,d,18)^Y.rotrBH(h,d,41),w=Y.rotrSL(h,d,14)^Y.rotrSL(h,d,18)^Y.rotrBL(h,d,41),B=h&x^~h&p,L=d&l^~d&y,N=Y.add5L(E,w,L,ul[b],Re[b]),z=Y.add5H(N,m,R,B,cl[b],_e[b]),H=N|0,V=Y.rotrSH(n,i,28)^Y.rotrBH(n,i,34)^Y.rotrBH(n,i,39),Q=Y.rotrSL(n,i,28)^Y.rotrBL(n,i,34)^Y.rotrBL(n,i,39),at=n&a^n&s^a&s,_t=i&o^i&f^o&f;m=p|0,E=y|0,p=x|0,y=l|0,x=h|0,l=d|0,{h,l:d}=Y.add(c|0,u|0,z|0,H|0),c=s|0,u=f|0,s=a|0,f=o|0,a=n|0,o=i|0;let I=Y.add3L(H,Q,_t);n=Y.add3H(I,z,V,at),i=I|0}({h:n,l:i}=Y.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:a,l:o}=Y.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:s,l:f}=Y.add(this.Ch|0,this.Cl|0,s|0,f|0),{h:c,l:u}=Y.add(this.Dh|0,this.Dl|0,c|0,u|0),{h,l:d}=Y.add(this.Eh|0,this.El|0,h|0,d|0),{h:x,l}=Y.add(this.Fh|0,this.Fl|0,x|0,l|0),{h:p,l:y}=Y.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:m,l:E}=Y.add(this.Hh|0,this.Hl|0,m|0,E|0),this.set(n,i,a,o,s,f,c,u,h,d,x,l,p,y,m,E)}roundClean(){_e.fill(0),Re.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Mi=bn(()=>new Oi);var Sn={};gt(Sn,{bitGet:()=>gl,bitLen:()=>xl,bitMask:()=>kr,bitSet:()=>ml,bytesToHex:()=>xe,bytesToNumberBE:()=>ge,bytesToNumberLE:()=>Le,concatBytes:()=>me,createHmacDrbg:()=>Fi,ensureBytes:()=>vt,equalBytes:()=>pl,hexToBytes:()=>He,hexToNumber:()=>qi,numberToBytesBE:()=>Ne,numberToBytesLE:()=>ze,numberToHexUnpadded:()=>Do,numberToVarBytesBE:()=>dl,utf8ToBytes:()=>yl,validateObject:()=>oe});var No=BigInt(0),wn=BigInt(1),hl=BigInt(2),Bn=t=>t instanceof Uint8Array,ll=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function xe(t){if(!Bn(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!Bn(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function pl(t,e){if(t.length!==e.length)return!1;for(let r=0;rNo;t>>=wn,e+=1);return e}function gl(t,e){return t>>BigInt(e)&wn}var ml=(t,e,r)=>t|(r?wn:No)<(hl<new Uint8Array(t),Lo=t=>Uint8Array.from(t);function Fi(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Vi(t),i=Vi(t),a=0,o=()=>{n.fill(1),i.fill(0),a=0},s=(...h)=>r(i,n,...h),f=(h=Vi())=>{i=s(Lo([0]),h),n=s(),h.length!==0&&(i=s(Lo([1]),h),n=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,d=[];for(;h{o(),f(h);let x;for(;!(x=d(c()));)f();return o(),x}}var vl={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function oe(t,e,r={}){let n=(i,a,o)=>{let s=vl[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);let f=t[i];if(!(o&&f===void 0)&&!s(f,t))throw new Error(`Invalid param ${String(i)}=${f} (${typeof f}), expected ${a}`)};for(let[i,a]of Object.entries(e))n(i,a,!1);for(let[i,a]of Object.entries(r))n(i,a,!0);return t}var At=BigInt(0),dt=BigInt(1),Ge=BigInt(2),bl=BigInt(3),Hi=BigInt(4),ko=BigInt(5),Po=BigInt(8),El=BigInt(9),wl=BigInt(16);function st(t,e){let r=t%e;return r>=At?r:e+r}function Bl(t,e,r){if(r<=At||e 0");if(r===dt)return At;let n=dt;for(;e>At;)e&dt&&(n=n*t%r),t=t*t%r,e>>=dt;return n}function pt(t,e,r){let n=t;for(;e-- >At;)n*=n,n%=r;return n}function An(t,e){if(t===At||e<=At)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=st(t,e),n=e,i=At,a=dt,o=dt,s=At;for(;r!==At;){let c=n/r,u=n%r,h=i-o*c,d=a-s*c;n=r,r=u,i=o,a=s,o=h,s=d}if(n!==dt)throw new Error("invert: does not exist");return st(i,e)}function Sl(t){let e=(t-dt)/Ge,r,n,i;for(r=t-dt,n=0;r%Ge===At;r/=Ge,n++);for(i=Ge;i(st(t,e)&dt)===dt,Cl=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zi(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Cl.reduce((n,i)=>(n[i]="function",n),e);return oe(t,r)}function Il(t,e,r){if(r 0");if(r===At)return t.ONE;if(r===dt)return e;let n=t.ONE,i=e;for(;r>At;)r&dt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=dt;return n}function Tl(t,e){let r=new Array(e.length),n=e.reduce((a,o,s)=>t.is0(o)?a:(r[s]=a,t.mul(a,o)),t.ONE),i=t.inv(n);return e.reduceRight((a,o,s)=>t.is0(o)?a:(r[s]=t.mul(a,r[s]),t.mul(a,o)),i),r}function Gi(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Cn(t,e,r=!1,n={}){if(t<=At)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:a}=Gi(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Al(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:kr(i),ZERO:At,ONE:dt,create:f=>st(f,t),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return At<=f&&ff===At,isOdd:f=>(f&dt)===dt,neg:f=>st(-f,t),eql:(f,c)=>f===c,sqr:f=>st(f*f,t),add:(f,c)=>st(f+c,t),sub:(f,c)=>st(f-c,t),mul:(f,c)=>st(f*c,t),pow:(f,c)=>Il(s,f,c),div:(f,c)=>st(f*An(c,t),t),sqrN:f=>f*f,addN:(f,c)=>f+c,subN:(f,c)=>f-c,mulN:(f,c)=>f*c,inv:f=>An(f,t),sqrt:n.sqrt||(f=>o(s,f)),invertBatch:f=>Tl(s,f),cmov:(f,c,u)=>u?c:f,toBytes:f=>r?ze(f,a):Ne(f,a),fromBytes:f=>{if(f.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${f.length}`);return r?Le(f):ge(f)}});return Object.freeze(s)}function Ko(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Oo(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Wi(t){let e=Oo(t);return e+Math.ceil(e/2)}function Mo(t,e,r=!1){let n=t.length,i=Oo(e),a=Wi(e);if(n<16||n1024)throw new Error(`expected ${a}-1024 bytes of input, got ${n}`);let o=r?ge(t):Le(t),s=st(o,e-dt)+dt;return r?ze(s,i):Ne(s,i)}var Rl=BigInt(0),Yi=BigInt(1);function In(t,e){let r=(i,a)=>{let o=a.negate();return i?o:a},n=i=>{let a=Math.ceil(e/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,a){let o=t.ZERO,s=i;for(;a>Rl;)a&Yi&&(o=o.add(s)),s=s.double(),a>>=Yi;return o},precomputeWindow(i,a){let{windows:o,windowSize:s}=n(a),f=[],c=i,u=c;for(let h=0;h>=x,y>f&&(y-=d,o+=Yi);let m=p,E=p+Math.abs(y)-1,b=l%2!==0,R=y<0;y===0?u=u.add(r(b,a[m])):c=c.add(r(R,a[E]))}return{p:c,f:u}},wNAFCached(i,a,o,s){let f=i._WINDOW_SIZE||1,c=a.get(i);return c||(c=this.precomputeWindow(i,f),f!==1&&a.set(i,s(c))),this.wNAF(f,c,o)}}}function Pr(t){return zi(t.Fp),oe(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Gi(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var Qt=BigInt(0),Vt=BigInt(1),Tn=BigInt(2),Ll=BigInt(8),Nl={zip215:!0};function Dl(t){let e=Pr(t);return oe(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function _n(t){let e=Dl(t),{Fp:r,n,prehash:i,hash:a,randomBytes:o,nByteLength:s,h:f}=e,c=Tn<{try{return{isValid:!0,value:r.sqrt(D*r.inv(A))}}catch{return{isValid:!1,value:Qt}}}),d=e.adjustScalarBytes||(D=>D),x=e.domain||((D,A,K)=>{if(A.length||K)throw new Error("Contexts/pre-hash are not supported");return D}),l=D=>typeof D=="bigint"&&Qtl(D)&&l(A)&&DD===Qt||p(D,c);function m(D,A){if(p(D,A))return D;throw new Error(`Expected valid scalar < ${A}, got ${typeof D} ${D}`)}function E(D){return D===Qt?D:m(D,n)}let b=new Map;function R(D){if(!(D instanceof w))throw new Error("ExtendedPoint expected")}class w{constructor(A,K,O,q){if(this.ex=A,this.ey=K,this.ez=O,this.et=q,!y(A))throw new Error("x required");if(!y(K))throw new Error("y required");if(!y(O))throw new Error("z required");if(!y(q))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(A){if(A instanceof w)throw new Error("extended point not allowed");let{x:K,y:O}=A||{};if(!y(K)||!y(O))throw new Error("invalid affine point");return new w(K,O,Vt,u(K*O))}static normalizeZ(A){let K=r.invertBatch(A.map(O=>O.ez));return A.map((O,q)=>O.toAffine(K[q])).map(w.fromAffine)}_setWindowSize(A){this._WINDOW_SIZE=A,b.delete(this)}assertValidity(){let{a:A,d:K}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:O,ey:q,ez:Z,et:X}=this,nt=u(O*O),J=u(q*q),et=u(Z*Z),wt=u(et*et),xt=u(nt*A),Rt=u(et*u(xt+J)),Lt=u(wt+u(K*u(nt*J)));if(Rt!==Lt)throw new Error("bad point: equation left != right (1)");let St=u(O*q),Dt=u(Z*X);if(St!==Dt)throw new Error("bad point: equation left != right (2)")}equals(A){R(A);let{ex:K,ey:O,ez:q}=this,{ex:Z,ey:X,ez:nt}=A,J=u(K*nt),et=u(Z*q),wt=u(O*nt),xt=u(X*q);return J===et&&wt===xt}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:A}=e,{ex:K,ey:O,ez:q}=this,Z=u(K*K),X=u(O*O),nt=u(Tn*u(q*q)),J=u(A*Z),et=K+O,wt=u(u(et*et)-Z-X),xt=J+X,Rt=xt-nt,Lt=J-X,St=u(wt*Rt),Dt=u(xt*Lt),ue=u(wt*Lt),Ue=u(Rt*xt);return new w(St,Dt,Ue,ue)}add(A){R(A);let{a:K,d:O}=e,{ex:q,ey:Z,ez:X,et:nt}=this,{ex:J,ey:et,ez:wt,et:xt}=A;if(K===BigInt(-1)){let Ra=u((Z-q)*(et+J)),La=u((Z+q)*(et-J)),qn=u(La-Ra);if(qn===Qt)return this.double();let Na=u(X*Tn*xt),Da=u(nt*Tn*wt),ka=Da+Na,Pa=La+Ra,Ua=Da-Na,$0=u(ka*qn),Q0=u(Pa*Ua),X0=u(ka*Ua),J0=u(qn*Pa);return new w($0,Q0,J0,X0)}let Rt=u(q*J),Lt=u(Z*et),St=u(nt*O*xt),Dt=u(X*wt),ue=u((q+Z)*(J+et)-Rt-Lt),Ue=Dt-St,br=Dt+St,_a=u(Lt-K*Rt),G0=u(ue*Ue),W0=u(br*_a),Y0=u(ue*_a),Z0=u(Ue*br);return new w(G0,W0,Z0,Y0)}subtract(A){return this.add(A.negate())}wNAF(A){return N.wNAFCached(this,b,A,w.normalizeZ)}multiply(A){let{p:K,f:O}=this.wNAF(m(A,n));return w.normalizeZ([K,O])[0]}multiplyUnsafe(A){let K=E(A);return K===Qt?L:this.equals(L)||K===Vt?this:this.equals(B)?this.wNAF(K).p:N.unsafeLadder(this,K)}isSmallOrder(){return this.multiplyUnsafe(f).is0()}isTorsionFree(){return N.unsafeLadder(this,n).is0()}toAffine(A){let{ex:K,ey:O,ez:q}=this,Z=this.is0();A==null&&(A=Z?Ll:r.inv(q));let X=u(K*A),nt=u(O*A),J=u(q*A);if(Z)return{x:Qt,y:Vt};if(J!==Vt)throw new Error("invZ was invalid");return{x:X,y:nt}}clearCofactor(){let{h:A}=e;return A===Vt?this:this.multiplyUnsafe(A)}static fromHex(A,K=!1){let{d:O,a:q}=e,Z=r.BYTES;A=vt("pointHex",A,Z);let X=A.slice(),nt=A[Z-1];X[Z-1]=nt&-129;let J=Le(X);J===Qt||(K?m(J,c):m(J,r.ORDER));let et=u(J*J),wt=u(et-Vt),xt=u(O*et-q),{isValid:Rt,value:Lt}=h(wt,xt);if(!Rt)throw new Error("Point.fromHex: invalid y coordinate");let St=(Lt&Vt)===Vt,Dt=(nt&128)!==0;if(!K&&Lt===Qt&&Dt)throw new Error("Point.fromHex: x=0 and x_0=1");return Dt!==St&&(Lt=u(-Lt)),w.fromAffine({x:Lt,y:J})}static fromPrivateKey(A){return V(A).point}toRawBytes(){let{x:A,y:K}=this.toAffine(),O=ze(K,r.BYTES);return O[O.length-1]|=A&Vt?128:0,O}toHex(){return xe(this.toRawBytes())}}w.BASE=new w(e.Gx,e.Gy,Vt,u(e.Gx*e.Gy)),w.ZERO=new w(Qt,Vt,Vt,Qt);let{BASE:B,ZERO:L}=w,N=In(w,s*8);function z(D){return st(D,n)}function H(D){return z(Le(D))}function V(D){let A=s;D=vt("private key",D,A);let K=vt("hashed private key",a(D),2*A),O=d(K.slice(0,A)),q=K.slice(A,2*A),Z=H(O),X=B.multiply(Z),nt=X.toRawBytes();return{head:O,prefix:q,scalar:Z,point:X,pointBytes:nt}}function Q(D){return V(D).pointBytes}function at(D=new Uint8Array,...A){let K=me(...A);return H(a(x(K,vt("context",D),!!i)))}function _t(D,A,K={}){D=vt("message",D),i&&(D=i(D));let{prefix:O,scalar:q,pointBytes:Z}=V(A),X=at(K.context,O,D),nt=B.multiply(X).toRawBytes(),J=at(K.context,nt,Z,D),et=z(X+J*q);E(et);let wt=me(nt,ze(et,r.BYTES));return vt("result",wt,s*2)}let I=Nl;function k(D,A,K,O=I){let{context:q,zip215:Z}=O,X=r.BYTES;D=vt("signature",D,2*X),A=vt("message",A),i&&(A=i(A));let nt=Le(D.slice(X,2*X)),J,et,wt;try{J=w.fromHex(K,Z),et=w.fromHex(D.slice(0,X),Z),wt=B.multiplyUnsafe(nt)}catch{return!1}if(!Z&&J.isSmallOrder())return!1;let xt=at(q,et.toRawBytes(),J.toRawBytes(),A);return et.add(J.multiplyUnsafe(xt)).subtract(wt).clearCofactor().equals(w.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:Q,sign:_t,verify:k,ExtendedPoint:w,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>o(r.BYTES),precompute(D=8,A=w.BASE){return A._setWindowSize(D),A.multiply(BigInt(3)),A}}}}var $i=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Vo=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),K1=BigInt(0),kl=BigInt(1),Zi=BigInt(2),Pl=BigInt(5),qo=BigInt(10),Ul=BigInt(20),Kl=BigInt(40),Fo=BigInt(80);function Ol(t){let e=$i,n=t*t%e*t%e,i=pt(n,Zi,e)*n%e,a=pt(i,kl,e)*t%e,o=pt(a,Pl,e)*a%e,s=pt(o,qo,e)*o%e,f=pt(s,Ul,e)*s%e,c=pt(f,Kl,e)*f%e,u=pt(c,Fo,e)*c%e,h=pt(u,Fo,e)*c%e,d=pt(h,qo,e)*o%e;return{pow_p_5_8:pt(d,Zi,e)*t%e,b2:n}}function Ml(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Vl(t,e){let r=$i,n=st(e*e*e,r),i=st(n*n*e,r),a=Ol(t*i).pow_p_5_8,o=st(t*n*a,r),s=st(e*o*o,r),f=o,c=st(o*Vo,r),u=s===t,h=s===st(-t,r),d=s===st(-t*Vo,r);return u&&(o=f),(h||d)&&(o=c),Uo(o,r)&&(o=st(-o,r)),{isValid:u||h,value:o}}var ve=Cn($i,void 0,!0),Qi={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:ve,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Mi,randomBytes:ur,adjustScalarBytes:Ml,uvRatio:Vl},lr=_n(Qi);function Ho(t,e,r){if(e.length>255)throw new Error("Context is too big");return vn(Ui("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var O1=_n({...Qi,domain:Ho}),M1=_n({...Qi,domain:Ho,prehash:Mi});var ql=(ve.ORDER+BigInt(3))/BigInt(8),V1=ve.pow(Zi,ql),q1=ve.sqrt(ve.neg(ve.ONE)),F1=(ve.ORDER-BigInt(5))/BigInt(8),H1=BigInt(486662);var z1=Ko(ve,ve.neg(BigInt(486664)));var G1=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),W1=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Y1=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Z1=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var $1=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var dr=32,be=64,Rn=32;async function zo(){let t=lr.utils.randomPrivateKey(),e=lr.getPublicKey(t);return{privateKey:Zo(t,e),publicKey:e}}async function Go(t){if(t.length!==Rn)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=lr.getPublicKey(e);return{privateKey:Zo(e,r),publicKey:r}}async function Wo(t,e){let r=t.subarray(0,Rn);return lr.sign(e instanceof Uint8Array?e:e.subarray(),r)}async function Yo(t,e,r){return lr.verify(e,r instanceof Uint8Array?r:r.subarray(),t)}function Zo(t,e){let r=new Uint8Array(be);for(let n=0;ni+a.length,0));let r=le(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return tr(r)}var Xi={alg:"A128GCM",ext:!0,k:"scm9jmO_4BJAgdwWGVulLg",key_ops:["encrypt","decrypt"],kty:"oct"};function Ln(t){let e=t?.algorithm??"AES-GCM",r=t?.keyLength??16,n=t?.nonceLength??12,i=t?.digest??"SHA-256",a=t?.saltLength??16,o=t?.iterations??32767,s=Et.get();r*=8;async function f(h,d){let x=s.getRandomValues(new Uint8Array(a)),l=s.getRandomValues(new Uint8Array(n)),p={name:e,iv:l};typeof d=="string"&&(d=Bt(d));let y;if(d.length===0){y=await s.subtle.importKey("jwk",Xi,{name:"AES-GCM"},!0,["encrypt"]);try{let E={name:"PBKDF2",salt:x,iterations:o,hash:{name:i}},b=await s.subtle.importKey("raw",d,{name:"PBKDF2"},!1,["deriveKey"]);y=await s.subtle.deriveKey(E,b,{name:e,length:r},!0,["encrypt"])}catch{y=await s.subtle.importKey("jwk",Xi,{name:"AES-GCM"},!0,["encrypt"])}}else{let E={name:"PBKDF2",salt:x,iterations:o,hash:{name:i}},b=await s.subtle.importKey("raw",d,{name:"PBKDF2"},!1,["deriveKey"]);y=await s.subtle.deriveKey(E,b,{name:e,length:r},!0,["encrypt"])}let m=await s.subtle.encrypt(p,y,h);return fe([x,p.iv,new Uint8Array(m)])}async function c(h,d){let x=h.subarray(0,a),l=h.subarray(a,a+n),p=h.subarray(a+n),y={name:e,iv:l};typeof d=="string"&&(d=Bt(d));let m;if(d.length===0)try{let b={name:"PBKDF2",salt:x,iterations:o,hash:{name:i}},R=await s.subtle.importKey("raw",d,{name:"PBKDF2"},!1,["deriveKey"]);m=await s.subtle.deriveKey(b,R,{name:e,length:r},!0,["decrypt"])}catch{m=await s.subtle.importKey("jwk",Xi,{name:"AES-GCM"},!0,["decrypt"])}else{let b={name:"PBKDF2",salt:x,iterations:o,hash:{name:i}},R=await s.subtle.importKey("raw",d,{name:"PBKDF2"},!1,["deriveKey"]);m=await s.subtle.deriveKey(b,R,{name:e,length:r},!0,["decrypt"])}let E=await s.subtle.decrypt(y,m,p);return new Uint8Array(E)}return{encrypt:f,decrypt:c}}async function pr(t,e){let n=await Ln().encrypt(t,e);return wr.encode(n)}var xr={};gt(xr,{KeyType:()=>ut,PrivateKey:()=>jt,PublicKey:()=>Jt});var Ji=new Float32Array([-0]),De=new Uint8Array(Ji.buffer);function Qo(t,e,r){Ji[0]=t,e[r]=De[0],e[r+1]=De[1],e[r+2]=De[2],e[r+3]=De[3]}function Xo(t,e){return De[0]=t[e],De[1]=t[e+1],De[2]=t[e+2],De[3]=t[e+3],Ji[0]}var ji=new Float64Array([-0]),kt=new Uint8Array(ji.buffer);function Jo(t,e,r){ji[0]=t,e[r]=kt[0],e[r+1]=kt[1],e[r+2]=kt[2],e[r+3]=kt[3],e[r+4]=kt[4],e[r+5]=kt[5],e[r+6]=kt[6],e[r+7]=kt[7]}function jo(t,e){return kt[0]=t[e],kt[1]=t[e+1],kt[2]=t[e+2],kt[3]=t[e+3],kt[4]=t[e+4],kt[5]=t[e+5],kt[6]=t[e+6],kt[7]=t[e+7],ji[0]}var Hl=BigInt(Number.MAX_SAFE_INTEGER),zl=BigInt(Number.MIN_SAFE_INTEGER),Ot=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return We;if(ezl)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>t0&&(i=0n,++n>t0&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return We;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):We}},We=new Ot(0,0);We.toBigInt=function(){return 0n};We.zzEncode=We.zzDecode=function(){return this};We.length=function(){return 1};var t0=4294967296n;function e0(t){let e=0,r=0;for(let n=0;n191&&s<224?a[o++]=(s&31)<<6|t[e++]&63:s>239&&s<365?(s=((s&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,a[o++]=55296+(s>>10),a[o++]=56320+(s&1023)):a[o++]=(s&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))}function ta(t,e,r){let n=r,i,a;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((a=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function Xt(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Nn(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var ea=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Xt(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Xt(this,4);return Nn(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Xt(this,4);return Nn(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Xt(this,4);let e=Xo(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Xt(this,4);let e=jo(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Xt(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return r0(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Xt(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Xt(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Ot(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Xt(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Xt(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Xt(this,8);let e=Nn(this.buf,this.pos+=4),r=Nn(this.buf,this.pos+=4);return new Ot(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function ra(t){return new ea(t instanceof Uint8Array?t:t.subarray())}function Dn(t,e){let r=ra(t);return e.decode(r)}function na(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return le(o);i+o>e&&(n=le(e),i=0);let s=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),s}}var Ye=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function ia(){}var sa=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Gl=na();function Wl(t){return globalThis.Buffer!=null?le(t):Gl(t)}var Or=class{len;head;tail;states;constructor(){this.len=0,this.head=new Ye(ia,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new Ye(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new oa((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Ur,10,Ot.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Ot.fromBigInt(e);return this._push(Ur,r.length(),r)}uint64Number(e){let r=Ot.fromNumber(e);return this._push(Ur,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Ot.fromBigInt(e).zzEncode();return this._push(Ur,r.length(),r)}sint64Number(e){let r=Ot.fromNumber(e).zzEncode();return this._push(Ur,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(aa,1,e?1:0)}fixed32(e){return this._push(Kr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Ot.fromBigInt(e);return this._push(Kr,4,r.lo)._push(Kr,4,r.hi)}fixed64Number(e){let r=Ot.fromNumber(e);return this._push(Kr,4,r.lo)._push(Kr,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(Qo,4,e)}double(e){return this._push(Jo,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(aa,1,0):this.uint32(r)._push(Zl,r,e)}string(e){let r=e0(e);return r!==0?this.uint32(r)._push(ta,r,e):this._push(aa,1,0)}fork(){return this.states=new sa(this),this.head=this.tail=new Ye(ia,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Ye(ia,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Wl(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function aa(t,e,r){e[r]=t&255}function Yl(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var oa=class extends Ye{next;constructor(e,r){super(Yl,e,r),this.next=void 0}};function Ur(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Kr(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Zl(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Or.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push($l,e,t),this},Or.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Ql,e,t),this});function $l(t,e,r){e.set(t,r)}function Ql(t,e,r){t.length<40?ta(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Bt(t),r)}function fa(){return new Or}function kn(t,e){let r=fa();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var yr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(yr||(yr={}));function Pn(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function ca(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(a,o){let s=e(a);o.int32(s)},n=function(a){let o=a.int32();return e(o)};return Pn("enum",yr.VARINT,r,n)}function Un(t,e){return Pn("message",yr.LENGTH_DELIMITED,t,e)}var ut;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(ut||(ut={}));var ua;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(ua||(ua={}));(function(t){t.codec=()=>ca(ua)})(ut||(ut={}));var Jt;(function(t){let e;t.codec=()=>(e==null&&(e=Un((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),ut.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=ut.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>kn(r,t.codec()),t.decode=r=>Dn(r,t.codec())})(Jt||(Jt={}));var jt;(function(t){let e;t.codec=()=>(e==null&&(e=Un((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),ut.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=ut.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>kn(r,t.codec()),t.decode=r=>Dn(r,t.codec())})(jt||(jt={}));var Mr=class{_key;constructor(e){this._key=gr(e,dr)}async verify(e,r){return Yo(this._key,r,e)}marshal(){return this._key}get bytes(){return Jt.encode({Type:ut.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Zt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Mt.digest(this.bytes);return e}},Ze=class{_key;_publicKey;constructor(e,r){this._key=gr(e,be),this._publicKey=gr(r,dr)}async sign(e){return Wo(this._key,e)}get public(){return new Mr(this._publicKey)}marshal(){return this._key}get bytes(){return jt.encode({Type:ut.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Zt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Mt.digest(this.bytes);return e}async id(){let e=pi.digest(this.public.bytes);return Ft.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return pr(this.bytes,e);throw new F(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Xl(t){if(t.length>be){t=gr(t,be+dr);let n=t.subarray(0,be),i=t.subarray(be,t.length);return new Ze(n,i)}t=gr(t,be);let e=t.subarray(0,be),r=t.subarray(dr);return new Ze(e,r)}function Jl(t){return t=gr(t,dr),new Mr(t)}async function jl(){let{privateKey:t,publicKey:e}=await zo();return new Ze(t,e)}async function ha(t){let{privateKey:e,publicKey:r}=await Go(t);return new Ze(e,r)}function gr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new F(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}var Fy=Nt(bt(),1),Hy=Nt(dn(),1),i0=Nt(it(),1);function te(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=fe([new Uint8Array(e-r.length),r])}return yt(r,"base64url")}function qt(t){let e=Kn(t);return new i0.default.jsbn.BigInteger(yt(e,"base16"),16)}function Kn(t,e){let r=Bt(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=fe([new Uint8Array(e-r.length),r])}return r}var a0={"P-256":256,"P-384":384,"P-521":521},td=Object.keys(a0),da=td.join(" / ");async function s0(t){if(t!=="P-256"&&t!=="P-384"&&t!=="P-521")throw new F(`Unknown curve: ${t}. Must be ${da}`,"ERR_INVALID_CURVE");let e=await Et.get().subtle.generateKey({name:"ECDH",namedCurve:t},!0,["deriveBits"]),r=async(a,o)=>{let s;o!=null?s=await Et.get().subtle.importKey("jwk",rd(t,o),{name:"ECDH",namedCurve:t},!1,["deriveBits"]):s=e.privateKey;let f=await Et.get().subtle.importKey("jwk",f0(t,a),{name:"ECDH",namedCurve:t},!1,[]),c=await Et.get().subtle.deriveBits({name:"ECDH",namedCurve:t,public:f},s,a0[t]);return new Uint8Array(c,0,c.byteLength)},n=await Et.get().subtle.exportKey("jwk",e.publicKey);return{key:ed(n),genSharedKey:r}}var o0={"P-256":32,"P-384":48,"P-521":66};function ed(t){if(t.crv==null||t.x==null||t.y==null)throw new F("JWK was missing components","ERR_INVALID_PARAMETERS");if(t.crv!=="P-256"&&t.crv!=="P-384"&&t.crv!=="P-521")throw new F(`Unknown curve: ${t.crv}. Must be ${da}`,"ERR_INVALID_CURVE");let e=o0[t.crv];return fe([Uint8Array.from([4]),Kn(t.x,e),Kn(t.y,e)],1+e*2)}function f0(t,e){if(t!=="P-256"&&t!=="P-384"&&t!=="P-521")throw new F(`Unknown curve: ${t}. Must be ${da}`,"ERR_INVALID_CURVE");let r=o0[t];if(!Zt(e.subarray(0,1),Uint8Array.from([4])))throw new F("Cannot unmarshal public key - invalid key format","ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:t,x:yt(e.subarray(1,r+1),"base64url"),y:yt(e.subarray(1+r),"base64url"),ext:!0}}var rd=(t,e)=>({...f0(t,e.public),d:yt(e.private,"base64url")});var c0=s0;async function u0(t,e){let r=wr.decode(t);return Ln().decrypt(r,e)}var h0={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,keySize:32}};async function l0(t,e,r){let n=h0[t];if(n==null){let E=Object.keys(h0).join(" / ");throw new F(`unknown cipher type '${t}'. Must be ${E}`,"ERR_INVALID_CIPHER_TYPE")}if(e==null)throw new F("missing hash type","ERR_MISSING_HASH_TYPE");let i=n.keySize,a=n.ivSize,o=20,s=Bt("key expansion"),f=2*(a+i+o),c=await Bi(e,r),u=await c.digest(s),h=[],d=0;for(;df&&(b=f-d),h.push(E),d+=b,u=await c.digest(u)}let x=f/2,l=fe(h),p=l.subarray(0,x),y=l.subarray(x,f),m=E=>({iv:E.subarray(0,a),cipherKey:E.subarray(a,a+i),macKey:E.subarray(a+i)});return{k1:m(p),k2:m(y)}}var ma={};gt(ma,{MAX_KEY_SIZE:()=>Hr,RsaPrivateKey:()=>vr,RsaPublicKey:()=>Fr,fromJwk:()=>ld,generateKeyPair:()=>dd,unmarshalRsaPrivateKey:()=>ud,unmarshalRsaPublicKey:()=>hd});var qr=Nt(it(),1);var L2=Nt(g0(),1);function mr(t){if(isNaN(t)||t<=0)throw new F("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return ur(t)}var d2=Nt(xn(),1),xa=Nt(it(),1);function m0(t,e){return e.map(r=>qt(t[r]))}function v0(t){return xa.default.pki.setRsaPrivateKey(...m0(t,["n","e","d","p","q","dp","dq","qi"]))}function b0(t){return xa.default.pki.setRsaPublicKey(...m0(t,["n","e"]))}var Qe={};gt(Qe,{jwkToPkcs1:()=>ad,jwkToPkix:()=>od,pkcs1ToJwk:()=>id,pkixToJwk:()=>sd});var x2=Nt(Rr(),1),g2=Nt(xn(),1);var Ee=Nt(it(),1);function id(t){let e=Ee.default.asn1.fromDer(yt(t,"ascii")),r=Ee.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:te(r.n),e:te(r.e),d:te(r.d),p:te(r.p),q:te(r.q),dp:te(r.dP),dq:te(r.dQ),qi:te(r.qInv),alg:"RS256"}}function ad(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new F("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ee.default.pki.privateKeyToAsn1({n:qt(t.n),e:qt(t.e),d:qt(t.d),p:qt(t.p),q:qt(t.q),dP:qt(t.dp),dQ:qt(t.dq),qInv:qt(t.qi)});return Bt(Ee.default.asn1.toDer(e).getBytes(),"ascii")}function sd(t){let e=Ee.default.asn1.fromDer(yt(t,"ascii")),r=Ee.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:te(r.n),e:te(r.e)}}function od(t){if(t.n==null||t.e==null)throw new F("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ee.default.pki.publicKeyToAsn1({n:qt(t.n),e:qt(t.e)});return Bt(Ee.default.asn1.toDer(e).getBytes(),"ascii")}async function E0(t){let e=await Et.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await S0(e);return{privateKey:r[0],publicKey:r[1]}}async function ga(t){let r=[await Et.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await fd(t)],n=await S0({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function w0(t,e){let r=await Et.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Et.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,e instanceof Uint8Array?e:e.subarray());return new Uint8Array(n,0,n.byteLength)}async function B0(t,e,r){let n=await Et.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Et.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r instanceof Uint8Array?r:r.subarray())}async function S0(t){if(t.privateKey==null||t.publicKey==null)throw new F("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Et.get().subtle.exportKey("jwk",t.privateKey),Et.get().subtle.exportKey("jwk",t.publicKey)])}async function fd(t){return Et.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function A0(t,e,r,n){let i=e?b0(t):v0(t),a=yt(r instanceof Uint8Array?r:r.subarray(),"ascii"),o=n(a,i);return Bt(o,"ascii")}function C0(t,e){return A0(t,!0,e,(r,n)=>n.encrypt(r))}function I0(t,e){return A0(t,!1,e,(r,n)=>n.decrypt(r))}function On(t){if(t.kty!=="RSA")throw new F("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new F("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Bt(t.n,"base64url").length*8}var Hr=8192,Fr=class{_key;constructor(e){this._key=e}async verify(e,r){return B0(this._key,r,e)}marshal(){return Qe.jwkToPkix(this._key)}get bytes(){return Jt.encode({Type:ut.RSA,Data:this.marshal()}).subarray()}encrypt(e){return C0(this._key,e)}equals(e){return Zt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Mt.digest(this.bytes);return e}},vr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return mr(16)}async sign(e){return w0(this._key,e)}get public(){if(this._publicKey==null)throw new F("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Fr(this._publicKey)}decrypt(e){return I0(this._key,e)}marshal(){return Qe.jwkToPkcs1(this._key)}get bytes(){return jt.encode({Type:ut.RSA,Data:this.marshal()}).subarray()}equals(e){return Zt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Mt.digest(this.bytes);return e}async id(){let e=await this.public.hash();return yt(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new qr.default.util.ByteBuffer(this.marshal()),i=qr.default.asn1.fromDer(n),a=qr.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return qr.default.pki.encryptRsaPrivateKey(a,e,o)}else{if(r==="libp2p-key")return pr(this.bytes,e);throw new F(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function ud(t){let e=Qe.pkcs1ToJwk(t);if(On(e)>Hr)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await ga(e);return new vr(r.privateKey,r.publicKey)}function hd(t){let e=Qe.pkixToJwk(t);if(On(e)>Hr)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Fr(e)}async function ld(t){if(On(t)>Hr)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await ga(t);return new vr(e.privateKey,e.publicKey)}async function dd(t){if(t>Hr)throw new F("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await E0(t);return new vr(e.privateKey,e.publicKey)}var Sa={};gt(Sa,{Secp256k1PrivateKey:()=>Gr,Secp256k1PublicKey:()=>zr,generateKeyPair:()=>Td,unmarshalSecp256k1PrivateKey:()=>Cd,unmarshalSecp256k1PublicKey:()=>Id});var pd=(t,e,r)=>t&e^~t&r,yd=(t,e,r)=>t&e^t&r^e&r,xd=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ke=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pe=new Uint32Array(64),va=class extends hr{constructor(){super(64,32,8,!1),this.A=ke[0]|0,this.B=ke[1]|0,this.C=ke[2]|0,this.D=ke[3]|0,this.E=ke[4]|0,this.F=ke[5]|0,this.G=ke[6]|0,this.H=ke[7]|0}get(){let{A:e,B:r,C:n,D:i,E:a,F:o,G:s,H:f}=this;return[e,r,n,i,a,o,s,f]}set(e,r,n,i,a,o,s,f){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=f|0}process(e,r){for(let h=0;h<16;h++,r+=4)Pe[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let d=Pe[h-15],x=Pe[h-2],l=$t(d,7)^$t(d,18)^d>>>3,p=$t(x,17)^$t(x,19)^x>>>10;Pe[h]=p+Pe[h-7]+l+Pe[h-16]|0}let{A:n,B:i,C:a,D:o,E:s,F:f,G:c,H:u}=this;for(let h=0;h<64;h++){let d=$t(s,6)^$t(s,11)^$t(s,25),x=u+d+pd(s,f,c)+xd[h]+Pe[h]|0,p=($t(n,2)^$t(n,13)^$t(n,22))+yd(n,i,a)|0;u=c,c=f,f=s,s=o+x|0,o=a,a=i,i=n,n=x+p|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,f=f+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,o,s,f,c,u)}roundClean(){Pe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var T0=bn(()=>new va);function gd(t){let e=Pr(t);oe(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:md,hexToBytes:vd}=Sn,Xe={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=Xe;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:md(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=Xe,r=typeof t=="string"?vd(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:a}=Xe._parseInt(r.subarray(2)),{d:o,l:s}=Xe._parseInt(a);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,r=c=>{let u=c.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),a=n.length/2,o=i.length/2,s=r(a),f=r(o);return`30${r(o+a+4)}02${f}${i}02${s}${n}`}},we=BigInt(0),Gt=BigInt(1),V2=BigInt(2),_0=BigInt(3),q2=BigInt(4);function bd(t){let e=gd(t),{Fp:r}=e,n=e.toBytes||((l,p,y)=>{let m=p.toAffine();return me(Uint8Array.from([4]),r.toBytes(m.x),r.toBytes(m.y))}),i=e.fromBytes||(l=>{let p=l.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),m=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:m}});function a(l){let{a:p,b:y}=e,m=r.sqr(l),E=r.mul(m,l);return r.add(r.add(E,r.mul(l,p)),y)}if(!r.eql(r.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(l){return typeof l=="bigint"&&wer.eql(b,r.ZERO);return E(y)&&E(m)?h.ZERO:new h(y,m,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(m=>m.pz));return p.map((m,E)=>m.toAffine(y[E])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(vt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(f(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let m=r.sqr(y),E=a(p);if(!r.eql(m,E))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:m,pz:E}=this,{px:b,py:R,pz:w}=p,B=r.eql(r.mul(y,w),r.mul(b,E)),L=r.eql(r.mul(m,w),r.mul(R,E));return B&&L}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,m=r.mul(y,_0),{px:E,py:b,pz:R}=this,w=r.ZERO,B=r.ZERO,L=r.ZERO,N=r.mul(E,E),z=r.mul(b,b),H=r.mul(R,R),V=r.mul(E,b);return V=r.add(V,V),L=r.mul(E,R),L=r.add(L,L),w=r.mul(p,L),B=r.mul(m,H),B=r.add(w,B),w=r.sub(z,B),B=r.add(z,B),B=r.mul(w,B),w=r.mul(V,w),L=r.mul(m,L),H=r.mul(p,H),V=r.sub(N,H),V=r.mul(p,V),V=r.add(V,L),L=r.add(N,N),N=r.add(L,N),N=r.add(N,H),N=r.mul(N,V),B=r.add(B,N),H=r.mul(b,R),H=r.add(H,H),N=r.mul(H,V),w=r.sub(w,N),L=r.mul(H,z),L=r.add(L,L),L=r.add(L,L),new h(w,B,L)}add(p){u(p);let{px:y,py:m,pz:E}=this,{px:b,py:R,pz:w}=p,B=r.ZERO,L=r.ZERO,N=r.ZERO,z=e.a,H=r.mul(e.b,_0),V=r.mul(y,b),Q=r.mul(m,R),at=r.mul(E,w),_t=r.add(y,m),I=r.add(b,R);_t=r.mul(_t,I),I=r.add(V,Q),_t=r.sub(_t,I),I=r.add(y,E);let k=r.add(b,w);return I=r.mul(I,k),k=r.add(V,at),I=r.sub(I,k),k=r.add(m,E),B=r.add(R,w),k=r.mul(k,B),B=r.add(Q,at),k=r.sub(k,B),N=r.mul(z,I),B=r.mul(H,at),N=r.add(B,N),B=r.sub(Q,N),N=r.add(Q,N),L=r.mul(B,N),Q=r.add(V,V),Q=r.add(Q,V),at=r.mul(z,at),I=r.mul(H,I),Q=r.add(Q,at),at=r.sub(V,at),at=r.mul(z,at),I=r.add(I,at),V=r.mul(Q,I),L=r.add(L,V),V=r.mul(k,I),B=r.mul(_t,B),B=r.sub(B,V),V=r.mul(_t,Q),N=r.mul(k,N),N=r.add(N,V),new h(B,L,N)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return x.wNAFCached(this,c,p,y=>{let m=r.invertBatch(y.map(E=>E.pz));return y.map((E,b)=>E.toAffine(m[b])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===we)return y;if(s(p),p===Gt)return this;let{endo:m}=e;if(!m)return x.unsafeLadder(this,p);let{k1neg:E,k1:b,k2neg:R,k2:w}=m.splitScalar(p),B=y,L=y,N=this;for(;b>we||w>we;)b&Gt&&(B=B.add(N)),w&Gt&&(L=L.add(N)),N=N.double(),b>>=Gt,w>>=Gt;return E&&(B=B.negate()),R&&(L=L.negate()),L=new h(r.mul(L.px,m.beta),L.py,L.pz),B.add(L)}multiply(p){s(p);let y=p,m,E,{endo:b}=e;if(b){let{k1neg:R,k1:w,k2neg:B,k2:L}=b.splitScalar(y),{p:N,f:z}=this.wNAF(w),{p:H,f:V}=this.wNAF(L);N=x.constTimeNegate(R,N),H=x.constTimeNegate(B,H),H=new h(r.mul(H.px,b.beta),H.py,H.pz),m=N.add(H),E=z.add(V)}else{let{p:R,f:w}=this.wNAF(y);m=R,E=w}return h.normalizeZ([m,E])[0]}multiplyAndAddUnsafe(p,y,m){let E=h.BASE,b=(w,B)=>B===we||B===Gt||!w.equals(E)?w.multiplyUnsafe(B):w.multiply(B),R=b(this,y).add(b(p,m));return R.is0()?void 0:R}toAffine(p){let{px:y,py:m,pz:E}=this,b=this.is0();p==null&&(p=b?r.ONE:r.inv(E));let R=r.mul(y,p),w=r.mul(m,p),B=r.mul(E,p);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:R,y:w}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===Gt)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===Gt?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return xe(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let d=e.nBitLength,x=In(h,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:f,weierstrassEquation:a,isWithinCurveOrder:o}}function Ed(t){let e=Pr(t);return oe(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function R0(t){let e=Ed(t),{Fp:r,n}=e,i=r.BYTES+1,a=2*r.BYTES+1;function o(I){return wexe(Ne(I,e.nByteLength));function l(I){let k=n>>Gt;return I>k}function p(I){return l(I)?s(-I):I}let y=(I,k,_)=>ge(I.slice(k,_));class m{constructor(k,_,D){this.r=k,this.s=_,this.recovery=D,this.assertValidity()}static fromCompact(k){let _=e.nByteLength;return k=vt("compactSignature",k,_*2),new m(y(k,0,_),y(k,_,2*_))}static fromDER(k){let{r:_,s:D}=Xe.toSig(vt("DER",k));return new m(_,D)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(k){return new m(this.r,this.s,k)}recoverPublicKey(k){let{r:_,s:D,recovery:A}=this,K=L(vt("msgHash",k));if(A==null||![0,1,2,3].includes(A))throw new Error("recovery id invalid");let O=A===2||A===3?_+e.n:_;if(O>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=A&1?"03":"02",Z=c.fromHex(q+x(O)),X=f(O),nt=s(-K*X),J=s(D*X),et=c.BASE.multiplyAndAddUnsafe(Z,nt,J);if(!et)throw new Error("point at infinify");return et.assertValidity(),et}hasHighS(){return l(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return He(this.toDERHex())}toDERHex(){return Xe.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return He(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}let E={isValidPrivateKey(I){try{return u(I),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let I=Wi(e.n);return Mo(e.randomBytes(I),e.n)},precompute(I=8,k=c.BASE){return k._setWindowSize(I),k.multiply(BigInt(3)),k}};function b(I,k=!0){return c.fromPrivateKey(I).toRawBytes(k)}function R(I){let k=I instanceof Uint8Array,_=typeof I=="string",D=(k||_)&&I.length;return k?D===i||D===a:_?D===2*i||D===2*a:I instanceof c}function w(I,k,_=!0){if(R(I))throw new Error("first arg must be private key");if(!R(k))throw new Error("second arg must be public key");return c.fromHex(k).multiply(u(I)).toRawBytes(_)}let B=e.bits2int||function(I){let k=ge(I),_=I.length*8-e.nBitLength;return _>0?k>>BigInt(_):k},L=e.bits2int_modN||function(I){return s(B(I))},N=kr(e.nBitLength);function z(I){if(typeof I!="bigint")throw new Error("bigint expected");if(!(we<=I&&Ixt in _))throw new Error("sign() legacy options not supported");let{hash:D,randomBytes:A}=e,{lowS:K,prehash:O,extraEntropy:q}=_;K==null&&(K=!0),I=vt("msgHash",I),O&&(I=vt("prehashed msgHash",D(I)));let Z=L(I),X=u(k),nt=[z(X),z(Z)];if(q!=null){let xt=q===!0?A(r.BYTES):q;nt.push(vt("extraEntropy",xt))}let J=me(...nt),et=Z;function wt(xt){let Rt=B(xt);if(!d(Rt))return;let Lt=f(Rt),St=c.BASE.multiply(Rt).toAffine(),Dt=s(St.x);if(Dt===we)return;let ue=s(Lt*s(et+Dt*X));if(ue===we)return;let Ue=(St.x===Dt?0:2)|Number(St.y&Gt),br=ue;return K&&l(ue)&&(br=p(ue),Ue^=1),new m(Dt,br,Ue)}return{seed:J,k2sig:wt}}let V={lowS:e.lowS,prehash:!1},Q={lowS:e.lowS,prehash:!1};function at(I,k,_=V){let{seed:D,k2sig:A}=H(I,k,_),K=e;return Fi(K.hash.outputLen,K.nByteLength,K.hmac)(D,A)}c.BASE._setWindowSize(8);function _t(I,k,_,D=Q){let A=I;if(k=vt("msgHash",k),_=vt("publicKey",_),"strict"in D)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:O}=D,q,Z;try{if(typeof A=="string"||A instanceof Uint8Array)try{q=m.fromDER(A)}catch(St){if(!(St instanceof Xe.Err))throw St;q=m.fromCompact(A)}else if(typeof A=="object"&&typeof A.r=="bigint"&&typeof A.s=="bigint"){let{r:St,s:Dt}=A;q=new m(St,Dt)}else throw new Error("PARSE");Z=c.fromHex(_)}catch(St){if(St.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&q.hasHighS())return!1;O&&(k=e.hash(k));let{r:X,s:nt}=q,J=L(k),et=f(nt),wt=s(J*et),xt=s(X*et),Rt=c.BASE.multiplyAndAddUnsafe(Z,wt,xt)?.toAffine();return Rt?s(Rt.x)===X:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:w,sign:at,verify:_t,ProjectivePoint:c,Signature:m,utils:E}}var Mn=class extends cr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Io(e);let n=Dr(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew Mn(t,e).update(r).digest();ba.create=(t,e)=>new Mn(t,e);function wd(t){return{hash:t,hmac:(e,...r)=>ba(t,e,vn(...r)),randomBytes:ur}}function L0(t,e){let r=n=>R0({...t,...wd(n)});return Object.freeze({...r(e),create:r})}var k0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),N0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Bd=BigInt(1),Ea=BigInt(2),D0=(t,e)=>(t+e/Ea)/e;function Sd(t){let e=k0,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),f=BigInt(88),c=t*t*t%e,u=c*c*t%e,h=pt(u,r,e)*u%e,d=pt(h,r,e)*u%e,x=pt(d,Ea,e)*c%e,l=pt(x,i,e)*x%e,p=pt(l,a,e)*l%e,y=pt(p,s,e)*p%e,m=pt(y,f,e)*y%e,E=pt(m,s,e)*p%e,b=pt(E,r,e)*u%e,R=pt(b,o,e)*l%e,w=pt(R,n,e)*c%e,B=pt(w,Ea,e);if(!wa.eql(wa.sqr(B),t))throw new Error("Cannot find square root");return B}var wa=Cn(k0,void 0,void 0,{sqrt:Sd}),Be=L0({a:BigInt(0),b:BigInt(7),Fp:wa,n:N0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=N0,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Bd*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,o=BigInt("0x100000000000000000000000000000000"),s=D0(a*t,e),f=D0(-n*t,e),c=st(t-s*r-f*i,e),u=st(-s*n-f*a,e),h=c>o,d=u>o;if(h&&(c=e-c),d&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:c,k2neg:d,k2:u}}}},T0),j2=BigInt(0);var tx=Be.ProjectivePoint;function P0(){return Be.utils.randomPrivateKey()}async function U0(t,e){let{digest:r}=await Mt.digest(e instanceof Uint8Array?e:e.subarray());try{return Be.sign(r,t).toDERRawBytes()}catch(n){throw new F(String(n),"ERR_INVALID_INPUT")}}async function K0(t,e,r){try{let{digest:n}=await Mt.digest(r instanceof Uint8Array?r:r.subarray());return Be.verify(e,n,t)}catch(n){throw new F(String(n),"ERR_INVALID_INPUT")}}function O0(t){return Be.ProjectivePoint.fromHex(t).toRawBytes(!0)}function M0(t){try{Be.getPublicKey(t,!0)}catch(e){throw new F(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Ba(t){try{Be.ProjectivePoint.fromHex(t)}catch(e){throw new F(String(e),"ERR_INVALID_PUBLIC_KEY")}}function V0(t){try{return Be.getPublicKey(t,!0)}catch(e){throw new F(String(e),"ERR_INVALID_PRIVATE_KEY")}}var zr=class{_key;constructor(e){Ba(e),this._key=e}async verify(e,r){return K0(this._key,r,e)}marshal(){return O0(this._key)}get bytes(){return Jt.encode({Type:ut.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Zt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Mt.digest(this.bytes);return e}},Gr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??V0(e),M0(this._key),Ba(this._publicKey)}async sign(e){return U0(this._key,e)}get public(){return new zr(this._publicKey)}marshal(){return this._key}get bytes(){return jt.encode({Type:ut.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Zt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Mt.digest(this.bytes);return e}async id(){let e=await this.public.hash();return yt(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return pr(this.bytes,e);throw new F(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Cd(t){return new Gr(t)}function Id(t){return new zr(t)}async function Td(){let t=P0();return new Gr(t)}var ce={rsa:ma,ed25519:la,secp256k1:Sa};function Aa(t){let e=Object.keys(ce).join(" / ");return new F(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function Ca(t){if(t=t.toLowerCase(),t==="rsa"||t==="ed25519"||t==="secp256k1")return ce[t];throw Aa(t)}async function _d(t,e){return Ca(t).generateKeyPair(e??2048)}async function Rd(t,e,r){if(t.toLowerCase()!=="ed25519")throw new F("Seed key derivation is unimplemented for RSA or secp256k1","ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return ha(e)}function Ld(t){let e=Jt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case ut.RSA:return ce.rsa.unmarshalRsaPublicKey(r);case ut.Ed25519:return ce.ed25519.unmarshalEd25519PublicKey(r);case ut.Secp256k1:return ce.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Aa(e.Type??"unknown")}}function Nd(t,e){return e=(e??"rsa").toLowerCase(),Ca(e),t.bytes}async function q0(t){let e=jt.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case ut.RSA:return ce.rsa.unmarshalRsaPrivateKey(r);case ut.Ed25519:return ce.ed25519.unmarshalEd25519PrivateKey(r);case ut.Secp256k1:return ce.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Aa(e.Type??"RSA")}}function Dd(t,e){return e=(e??"rsa").toLowerCase(),Ca(e),t.bytes}async function kd(t,e){try{let i=await u0(t,e);return await q0(i)}catch{}let r=Vn.default.pki.decryptRsaPrivateKey(t,e);if(r===null)throw new F("Cannot read the key, most likely the password is wrong or not a RSA key","ERR_CANNOT_DECRYPT_PEM");let n=Vn.default.asn1.toDer(Vn.default.pki.privateKeyToAsn1(r));return n=Bt(n.getBytes(),"ascii"),ce.rsa.unmarshalRsaPrivateKey(n)}var H0=Nt(Ai(),1),z0=Nt(bt(),1),F0={sha1:"sha1","sha2-256":"sha256","sha2-512":"sha512"};function Ta(t,e,r,n,i){if(i!=="sha1"&&i!=="sha2-256"&&i!=="sha2-512"){let s=Object.keys(F0).join(" / ");throw new F(`Hash '${i}' is unknown or not supported. Must be ${s}`,"ERR_UNSUPPORTED_HASH_TYPE")}let a=F0[i],o=(0,H0.default)(t,e,r,n,a);return z0.default.encode64(o,null)}return af(Pd);})(); +/*! Bundled license information: + +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/utils.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/modular.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/curve.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/edwards.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/ed25519.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/weierstrass.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/_shortw_utils.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/secp256k1.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) +*/ +return Libp2PCrypto})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts new file mode 100644 index 000000000..d0f881bb1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts @@ -0,0 +1,2 @@ +export declare function cipherMode(key: Uint8Array): string; +//# sourceMappingURL=cipher-mode.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts.map new file mode 100644 index 000000000..fcf41104f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cipher-mode.d.ts","sourceRoot":"","sources":["../../../src/aes/cipher-mode.ts"],"names":[],"mappings":"AAOA,wBAAgB,UAAU,CAAE,GAAG,EAAE,UAAU,GAAG,MAAM,CAOnD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js new file mode 100644 index 000000000..f9f41a8b3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js @@ -0,0 +1,13 @@ +import { CodeError } from '@libp2p/interface/errors'; +const CIPHER_MODES = { + 16: 'aes-128-ctr', + 32: 'aes-256-ctr' +}; +export function cipherMode(key) { + if (key.length === 16 || key.length === 32) { + return CIPHER_MODES[key.length]; + } + const modes = Object.entries(CIPHER_MODES).map(([k, v]) => `${k} (${v})`).join(' / '); + throw new CodeError(`Invalid key length ${key.length} bytes. Must be ${modes}`, 'ERR_INVALID_KEY_LENGTH'); +} +//# sourceMappingURL=cipher-mode.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js.map new file mode 100644 index 000000000..97e499cea --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/cipher-mode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cipher-mode.js","sourceRoot":"","sources":["../../../src/aes/cipher-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,aAAa;CAClB,CAAA;AAED,MAAM,UAAU,UAAU,CAAE,GAAe;IACzC,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE;QAC1C,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KAChC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACrF,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,CAAC,MAAM,mBAAmB,KAAK,EAAE,EAAE,wBAAwB,CAAC,CAAA;AAC3G,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts new file mode 100644 index 000000000..248eedda0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts @@ -0,0 +1,7 @@ +import 'node-forge/lib/aes.js'; +export interface Cipher { + update(data: Uint8Array): Uint8Array; +} +export declare function createCipheriv(mode: any, key: Uint8Array, iv: Uint8Array): Cipher; +export declare function createDecipheriv(mode: any, key: Uint8Array, iv: Uint8Array): Cipher; +//# sourceMappingURL=ciphers-browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts.map new file mode 100644 index 000000000..896a542e1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ciphers-browser.d.ts","sourceRoot":"","sources":["../../../src/aes/ciphers-browser.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAM9B,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAA;CACrC;AAED,wBAAgB,cAAc,CAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,MAAM,CASlF;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,MAAM,CASpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js new file mode 100644 index 000000000..d34162c56 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js @@ -0,0 +1,26 @@ +import 'node-forge/lib/aes.js'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +export function createCipheriv(mode, key, iv) { + const cipher2 = forge.cipher.createCipher('AES-CTR', uint8ArrayToString(key, 'ascii')); + cipher2.start({ iv: uint8ArrayToString(iv, 'ascii') }); + return { + update: (data) => { + cipher2.update(forge.util.createBuffer(uint8ArrayToString(data, 'ascii'))); + return uint8ArrayFromString(cipher2.output.getBytes(), 'ascii'); + } + }; +} +export function createDecipheriv(mode, key, iv) { + const cipher2 = forge.cipher.createDecipher('AES-CTR', uint8ArrayToString(key, 'ascii')); + cipher2.start({ iv: uint8ArrayToString(iv, 'ascii') }); + return { + update: (data) => { + cipher2.update(forge.util.createBuffer(uint8ArrayToString(data, 'ascii'))); + return uint8ArrayFromString(cipher2.output.getBytes(), 'ascii'); + } + }; +} +//# sourceMappingURL=ciphers-browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js.map new file mode 100644 index 000000000..6f63c2886 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ciphers-browser.js","sourceRoot":"","sources":["../../../src/aes/ciphers-browser.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAC9B,qCAAqC;AACrC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAMtE,MAAM,UAAU,cAAc,CAAE,IAAS,EAAE,GAAe,EAAE,EAAc;IACxE,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;IACtF,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,kBAAkB,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACtD,OAAO;QACL,MAAM,EAAE,CAAC,IAAgB,EAAE,EAAE;YAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;YAC1E,OAAO,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;QACjE,CAAC;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAE,IAAS,EAAE,GAAe,EAAE,EAAc;IAC1E,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;IACxF,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,kBAAkB,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACtD,OAAO;QACL,MAAM,EAAE,CAAC,IAAgB,EAAE,EAAE;YAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;YAC1E,OAAO,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;QACjE,CAAC;KACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts new file mode 100644 index 000000000..cd99f8b88 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts @@ -0,0 +1,5 @@ +/// +import crypto from 'crypto'; +export declare const createCipheriv: typeof crypto.createCipheriv; +export declare const createDecipheriv: typeof crypto.createDecipheriv; +//# sourceMappingURL=ciphers.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts.map new file mode 100644 index 000000000..a1fade192 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ciphers.d.ts","sourceRoot":"","sources":["../../../src/aes/ciphers.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,eAAO,MAAM,cAAc,8BAAwB,CAAA;AACnD,eAAO,MAAM,gBAAgB,gCAA0B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js new file mode 100644 index 000000000..3e14a7049 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js @@ -0,0 +1,4 @@ +import crypto from 'crypto'; +export const createCipheriv = crypto.createCipheriv; +export const createDecipheriv = crypto.createDecipheriv; +//# sourceMappingURL=ciphers.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js.map new file mode 100644 index 000000000..1bce69141 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/ciphers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ciphers.js","sourceRoot":"","sources":["../../../src/aes/ciphers.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts new file mode 100644 index 000000000..f495b046a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts @@ -0,0 +1,50 @@ +/** + * @packageDocumentation + * + * Exposes an interface to AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197. + * + * This uses `CTR` mode. + * + * /** + * @example + * + * ```js + * import { create } from '@libp2p/crypto/aes' + * + * // Setting up Key and IV + * + * // A 16 bytes array, 128 Bits, AES-128 is chosen + * const key128 = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + * + * // A 16 bytes array, 128 Bits, + * const IV = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + * + * const decryptedMessage = 'Hello, world!' + * + * // Encrypting + * const cipher = await crypto.aes.create(key128, IV) + * const encryptedBuffer = await encrypt(Uint8Array.from(decryptedMessage)) + * console.log(encryptedBuffer) + * // prints: + * + * // Decrypting + * const decipher = await crypto.aes.create(key128, IV) + * const decryptedBuffer = await decrypt(encryptedBuffer) + * + * console.log(decryptedBuffer) + * // prints: + * + * console.log(decryptedBuffer.toString('utf-8')) + * // prints: Hello, world! + * ``` + */ +export interface AESCipher { + encrypt(data: Uint8Array): Promise; + decrypt(data: Uint8Array): Promise; +} +/** + * @param key - The key, if length `16` then `AES 128` is used. For length `32`, `AES 256` is used + * @param iv - Must have length `16` + */ +export declare function create(key: Uint8Array, iv: Uint8Array): Promise; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts.map new file mode 100644 index 000000000..6a25b9c13 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/aes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAKH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC9C,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CAC/C;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAgBjF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js new file mode 100644 index 000000000..a96a54de3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js @@ -0,0 +1,61 @@ +/** + * @packageDocumentation + * + * Exposes an interface to AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197. + * + * This uses `CTR` mode. + * + * /** + * @example + * + * ```js + * import { create } from '@libp2p/crypto/aes' + * + * // Setting up Key and IV + * + * // A 16 bytes array, 128 Bits, AES-128 is chosen + * const key128 = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + * + * // A 16 bytes array, 128 Bits, + * const IV = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + * + * const decryptedMessage = 'Hello, world!' + * + * // Encrypting + * const cipher = await crypto.aes.create(key128, IV) + * const encryptedBuffer = await encrypt(Uint8Array.from(decryptedMessage)) + * console.log(encryptedBuffer) + * // prints: + * + * // Decrypting + * const decipher = await crypto.aes.create(key128, IV) + * const decryptedBuffer = await decrypt(encryptedBuffer) + * + * console.log(decryptedBuffer) + * // prints: + * + * console.log(decryptedBuffer.toString('utf-8')) + * // prints: Hello, world! + * ``` + */ +import { cipherMode } from './cipher-mode.js'; +import * as ciphers from './ciphers.js'; +/** + * @param key - The key, if length `16` then `AES 128` is used. For length `32`, `AES 256` is used + * @param iv - Must have length `16` + */ +export async function create(key, iv) { + const mode = cipherMode(key); + const cipher = ciphers.createCipheriv(mode, key, iv); + const decipher = ciphers.createDecipheriv(mode, key, iv); + const res = { + async encrypt(data) { + return cipher.update(data); + }, + async decrypt(data) { + return decipher.update(data); + } + }; + return res; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js.map new file mode 100644 index 000000000..e83d74cd5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/aes/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/aes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAOvC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAE,GAAe,EAAE,EAAc;IAC3D,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAA;IAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;IACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;IAExD,MAAM,GAAG,GAAc;QACrB,KAAK,CAAC,OAAO,CAAE,IAAI;YACjB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC5B,CAAC;QAED,KAAK,CAAC,OAAO,CAAE,IAAI;YACjB,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts new file mode 100644 index 000000000..28abb9a55 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts @@ -0,0 +1,10 @@ +import type { CreateOptions, AESCipher } from './interface.js'; +export declare const derivedEmptyPasswordKey: { + alg: string; + ext: boolean; + k: string; + key_ops: string[]; + kty: string; +}; +export declare function create(opts?: CreateOptions): AESCipher; +//# sourceMappingURL=aes-gcm.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts.map new file mode 100644 index 000000000..9db707bf6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aes-gcm.browser.d.ts","sourceRoot":"","sources":["../../../src/ciphers/aes-gcm.browser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAY9D,eAAO,MAAM,uBAAuB;;;;;;CAA0G,CAAA;AAI9I,wBAAgB,MAAM,CAAE,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAyFvD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js new file mode 100644 index 000000000..65bc96c49 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js @@ -0,0 +1,99 @@ +import { concat } from 'uint8arrays/concat'; +import { fromString } from 'uint8arrays/from-string'; +import webcrypto from '../webcrypto.js'; +// WebKit on Linux does not support deriving a key from an empty PBKDF2 key. +// So, as a workaround, we provide the generated key as a constant. We test that +// this generated key is accurate in test/workaround.spec.ts +// Generated via: +// await crypto.subtle.exportKey('jwk', +// await crypto.subtle.deriveKey( +// { name: 'PBKDF2', salt: new Uint8Array(16), iterations: 32767, hash: { name: 'SHA-256' } }, +// await crypto.subtle.importKey('raw', new Uint8Array(0), { name: 'PBKDF2' }, false, ['deriveKey']), +// { name: 'AES-GCM', length: 128 }, true, ['encrypt', 'decrypt']) +// ) +export const derivedEmptyPasswordKey = { alg: 'A128GCM', ext: true, k: 'scm9jmO_4BJAgdwWGVulLg', key_ops: ['encrypt', 'decrypt'], kty: 'oct' }; +// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples +export function create(opts) { + const algorithm = opts?.algorithm ?? 'AES-GCM'; + let keyLength = opts?.keyLength ?? 16; + const nonceLength = opts?.nonceLength ?? 12; + const digest = opts?.digest ?? 'SHA-256'; + const saltLength = opts?.saltLength ?? 16; + const iterations = opts?.iterations ?? 32767; + const crypto = webcrypto.get(); + keyLength *= 8; // Browser crypto uses bits instead of bytes + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to encrypt the data. + */ + async function encrypt(data, password) { + const salt = crypto.getRandomValues(new Uint8Array(saltLength)); + const nonce = crypto.getRandomValues(new Uint8Array(nonceLength)); + const aesGcm = { name: algorithm, iv: nonce }; + if (typeof password === 'string') { + password = fromString(password); + } + let cryptoKey; + if (password.length === 0) { + cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['encrypt']); + try { + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } }; + const runtimeDerivedEmptyPassword = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']); + cryptoKey = await crypto.subtle.deriveKey(deriveParams, runtimeDerivedEmptyPassword, { name: algorithm, length: keyLength }, true, ['encrypt']); + } + catch { + cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['encrypt']); + } + } + else { + // Derive a key using PBKDF2. + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } }; + const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']); + cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['encrypt']); + } + // Encrypt the string. + const ciphertext = await crypto.subtle.encrypt(aesGcm, cryptoKey, data); + return concat([salt, aesGcm.iv, new Uint8Array(ciphertext)]); + } + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to decrypt the data. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. + */ + async function decrypt(data, password) { + const salt = data.subarray(0, saltLength); + const nonce = data.subarray(saltLength, saltLength + nonceLength); + const ciphertext = data.subarray(saltLength + nonceLength); + const aesGcm = { name: algorithm, iv: nonce }; + if (typeof password === 'string') { + password = fromString(password); + } + let cryptoKey; + if (password.length === 0) { + try { + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } }; + const runtimeDerivedEmptyPassword = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']); + cryptoKey = await crypto.subtle.deriveKey(deriveParams, runtimeDerivedEmptyPassword, { name: algorithm, length: keyLength }, true, ['decrypt']); + } + catch { + cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['decrypt']); + } + } + else { + // Derive the key using PBKDF2. + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } }; + const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']); + cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['decrypt']); + } + // Decrypt the string. + const plaintext = await crypto.subtle.decrypt(aesGcm, cryptoKey, ciphertext); + return new Uint8Array(plaintext); + } + const cipher = { + encrypt, + decrypt + }; + return cipher; +} +//# sourceMappingURL=aes-gcm.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js.map new file mode 100644 index 000000000..8f976e06d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aes-gcm.browser.js","sourceRoot":"","sources":["../../../src/ciphers/aes-gcm.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,SAAS,MAAM,iBAAiB,CAAA;AAGvC,4EAA4E;AAC5E,gFAAgF;AAChF,4DAA4D;AAC5D,iBAAiB;AACjB,uCAAuC;AACvC,mCAAmC;AACnC,kGAAkG;AAClG,yGAAyG;AACzG,sEAAsE;AACtE,IAAI;AACJ,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,SAAS,E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way-down/crypto/dist/src/ciphers/aes-gcm.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts new file mode 100644 index 000000000..246d3584c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts @@ -0,0 +1,3 @@ +import type { CreateOptions, AESCipher } from './interface.js'; +export declare function create(opts?: CreateOptions): AESCipher; +//# sourceMappingURL=aes-gcm.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts.map new file mode 100644 index 000000000..209146c9e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aes-gcm.d.ts","sourceRoot":"","sources":["../../../src/ciphers/aes-gcm.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAI9D,wBAAgB,MAAM,CAAE,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CA8FvD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js new file mode 100644 index 000000000..c7d8a7670 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js @@ -0,0 +1,83 @@ +import crypto from 'crypto'; +import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples +export function create(opts) { + const algorithm = opts?.algorithm ?? 'aes-128-gcm'; + const keyLength = opts?.keyLength ?? 16; + const nonceLength = opts?.nonceLength ?? 12; + const digest = opts?.digest ?? 'sha256'; + const saltLength = opts?.saltLength ?? 16; + const iterations = opts?.iterations ?? 32767; + const algorithmTagLength = opts?.algorithmTagLength ?? 16; + async function encryptWithKey(data, key) { + const nonce = crypto.randomBytes(nonceLength); + // Create the cipher instance. + const cipher = crypto.createCipheriv(algorithm, key, nonce); + // Encrypt and prepend nonce. + const ciphertext = uint8ArrayConcat([cipher.update(data), cipher.final()]); + // @ts-expect-error getAuthTag is not a function + return uint8ArrayConcat([nonce, ciphertext, cipher.getAuthTag()]); + } + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to encrypt the data. + */ + async function encrypt(data, password) { + // Generate a 128-bit salt using a CSPRNG. + const salt = crypto.randomBytes(saltLength); + if (typeof password === 'string') { + password = uint8ArrayFromString(password); + } + // Derive a key using PBKDF2. + const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest); + // Encrypt and prepend salt. + return uint8ArrayConcat([salt, await encryptWithKey(Uint8Array.from(data), key)]); + } + /** + * Decrypts the given cipher text with the provided key. The `key` should + * be a cryptographically safe key and not a plaintext password. To use + * a plaintext password, use `decrypt`. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. + */ + async function decryptWithKey(ciphertextAndNonce, key) { + // Create Uint8Arrays of nonce, ciphertext and tag. + const nonce = ciphertextAndNonce.subarray(0, nonceLength); + const ciphertext = ciphertextAndNonce.subarray(nonceLength, ciphertextAndNonce.length - algorithmTagLength); + const tag = ciphertextAndNonce.subarray(ciphertext.length + nonceLength); + // Create the cipher instance. + const cipher = crypto.createDecipheriv(algorithm, key, nonce); + // Decrypt and return result. + // @ts-expect-error getAuthTag is not a function + cipher.setAuthTag(tag); + return uint8ArrayConcat([cipher.update(ciphertext), cipher.final()]); + } + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to decrypt the data. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. + * + * @param {Uint8Array} data - The data to decrypt + * @param {string|Uint8Array} password - A plain password + */ + async function decrypt(data, password) { + // Create Uint8Arrays of salt and ciphertextAndNonce. + const salt = data.subarray(0, saltLength); + const ciphertextAndNonce = data.subarray(saltLength); + if (typeof password === 'string') { + password = uint8ArrayFromString(password); + } + // Derive the key using PBKDF2. + const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest); + // Decrypt and return result. + return decryptWithKey(ciphertextAndNonce, key); + } + const cipher = { + encrypt, + decrypt + }; + return cipher; +} +//# sourceMappingURL=aes-gcm.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js.map new file mode 100644 index 000000000..ce72ce7ef --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/aes-gcm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aes-gcm.js","sourceRoot":"","sources":["../../../src/ciphers/aes-gcm.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAG5E,yFAAyF;AAEzF,MAAM,UAAU,MAAM,CAAE,IAAoB;IAC1C,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,aAAa,CAAA;IAClD,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,EAAE,CAAA;IACvC,MAAM,WAAW,GAAG,IAAI,EAAE,WAAW,IAAI,EAAE,CAAA;IAC3C,MAAM,MAAM,GAAG,IAAI,EAA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GAAG,CAAC,CAAA;IAChD,CAAC;IAED,MAAM,MAAM,GAAc;QACxB,OAAO;QACP,OAAO;KACR,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts new file mode 100644 index 000000000..19dff36bc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts @@ -0,0 +1,14 @@ +export interface CreateOptions { + algorithm?: string; + nonceLength?: number; + keyLength?: number; + digest?: string; + saltLength?: number; + iterations?: number; + algorithmTagLength?: number; +} +export interface AESCipher { + encrypt(data: Uint8Array, password: string | Uint8Array): Promise; + decrypt(data: Uint8Array, password: string | Uint8Array): Promise; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts.map new file mode 100644 index 000000000..336b754db --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/ciphers/interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7E,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CAC9E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js new file mode 100644 index 000000000..95423acbd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js.map new file mode 100644 index 000000000..9f1f40f99 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/ciphers/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/ciphers/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts new file mode 100644 index 000000000..f80c361b4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts @@ -0,0 +1,5 @@ +export declare function create(hashType: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise<{ + digest(data: Uint8Array): Promise; + length: number; +}>; +//# sourceMappingURL=index-browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts.map new file mode 100644 index 000000000..85eba7641 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../../src/hmac/index-browser.ts"],"names":[],"mappings":"AAcA,wBAAsB,MAAM,CAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAoBpK"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js new file mode 100644 index 000000000..ee834f8f1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js @@ -0,0 +1,25 @@ +import webcrypto from '../webcrypto.js'; +import lengths from './lengths.js'; +const hashTypes = { + SHA1: 'SHA-1', + SHA256: 'SHA-256', + SHA512: 'SHA-512' +}; +const sign = async (key, data) => { + const buf = await webcrypto.get().subtle.sign({ name: 'HMAC' }, key, data); + return new Uint8Array(buf, 0, buf.byteLength); +}; +export async function create(hashType, secret) { + const hash = hashTypes[hashType]; + const key = await webcrypto.get().subtle.importKey('raw', secret, { + name: 'HMAC', + hash: { name: hash } + }, false, ['sign']); + return { + async digest(data) { + return sign(key, data); + }, + length: lengths[hashType] + }; +} +//# sourceMappingURL=index-browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js.map new file mode 100644 index 000000000..7ae7ba52f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-browser.js","sourceRoot":"","sources":["../../../src/hmac/index-browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAA;AACvC,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;CAClB,CAAA;AAED,MAAM,IAAI,GAAG,KAAK,EAAE,GAAc,EAAE,IAAgB,EAAuB,EAAE;IAC3E,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAC1E,OAAO,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;AAC/C,CAAC,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAE,QAAsC,EAAE,MAAkB;IACtF,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IAEhC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAChD,KAAK,EACL,MAAM,EACN;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACrB,EACD,KAAK,EACL,CAAC,MAAM,CAAC,CACT,CAAA;IAED,OAAO;QACL,KAAK,CAAC,MAAM,CAAE,IAAgB;YAC5B,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACxB,CAAC;QACD,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC;KAC1B,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts new file mode 100644 index 000000000..38e613e15 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts @@ -0,0 +1,22 @@ +/** + * @packageDocumentation + * + * Exposes an interface to the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198. An HMAC is a cryptographic hash that uses a key to sign a message. The receiver verifies the hash by recomputing it using the same key. + * + * @example + * + * ```js + * import { create } from '@libp2p/hmac' + * + * const hash = 'SHA1' // 'SHA256' || 'SHA512' + * const hmac = await crypto.hmac.create(hash, uint8ArrayFromString('secret')) + * const sig = await hmac.digest(uint8ArrayFromString('hello world')) + * console.log(sig) + * ``` + */ +export interface HMAC { + digest(data: Uint8Array): Promise; + length: number; +} +export declare function create(hash: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts.map new file mode 100644 index 000000000..10ab7c969 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hmac/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,WAAW,IAAI;IACnB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,MAAM,CAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAWnG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js new file mode 100644 index 000000000..ca702687c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js @@ -0,0 +1,30 @@ +/** + * @packageDocumentation + * + * Exposes an interface to the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198. An HMAC is a cryptographic hash that uses a key to sign a message. The receiver verifies the hash by recomputing it using the same key. + * + * @example + * + * ```js + * import { create } from '@libp2p/hmac' + * + * const hash = 'SHA1' // 'SHA256' || 'SHA512' + * const hmac = await crypto.hmac.create(hash, uint8ArrayFromString('secret')) + * const sig = await hmac.digest(uint8ArrayFromString('hello world')) + * console.log(sig) + * ``` + */ +import crypto from 'crypto'; +import lengths from './lengths.js'; +export async function create(hash, secret) { + const res = { + async digest(data) { + const hmac = crypto.createHmac(hash.toLowerCase(), secret); + hmac.update(data); + return hmac.digest(); + }, + length: lengths[hash] + }; + return res; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js.map new file mode 100644 index 000000000..4c9dd3f8e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hmac/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,OAAO,MAAM,cAAc,CAAA;AAOlC,MAAM,CAAC,KAAK,UAAU,MAAM,CAAE,IAAkC,EAAE,MAAkB;IAClF,MAAM,GAAG,GAAG;QACV,KAAK,CAAC,MAAM,CAAE,IAAgB;YAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAA;YAC1D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACjB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAA;QACtB,CAAC;QACD,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;KACtB,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts new file mode 100644 index 000000000..5318ddb91 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts @@ -0,0 +1,7 @@ +declare const _default: { + SHA1: number; + SHA256: number; + SHA512: number; +}; +export default _default; +//# sourceMappingURL=lengths.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts.map new file mode 100644 index 000000000..2569fc288 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lengths.d.ts","sourceRoot":"","sources":["../../../src/hmac/lengths.ts"],"names":[],"mappings":";;;;;AAAA,wBAIC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js new file mode 100644 index 000000000..f9522f59c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js @@ -0,0 +1,6 @@ +export default { + SHA1: 20, + SHA256: 32, + SHA512: 64 +}; +//# sourceMappingURL=lengths.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js.map new file mode 100644 index 000000000..17333bd88 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/hmac/lengths.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lengths.js","sourceRoot":"","sources":["../../../src/hmac/lengths.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;CACX,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts new file mode 100644 index 000000000..45eb188a3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts @@ -0,0 +1,20 @@ +/** + * @packageDocumentation + * + * The `libp2p-crypto` library depends on the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) in the browser. Web Crypto is available in all modern browsers, however browsers restrict its usage to [Secure Contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). + * + * *This means you will not be able to use some `@libp2p/crypto` functions in the browser when the page is served over HTTP.* + * + * To enable the Web Crypto API and allow `@libp2p/crypto` to work fully, please serve your page over HTTPS. + */ +import * as aes from './aes/index.js'; +import * as hmac from './hmac/index.js'; +import * as keys from './keys/index.js'; +import pbkdf2 from './pbkdf2.js'; +import randomBytes from './random-bytes.js'; +export { aes }; +export { hmac }; +export { keys }; +export { randomBytes }; +export { pbkdf2 }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts.map new file mode 100644 index 000000000..8662611f0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,CAAA;AACd,OAAO,EAAE,IAAI,EAAE,CAAA;AACf,OAAO,EAAE,IAAI,EAAE,CAAA;AACf,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js new file mode 100644 index 000000000..990949f3d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js @@ -0,0 +1,20 @@ +/** + * @packageDocumentation + * + * The `libp2p-crypto` library depends on the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) in the browser. Web Crypto is available in all modern browsers, however browsers restrict its usage to [Secure Contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). + * + * *This means you will not be able to use some `@libp2p/crypto` functions in the browser when the page is served over HTTP.* + * + * To enable the Web Crypto API and allow `@libp2p/crypto` to work fully, please serve your page over HTTPS. + */ +import * as aes from './aes/index.js'; +import * as hmac from './hmac/index.js'; +import * as keys from './keys/index.js'; +import pbkdf2 from './pbkdf2.js'; +import randomBytes from './random-bytes.js'; +export { aes }; +export { hmac }; +export { keys }; +export { randomBytes }; +export { pbkdf2 }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js.map new file mode 100644 index 000000000..506db4773 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,CAAA;AACd,OAAO,EAAE,IAAI,EAAE,CAAA;AACf,OAAO,EAAE,IAAI,EAAE,CAAA;AACf,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts new file mode 100644 index 000000000..db497e874 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts @@ -0,0 +1,3 @@ +import type { ECDHKey } from './interface.js'; +export declare function generateEphmeralKeyPair(curve: string): Promise; +//# sourceMappingURL=ecdh-browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts.map new file mode 100644 index 000000000..fa944335f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ecdh-browser.d.ts","sourceRoot":"","sources":["../../../src/keys/ecdh-browser.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAA0D,MAAM,gBAAgB,CAAA;AAWrG,wBAAsB,uBAAuB,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkE9E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js new file mode 100644 index 000000000..7221dd0f5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js @@ -0,0 +1,96 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; +import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +import { base64urlToBuffer } from '../util.js'; +import webcrypto from '../webcrypto.js'; +const bits = { + 'P-256': 256, + 'P-384': 384, + 'P-521': 521 +}; +const curveTypes = Object.keys(bits); +const names = curveTypes.join(' / '); +export async function generateEphmeralKeyPair(curve) { + if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') { + throw new CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE'); + } + const pair = await webcrypto.get().subtle.generateKey({ + name: 'ECDH', + namedCurve: curve + }, true, ['deriveBits']); + // forcePrivate is used for testing only + const genSharedKey = async (theirPub, forcePrivate) => { + let privateKey; + if (forcePrivate != null) { + privateKey = await webcrypto.get().subtle.importKey('jwk', unmarshalPrivateKey(curve, forcePrivate), { + name: 'ECDH', + namedCurve: curve + }, false, ['deriveBits']); + } + else { + privateKey = pair.privateKey; + } + const key = await webcrypto.get().subtle.importKey('jwk', unmarshalPublicKey(curve, theirPub), { + name: 'ECDH', + namedCurve: curve + }, false, []); + const buffer = await webcrypto.get().subtle.deriveBits({ + name: 'ECDH', + // @ts-expect-error namedCurve is missing from the types + namedCurve: curve, + public: key + }, privateKey, bits[curve]); + return new Uint8Array(buffer, 0, buffer.byteLength); + }; + const publicKey = await webcrypto.get().subtle.exportKey('jwk', pair.publicKey); + const ecdhKey = { + key: marshalPublicKey(publicKey), + genSharedKey + }; + return ecdhKey; +} +const curveLengths = { + 'P-256': 32, + 'P-384': 48, + 'P-521': 66 +}; +// Marshal converts a jwk encoded ECDH public key into the +// form specified in section 4.3.6 of ANSI X9.62. (This is the format +// go-ipfs uses) +function marshalPublicKey(jwk) { + if (jwk.crv == null || jwk.x == null || jwk.y == null) { + throw new CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS'); + } + if (jwk.crv !== 'P-256' && jwk.crv !== 'P-384' && jwk.crv !== 'P-521') { + throw new CodeError(`Unknown curve: ${jwk.crv}. Must be ${names}`, 'ERR_INVALID_CURVE'); + } + const byteLen = curveLengths[jwk.crv]; + return uint8ArrayConcat([ + Uint8Array.from([4]), + base64urlToBuffer(jwk.x, byteLen), + base64urlToBuffer(jwk.y, byteLen) + ], 1 + byteLen * 2); +} +// Unmarshal converts a point, serialized by Marshal, into an jwk encoded key +function unmarshalPublicKey(curve, key) { + if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') { + throw new CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE'); + } + const byteLen = curveLengths[curve]; + if (!uint8ArrayEquals(key.subarray(0, 1), Uint8Array.from([4]))) { + throw new CodeError('Cannot unmarshal public key - invalid key format', 'ERR_INVALID_KEY_FORMAT'); + } + return { + kty: 'EC', + crv: curve, + x: uint8ArrayToString(key.subarray(1, byteLen + 1), 'base64url'), + y: uint8ArrayToString(key.subarray(1 + byteLen), 'base64url'), + ext: true + }; +} +const unmarshalPrivateKey = (curve, key) => ({ + ...unmarshalPublicKey(curve, key.public), + d: uint8ArrayToString(key.private, 'base64url') +}); +//# sourceMappingURL=ecdh-browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js.map new file mode 100644 index 000000000..42f2567fb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ecdh-browser.js","sourceRoot":"","sources":["../../../src/keys/ecdh-browser.ts"],"names":[],"mappings":"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E,IAAI;QACT,GAAG,EAAE,KAAK;QACV,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC;QAChE,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,EAAE,WAAW,CAAC;QAC7D,GAAG,EAAE,IAAI;KACV,CAAA;AACH,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,GAAgB,EAAwB,EAAE,CAAC,CAAC;IACtF,GAAG,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC;IACxC,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC;CAChD,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts new file mode 100644 index 000000000..b53863255 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts @@ -0,0 +1,8 @@ +import type { ECDHKey } from './interface.js'; +/** + * Generates an ephemeral public key and returns a function that will compute the shared secret key. + * + * Focuses only on ECDH now, but can be made more general in the future. + */ +export declare function generateEphmeralKeyPair(curve: string): Promise; +//# sourceMappingURL=ecdh.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts.map new file mode 100644 index 000000000..3307582ba --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ecdh.d.ts","sourceRoot":"","sources":["../../../src/keys/ecdh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,gBAAgB,CAAA;AAW1D;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAmB9E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js new file mode 100644 index 000000000..3af505bba --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js @@ -0,0 +1,31 @@ +import crypto from 'crypto'; +import { CodeError } from '@libp2p/interface/errors'; +const curves = { + 'P-256': 'prime256v1', + 'P-384': 'secp384r1', + 'P-521': 'secp521r1' +}; +const curveTypes = Object.keys(curves); +const names = curveTypes.join(' / '); +/** + * Generates an ephemeral public key and returns a function that will compute the shared secret key. + * + * Focuses only on ECDH now, but can be made more general in the future. + */ +export async function generateEphmeralKeyPair(curve) { + if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') { + throw new CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE'); + } + const ecdh = crypto.createECDH(curves[curve]); + ecdh.generateKeys(); + return { + key: ecdh.getPublicKey(), + async genSharedKey(theirPub, forcePrivate) { + if (forcePrivate != null) { + ecdh.setPrivateKey(forcePrivate.private); + } + return ecdh.computeSecret(theirPub); + } + }; +} +//# sourceMappingURL=ecdh.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js.map new file mode 100644 index 000000000..2607fd7b5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ecdh.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ecdh.js","sourceRoot":"","sources":["../../../src/keys/ecdh.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAGpD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;CACrB,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACtC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAEpC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAE,KAAa;IAC1D,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,EAAE;QAC/D,MAAM,IAAI,SAAS,CAAC,kBAAkB,KAAK,aAAa,KAAK,EAAE,EAAE,mBAAmB,CAAC,CAAA;KACtF;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7C,IAAI,CAAC,YAAY,EAAE,CAAA;IAEnB,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,YAAY,EAAgB;QAEtC,KAAK,CAAC,YAAY,CAAE,QAAoB,EAAE,YAA0B;YAClE,IAAI,YAAY,IAAI,IAAI,EAAE;gBACxB,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;aACzC;YAED,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QACrC,CAAC;KACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts new file mode 100644 index 000000000..a2a2190ff --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts @@ -0,0 +1,14 @@ +import type { Uint8ArrayKeyPair } from './interface'; +import type { Uint8ArrayList } from 'uint8arraylist'; +declare const PUBLIC_KEY_BYTE_LENGTH = 32; +declare const PRIVATE_KEY_BYTE_LENGTH = 64; +export { PUBLIC_KEY_BYTE_LENGTH as publicKeyLength }; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export declare function generateKey(): Promise; +/** + * Generate keypair from a 32 byte uint8array + */ +export declare function generateKeyFromSeed(seed: Uint8Array): Promise; +export declare function hashAndSign(privateKey: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function hashAndVerify(publicKey: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +//# sourceMappingURL=ed25519-browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts.map new file mode 100644 index 000000000..7e1be94a7 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519-browser.d.ts","sourceRoot":"","sources":["../../../src/keys/ed25519-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,QAAA,MAAM,sBAAsB,KAAK,CAAA;AACjC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAGlC,OAAO,EAAE,sBAAsB,IAAI,eAAe,EAAE,CAAA;AACpD,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAA;AAEtD,wBAAsB,WAAW,IAAK,OAAO,CAAC,iBAAiB,CAAC,CAY/D;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAiBvF;AAED,wBAAsB,WAAW,CAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAIhH;AAED,wBAAsB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/H"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js new file mode 100644 index 000000000..e5502de0a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js @@ -0,0 +1,52 @@ +import { ed25519 as ed } from '@noble/curves/ed25519'; +const PUBLIC_KEY_BYTE_LENGTH = 32; +const PRIVATE_KEY_BYTE_LENGTH = 64; // private key is actually 32 bytes but for historical reasons we concat private and public keys +const KEYS_BYTE_LENGTH = 32; +export { PUBLIC_KEY_BYTE_LENGTH as publicKeyLength }; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export async function generateKey() { + // the actual private key (32 bytes) + const privateKeyRaw = ed.utils.randomPrivateKey(); + const publicKey = ed.getPublicKey(privateKeyRaw); + // concatenated the public key to the private key + const privateKey = concatKeys(privateKeyRaw, publicKey); + return { + privateKey, + publicKey + }; +} +/** + * Generate keypair from a 32 byte uint8array + */ +export async function generateKeyFromSeed(seed) { + if (seed.length !== KEYS_BYTE_LENGTH) { + throw new TypeError('"seed" must be 32 bytes in length.'); + } + else if (!(seed instanceof Uint8Array)) { + throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.'); + } + // based on node forges algorithm, the seed is used directly as private key + const privateKeyRaw = seed; + const publicKey = ed.getPublicKey(privateKeyRaw); + const privateKey = concatKeys(privateKeyRaw, publicKey); + return { + privateKey, + publicKey + }; +} +export async function hashAndSign(privateKey, msg) { + const privateKeyRaw = privateKey.subarray(0, KEYS_BYTE_LENGTH); + return ed.sign(msg instanceof Uint8Array ? msg : msg.subarray(), privateKeyRaw); +} +export async function hashAndVerify(publicKey, sig, msg) { + return ed.verify(sig, msg instanceof Uint8Array ? msg : msg.subarray(), publicKey); +} +function concatKeys(privateKeyRaw, publicKey) { + const privateKey = new Uint8Array(PRIVATE_KEY_BYTE_LENGTH); + for (let i = 0; i < KEYS_BYTE_LENGTH; i++) { + privateKey[i] = privateKeyRaw[i]; + privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i]; + } + return privateKey; +} +//# sourceMappingURL=ed25519-browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js.map new file mode 100644 index 000000000..71daaad10 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519-browser.js","sourceRoot":"","sources":["../../../src/keys/ed25519-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAIrD,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACjC,MAAM,uBAAuB,GAAG,EAAE,CAAA,CAAC,gGAAgG;AACnI,MAAM,gBAAgB,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EAAE,EAAE,aAAa,CAAC,CAAA;AACjF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAE,SAAqB,EAAE,GAAe,EAAE,GAAgC;IAC3G,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;AACpF,CAAC;AAED,SAAS,UAAU,CAAE,aAAyB,EAAE,SAAqB;IACnE,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAA;IAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE;QACzC,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;QAChC,UAAU,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;KAChD;IACD,OAAO,UAAU,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts new file mode 100644 index 000000000..7c47c7299 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts @@ -0,0 +1,41 @@ +import type { Multibase } from 'multiformats'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export declare class Ed25519PublicKey { + private readonly _key; + constructor(key: Uint8Array); + verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise; + marshal(): Uint8Array; + get bytes(): Uint8Array; + equals(key: any): boolean; + hash(): Promise; +} +export declare class Ed25519PrivateKey { + private readonly _key; + private readonly _publicKey; + constructor(key: Uint8Array, publicKey: Uint8Array); + sign(message: Uint8Array | Uint8ArrayList): Promise; + get public(): Ed25519PublicKey; + marshal(): Uint8Array; + get bytes(): Uint8Array; + equals(key: any): boolean; + hash(): Promise; + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the identity multihash containing its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + * + * @returns {Promise} + */ + id(): Promise; + /** + * Exports the key into a password protected `format` + */ + export(password: string, format?: string): Promise>; +} +export declare function unmarshalEd25519PrivateKey(bytes: Uint8Array): Ed25519PrivateKey; +export declare function unmarshalEd25519PublicKey(bytes: Uint8Array): Ed25519PublicKey; +export declare function generateKeyPair(): Promise; +export declare function generateKeyPairFromSeed(seed: Uint8Array): Promise; +//# sourceMappingURL=ed25519-class.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts.map new file mode 100644 index 000000000..07d5b2582 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519-class.d.ts","sourceRoot":"","sources":["../../../src/keys/ed25519-class.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;gBAEpB,GAAG,EAAE,UAAU;IAItB,MAAM,CAAE,IAAI,EAAE,UAAU,GAAG,cAAc,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAInF,OAAO,IAAK,UAAU;IAItB,IAAI,KAAK,IAAK,UAAU,CAKvB;IAED,MAAM,CAAE,GAAG,EAAE,GAAG,GAAG,OAAO;IAIpB,IAAI,IAAK,OAAO,CAAC,UAAU,CAAC;CAKnC;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;gBAI1B,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU;IAK7C,IAAI,CAAE,OAAO,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAItE,IAAI,MAAM,IAAK,gBAAgB,CAE9B;IAED,OAAO,IAAK,UAAU;IAItB,IAAI,KAAK,IAAK,UAAU,CAKvB;IAED,MAAM,CAAE,GAAG,EAAE,GAAG,GAAG,OAAO;IAIpB,IAAI,IAAK,OAAO,CAAC,UAAU,CAAC;IAMlC;;;;;;;;OAQG;IACG,EAAE,IAAK,OAAO,CAAC,MAAM,CAAC;IAK5B;;OAEG;IACG,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAe,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CAOhF;AAED,wBAAgB,0BAA0B,CAAE,KAAK,EAAE,UAAU,GAAG,iBAAiB,CAahF;AAED,wBAAgB,yBAAyB,CAAE,KAAK,EAAE,UAAU,GAAG,gBAAgB,CAG9E;AAED,wBAAsB,eAAe,IAAK,OAAO,CAAC,iBAAiB,CAAC,CAGnE;AAED,wBAAsB,uBAAuB,CAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAG3F"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js new file mode 100644 index 000000000..32519db60 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js @@ -0,0 +1,122 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { base58btc } from 'multiformats/bases/base58'; +import { identity } from 'multiformats/hashes/identity'; +import { sha256 } from 'multiformats/hashes/sha2'; +import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; +import * as crypto from './ed25519.js'; +import { exporter } from './exporter.js'; +import * as pbm from './keys.js'; +export class Ed25519PublicKey { + _key; + constructor(key) { + this._key = ensureKey(key, crypto.publicKeyLength); + } + async verify(data, sig) { + return crypto.hashAndVerify(this._key, sig, data); + } + marshal() { + return this._key; + } + get bytes() { + return pbm.PublicKey.encode({ + Type: pbm.KeyType.Ed25519, + Data: this.marshal() + }).subarray(); + } + equals(key) { + return uint8ArrayEquals(this.bytes, key.bytes); + } + async hash() { + const { bytes } = await sha256.digest(this.bytes); + return bytes; + } +} +export class Ed25519PrivateKey { + _key; + _publicKey; + // key - 64 byte Uint8Array containing private key + // publicKey - 32 byte Uint8Array containing public key + constructor(key, publicKey) { + this._key = ensureKey(key, crypto.privateKeyLength); + this._publicKey = ensureKey(publicKey, crypto.publicKeyLength); + } + async sign(message) { + return crypto.hashAndSign(this._key, message); + } + get public() { + return new Ed25519PublicKey(this._publicKey); + } + marshal() { + return this._key; + } + get bytes() { + return pbm.PrivateKey.encode({ + Type: pbm.KeyType.Ed25519, + Data: this.marshal() + }).subarray(); + } + equals(key) { + return uint8ArrayEquals(this.bytes, key.bytes); + } + async hash() { + const { bytes } = await sha256.digest(this.bytes); + return bytes; + } + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the identity multihash containing its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + * + * @returns {Promise} + */ + async id() { + const encoding = identity.digest(this.public.bytes); + return base58btc.encode(encoding.bytes).substring(1); + } + /** + * Exports the key into a password protected `format` + */ + async export(password, format = 'libp2p-key') { + if (format === 'libp2p-key') { + return exporter(this.bytes, password); + } + else { + throw new CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT'); + } + } +} +export function unmarshalEd25519PrivateKey(bytes) { + // Try the old, redundant public key version + if (bytes.length > crypto.privateKeyLength) { + bytes = ensureKey(bytes, crypto.privateKeyLength + crypto.publicKeyLength); + const privateKeyBytes = bytes.subarray(0, crypto.privateKeyLength); + const publicKeyBytes = bytes.subarray(crypto.privateKeyLength, bytes.length); + return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes); + } + bytes = ensureKey(bytes, crypto.privateKeyLength); + const privateKeyBytes = bytes.subarray(0, crypto.privateKeyLength); + const publicKeyBytes = bytes.subarray(crypto.publicKeyLength); + return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes); +} +export function unmarshalEd25519PublicKey(bytes) { + bytes = ensureKey(bytes, crypto.publicKeyLength); + return new Ed25519PublicKey(bytes); +} +export async function generateKeyPair() { + const { privateKey, publicKey } = await crypto.generateKey(); + return new Ed25519PrivateKey(privateKey, publicKey); +} +export async function generateKeyPairFromSeed(seed) { + const { privateKey, publicKey } = await crypto.generateKeyFromSeed(seed); + return new Ed25519PrivateKey(privateKey, publicKey); +} +function ensureKey(key, length) { + key = Uint8Array.from(key ?? []); + if (key.length !== length) { + throw new CodeError(`Key must be a Uint8Array of length ${length}, got ${key.length}`, 'ERR_INVALID_KEY_TYPE'); + } + return key; +} +//# sourceMappingURL=ed25519-class.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js.map new file mode 100644 index 000000000..7b4da0be6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519-class.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519-class.js","sourceRoot":"","sources":["../../../src/keys/ed25519-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE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AAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAA;IAChD,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAA;IAC5D,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAE,IAAgB;IAC7D,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;IACxE,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;AACrD,CAAC;AAED,SAAS,SAAS,CAAE,GAAe,EAAE,MAAc;IACjD,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;IAChC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;QACzB,MAAM,IAAI,SAAS,CAAC,sCAAsC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAA;KAC/G;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts new file mode 100644 index 000000000..8129c0405 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts @@ -0,0 +1,15 @@ +/// +import type { Uint8ArrayKeyPair } from './interface.js'; +import type { Uint8ArrayList } from 'uint8arraylist'; +declare const PUBLIC_KEY_BYTE_LENGTH = 32; +declare const PRIVATE_KEY_BYTE_LENGTH = 64; +export { PUBLIC_KEY_BYTE_LENGTH as publicKeyLength }; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export declare function generateKey(): Promise; +/** + * Generate keypair from a 32 byte uint8array + */ +export declare function generateKeyFromSeed(seed: Uint8Array): Promise; +export declare function hashAndSign(key: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function hashAndVerify(key: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +//# sourceMappingURL=ed25519.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts.map new file mode 100644 index 000000000..cc951e753 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519.d.ts","sourceRoot":"","sources":["../../../src/keys/ed25519.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,QAAA,MAAM,sBAAsB,KAAK,CAAA;AACjC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAIlC,OAAO,EAAE,sBAAsB,IAAI,eAAe,EAAE,CAAA;AACpD,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAA;AAuBtD,wBAAsB,WAAW,IAAK,OAAO,CAAC,iBAAiB,CAAC,CAe/D;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAcvF;AAED,wBAAsB,WAAW,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BrG;AAED,wBAAsB,aAAa,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBzH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js new file mode 100644 index 000000000..3794f4eac --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js @@ -0,0 +1,120 @@ +import crypto from 'crypto'; +import { promisify } from 'util'; +import { fromString as uint8arrayFromString } from 'uint8arrays/from-string'; +import { toString as uint8arrayToString } from 'uint8arrays/to-string'; +const keypair = promisify(crypto.generateKeyPair); +const PUBLIC_KEY_BYTE_LENGTH = 32; +const PRIVATE_KEY_BYTE_LENGTH = 64; // private key is actually 32 bytes but for historical reasons we concat private and public keys +const KEYS_BYTE_LENGTH = 32; +const SIGNATURE_BYTE_LENGTH = 64; +export { PUBLIC_KEY_BYTE_LENGTH as publicKeyLength }; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +function derivePublicKey(privateKey) { + const keyObject = crypto.createPrivateKey({ + format: 'jwk', + key: { + crv: 'Ed25519', + x: '', + d: uint8arrayToString(privateKey, 'base64url'), + kty: 'OKP' + } + }); + const jwk = keyObject.export({ + format: 'jwk' + }); + if (jwk.x == null || jwk.x === '') { + throw new Error('Could not export JWK public key'); + } + return uint8arrayFromString(jwk.x, 'base64url'); +} +export async function generateKey() { + const key = await keypair('ed25519', { + publicKeyEncoding: { type: 'spki', format: 'jwk' }, + privateKeyEncoding: { type: 'pkcs8', format: 'jwk' } + }); + // @ts-expect-error node types are missing jwk as a format + const privateKeyRaw = uint8arrayFromString(key.privateKey.d, 'base64url'); + // @ts-expect-error node types are missing jwk as a format + const publicKeyRaw = uint8arrayFromString(key.privateKey.x, 'base64url'); + return { + privateKey: concatKeys(privateKeyRaw, publicKeyRaw), + publicKey: publicKeyRaw + }; +} +/** + * Generate keypair from a 32 byte uint8array + */ +export async function generateKeyFromSeed(seed) { + if (seed.length !== KEYS_BYTE_LENGTH) { + throw new TypeError('"seed" must be 32 bytes in length.'); + } + else if (!(seed instanceof Uint8Array)) { + throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.'); + } + // based on node forges algorithm, the seed is used directly as private key + const publicKeyRaw = derivePublicKey(seed); + return { + privateKey: concatKeys(seed, publicKeyRaw), + publicKey: publicKeyRaw + }; +} +export async function hashAndSign(key, msg) { + if (!(key instanceof Uint8Array)) { + throw new TypeError('"key" must be a node.js Buffer, or Uint8Array.'); + } + let privateKey; + let publicKey; + if (key.byteLength === PRIVATE_KEY_BYTE_LENGTH) { + privateKey = key.subarray(0, 32); + publicKey = key.subarray(32); + } + else if (key.byteLength === KEYS_BYTE_LENGTH) { + privateKey = key.subarray(0, 32); + publicKey = derivePublicKey(privateKey); + } + else { + throw new TypeError('"key" must be 64 or 32 bytes in length.'); + } + const obj = crypto.createPrivateKey({ + format: 'jwk', + key: { + crv: 'Ed25519', + d: uint8arrayToString(privateKey, 'base64url'), + x: uint8arrayToString(publicKey, 'base64url'), + kty: 'OKP' + } + }); + return crypto.sign(null, msg instanceof Uint8Array ? msg : msg.subarray(), obj); +} +export async function hashAndVerify(key, sig, msg) { + if (key.byteLength !== PUBLIC_KEY_BYTE_LENGTH) { + throw new TypeError('"key" must be 32 bytes in length.'); + } + else if (!(key instanceof Uint8Array)) { + throw new TypeError('"key" must be a node.js Buffer, or Uint8Array.'); + } + if (sig.byteLength !== SIGNATURE_BYTE_LENGTH) { + throw new TypeError('"sig" must be 64 bytes in length.'); + } + else if (!(sig instanceof Uint8Array)) { + throw new TypeError('"sig" must be a node.js Buffer, or Uint8Array.'); + } + const obj = crypto.createPublicKey({ + format: 'jwk', + key: { + crv: 'Ed25519', + x: uint8arrayToString(key, 'base64url'), + kty: 'OKP' + } + }); + return crypto.verify(null, msg instanceof Uint8Array ? msg : msg.subarray(), obj, sig); +} +function concatKeys(privateKeyRaw, publicKey) { + const privateKey = new Uint8Array(PRIVATE_KEY_BYTE_LENGTH); + for (let i = 0; i < KEYS_BYTE_LENGTH; i++) { + privateKey[i] = privateKeyRaw[i]; + privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i]; + } + return privateKey; +} +//# sourceMappingURL=ed25519.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js.map new file mode 100644 index 000000000..dd98ffc95 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ed25519.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519.js","sourceRoot":"","sources":["../../../src/keys/ed25519.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAItE,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAEjD,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACjC,MAAM,uBAAuB,GAAG,EAAE,CAAA,CAAC,gGAAgG;AACnI,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAC3B,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEhC,OAAO,EAAE,sBAAsB,IAAI,eAAe,EAAE,CAAA;AACpD,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAA;AAEtD,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IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAA;IAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE;QACzC,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;QAChC,UAAU,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;KAChD;IACD,OAAO,UAAU,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts new file mode 100644 index 000000000..705603eb8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts @@ -0,0 +1,9 @@ +import { generateEphmeralKeyPair } from './ecdh.js'; +/** + * Generates an ephemeral public key and returns a function that will compute + * the shared secret key. + * + * Focuses only on ECDH now, but can be made more general in the future. + */ +export default generateEphmeralKeyPair; +//# sourceMappingURL=ephemeral-keys.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts.map new file mode 100644 index 000000000..7418c6974 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ephemeral-keys.d.ts","sourceRoot":"","sources":["../../../src/keys/ephemeral-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAEnD;;;;;GAKG;AACH,eAAe,uBAAuB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js new file mode 100644 index 000000000..5f1782f7e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js @@ -0,0 +1,9 @@ +import { generateEphmeralKeyPair } from './ecdh.js'; +/** + * Generates an ephemeral public key and returns a function that will compute + * the shared secret key. + * + * Focuses only on ECDH now, but can be made more general in the future. + */ +export default generateEphmeralKeyPair; +//# sourceMappingURL=ephemeral-keys.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js.map new file mode 100644 index 000000000..986f0f6e1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/ephemeral-keys.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ephemeral-keys.js","sourceRoot":"","sources":["../../../src/keys/ephemeral-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAEnD;;;;;GAKG;AACH,eAAe,uBAAuB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts new file mode 100644 index 000000000..e47288f7e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts @@ -0,0 +1,8 @@ +import type { Multibase } from 'multiformats'; +/** + * Exports the given PrivateKey as a base64 encoded string. + * The PrivateKey is encrypted via a password derived PBKDF2 key + * leveraging the aes-gcm cipher algorithm. + */ +export declare function exporter(privateKey: Uint8Array, password: string): Promise>; +//# sourceMappingURL=exporter.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts.map new file mode 100644 index 000000000..39f89376f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/keys/exporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;GAIG;AACH,wBAAsB,QAAQ,CAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAIjG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js new file mode 100644 index 000000000..6d64d576c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js @@ -0,0 +1,13 @@ +import { base64 } from 'multiformats/bases/base64'; +import * as ciphers from '../ciphers/aes-gcm.js'; +/** + * Exports the given PrivateKey as a base64 encoded string. + * The PrivateKey is encrypted via a password derived PBKDF2 key + * leveraging the aes-gcm cipher algorithm. + */ +export async function exporter(privateKey, password) { + const cipher = ciphers.create(); + const encryptedKey = await cipher.encrypt(privateKey, password); + return base64.encode(encryptedKey); +} +//# sourceMappingURL=exporter.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js.map new file mode 100644 index 000000000..2d2e88cb6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/exporter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../../src/keys/exporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAGhD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAE,UAAsB,EAAE,QAAgB;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;IAC/B,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAC/D,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AACpC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts new file mode 100644 index 000000000..cf69f3e7c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts @@ -0,0 +1,7 @@ +/** + * Attempts to decrypt a base64 encoded PrivateKey string + * with the given password. The privateKey must have been exported + * using the same password and underlying cipher (aes-gcm) + */ +export declare function importer(privateKey: string, password: string): Promise; +//# sourceMappingURL=importer.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts.map new file mode 100644 index 000000000..a484c81e5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"importer.d.ts","sourceRoot":"","sources":["../../../src/keys/importer.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,QAAQ,CAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAIzF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js new file mode 100644 index 000000000..ca9e66194 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js @@ -0,0 +1,13 @@ +import { base64 } from 'multiformats/bases/base64'; +import * as ciphers from '../ciphers/aes-gcm.js'; +/** + * Attempts to decrypt a base64 encoded PrivateKey string + * with the given password. The privateKey must have been exported + * using the same password and underlying cipher (aes-gcm) + */ +export async function importer(privateKey, password) { + const encryptedKey = base64.decode(privateKey); + const cipher = ciphers.create(); + return cipher.decrypt(encryptedKey, password); +} +//# sourceMappingURL=importer.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js.map new file mode 100644 index 000000000..3a4898d0f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/importer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"importer.js","sourceRoot":"","sources":["../../../src/keys/importer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAE,UAAkB,EAAE,QAAgB;IAClE,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;IAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;AAC/C,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts new file mode 100644 index 000000000..7cafbb666 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts @@ -0,0 +1,69 @@ +/** + * @packageDocumentation + * + * **Supported Key Types** + * + * The {@link generateKeyPair}, {@link marshalPublicKey}, and {@link marshalPrivateKey} functions accept a string `type` argument. + * + * Currently the `'RSA'`, `'ed25519'`, and `secp256k1` types are supported, although ed25519 and secp256k1 keys support only signing and verification of messages. + * + * For encryption / decryption support, RSA keys should be used. + */ +import 'node-forge/lib/asn1.js'; +import 'node-forge/lib/pbe.js'; +import * as Ed25519 from './ed25519-class.js'; +import generateEphemeralKeyPair from './ephemeral-keys.js'; +import { keyStretcher } from './key-stretcher.js'; +import * as keysPBM from './keys.js'; +import * as RSA from './rsa-class.js'; +import * as Secp256k1 from './secp256k1-class.js'; +import type { PrivateKey, PublicKey } from '@libp2p/interface/keys'; +export { keyStretcher }; +export { generateEphemeralKeyPair }; +export { keysPBM }; +export type KeyTypes = 'RSA' | 'Ed25519' | 'secp256k1'; +export declare const supportedKeys: { + rsa: typeof RSA; + ed25519: typeof Ed25519; + secp256k1: typeof Secp256k1; +}; +/** + * Generates a keypair of the given type and bitsize + * + * @param type + * @param bits - Minimum of 1024 + */ +export declare function generateKeyPair(type: KeyTypes, bits?: number): Promise; +/** + * Generates a keypair of the given type and bitsize. + * + * Seed is a 32 byte uint8array + */ +export declare function generateKeyPairFromSeed(type: KeyTypes, seed: Uint8Array, bits?: number): Promise; +/** + * Converts a protobuf serialized public key into its representative object + */ +export declare function unmarshalPublicKey(buf: Uint8Array): PublicKey; +/** + * Converts a public key object into a protobuf serialized public key + */ +export declare function marshalPublicKey(key: { + bytes: Uint8Array; +}, type?: string): Uint8Array; +/** + * Converts a protobuf serialized private key into its representative object + */ +export declare function unmarshalPrivateKey(buf: Uint8Array): Promise; +/** + * Converts a private key object into a protobuf serialized private key + */ +export declare function marshalPrivateKey(key: { + bytes: Uint8Array; +}, type?: string): Uint8Array; +/** + * Converts an exported private key into its representative object. + * + * Supported formats are 'pem' (RSA only) and 'libp2p-key'. + */ +export declare function importKey(encryptedKey: string, password: string): Promise; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts.map new file mode 100644 index 000000000..5828e2182 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,wBAAwB,CAAA;AAC/B,OAAO,uBAAuB,CAAA;AAK9B,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,wBAAwB,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAA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arraylists-all-the-way-down/crypto/dist/src/keys/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js new file mode 100644 index 000000000..88fb7618a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js @@ -0,0 +1,136 @@ +/** + * @packageDocumentation + * + * **Supported Key Types** + * + * The {@link generateKeyPair}, {@link marshalPublicKey}, and {@link marshalPrivateKey} functions accept a string `type` argument. + * + * Currently the `'RSA'`, `'ed25519'`, and `secp256k1` types are supported, although ed25519 and secp256k1 keys support only signing and verification of messages. + * + * For encryption / decryption support, RSA keys should be used. + */ +import 'node-forge/lib/asn1.js'; +import 'node-forge/lib/pbe.js'; +import { CodeError } from '@libp2p/interface/errors'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import * as Ed25519 from './ed25519-class.js'; +import generateEphemeralKeyPair from './ephemeral-keys.js'; +import { importer } from './importer.js'; +import { keyStretcher } from './key-stretcher.js'; +import * as keysPBM from './keys.js'; +import * as RSA from './rsa-class.js'; +import * as Secp256k1 from './secp256k1-class.js'; +export { keyStretcher }; +export { generateEphemeralKeyPair }; +export { keysPBM }; +export const supportedKeys = { + rsa: RSA, + ed25519: Ed25519, + secp256k1: Secp256k1 +}; +function unsupportedKey(type) { + const supported = Object.keys(supportedKeys).join(' / '); + return new CodeError(`invalid or unsupported key type ${type}. Must be ${supported}`, 'ERR_UNSUPPORTED_KEY_TYPE'); +} +function typeToKey(type) { + type = type.toLowerCase(); + if (type === 'rsa' || type === 'ed25519' || type === 'secp256k1') { + return supportedKeys[type]; + } + throw unsupportedKey(type); +} +/** + * Generates a keypair of the given type and bitsize + * + * @param type + * @param bits - Minimum of 1024 + */ +export async function generateKeyPair(type, bits) { + return typeToKey(type).generateKeyPair(bits ?? 2048); +} +/** + * Generates a keypair of the given type and bitsize. + * + * Seed is a 32 byte uint8array + */ +export async function generateKeyPairFromSeed(type, seed, bits) { + if (type.toLowerCase() !== 'ed25519') { + throw new CodeError('Seed key derivation is unimplemented for RSA or secp256k1', 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE'); + } + return Ed25519.generateKeyPairFromSeed(seed); +} +/** + * Converts a protobuf serialized public key into its representative object + */ +export function unmarshalPublicKey(buf) { + const decoded = keysPBM.PublicKey.decode(buf); + const data = decoded.Data ?? new Uint8Array(); + switch (decoded.Type) { + case keysPBM.KeyType.RSA: + return supportedKeys.rsa.unmarshalRsaPublicKey(data); + case keysPBM.KeyType.Ed25519: + return supportedKeys.ed25519.unmarshalEd25519PublicKey(data); + case keysPBM.KeyType.Secp256k1: + return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data); + default: + throw unsupportedKey(decoded.Type ?? 'unknown'); + } +} +/** + * Converts a public key object into a protobuf serialized public key + */ +export function marshalPublicKey(key, type) { + type = (type ?? 'rsa').toLowerCase(); + typeToKey(type); // check type + return key.bytes; +} +/** + * Converts a protobuf serialized private key into its representative object + */ +export async function unmarshalPrivateKey(buf) { + const decoded = keysPBM.PrivateKey.decode(buf); + const data = decoded.Data ?? new Uint8Array(); + switch (decoded.Type) { + case keysPBM.KeyType.RSA: + return supportedKeys.rsa.unmarshalRsaPrivateKey(data); + case keysPBM.KeyType.Ed25519: + return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data); + case keysPBM.KeyType.Secp256k1: + return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data); + default: + throw unsupportedKey(decoded.Type ?? 'RSA'); + } +} +/** + * Converts a private key object into a protobuf serialized private key + */ +export function marshalPrivateKey(key, type) { + type = (type ?? 'rsa').toLowerCase(); + typeToKey(type); // check type + return key.bytes; +} +/** + * Converts an exported private key into its representative object. + * + * Supported formats are 'pem' (RSA only) and 'libp2p-key'. + */ +export async function importKey(encryptedKey, password) { + try { + const key = await importer(encryptedKey, password); + return await unmarshalPrivateKey(key); + } + catch (_) { + // Ignore and try the old pem decrypt + } + // Only rsa supports pem right now + const key = forge.pki.decryptRsaPrivateKey(encryptedKey, password); + if (key === null) { + throw new CodeError('Cannot read the key, most likely the password is wrong or not a RSA key', 'ERR_CANNOT_DECRYPT_PEM'); + } + let der = forge.asn1.toDer(forge.pki.privateKeyToAsn1(key)); + der = uint8ArrayFromString(der.getBytes(), 'ascii'); + return supportedKeys.rsa.unmarshalRsaPrivateKey(der); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js.map new file mode 100644 index 000000000..d5b266c9d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,wBAAwB,CAAA;AAC/B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,qCAAqC;AACrC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,wBAAwB,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AAGjD,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,OAAO,E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} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts new file mode 100644 index 000000000..16b2839ba --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts @@ -0,0 +1,36 @@ +export interface JWKKeyPair { + privateKey: JsonWebKey; + publicKey: JsonWebKey; +} +export interface Uint8ArrayKeyPair { + privateKey: Uint8Array; + publicKey: Uint8Array; +} +export interface ECDHKeyPair { + private: Uint8Array; + public: Uint8Array; +} +export interface ECDHKey { + key: Uint8Array; + genSharedKey(theirPub: Uint8Array, forcePrivate?: ECDHKeyPair): Promise; +} +export interface JWKEncodedPublicKey { + kty: string; + crv: 'P-256' | 'P-384' | 'P-521'; + x: string; + y: string; + ext: boolean; +} +export interface JWKEncodedPrivateKey extends JWKEncodedPublicKey { + d: string; +} +export interface EnhancedKey { + iv: Uint8Array; + cipherKey: Uint8Array; + macKey: Uint8Array; +} +export interface EnhancedKeyPair { + k1: EnhancedKey; + k2: EnhancedKey; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts.map new file mode 100644 index 000000000..d85d10aab --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/keys/interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,UAAU,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,UAAU,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,CAAA;IACnB,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,UAAU,CAAA;IACf,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACpF;AAED,MAAM,WAAW,mBAAmB;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE;AAE1H,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAAG,CAAC,EAAE,MAAM,CAAA;CAAE;AAE/E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,UAAU,CAAA;IACd,SAAS,EAAE,UAAU,CAAA;IACrB,MAAM,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,WAAW,CAAA;IACf,EAAE,EAAE,WAAW,CAAA;CAChB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js new file mode 100644 index 000000000..95423acbd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js.map new file mode 100644 index 000000000..c3dafa4e2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/keys/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts new file mode 100644 index 000000000..93f77d8c6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts @@ -0,0 +1,8 @@ +import 'node-forge/lib/rsa.js'; +export interface JWK { + encrypt(msg: string): string; + decrypt(msg: string): string; +} +export declare function jwk2priv(key: JsonWebKey): JWK; +export declare function jwk2pub(key: JsonWebKey): JWK; +//# sourceMappingURL=jwk2pem.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts.map new file mode 100644 index 000000000..5753c8987 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"jwk2pem.d.ts","sourceRoot":"","sources":["../../../src/keys/jwk2pem.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAK9B,MAAM,WAAW,GAAG;IAClB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAC7B;AAMD,wBAAgB,QAAQ,CAAE,GAAG,EAAE,UAAU,GAAG,GAAG,CAE9C;AAED,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,GAAG,GAAG,CAE7C"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js new file mode 100644 index 000000000..7d95017e0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js @@ -0,0 +1,14 @@ +import 'node-forge/lib/rsa.js'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import { base64urlToBigInteger } from '../util.js'; +function convert(key, types) { + return types.map(t => base64urlToBigInteger(key[t])); +} +export function jwk2priv(key) { + return forge.pki.setRsaPrivateKey(...convert(key, ['n', 'e', 'd', 'p', 'q', 'dp', 'dq', 'qi'])); +} +export function jwk2pub(key) { + return forge.pki.setRsaPublicKey(...convert(key, ['n', 'e'])); +} +//# sourceMappingURL=jwk2pem.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js.map new file mode 100644 index 000000000..7230fa38a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/jwk2pem.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jwk2pem.js","sourceRoot":"","sources":["../../../src/keys/jwk2pem.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAC9B,qCAAqC;AACrC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAOlD,SAAS,OAAO,CAAE,GAAQ,EAAE,KAAe;IACzC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAE,GAAe;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AACjG,CAAC;AAED,MAAM,UAAU,OAAO,CAAE,GAAe;IACtC,OAAO,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AAC/D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts new file mode 100644 index 000000000..03bd70b5e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts @@ -0,0 +1,7 @@ +import type { EnhancedKeyPair } from './interface.js'; +/** + * Generates a set of keys for each party by stretching the shared key. + * (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey) + */ +export declare function keyStretcher(cipherType: 'AES-128' | 'AES-256' | 'Blowfish', hash: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise; +//# sourceMappingURL=key-stretcher.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts.map new file mode 100644 index 000000000..52e86a446 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"key-stretcher.d.ts","sourceRoot":"","sources":["../../../src/keys/key-stretcher.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAiBlE;;;GAGG;AACH,wBAAsB,YAAY,CAAE,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAoDpK"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js new file mode 100644 index 000000000..f722591f3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js @@ -0,0 +1,65 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import * as hmac from '../hmac/index.js'; +const cipherMap = { + 'AES-128': { + ivSize: 16, + keySize: 16 + }, + 'AES-256': { + ivSize: 16, + keySize: 32 + }, + Blowfish: { + ivSize: 8, + keySize: 32 + } +}; +/** + * Generates a set of keys for each party by stretching the shared key. + * (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey) + */ +export async function keyStretcher(cipherType, hash, secret) { + const cipher = cipherMap[cipherType]; + if (cipher == null) { + const allowed = Object.keys(cipherMap).join(' / '); + throw new CodeError(`unknown cipher type '${cipherType}'. Must be ${allowed}`, 'ERR_INVALID_CIPHER_TYPE'); + } + if (hash == null) { + throw new CodeError('missing hash type', 'ERR_MISSING_HASH_TYPE'); + } + const cipherKeySize = cipher.keySize; + const ivSize = cipher.ivSize; + const hmacKeySize = 20; + const seed = uint8ArrayFromString('key expansion'); + const resultLength = 2 * (ivSize + cipherKeySize + hmacKeySize); + const m = await hmac.create(hash, secret); + let a = await m.digest(seed); + const result = []; + let j = 0; + while (j < resultLength) { + const b = await m.digest(uint8ArrayConcat([a, seed])); + let todo = b.length; + if (j + todo > resultLength) { + todo = resultLength - j; + } + result.push(b); + j += todo; + a = await m.digest(a); + } + const half = resultLength / 2; + const resultBuffer = uint8ArrayConcat(result); + const r1 = resultBuffer.subarray(0, half); + const r2 = resultBuffer.subarray(half, resultLength); + const createKey = (res) => ({ + iv: res.subarray(0, ivSize), + cipherKey: res.subarray(ivSize, ivSize + cipherKeySize), + macKey: res.subarray(ivSize + cipherKeySize) + }); + return { + k1: createKey(r1), + k2: createKey(r2) + }; +} +//# sourceMappingURL=key-stretcher.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js.map new file mode 100644 index 000000000..f24834f8c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/key-stretcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"key-stretcher.js","sourceRoot":"","sources":["../../../src/keys/key-stretcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAA;AAGxC,MAAM,SAAS,GAAG;IAChB,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EA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AC,gBAAgB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;QACrD,IAAI,IAAI,GAAG,CAAC,CAAC,MAAM,CAAA;QAEnB,IAAI,CAAC,GAAG,IAAI,GAAG,YAAY,EAAE;YAC3B,IAAI,GAAG,YAAY,GAAG,CAAC,CAAA;SACxB;QAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACd,CAAC,IAAI,IAAI,CAAA;QACT,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KACtB;IAED,MAAM,IAAI,GAAG,YAAY,GAAG,CAAC,CAAA;IAC7B,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IACzC,MAAM,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;IAEpD,MAAM,SAAS,GAAG,CAAC,GAAe,EAAe,EAAE,CAAC,CAAC;QACnD,EAAE,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;QACvD,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,aAAa,CAAC;KAC7C,CAAC,CAAA;IAEF,OAAO;QACL,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC;QACjB,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC;KAClB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts new file mode 100644 index 000000000..8bc93bbc1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts @@ -0,0 +1,29 @@ +import type { Codec } from 'protons-runtime'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export declare enum KeyType { + RSA = "RSA", + Ed25519 = "Ed25519", + Secp256k1 = "Secp256k1" +} +export declare namespace KeyType { + const codec: () => Codec; +} +export interface PublicKey { + Type?: KeyType; + Data?: Uint8Array; +} +export declare namespace PublicKey { + const codec: () => Codec; + const encode: (obj: Partial) => Uint8Array; + const decode: (buf: Uint8Array | Uint8ArrayList) => PublicKey; +} +export interface PrivateKey { + Type?: KeyType; + Data?: Uint8Array; +} +export declare namespace PrivateKey { + const codec: () => Codec; + const encode: (obj: Partial) => Uint8Array; + const decode: (buf: Uint8Array | Uint8ArrayList) => PrivateKey; +} +//# sourceMappingURL=keys.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts.map new file mode 100644 index 000000000..39af08aa6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/keys/keys.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,oBAAY,OAAO;IACjB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAQD,yBAAiB,OAAO,CAAC;IAChB,MAAM,KAAK,QAAO,MAAM,OAAO,CAErC,CAAA;CACF;AACD,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,yBAAiB,SAAS,CAAC;IAGlB,MAAM,KAAK,QAAO,MAAM,SAAS,CA8CvC,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,SAAS,CAAC,KAAG,UAEhD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,SAEzD,CAAA;CACF;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,yBAAiB,UAAU,CAAC;IAGnB,MAAM,KAAK,QAAO,MAAM,UAAU,CA8CxC,CAAA;IAEM,MAAM,MAAM,QAAS,QAAQ,UAAU,CAAC,KAAG,UAEjD,CAAA;IAEM,MAAM,MAAM,QAAS,UAAU,GAAG,cAAc,KAAG,UAEzD,CAAA;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js new file mode 100644 index 000000000..bc4954505 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js @@ -0,0 +1,122 @@ +/* eslint-disable import/export */ +/* eslint-disable complexity */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime'; +export var KeyType; +(function (KeyType) { + KeyType["RSA"] = "RSA"; + KeyType["Ed25519"] = "Ed25519"; + KeyType["Secp256k1"] = "Secp256k1"; +})(KeyType || (KeyType = {})); +var __KeyTypeValues; +(function (__KeyTypeValues) { + __KeyTypeValues[__KeyTypeValues["RSA"] = 0] = "RSA"; + __KeyTypeValues[__KeyTypeValues["Ed25519"] = 1] = "Ed25519"; + __KeyTypeValues[__KeyTypeValues["Secp256k1"] = 2] = "Secp256k1"; +})(__KeyTypeValues || (__KeyTypeValues = {})); +(function (KeyType) { + KeyType.codec = () => { + return enumeration(__KeyTypeValues); + }; +})(KeyType || (KeyType = {})); +export var PublicKey; +(function (PublicKey) { + let _codec; + PublicKey.codec = () => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork(); + } + if (obj.Type != null) { + w.uint32(8); + KeyType.codec().encode(obj.Type, w); + } + if (obj.Data != null) { + w.uint32(18); + w.bytes(obj.Data); + } + if (opts.lengthDelimited !== false) { + w.ldelim(); + } + }, (reader, length) => { + const obj = {}; + const end = length == null ? reader.len : reader.pos + length; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + obj.Type = KeyType.codec().decode(reader); + break; + case 2: + obj.Data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return obj; + }); + } + return _codec; + }; + PublicKey.encode = (obj) => { + return encodeMessage(obj, PublicKey.codec()); + }; + PublicKey.decode = (buf) => { + return decodeMessage(buf, PublicKey.codec()); + }; +})(PublicKey || (PublicKey = {})); +export var PrivateKey; +(function (PrivateKey) { + let _codec; + PrivateKey.codec = () => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork(); + } + if (obj.Type != null) { + w.uint32(8); + KeyType.codec().encode(obj.Type, w); + } + if (obj.Data != null) { + w.uint32(18); + w.bytes(obj.Data); + } + if (opts.lengthDelimited !== false) { + w.ldelim(); + } + }, (reader, length) => { + const obj = {}; + const end = length == null ? reader.len : reader.pos + length; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + obj.Type = KeyType.codec().decode(reader); + break; + case 2: + obj.Data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return obj; + }); + } + return _codec; + }; + PrivateKey.encode = (obj) => { + return encodeMessage(obj, PrivateKey.codec()); + }; + PrivateKey.decode = (buf) => { + return decodeMessage(buf, PrivateKey.codec()); + }; +})(PrivateKey || (PrivateKey = {})); +//# sourceMappingURL=keys.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js.map new file mode 100644 index 000000000..40658fe9a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/keys.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/keys/keys.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,oDAAoD;AACpD,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAIpF,MAAM,CAAN,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,8BAAmB,CAAA;IACnB,kCAAuB,CAAA;AACzB,CAAC,EAJW,OAAO,KAAP,OAAO,QAIlB;AAED,IAAK,eAIJ;AAJD,WAAK,eAAe;IAClB,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,+DAAa,CAAA;AACf,CAAC,EAJI,eAAe,KAAf,eAAe,QAInB;AAED,WAAiB,OAAO;IACT,aAAK,GAAG,GAAmB,EAAE;QACxC,OAAO,WAAW,CAAU,eAAe,CAAC,CAAA;IAC9C,CAAC,CAAA;AACH,CAAC,EAJgB,OAAO,KAAP,OAAO,QAIvB;AAMD,MAAM,KAAW,SAAS,CA0DzB;AA1DD,WAAiB,SAAS;IACxB,IAAI,MAAwB,CAAA;IAEf,eAAK,GAAG,GAAqB,EAAE;QAC1C,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,GAAG,OAAO,CAAY,CAAC,GAAG,EAAE,CAAC,EAAE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EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;gBACpB,MAAM,GAAG,GAAQ,EAAE,CAAA;gBAEnB,MAAM,GAAG,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,CAAA;gBAE7D,OAAO,MAAM,CAAC,GAAG,GAAG,GAAG,EAAE;oBACvB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAA;oBAE3B,QAAQ,GAAG,KAAK,CAAC,EAAE;wBACjB,KAAK,CAAC;4BACJ,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;4BACzC,MAAK;wBACP,KAAK,CAAC;4BACJ,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA;4BACzB,MAAK;wBACP;4BACE,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;4BACxB,MAAK;qBACR;iBACF;gBAED,OAAO,GAAG,CAAA;YACZ,CAAC,CAAC,CAAA;SACH;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAEY,iBAAM,GAAG,CAAC,GAAwB,EAAc,EAAE;QAC7D,OAAO,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAA;IAC/C,CAAC,CAAA;IAEY,iBAAM,GAAG,CAAC,GAAgC,EAAc,EAAE;QACrE,OAAO,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAA;IAC/C,CAAC,CAAA;AACH,CAAC,EA1DgB,UAAU,KAAV,UAAU,QA0D1B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts new file mode 100644 index 000000000..b5faa4c10 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts @@ -0,0 +1,14 @@ +import randomBytes from '../random-bytes.js'; +import * as utils from './rsa-utils.js'; +import type { JWKKeyPair } from './interface.js'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export { utils }; +export declare function generateKey(bits: number): Promise; +export declare function unmarshalPrivateKey(key: JsonWebKey): Promise; +export { randomBytes as getRandomValues }; +export declare function hashAndSign(key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function hashAndVerify(key: JsonWebKey, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function encrypt(key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Uint8Array; +export declare function decrypt(key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Uint8Array; +export declare function keySize(jwk: JsonWebKey): number; +//# sourceMappingURL=rsa-browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts.map new file mode 100644 index 000000000..d56829c45 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa-browser.d.ts","sourceRoot":"","sources":["../../../src/keys/rsa-browser.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAG5C,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,wBAAsB,WAAW,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAkBpE;AAGD,wBAAsB,mBAAmB,CAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CA0B/E;AAED,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,CAAA;AAEzC,wBAAsB,WAAW,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBzG;AAED,wBAAsB,aAAa,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBzH;AAiDD,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,CAEtF;AAED,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,CAEtF;AAED,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,GAAG,MAAM,CAQhD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js new file mode 100644 index 000000000..58aea8ebb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js @@ -0,0 +1,109 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +import randomBytes from '../random-bytes.js'; +import webcrypto from '../webcrypto.js'; +import { jwk2pub, jwk2priv } from './jwk2pem.js'; +import * as utils from './rsa-utils.js'; +export { utils }; +export async function generateKey(bits) { + const pair = await webcrypto.get().subtle.generateKey({ + name: 'RSASSA-PKCS1-v1_5', + modulusLength: bits, + publicExponent: new Uint8Array([0x01, 0x00, 0x01]), + hash: { name: 'SHA-256' } + }, true, ['sign', 'verify']); + const keys = await exportKey(pair); + return { + privateKey: keys[0], + publicKey: keys[1] + }; +} +// Takes a jwk key +export async function unmarshalPrivateKey(key) { + const privateKey = await webcrypto.get().subtle.importKey('jwk', key, { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, true, ['sign']); + const pair = [ + privateKey, + await derivePublicFromPrivate(key) + ]; + const keys = await exportKey({ + privateKey: pair[0], + publicKey: pair[1] + }); + return { + privateKey: keys[0], + publicKey: keys[1] + }; +} +export { randomBytes as getRandomValues }; +export async function hashAndSign(key, msg) { + const privateKey = await webcrypto.get().subtle.importKey('jwk', key, { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, false, ['sign']); + const sig = await webcrypto.get().subtle.sign({ name: 'RSASSA-PKCS1-v1_5' }, privateKey, msg instanceof Uint8Array ? msg : msg.subarray()); + return new Uint8Array(sig, 0, sig.byteLength); +} +export async function hashAndVerify(key, sig, msg) { + const publicKey = await webcrypto.get().subtle.importKey('jwk', key, { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, false, ['verify']); + return webcrypto.get().subtle.verify({ name: 'RSASSA-PKCS1-v1_5' }, publicKey, sig, msg instanceof Uint8Array ? msg : msg.subarray()); +} +async function exportKey(pair) { + if (pair.privateKey == null || pair.publicKey == null) { + throw new CodeError('Private and public key are required', 'ERR_INVALID_PARAMETERS'); + } + return Promise.all([ + webcrypto.get().subtle.exportKey('jwk', pair.privateKey), + webcrypto.get().subtle.exportKey('jwk', pair.publicKey) + ]); +} +async function derivePublicFromPrivate(jwKey) { + return webcrypto.get().subtle.importKey('jwk', { + kty: jwKey.kty, + n: jwKey.n, + e: jwKey.e + }, { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, true, ['verify']); +} +/* + +RSA encryption/decryption for the browser with webcrypto workaround +"bloody dark magic. webcrypto's why." + +Explanation: + - Convert JWK to nodeForge + - Convert msg Uint8Array to nodeForge buffer: ByteBuffer is a "binary-string backed buffer", so let's make our Uint8Array a binary string + - Convert resulting nodeForge buffer to Uint8Array: it returns a binary string, turn that into a Uint8Array + +*/ +function convertKey(key, pub, msg, handle) { + const fkey = pub ? jwk2pub(key) : jwk2priv(key); + const fmsg = uint8ArrayToString(msg instanceof Uint8Array ? msg : msg.subarray(), 'ascii'); + const fomsg = handle(fmsg, fkey); + return uint8ArrayFromString(fomsg, 'ascii'); +} +export function encrypt(key, msg) { + return convertKey(key, true, msg, (msg, key) => key.encrypt(msg)); +} +export function decrypt(key, msg) { + return convertKey(key, false, msg, (msg, key) => key.decrypt(msg)); +} +export function keySize(jwk) { + if (jwk.kty !== 'RSA') { + throw new CodeError('invalid key type', 'ERR_INVALID_KEY_TYPE'); + } + else if (jwk.n == null) { + throw new CodeError('invalid key modulus', 'ERR_INVALID_KEY_MODULUS'); + } + const bytes = uint8ArrayFromString(jwk.n, 'base64url'); + return bytes.length * 8; +} +//# sourceMappingURL=rsa-browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js.map new file mode 100644 index 000000000..3c7fea4e9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa-browser.js","sourceRoot":"","sources":["../../../src/keys/rsa-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,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b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts new file mode 100644 index 000000000..481cfe755 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts @@ -0,0 +1,44 @@ +import 'node-forge/lib/sha512.js'; +import type { Multibase } from 'multiformats'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export declare const MAX_KEY_SIZE = 8192; +export declare class RsaPublicKey { + private readonly _key; + constructor(key: JsonWebKey); + verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise; + marshal(): Uint8Array; + get bytes(): Uint8Array; + encrypt(bytes: Uint8Array | Uint8ArrayList): Uint8Array; + equals(key: any): boolean; + hash(): Promise; +} +export declare class RsaPrivateKey { + private readonly _key; + private readonly _publicKey; + constructor(key: JsonWebKey, publicKey: JsonWebKey); + genSecret(): Uint8Array; + sign(message: Uint8Array | Uint8ArrayList): Promise; + get public(): RsaPublicKey; + decrypt(bytes: Uint8Array | Uint8ArrayList): Uint8Array; + marshal(): Uint8Array; + get bytes(): Uint8Array; + equals(key: any): boolean; + hash(): Promise; + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + id(): Promise; + /** + * Exports the key into a password protected PEM format + */ + export(password: string, format?: string): Promise>; +} +export declare function unmarshalRsaPrivateKey(bytes: Uint8Array): Promise; +export declare function unmarshalRsaPublicKey(bytes: Uint8Array): RsaPublicKey; +export declare function fromJwk(jwk: JsonWebKey): Promise; +export declare function generateKeyPair(bits: number): Promise; +//# sourceMappingURL=rsa-class.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts.map new file mode 100644 index 000000000..631d4cb8d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa-class.d.ts","sourceRoot":"","sources":["../../../src/keys/rsa-class.ts"],"names":[],"mappings":"AAKA,OAAO,0BAA0B,CAAA;AAKjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,eAAO,MAAM,YAAY,OAAO,CAAA;AAEhC,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;gBAEpB,GAAG,EAAE,UAAU;IAItB,MAAM,CAAE,IAAI,EAAE,UAAU,GAAG,cAAc,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAInF,OAAO,IAAK,UAAU;IAItB,IAAI,KAAK,IAAK,UAAU,CAKvB;IAED,OAAO,CAAE,KAAK,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU;IAIxD,MAAM,CAAE,GAAG,EAAE,GAAG,GAAG,OAAO;IAIpB,IAAI,IAAK,OAAO,CAAC,UAAU,CAAC;CAKnC;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;gBAE1B,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU;IAKnD,SAAS,IAAK,UAAU;IAIlB,IAAI,CAAE,OAAO,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAItE,IAAI,MAAM,IAAK,YAAY,CAM1B;IAED,OAAO,CAAE,KAAK,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU;IAIxD,OAAO,IAAK,UAAU;IAItB,IAAI,KAAK,IAAK,UAAU,CAKvB;IAED,MAAM,CAAE,GAAG,EAAE,GAAG,GAAG,OAAO;IAIpB,IAAI,IAAK,OAAO,CAAC,UAAU,CAAC;IAMlC;;;;;;OAMG;IACG,EAAE,IAAK,OAAO,CAAC,MAAM,CAAC;IAK5B;;OAEG;IACG,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAW,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CAmB5E;AAED,wBAAsB,sBAAsB,CAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAUvF;AAED,wBAAgB,qBAAqB,CAAE,KAAK,EAAE,UAAU,GAAG,YAAY,CAQtE;AAED,wBAAsB,OAAO,CAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAQtE;AAED,wBAAsB,eAAe,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAQ3E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js new file mode 100644 index 000000000..38adf5bfa --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js @@ -0,0 +1,142 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { sha256 } from 'multiformats/hashes/sha2'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; +import 'node-forge/lib/sha512.js'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +import { exporter } from './exporter.js'; +import * as pbm from './keys.js'; +import * as crypto from './rsa.js'; +export const MAX_KEY_SIZE = 8192; +export class RsaPublicKey { + _key; + constructor(key) { + this._key = key; + } + async verify(data, sig) { + return crypto.hashAndVerify(this._key, sig, data); + } + marshal() { + return crypto.utils.jwkToPkix(this._key); + } + get bytes() { + return pbm.PublicKey.encode({ + Type: pbm.KeyType.RSA, + Data: this.marshal() + }).subarray(); + } + encrypt(bytes) { + return crypto.encrypt(this._key, bytes); + } + equals(key) { + return uint8ArrayEquals(this.bytes, key.bytes); + } + async hash() { + const { bytes } = await sha256.digest(this.bytes); + return bytes; + } +} +export class RsaPrivateKey { + _key; + _publicKey; + constructor(key, publicKey) { + this._key = key; + this._publicKey = publicKey; + } + genSecret() { + return crypto.getRandomValues(16); + } + async sign(message) { + return crypto.hashAndSign(this._key, message); + } + get public() { + if (this._publicKey == null) { + throw new CodeError('public key not provided', 'ERR_PUBKEY_NOT_PROVIDED'); + } + return new RsaPublicKey(this._publicKey); + } + decrypt(bytes) { + return crypto.decrypt(this._key, bytes); + } + marshal() { + return crypto.utils.jwkToPkcs1(this._key); + } + get bytes() { + return pbm.PrivateKey.encode({ + Type: pbm.KeyType.RSA, + Data: this.marshal() + }).subarray(); + } + equals(key) { + return uint8ArrayEquals(this.bytes, key.bytes); + } + async hash() { + const { bytes } = await sha256.digest(this.bytes); + return bytes; + } + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + async id() { + const hash = await this.public.hash(); + return uint8ArrayToString(hash, 'base58btc'); + } + /** + * Exports the key into a password protected PEM format + */ + async export(password, format = 'pkcs-8') { + if (format === 'pkcs-8') { + const buffer = new forge.util.ByteBuffer(this.marshal()); + const asn1 = forge.asn1.fromDer(buffer); + const privateKey = forge.pki.privateKeyFromAsn1(asn1); + const options = { + algorithm: 'aes256', + count: 10000, + saltSize: 128 / 8, + prfAlgorithm: 'sha512' + }; + return forge.pki.encryptRsaPrivateKey(privateKey, password, options); + } + else if (format === 'libp2p-key') { + return exporter(this.bytes, password); + } + else { + throw new CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT'); + } + } +} +export async function unmarshalRsaPrivateKey(bytes) { + const jwk = crypto.utils.pkcs1ToJwk(bytes); + if (crypto.keySize(jwk) > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE'); + } + const keys = await crypto.unmarshalPrivateKey(jwk); + return new RsaPrivateKey(keys.privateKey, keys.publicKey); +} +export function unmarshalRsaPublicKey(bytes) { + const jwk = crypto.utils.pkixToJwk(bytes); + if (crypto.keySize(jwk) > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE'); + } + return new RsaPublicKey(jwk); +} +export async function fromJwk(jwk) { + if (crypto.keySize(jwk) > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE'); + } + const keys = await crypto.unmarshalPrivateKey(jwk); + return new RsaPrivateKey(keys.privateKey, keys.publicKey); +} +export async function generateKeyPair(bits) { + if (bits > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE'); + } + const keys = await crypto.generateKey(bits); + return new RsaPrivateKey(keys.privateKey, keys.publicKey); +} +//# sourceMappingURL=rsa-class.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js.map new file mode 100644 index 000000000..8ad096881 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-class.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa-class.js","sourceRoot":"","sources":["../../../src/keys/rsa-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,qCAAqC;AACrC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAA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AAA;IAE3C,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;AAC3D,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts new file mode 100644 index 000000000..4fe649c39 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts @@ -0,0 +1,7 @@ +import 'node-forge/lib/asn1.js'; +import 'node-forge/lib/rsa.js'; +export declare function pkcs1ToJwk(bytes: Uint8Array): JsonWebKey; +export declare function jwkToPkcs1(jwk: JsonWebKey): Uint8Array; +export declare function pkixToJwk(bytes: Uint8Array): JsonWebKey; +export declare function jwkToPkix(jwk: JsonWebKey): Uint8Array; +//# sourceMappingURL=rsa-utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts.map new file mode 100644 index 000000000..c94de6143 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa-utils.d.ts","sourceRoot":"","sources":["../../../src/keys/rsa-utils.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,uBAAuB,CAAA;AAS9B,wBAAgB,UAAU,CAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAiBzD;AAGD,wBAAgB,UAAU,CAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAiBvD;AAGD,wBAAgB,SAAS,CAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CASxD;AAGD,wBAAgB,SAAS,CAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAWtD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js new file mode 100644 index 000000000..e01098bcb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js @@ -0,0 +1,65 @@ +import 'node-forge/lib/asn1.js'; +import 'node-forge/lib/rsa.js'; +import { CodeError } from '@libp2p/interface/errors'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +import { bigIntegerToUintBase64url, base64urlToBigInteger } from './../util.js'; +// Convert a PKCS#1 in ASN1 DER format to a JWK key +export function pkcs1ToJwk(bytes) { + const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')); + const privateKey = forge.pki.privateKeyFromAsn1(asn1); + // https://tools.ietf.org/html/rfc7518#section-6.3.1 + return { + kty: 'RSA', + n: bigIntegerToUintBase64url(privateKey.n), + e: bigIntegerToUintBase64url(privateKey.e), + d: bigIntegerToUintBase64url(privateKey.d), + p: bigIntegerToUintBase64url(privateKey.p), + q: bigIntegerToUintBase64url(privateKey.q), + dp: bigIntegerToUintBase64url(privateKey.dP), + dq: bigIntegerToUintBase64url(privateKey.dQ), + qi: bigIntegerToUintBase64url(privateKey.qInv), + alg: 'RS256' + }; +} +// Convert a JWK key into PKCS#1 in ASN1 DER format +export function jwkToPkcs1(jwk) { + if (jwk.n == null || jwk.e == null || jwk.d == null || jwk.p == null || jwk.q == null || jwk.dp == null || jwk.dq == null || jwk.qi == null) { + throw new CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS'); + } + const asn1 = forge.pki.privateKeyToAsn1({ + n: base64urlToBigInteger(jwk.n), + e: base64urlToBigInteger(jwk.e), + d: base64urlToBigInteger(jwk.d), + p: base64urlToBigInteger(jwk.p), + q: base64urlToBigInteger(jwk.q), + dP: base64urlToBigInteger(jwk.dp), + dQ: base64urlToBigInteger(jwk.dq), + qInv: base64urlToBigInteger(jwk.qi) + }); + return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii'); +} +// Convert a PKCIX in ASN1 DER format to a JWK key +export function pkixToJwk(bytes) { + const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')); + const publicKey = forge.pki.publicKeyFromAsn1(asn1); + return { + kty: 'RSA', + n: bigIntegerToUintBase64url(publicKey.n), + e: bigIntegerToUintBase64url(publicKey.e) + }; +} +// Convert a JWK key to PKCIX in ASN1 DER format +export function jwkToPkix(jwk) { + if (jwk.n == null || jwk.e == null) { + throw new CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS'); + } + const asn1 = forge.pki.publicKeyToAsn1({ + n: base64urlToBigInteger(jwk.n), + e: base64urlToBigInteger(jwk.e) + }); + return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii'); +} +//# sourceMappingURL=rsa-utils.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js.map new file mode 100644 index 000000000..048eba52b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa-utils.js","sourceRoot":"","sources":["../../../src/keys/rsa-utils.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,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C,CAAC;QACzC,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC;KAC1C,CAAA;AACH,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,SAAS,CAAE,GAAe;IACxC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,EAAE;QAClC,MAAM,IAAI,SAAS,CAAC,4BAA4B,EAAE,wBAAwB,CAAC,CAAA;KAC5E;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;QACrC,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/B,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;KAChC,CAAC,CAAA;IAEF,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;AACzE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts new file mode 100644 index 000000000..f8787e167 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts @@ -0,0 +1,14 @@ +import randomBytes from '../random-bytes.js'; +import * as utils from './rsa-utils.js'; +import type { JWKKeyPair } from './interface.js'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export { utils }; +export declare function generateKey(bits: number): Promise; +export declare function unmarshalPrivateKey(key: JsonWebKey): Promise; +export { randomBytes as getRandomValues }; +export declare function hashAndSign(key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function hashAndVerify(key: JsonWebKey, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function encrypt(key: JsonWebKey, bytes: Uint8Array | Uint8ArrayList): Uint8Array; +export declare function decrypt(key: JsonWebKey, bytes: Uint8Array | Uint8ArrayList): Uint8Array; +export declare function keySize(jwk: JsonWebKey): number; +//# sourceMappingURL=rsa.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts.map new file mode 100644 index 000000000..7f4d8361d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa.d.ts","sourceRoot":"","sources":["../../../src/keys/rsa.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,wBAAsB,WAAW,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAcpE;AAGD,wBAAsB,mBAAmB,CAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAY/E;AAED,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,CAAA;AAEzC,wBAAsB,WAAW,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAazG;AAED,wBAAsB,aAAa,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAazH;AAID,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,CAQxF;AAED,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,CAQxF;AAED,wBAAgB,OAAO,CAAE,GAAG,EAAE,UAAU,GAAG,MAAM,CAQhD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js new file mode 100644 index 000000000..58085d563 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js @@ -0,0 +1,94 @@ +import crypto from 'crypto'; +import { promisify } from 'util'; +import { CodeError } from '@libp2p/interface/errors'; +import randomBytes from '../random-bytes.js'; +import * as utils from './rsa-utils.js'; +const keypair = promisify(crypto.generateKeyPair); +export { utils }; +export async function generateKey(bits) { + // @ts-expect-error node types are missing jwk as a format + const key = await keypair('rsa', { + modulusLength: bits, + publicKeyEncoding: { type: 'pkcs1', format: 'jwk' }, + privateKeyEncoding: { type: 'pkcs1', format: 'jwk' } + }); + return { + // @ts-expect-error node types are missing jwk as a format + privateKey: key.privateKey, + // @ts-expect-error node types are missing jwk as a format + publicKey: key.publicKey + }; +} +// Takes a jwk key +export async function unmarshalPrivateKey(key) { + if (key == null) { + throw new CodeError('Missing key parameter', 'ERR_MISSING_KEY'); + } + return { + privateKey: key, + publicKey: { + kty: key.kty, + n: key.n, + e: key.e + } + }; +} +export { randomBytes as getRandomValues }; +export async function hashAndSign(key, msg) { + const hash = crypto.createSign('RSA-SHA256'); + if (msg instanceof Uint8Array) { + hash.update(msg); + } + else { + for (const buf of msg) { + hash.update(buf); + } + } + // @ts-expect-error node types are missing jwk as a format + return hash.sign({ format: 'jwk', key }); +} +export async function hashAndVerify(key, sig, msg) { + const hash = crypto.createVerify('RSA-SHA256'); + if (msg instanceof Uint8Array) { + hash.update(msg); + } + else { + for (const buf of msg) { + hash.update(buf); + } + } + // @ts-expect-error node types are missing jwk as a format + return hash.verify({ format: 'jwk', key }, sig); +} +const padding = crypto.constants.RSA_PKCS1_PADDING; +export function encrypt(key, bytes) { + if (bytes instanceof Uint8Array) { + // @ts-expect-error node types are missing jwk as a format + return crypto.publicEncrypt({ format: 'jwk', key, padding }, bytes); + } + else { + // @ts-expect-error node types are missing jwk as a format + return crypto.publicEncrypt({ format: 'jwk', key, padding }, bytes.subarray()); + } +} +export function decrypt(key, bytes) { + if (bytes instanceof Uint8Array) { + // @ts-expect-error node types are missing jwk as a format + return crypto.privateDecrypt({ format: 'jwk', key, padding }, bytes); + } + else { + // @ts-expect-error node types are missing jwk as a format + return crypto.privateDecrypt({ format: 'jwk', key, padding }, bytes.subarray()); + } +} +export function keySize(jwk) { + if (jwk.kty !== 'RSA') { + throw new CodeError('invalid key type', 'ERR_INVALID_KEY_TYPE'); + } + else if (jwk.n == null) { + throw new CodeError('invalid key modulus', 'ERR_INVALID_KEY_MODULUS'); + } + const modulus = Buffer.from(jwk.n, 'base64'); + return modulus.length * 8; +} +//# sourceMappingURL=rsa.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js.map new file mode 100644 index 000000000..76465cb0c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/rsa.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa.js","sourceRoot":"","sources":["../../../src/keys/rsa.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAA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,IAAI,KAAK,YAAY,UAAU,EAAE;QAC/B,0DAA0D;QAC1D,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,CAAA;KACrE;SAAM;QACL,0DAA0D;QAC1D,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;KAChF;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAE,GAAe;IACtC,IAAI,GAAG,CAAC,GAAG,KAAK,KAAK,EAAE;QACrB,MAAM,IAAI,SAAS,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAA;KAChE;SAAM,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,EAAE;QACxB,MAAM,IAAI,SAAS,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAAA;KACtE;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC5C,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAA;AAC3B,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts new file mode 100644 index 000000000..15ca1784b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts @@ -0,0 +1,18 @@ +import type { Uint8ArrayList } from 'uint8arraylist'; +declare const PRIVATE_KEY_BYTE_LENGTH = 32; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export declare function generateKey(): Uint8Array; +/** + * Hash and sign message with private key + */ +export declare function hashAndSign(key: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +/** + * Hash message and verify signature with public key + */ +export declare function hashAndVerify(key: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function compressPublicKey(key: Uint8Array): Uint8Array; +export declare function decompressPublicKey(key: Uint8Array): Uint8Array; +export declare function validatePrivateKey(key: Uint8Array): void; +export declare function validatePublicKey(key: Uint8Array): void; +export declare function computePublicKey(privateKey: Uint8Array): Uint8Array; +//# sourceMappingURL=secp256k1-browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts.map new file mode 100644 index 000000000..606f733cc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1-browser.d.ts","sourceRoot":"","sources":["../../../src/keys/secp256k1-browser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAA;AAEtD,wBAAgB,WAAW,IAAK,UAAU,CAEzC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAQzG;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAOzH;AAED,wBAAgB,iBAAiB,CAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAG9D;AAED,wBAAgB,mBAAmB,CAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAGhE;AAED,wBAAgB,kBAAkB,CAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAMzD;AAED,wBAAgB,iBAAiB,CAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAMxD;AAED,wBAAgB,gBAAgB,CAAE,UAAU,EAAE,UAAU,GAAG,UAAU,CAMpE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js new file mode 100644 index 000000000..092a911bd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js @@ -0,0 +1,66 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { secp256k1 as secp } from '@noble/curves/secp256k1'; +import { sha256 } from 'multiformats/hashes/sha2'; +const PRIVATE_KEY_BYTE_LENGTH = 32; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export function generateKey() { + return secp.utils.randomPrivateKey(); +} +/** + * Hash and sign message with private key + */ +export async function hashAndSign(key, msg) { + const { digest } = await sha256.digest(msg instanceof Uint8Array ? msg : msg.subarray()); + try { + const signature = secp.sign(digest, key); + return signature.toDERRawBytes(); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT'); + } +} +/** + * Hash message and verify signature with public key + */ +export async function hashAndVerify(key, sig, msg) { + try { + const { digest } = await sha256.digest(msg instanceof Uint8Array ? msg : msg.subarray()); + return secp.verify(sig, digest, key); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT'); + } +} +export function compressPublicKey(key) { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(true); + return point; +} +export function decompressPublicKey(key) { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(false); + return point; +} +export function validatePrivateKey(key) { + try { + secp.getPublicKey(key, true); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY'); + } +} +export function validatePublicKey(key) { + try { + secp.ProjectivePoint.fromHex(key); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PUBLIC_KEY'); + } +} +export function computePublicKey(privateKey) { + try { + return secp.getPublicKey(privateKey, true); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY'); + } +} +//# sourceMappingURL=secp256k1-browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js.map new file mode 100644 index 000000000..61654f79e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1-browser.js","sourceRoot":"","sources":["../../../src/keys/secp256k1-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAGjD,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAA;AAEtD,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAA;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,GAAe,EAAE,GAAgC;IAClF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC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AAC,CAAA;KAC7B;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,yBAAyB,CAAC,CAAA;KAC5D;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,GAAe;IAChD,IAAI;QACF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;KAClC;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,wBAAwB,CAAC,CAAA;KAC3D;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAE,UAAsB;IACtD,IAAI;QACF,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;KAC3C;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,yBAAyB,CAAC,CAAA;KAC5D;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts new file mode 100644 index 000000000..cd5282842 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts @@ -0,0 +1,38 @@ +import type { Multibase } from 'multiformats'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export declare class Secp256k1PublicKey { + private readonly _key; + constructor(key: Uint8Array); + verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise; + marshal(): Uint8Array; + get bytes(): Uint8Array; + equals(key: any): boolean; + hash(): Promise; +} +export declare class Secp256k1PrivateKey { + private readonly _key; + private readonly _publicKey; + constructor(key: Uint8Array, publicKey?: Uint8Array); + sign(message: Uint8Array | Uint8ArrayList): Promise; + get public(): Secp256k1PublicKey; + marshal(): Uint8Array; + get bytes(): Uint8Array; + equals(key: any): boolean; + hash(): Promise; + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + id(): Promise; + /** + * Exports the key into a password protected `format` + */ + export(password: string, format?: string): Promise>; +} +export declare function unmarshalSecp256k1PrivateKey(bytes: Uint8Array): Secp256k1PrivateKey; +export declare function unmarshalSecp256k1PublicKey(bytes: Uint8Array): Secp256k1PublicKey; +export declare function generateKeyPair(): Promise; +//# sourceMappingURL=secp256k1-class.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts.map new file mode 100644 index 000000000..b9b6415d5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1-class.d.ts","sourceRoot":"","sources":["../../../src/keys/secp256k1-class.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;gBAEpB,GAAG,EAAE,UAAU;IAKtB,MAAM,CAAE,IAAI,EAAE,UAAU,GAAG,cAAc,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAInF,OAAO,IAAK,UAAU;IAItB,IAAI,KAAK,IAAK,UAAU,CAKvB;IAED,MAAM,CAAE,GAAG,EAAE,GAAG,GAAG,OAAO;IAIpB,IAAI,IAAK,OAAO,CAAC,UAAU,CAAC;CAKnC;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;gBAE1B,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,UAAU;IAO9C,IAAI,CAAE,OAAO,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAItE,IAAI,MAAM,IAAK,kBAAkB,CAEhC;IAED,OAAO,IAAK,UAAU;IAItB,IAAI,KAAK,IAAK,UAAU,CAKvB;IAED,MAAM,CAAE,GAAG,EAAE,GAAG,GAAG,OAAO;IAIpB,IAAI,IAAK,OAAO,CAAC,UAAU,CAAC;IAMlC;;;;;;OAMG;IACG,EAAE,IAAK,OAAO,CAAC,MAAM,CAAC;IAK5B;;OAEG;IACG,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAe,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CAOhF;AAED,wBAAgB,4BAA4B,CAAE,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAEpF;AAED,wBAAgB,2BAA2B,CAAE,KAAK,EAAE,UAAU,GAAG,kBAAkB,CAElF;AAED,wBAAsB,eAAe,IAAK,OAAO,CAAC,mBAAmB,CAAC,CAGrE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js new file mode 100644 index 000000000..fa7513b64 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js @@ -0,0 +1,98 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { sha256 } from 'multiformats/hashes/sha2'; +import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +import { exporter } from './exporter.js'; +import * as keysProtobuf from './keys.js'; +import * as crypto from './secp256k1.js'; +export class Secp256k1PublicKey { + _key; + constructor(key) { + crypto.validatePublicKey(key); + this._key = key; + } + async verify(data, sig) { + return crypto.hashAndVerify(this._key, sig, data); + } + marshal() { + return crypto.compressPublicKey(this._key); + } + get bytes() { + return keysProtobuf.PublicKey.encode({ + Type: keysProtobuf.KeyType.Secp256k1, + Data: this.marshal() + }).subarray(); + } + equals(key) { + return uint8ArrayEquals(this.bytes, key.bytes); + } + async hash() { + const { bytes } = await sha256.digest(this.bytes); + return bytes; + } +} +export class Secp256k1PrivateKey { + _key; + _publicKey; + constructor(key, publicKey) { + this._key = key; + this._publicKey = publicKey ?? crypto.computePublicKey(key); + crypto.validatePrivateKey(this._key); + crypto.validatePublicKey(this._publicKey); + } + async sign(message) { + return crypto.hashAndSign(this._key, message); + } + get public() { + return new Secp256k1PublicKey(this._publicKey); + } + marshal() { + return this._key; + } + get bytes() { + return keysProtobuf.PrivateKey.encode({ + Type: keysProtobuf.KeyType.Secp256k1, + Data: this.marshal() + }).subarray(); + } + equals(key) { + return uint8ArrayEquals(this.bytes, key.bytes); + } + async hash() { + const { bytes } = await sha256.digest(this.bytes); + return bytes; + } + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + async id() { + const hash = await this.public.hash(); + return uint8ArrayToString(hash, 'base58btc'); + } + /** + * Exports the key into a password protected `format` + */ + async export(password, format = 'libp2p-key') { + if (format === 'libp2p-key') { + return exporter(this.bytes, password); + } + else { + throw new CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT'); + } + } +} +export function unmarshalSecp256k1PrivateKey(bytes) { + return new Secp256k1PrivateKey(bytes); +} +export function unmarshalSecp256k1PublicKey(bytes) { + return new Secp256k1PublicKey(bytes); +} +export async function generateKeyPair() { + const privateKeyBytes = crypto.generateKey(); + return new Secp256k1PrivateKey(privateKeyBytes); +} +//# sourceMappingURL=secp256k1-class.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js.map new file mode 100644 index 000000000..d750a5a51 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1-class.js.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1-class.js","sourceRoot":"","sources":["../../../src/keys/secp256k1-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,YAAY,MAAM,WAAW,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAIxC,MAAM,OAAO,kBAAkB;IACZ,IAAI,CAAY;IAEjC,YAAa,GAAe;QAC1B,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAAiC,EAAE,GAAe;QAC9D,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;IAED,OAAO;QACL,OAAO,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAED,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way-down/crypto/dist/src/keys/secp256k1.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts new file mode 100644 index 000000000..0c76d450c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts @@ -0,0 +1,18 @@ +import type { Uint8ArrayList } from 'uint8arraylist'; +declare const PRIVATE_KEY_BYTE_LENGTH = 32; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export declare function generateKey(): Uint8Array; +/** + * Hash and sign message with private key + */ +export declare function hashAndSign(key: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +/** + * Hash message and verify signature with public key + */ +export declare function hashAndVerify(key: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise; +export declare function compressPublicKey(key: Uint8Array): Uint8Array; +export declare function decompressPublicKey(key: Uint8Array): Uint8Array; +export declare function validatePrivateKey(key: Uint8Array): void; +export declare function validatePublicKey(key: Uint8Array): void; +export declare function computePublicKey(privateKey: Uint8Array): Uint8Array; +//# sourceMappingURL=secp256k1.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts.map new file mode 100644 index 000000000..dad1409ba --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1.d.ts","sourceRoot":"","sources":["../../../src/keys/secp256k1.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAA;AAEtD,wBAAgB,WAAW,IAAK,UAAU,CAEzC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBzG;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBzH;AAED,wBAAgB,iBAAiB,CAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAG9D;AAED,wBAAgB,mBAAmB,CAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAGhE;AAED,wBAAgB,kBAAkB,CAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAMzD;AAED,wBAAgB,iBAAiB,CAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAMxD;AAED,wBAAgB,gBAAgB,CAAE,UAAU,EAAE,UAAU,GAAG,UAAU,CAMpE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js new file mode 100644 index 000000000..6af764d40 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js @@ -0,0 +1,84 @@ +import crypto from 'node:crypto'; +import { CodeError } from '@libp2p/interface/errors'; +import { secp256k1 as secp } from '@noble/curves/secp256k1'; +const PRIVATE_KEY_BYTE_LENGTH = 32; +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength }; +export function generateKey() { + return secp.utils.randomPrivateKey(); +} +/** + * Hash and sign message with private key + */ +export async function hashAndSign(key, msg) { + const hash = crypto.createHash('sha256'); + if (msg instanceof Uint8Array) { + hash.update(msg); + } + else { + for (const buf of msg) { + hash.update(buf); + } + } + const digest = hash.digest(); + try { + const signature = secp.sign(digest, key); + return signature.toDERRawBytes(); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT'); + } +} +/** + * Hash message and verify signature with public key + */ +export async function hashAndVerify(key, sig, msg) { + const hash = crypto.createHash('sha256'); + if (msg instanceof Uint8Array) { + hash.update(msg); + } + else { + for (const buf of msg) { + hash.update(buf); + } + } + const digest = hash.digest(); + try { + return secp.verify(sig, digest, key); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT'); + } +} +export function compressPublicKey(key) { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(true); + return point; +} +export function decompressPublicKey(key) { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(false); + return point; +} +export function validatePrivateKey(key) { + try { + secp.getPublicKey(key, true); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY'); + } +} +export function validatePublicKey(key) { + try { + secp.ProjectivePoint.fromHex(key); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PUBLIC_KEY'); + } +} +export function computePublicKey(privateKey) { + try { + return secp.getPublicKey(privateKey, true); + } + catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY'); + } +} +//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js.map new file mode 100644 index 000000000..070ed51da --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/keys/secp256k1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["../../../src/keys/secp256k1.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAC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AA;KAC3C;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,yBAAyB,CAAC,CAAA;KAC5D;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts new file mode 100644 index 000000000..3b8617995 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts @@ -0,0 +1,5 @@ +/** + * Computes the Password-Based Key Derivation Function 2. + */ +export default function pbkdf2(password: string, salt: string, iterations: number, keySize: number, hash: string): string; +//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts.map new file mode 100644 index 000000000..f47134fed --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src/pbkdf2.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBzH"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js new file mode 100644 index 000000000..fc512923d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js @@ -0,0 +1,30 @@ +import { CodeError } from '@libp2p/interface/errors'; +// @ts-expect-error types are missing +import forgePbkdf2 from 'node-forge/lib/pbkdf2.js'; +// @ts-expect-error types are missing +import forgeUtil from 'node-forge/lib/util.js'; +/** + * Maps an IPFS hash name to its node-forge equivalent. + * + * See https://github.com/multiformats/multihash/blob/master/hashtable.csv + * + * @private + */ +const hashName = { + sha1: 'sha1', + 'sha2-256': 'sha256', + 'sha2-512': 'sha512' +}; +/** + * Computes the Password-Based Key Derivation Function 2. + */ +export default function pbkdf2(password, salt, iterations, keySize, hash) { + if (hash !== 'sha1' && hash !== 'sha2-256' && hash !== 'sha2-512') { + const types = Object.keys(hashName).join(' / '); + throw new CodeError(`Hash '${hash}' is unknown or not supported. Must be ${types}`, 'ERR_UNSUPPORTED_HASH_TYPE'); + } + const hasher = hashName[hash]; + const dek = forgePbkdf2(password, salt, iterations, keySize, hasher); + return forgeUtil.encode64(dek, null); +} +//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js.map new file mode 100644 index 000000000..c089bb916 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/pbkdf2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../src/pbkdf2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,qCAAqC;AACrC,OAAO,WAAW,MAAM,0BAA0B,CAAA;AAClD,qCAAqC;AACrC,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAE9C;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;CACrB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,QAAgB,EAAE,IAAY,EAAE,UAAkB,EAAE,OAAe,EAAE,IAAY;IAC/G,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU,EAAE;QACjE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC/C,MAAM,IAAI,SAAS,CAAC,SAAS,IAAI,0CAA0C,KAAK,EAAE,EAAE,2BAA2B,CAAC,CAAA;KACjH;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,GAAG,GAAG,WAAW,CACrB,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,OAAO,EACP,MAAM,CACP,CAAA;IAED,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;AACtC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts new file mode 100644 index 000000000..4581f3895 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts @@ -0,0 +1,5 @@ +/** + * Generates a Uint8Array with length `number` populated by random bytes + */ +export default function randomBytes(length: number): Uint8Array; +//# sourceMappingURL=random-bytes.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts.map new file mode 100644 index 000000000..3611f639f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"random-bytes.d.ts","sourceRoot":"","sources":["../../src/random-bytes.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAK/D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js new file mode 100644 index 000000000..e01e41c7a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js @@ -0,0 +1,12 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { randomBytes as randB } from '@noble/hashes/utils'; +/** + * Generates a Uint8Array with length `number` populated by random bytes + */ +export default function randomBytes(length) { + if (isNaN(length) || length <= 0) { + throw new CodeError('random bytes length must be a Number bigger than 0', 'ERR_INVALID_LENGTH'); + } + return randB(length); +} +//# sourceMappingURL=random-bytes.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js.map new file mode 100644 index 000000000..7cc1a0f81 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/random-bytes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"random-bytes.js","sourceRoot":"","sources":["../../src/random-bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAE1D;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,MAAc;IACjD,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE;QAChC,MAAM,IAAI,SAAS,CAAC,oDAAoD,EAAE,oBAAoB,CAAC,CAAA;KAChG;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts new file mode 100644 index 000000000..d59fc983a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts @@ -0,0 +1,9 @@ +import 'node-forge/lib/util.js'; +import 'node-forge/lib/jsbn.js'; +import forge from 'node-forge/lib/forge.js'; +export declare function bigIntegerToUintBase64url(num: { + abs(): any; +}, len?: number): string; +export declare function base64urlToBigInteger(str: string): typeof forge.jsbn.BigInteger; +export declare function base64urlToBuffer(str: string, len?: number): Uint8Array; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts.map new file mode 100644 index 000000000..f02676bc9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,wBAAwB,CAAA;AAE/B,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAK3C,wBAAgB,yBAAyB,CAAE,GAAG,EAAE;IAAE,GAAG,IAAI,GAAG,CAAA;CAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAgBpF;AAGD,wBAAgB,qBAAqB,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAGhF;AAED,wBAAgB,iBAAiB,CAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CASxE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js new file mode 100644 index 000000000..ca37c5404 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js @@ -0,0 +1,37 @@ +import 'node-forge/lib/util.js'; +import 'node-forge/lib/jsbn.js'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; +export function bigIntegerToUintBase64url(num, len) { + // Call `.abs()` to convert to unsigned + let buf = Uint8Array.from(num.abs().toByteArray()); // toByteArray converts to big endian + // toByteArray() gives us back a signed array, which will include a leading 0 + // byte if the most significant bit of the number is 1: + // https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer + // Our number will always be positive so we should remove the leading padding. + buf = buf[0] === 0 ? buf.subarray(1) : buf; + if (len != null) { + if (buf.length > len) + throw new Error('byte array longer than desired length'); + buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]); + } + return uint8ArrayToString(buf, 'base64url'); +} +// Convert a base64url encoded string to a BigInteger +export function base64urlToBigInteger(str) { + const buf = base64urlToBuffer(str); + return new forge.jsbn.BigInteger(uint8ArrayToString(buf, 'base16'), 16); +} +export function base64urlToBuffer(str, len) { + let buf = uint8ArrayFromString(str, 'base64urlpad'); + if (len != null) { + if (buf.length > len) + throw new Error('byte array longer than desired length'); + buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]); + } + return buf; +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js.map new file mode 100644 index 000000000..8035f5670 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,wBAAwB,CAAA;AAC/B,qCAAqC;AACrC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAEtE,MAAM,UAAU,yBAAyB,CAAE,GAAmB,EAAE,GAAY;IAC1E,uCAAuC;IACvC,IAAI,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA,CAAC,qCAAqC;IAExF,6EAA6E;IAC7E,uDAAuD;IACvD,6EAA6E;IAC7E,8EAA8E;IAC9E,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAE1C,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAC9E,GAAG,GAAG,gBAAgB,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;KAChE;IAED,OAAO,kBAAkB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;AAC7C,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,qBAAqB,CAAE,GAAW;IAChD,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAA;IAClC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAA;AACzE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,GAAW,EAAE,GAAY;IAC1D,IAAI,GAAG,GAAG,oBAAoB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAA;IAEnD,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAC9E,GAAG,GAAG,gBAAgB,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;KAChE;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts new file mode 100644 index 000000000..a7d6b9277 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts @@ -0,0 +1,5 @@ +declare const _default: { + get(win?: typeof globalThis): Crypto; +}; +export default _default; +//# sourceMappingURL=webcrypto.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts.map new file mode 100644 index 000000000..b50f2bfbe --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["../../src/webcrypto.ts"],"names":[],"mappings":";;;AAIA,wBAmBC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js new file mode 100644 index 000000000..7ba858c17 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js @@ -0,0 +1,17 @@ +/* eslint-env browser */ +// Check native crypto exists and is enabled (In insecure context `self.crypto` +// exists but `self.crypto.subtle` does not). +export default { + get(win = globalThis) { + const nativeCrypto = win.crypto; + if (nativeCrypto == null || nativeCrypto.subtle == null) { + throw Object.assign(new Error('Missing Web Crypto API. ' + + 'The most likely cause of this error is that this page is being accessed ' + + 'from an insecure context (i.e. not HTTPS). For more information and ' + + 'possible resolutions see ' + + 'https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api'), { code: 'ERR_MISSING_WEB_CRYPTO' }); + } + return nativeCrypto; + } +}; +//# sourceMappingURL=webcrypto.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js.map new file mode 100644 index 000000000..66311f6b2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/src/webcrypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webcrypto.js","sourceRoot":"","sources":["../../src/webcrypto.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,+EAA+E;AAC/E,6CAA6C;AAC7C,eAAe;IACb,GAAG,CAAE,GAAG,GAAG,UAAU;QACnB,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAA;QAE/B,IAAI,YAAY,IAAI,IAAI,IAAI,YAAY,CAAC,MAAM,IAAI,IAAI,EAAE;YACvD,MAAM,MAAM,CAAC,MAAM,CACjB,IAAI,KAAK,CACP,0BAA0B;gBAC1B,0EAA0E;gBAC1E,sEAAsE;gBACtE,2BAA2B;gBAC3B,wFAAwF,CACzF,EACD,EAAE,IAAI,EAAE,wBAAwB,EAAE,CACnC,CAAA;SACF;QAED,OAAO,YAAY,CAAA;IACrB,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts new file mode 100644 index 000000000..9064acdeb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=aes.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts.map new file mode 100644 index 000000000..447d94c9b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aes.spec.d.ts","sourceRoot":"","sources":["../../../test/aes/aes.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js new file mode 100644 index 000000000..1f5432ea7 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js @@ -0,0 +1,87 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-disable valid-jsdoc */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import * as crypto from '../../src/index.js'; +import fixtures from './../fixtures/aes.js'; +import goFixtures from './../fixtures/go-aes.js'; +const bytes = [{ + length: 16, + hash: 'AES-128' + }, { + length: 32, + hash: 'AES-256' + }]; +describe('AES-CTR', () => { + bytes.forEach(({ length, hash }) => { + it(`${hash} - encrypt and decrypt`, async () => { + const key = new Uint8Array(length); + key.fill(5); + const iv = new Uint8Array(16); + iv.fill(1); + const cipher = await crypto.aes.create(key, iv); + await encryptAndDecrypt(cipher); + await encryptAndDecrypt(cipher); + await encryptAndDecrypt(cipher); + await encryptAndDecrypt(cipher); + await encryptAndDecrypt(cipher); + }); + }); + bytes.forEach(({ length, hash }) => { + it(`${hash} - fixed - encrypt and decrypt`, async () => { + const key = new Uint8Array(length); + key.fill(5); + const iv = new Uint8Array(16); + iv.fill(1); + const cipher = await crypto.aes.create(key, iv); + // @ts-expect-error cannot index fixtures like this + const fixture = fixtures[length]; + for (let i = 0; i < fixture.inputs.length; i++) { + const input = fixture.inputs[i]; + const output = fixture.outputs[i]; + const encrypted = await cipher.encrypt(input); + expect(encrypted).to.have.length(output.length); + expect(encrypted).to.eql(output); + const decrypted = await cipher.decrypt(encrypted); + expect(decrypted).to.eql(input); + } + }); + }); + bytes.forEach(({ length, hash }) => { + // @ts-expect-error cannot index fixtures like this + if (goFixtures[length] == null) { + return; + } + it(`${hash} - go interop - encrypt and decrypt`, async () => { + const key = new Uint8Array(length); + key.fill(5); + const iv = new Uint8Array(16); + iv.fill(1); + const cipher = await crypto.aes.create(key, iv); + // @ts-expect-error cannot index fixtures like this + const fixture = goFixtures[length]; + for (let i = 0; i < fixture.inputs.length; i++) { + const input = fixture.inputs[i]; + const output = fixture.outputs[i]; + const encrypted = await cipher.encrypt(input); + expect(encrypted).to.have.length(output.length); + expect(encrypted).to.eql(output); + const decrypted = await cipher.decrypt(encrypted); + expect(decrypted).to.eql(input); + } + }); + }); + it('checks key length', () => { + const key = new Uint8Array(5); + const iv = new Uint8Array(16); + return expect(crypto.aes.create(key, iv)).to.eventually.be.rejected.with.property('code', 'ERR_INVALID_KEY_LENGTH'); + }); +}); +async function encryptAndDecrypt(cipher) { + const data = new Uint8Array(100); + data.fill(Math.ceil(Math.random() * 100)); + const encrypted = await cipher.encrypt(data); + const decrypted = await cipher.decrypt(encrypted); + expect(decrypted).to.be.eql(data); +} +//# sourceMappingURL=aes.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js.map new file mode 100644 index 000000000..f94763726 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/aes/aes.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aes.spec.js","sourceRoot":"","sources":["../../../test/aes/aes.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,gCAAgC;AAChC,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,QAAQ,MAAM,sBAAsB,CAAA;AAC3C,OAAO,UAAU,MAAM,yBAAyB,CAAA;AAGhD,MAAM,KAAK,GAAG,CAAC;QACb,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAChB,EAAE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KACh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AE,wBAAwB,CAAC,CAAA;IACrH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,KAAK,UAAU,iBAAiB,CAAE,MAAiB;IACjD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAA;IAEzC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAEjD,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts new file mode 100644 index 000000000..00878891a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=crypto.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts.map new file mode 100644 index 000000000..e7f21c887 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.spec.d.ts","sourceRoot":"","sources":["../../test/crypto.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js new file mode 100644 index 000000000..7b0687384 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js @@ -0,0 +1,130 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; +import * as crypto from '../src/index.js'; +import { RsaPrivateKey, RsaPublicKey } from '../src/keys/rsa-class.js'; +import fixtures from './fixtures/go-key-rsa.js'; +describe('libp2p-crypto', function () { + this.timeout(20 * 1000); + let key; + before(async () => { + const generated = await crypto.keys.generateKeyPair('RSA', 512); + if (!(generated instanceof RsaPrivateKey)) { + throw new Error('Key was incorrect type'); + } + key = generated; + }); + it('marshalPublicKey and unmarshalPublicKey', () => { + const key2 = crypto.keys.unmarshalPublicKey(crypto.keys.marshalPublicKey(key.public)); + if (!(key2 instanceof RsaPublicKey)) { + throw new Error('Wrong key type unmarshalled'); + } + expect(key2.equals(key.public)).to.be.eql(true); + expect(() => { + crypto.keys.marshalPublicKey(key.public, 'invalid-key-type'); + }).to.throw(); + }); + it('marshalPrivateKey and unmarshalPrivateKey', async () => { + expect(() => { + crypto.keys.marshalPrivateKey(key, 'invalid-key-type'); + }).to.throw(); + const key2 = await crypto.keys.unmarshalPrivateKey(crypto.keys.marshalPrivateKey(key)); + if (!(key2 instanceof RsaPrivateKey)) { + throw new Error('Wrong key type unmarshalled'); + } + expect(key2.equals(key)).to.be.eql(true); + expect(key2.public.equals(key.public)).to.be.eql(true); + }); + it('generateKeyPair', () => { + // @ts-expect-error key type is invalid + return expect(crypto.keys.generateKeyPair('invalid-key-type', 512)).to.eventually.be.rejected.with.property('code', 'ERR_UNSUPPORTED_KEY_TYPE'); + }); + it('generateKeyPairFromSeed', () => { + const seed = crypto.randomBytes(32); + // @ts-expect-error key type is invalid + return expect(crypto.keys.generateKeyPairFromSeed('invalid-key-type', seed, 512)).to.eventually.be.rejected.with.property('code', 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE'); + }); + // https://github.com/libp2p/js-libp2p-crypto/issues/314 + function isSafari() { + return typeof navigator !== 'undefined' && navigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome') && navigator.userAgent.includes('Mac'); + } + // marshalled keys seem to be slightly different + // unsure as to if this is just a difference in encoding + // or a bug + describe('go interop', () => { + it('unmarshals private key', async () => { + if (isSafari()) { + // eslint-disable-next-line no-console + console.warn('Skipping test in Safari. Known bug: https://github.com/libp2p/js-libp2p-crypto/issues/314'); + return; + } + const key = await crypto.keys.unmarshalPrivateKey(fixtures.private.key); + const hash = fixtures.private.hash; + expect(fixtures.private.key).to.eql(key.bytes); + const digest = await key.hash(); + expect(digest).to.eql(hash); + }); + it('unmarshals public key', async () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.public.key); + const hash = fixtures.public.hash; + expect(crypto.keys.marshalPublicKey(key)).to.eql(fixtures.public.key); + const digest = await key.hash(); + expect(digest).to.eql(hash); + }); + it('unmarshal -> marshal, private key', async () => { + const key = await crypto.keys.unmarshalPrivateKey(fixtures.private.key); + const marshalled = crypto.keys.marshalPrivateKey(key); + if (isSafari()) { + // eslint-disable-next-line no-console + console.warn('Running differnt test in Safari. Known bug: https://github.com/libp2p/js-libp2p-crypto/issues/314'); + const key2 = await crypto.keys.unmarshalPrivateKey(marshalled); + expect(key2.bytes).to.eql(key.bytes); + return; + } + expect(marshalled).to.eql(fixtures.private.key); + }); + it('unmarshal -> marshal, public key', () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.public.key); + const marshalled = crypto.keys.marshalPublicKey(key); + expect(uint8ArrayEquals(fixtures.public.key, marshalled)).to.eql(true); + }); + }); + describe('pbkdf2', () => { + it('generates a derived password using sha1', () => { + const p1 = crypto.pbkdf2('password', 'at least 16 character salt', 500, 512 / 8, 'sha1'); + expect(p1).to.exist(); + expect(p1).to.be.a('string'); + }); + it('generates a derived password using sha2-512', () => { + const p1 = crypto.pbkdf2('password', 'at least 16 character salt', 500, 512 / 8, 'sha2-512'); + expect(p1).to.exist(); + expect(p1).to.be.a('string'); + }); + it('generates the same derived password with the same options', () => { + const p1 = crypto.pbkdf2('password', 'at least 16 character salt', 10, 512 / 8, 'sha1'); + const p2 = crypto.pbkdf2('password', 'at least 16 character salt', 10, 512 / 8, 'sha1'); + const p3 = crypto.pbkdf2('password', 'at least 16 character salt', 11, 512 / 8, 'sha1'); + expect(p2).to.equal(p1); + expect(p3).to.not.equal(p2); + }); + it('throws on invalid hash name', () => { + const fn = () => crypto.pbkdf2('password', 'at least 16 character salt', 500, 512 / 8, 'shaX-xxx'); + expect(fn).to.throw().with.property('code', 'ERR_UNSUPPORTED_HASH_TYPE'); + }); + }); + describe('randomBytes', () => { + it('throws with invalid number passed', () => { + expect(() => { + crypto.randomBytes(-1); + }).to.throw(); + }); + it('generates different random things', () => { + const buf1 = crypto.randomBytes(10); + expect(buf1.length).to.equal(10); + const buf2 = crypto.randomBytes(10); + expect(buf1).to.not.eql(buf2); + }); + }); +}); +//# sourceMappingURL=crypto.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js.map new file mode 100644 index 000000000..7f73ba75d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/crypto.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.spec.js","sourceRoot":"","sources":["../../test/crypto.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MA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C,CAAA;YAChC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;YACnC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC/B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts new file mode 100644 index 000000000..95a536b94 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts @@ -0,0 +1,12 @@ +declare const _default: { + 16: { + inputs: Uint8Array[]; + outputs: Uint8Array[]; + }; + 32: { + inputs: Uint8Array[]; + outputs: Uint8Array[]; + }; +}; +export default _default; +//# sourceMappingURL=aes.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts.map new file mode 100644 index 000000000..7d6d0323b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aes.d.ts","sourceRoot":"","sources":["../../../test/fixtures/aes.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,wBAiCC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js new file mode 100644 index 000000000..64cf8fe3a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js @@ -0,0 +1,36 @@ +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +export default { + 16: { + inputs: [ + uint8ArrayFromString('Ly8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLw', 'base64'), + uint8ArrayFromString('GBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGA', 'base64'), + uint8ArrayFromString('BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBw', 'base64'), + uint8ArrayFromString('GRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQ', 'base64'), + uint8ArrayFromString('MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMA', 'base64') + ], + outputs: [ + uint8ArrayFromString('eWgAlzmJFu/qlzoPZBbkblX4+Q+RgN8ZwK+EqWLL52rgZs70HdUkAhrVXh2G24hJ1LAhX8ZblIuE/LZzdKCSwgBhtQDBlRUz+GEgPlaZ7kMmIjePRsFjax9DWmE3P0XLIelK7Q', 'base64'), + uint8ArrayFromString('bax/s27eT9tXTEbMpm645VoxoPxOOkkzmNoDyAp8mHWJKBd/ODnLH2XjH8bfVmJ4ZFZ0kI5/RK/56BZTFkQ85pIWmcFDBTP979JQH/5nuZF7Y82vnJC/Qx/sK2LF6x8yReRkQA', 'base64'), + uint8ArrayFromString('v11+v7QqdpAcvNO/04KqmYbws1NLFypEnsh7mzmpmIUhclodg1tGaVMtKC9NYGEIKAFu9WqsmJIFcoQAsx8sThNtXMfiJAxKtPHga1MNpxv7ZcFiMVrhxUvVkDTrglz324vRhA', 'base64'), + uint8ArrayFromString('v241vvosvogW0YPIcB89t/dfBPlFk+5KEkfFc43iZlxbgLWsQ20RpTQKNx834f2MmiNoPndnxZh9hoy1qkxLcsO8RMUcL3RSIoDoeg7leqEk1KGkkVbX6d4yj1mDIILEbSTM/g', 'base64'), + uint8ArrayFromString('YY4IJUWtfLRhRi1bxH64h9Voq1nnPysqB/VLpc22GDKq2YBwctfRkYfrs9QFUY7HNd0n76cV7aiR+fpsAvdZSeTj/5t5nc1gKyBw0a1gjyvcjBrNIiI1nSmnfevzVQ0OXW3pug', 'base64') + ] + }, + 32: { + inputs: [ + uint8ArrayFromString('RERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERA', 'base64'), + uint8ArrayFromString('CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg', 'base64'), + uint8ArrayFromString('S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSw', 'base64'), + uint8ArrayFromString('IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw', 'base64'), + uint8ArrayFromString('SEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISA', 'base64') + ], + outputs: [ + uint8ArrayFromString('xjtba97WH+ZwAceuEeDC4YpBOqAf+WYQSi5VHuj5eGwmpWkbDGJibIKjEIl0aJm8Bfuj9AA6Ac8ZTrzSzd0whEjRC0MOKtpHlPx+tzwgXSR9Z791UvG+sAGBdnCLmbI4PVs0xg', 'base64'), + uint8ArrayFromString('zvFjePijOR7YVv/AWcGwEU4+UJW96xudr/gHE95Ab8fMoxoQX91GIO8EOqL97QgzXgOlut/SdGXkUmdMSiwzdb2MhOa88xielV2T4nHDHxgJExuEtJgaQX2QVqcpkJ7MTC61bg', 'base64'), + uint8ArrayFromString('maHJQlcu8leI7pfGgXo+zY78bbvutz9f8GHc0SWQ7VT7lZjeWcjQd9UmQRMC/MF9Xky2xvN5/RAt/lIvks4paf7t7I121sXkO30tyD0YbhrrXK//VXc5oJFrzhw+CqZZBxT28w', 'base64'), + uint8ArrayFromString('T9cWHYSC1vjtfOo2104A0/beNls1AjEoAMq8Gbh5pOu9YQ4AU6ZYPjcxT5mIwYXOrGPPSfbYwGsyzqfyGbQ/uMk9WvLfwA2MH/BwnfpajgMoDGo/SSpPUhQpu60XVTv91L9tLg', 'base64'), + uint8ArrayFromString('yeA4QKfgfDETM9Di2DIMSQ//nGxis5BuIZcrQOOZeCcVlyk99RQfF23VbTcjKHptKQogsBm4W7Cxhor8oAJsK97vrgKRSiKD7dbrZhrMfEBlhrotNx00N6tfrFbyZY2Z3qGAUw', 'base64') + ] + } +}; +//# sourceMappingURL=aes.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js.map new file mode 100644 index 000000000..b2841435f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/aes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aes.js","sourceRoot":"","sources":["../../../test/fixtures/aes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,eAAe;IACb,EAAE,EAAE;QACF,MAAM,EAAE;YACN,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;SACzK;QACD,OAAO,EAAE;YACP,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;SACzK;KACF;IACD,EAAE,EAAE;QACF,MAAM,EAAE;YACN,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;SACzK;QACD,OAAO,EAAE;YACP,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;YACxK,oBAAoB,CAAC,wIAAwI,EAAE,QAAQ,CAAC;SACzK;KACF;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts new file mode 100644 index 000000000..fa1d4fdfd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts @@ -0,0 +1,8 @@ +declare const _default: { + 16: { + inputs: Uint8Array[]; + outputs: Uint8Array[]; + }; +}; +export default _default; +//# sourceMappingURL=go-aes.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts.map new file mode 100644 index 000000000..ff818cdfa --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"go-aes.d.ts","sourceRoot":"","sources":["../../../test/fixtures/go-aes.ts"],"names":[],"mappings":";;;;;;AAAA,wBAiBC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js new file mode 100644 index 000000000..7043442d1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js @@ -0,0 +1,19 @@ +export default { + 16: { + inputs: [ + Uint8Array.from([47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47]), + Uint8Array.from([24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24]), + Uint8Array.from([7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]), + Uint8Array.from([25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]), + Uint8Array.from([48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48]) + ], + outputs: [ + Uint8Array.from([121, 104, 0, 151, 57, 137, 22, 239, 234, 151, 58, 15, 100, 22, 228, 110, 85, 248, 249, 15, 145, 128, 223, 25, 192, 175, 132, 169, 98, 203, 231, 106, 224, 102, 206, 244, 29, 213, 36, 2, 26, 213, 94, 29, 134, 219, 136, 73, 212, 176, 33, 95, 198, 91, 148, 139, 132, 252, 182, 115, 116, 160, 146, 194, 0, 97, 181, 0, 193, 149, 21, 51, 248, 97, 32, 62, 86, 153, 238, 67, 38, 34, 55, 143, 70, 193, 99, 107, 31, 67, 90, 97, 55, 63, 69, 203, 33, 233, 74, 237]), + Uint8Array.from([109, 172, 127, 179, 110, 222, 79, 219, 87, 76, 70, 204, 166, 110, 184, 229, 90, 49, 160, 252, 78, 58, 73, 51, 152, 218, 3, 200, 10, 124, 152, 117, 137, 40, 23, 127, 56, 57, 203, 31, 101, 227, 31, 198, 223, 86, 98, 120, 100, 86, 116, 144, 142, 127, 68, 175, 249, 232, 22, 83, 22, 68, 60, 230, 146, 22, 153, 193, 67, 5, 51, 253, 239, 210, 80, 31, 254, 103, 185, 145, 123, 99, 205, 175, 156, 144, 191, 67, 31, 236, 43, 98, 197, 235, 31, 50, 69, 228, 100, 64]), + Uint8Array.from([191, 93, 126, 191, 180, 42, 118, 144, 28, 188, 211, 191, 211, 130, 170, 153, 134, 240, 179, 83, 75, 23, 42, 68, 158, 200, 123, 155, 57, 169, 152, 133, 33, 114, 90, 29, 131, 91, 70, 105, 83, 45, 40, 47, 77, 96, 97, 8, 40, 1, 110, 245, 106, 172, 152, 146, 5, 114, 132, 0, 179, 31, 44, 78, 19, 109, 92, 199, 226, 36, 12, 74, 180, 241, 224, 107, 83, 13, 167, 27, 251, 101, 193, 98, 49, 90, 225, 197, 75, 213, 144, 52, 235, 130, 92, 247, 219, 139, 209, 132]), + Uint8Array.from([191, 110, 53, 190, 250, 44, 190, 136, 22, 209, 131, 200, 112, 31, 61, 183, 247, 95, 4, 249, 69, 147, 238, 74, 18, 71, 197, 115, 141, 226, 102, 92, 91, 128, 181, 172, 67, 109, 17, 165, 52, 10, 55, 31, 55, 225, 253, 140, 154, 35, 104, 62, 119, 103, 197, 152, 125, 134, 140, 181, 170, 76, 75, 114, 195, 188, 68, 197, 28, 47, 116, 82, 34, 128, 232, 122, 14, 229, 122, 161, 36, 212, 161, 164, 145, 86, 215, 233, 222, 50, 143, 89, 131, 32, 130, 196, 109, 36, 204, 254]), + Uint8Array.from([97, 142, 8, 37, 69, 173, 124, 180, 97, 70, 45, 91, 196, 126, 184, 135, 213, 104, 171, 89, 231, 63, 43, 42, 7, 245, 75, 165, 205, 182, 24, 50, 170, 217, 128, 112, 114, 215, 209, 145, 135, 235, 179, 212, 5, 81, 142, 199, 53, 221, 39, 239, 167, 21, 237, 168, 145, 249, 250, 108, 2, 247, 89, 73, 228, 227, 255, 155, 121, 157, 205, 96, 43, 32, 112, 209, 173, 96, 143, 43, 220, 140, 26, 205, 34, 34, 53, 157, 41, 167, 125, 235, 243, 85, 13, 14, 93, 109, 233, 186]) + ] + } +}; +//# sourceMappingURL=go-aes.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js.map new file mode 100644 index 000000000..7ca9f5b18 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-aes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"go-aes.js","sourceRoot":"","sources":["../../../test/fixtures/go-aes.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,EAAE,EAAE;QACF,MAAM,EAAE;YACN,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,E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AE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SAC5d;KACF;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts new file mode 100644 index 000000000..b17648d27 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts @@ -0,0 +1,9 @@ +declare const _default: { + curve: string; + bob: { + private: Uint8Array; + public: Uint8Array; + }; +}; +export default _default; +//# sourceMappingURL=go-elliptic-key.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts.map new file mode 100644 index 000000000..623298dd1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"go-elliptic-key.d.ts","sourceRoot":"","sources":["../../../test/fixtures/go-elliptic-key.ts"],"names":[],"mappings":";;;;;;;AAAA,wBAUC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js new file mode 100644 index 000000000..bb87b9093 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js @@ -0,0 +1,12 @@ +export default { + curve: 'P-256', + bob: { + private: Uint8Array.from([ + 181, 217, 162, 151, 225, 36, 53, 253, 107, 66, 27, 27, 232, 72, 0, 0, 103, 167, 84, 62, 203, 91, 97, 137, 131, 193, 230, 126, 98, 242, 216, 170 + ]), + public: Uint8Array.from([ + 4, 53, 59, 128, 56, 162, 250, 72, 141, 206, 117, 232, 57, 96, 39, 39, 247, 7, 27, 57, 251, 232, 120, 186, 21, 239, 176, 139, 195, 129, 125, 85, 11, 188, 191, 32, 227, 0, 6, 163, 101, 68, 208, 1, 43, 131, 124, 112, 102, 91, 104, 79, 16, 119, 152, 208, 4, 147, 155, 83, 20, 146, 104, 55, 90 + ]) + } +}; +//# sourceMappingURL=go-elliptic-key.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js.map new file mode 100644 index 000000000..45e7f2046 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-elliptic-key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"go-elliptic-key.js","sourceRoot":"","sources":["../../../test/fixtures/go-elliptic-key.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,OAAO;IACd,GAAG,EAAE;QACH,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;YACvB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;SAChJ,CAAC;QACF,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC;YACtB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;SACjS,CAAC;KACH;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts new file mode 100644 index 000000000..c3641167d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts @@ -0,0 +1,16 @@ +declare const _default: { + redundantPubKey: { + privateKey: Uint8Array; + publicKey: Uint8Array; + data: Uint8Array; + signature: Uint8Array; + }; + verify: { + publicKey: Uint8Array; + privateKey: Uint8Array; + data: Uint8Array; + signature: Uint8Array; + }; +}; +export default _default; +//# sourceMappingURL=go-key-ed25519.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts.map new file mode 100644 index 000000000..082e8e23b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"go-key-ed25519.d.ts","sourceRoot":"","sources":["../../../test/fixtures/go-key-ed25519.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wBAuCC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js new file mode 100644 index 000000000..91c6da530 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js @@ -0,0 +1,38 @@ +export default { + // Generation code from https://github.com/libp2p/js-libp2p-crypto/issues/175#issuecomment-634467463 + // + // package main + // + // import ( + // "crypto/rand" + // "fmt" + // "strings" + // "github.com/libp2p/go-libp2p-core/crypto" + // ) + // func main() { + // priv, pub, _ := crypto.GenerateEd25519Key(rand.Reader) + // pubkeyBytes, _ := pub.Bytes() + // privkeyBytes, _ := priv.Bytes() + // data := []byte("hello! and welcome to some awesome crypto primitives") + // sig, _ := priv.Sign(data) + // fmt.Println("{\n publicKey: Uint8Array.from(", strings.Replace(fmt.Sprint(pubkeyBytes), " ", ",", -1), "),") + // fmt.Println(" privateKey: Uint8Array.from(", strings.Replace(fmt.Sprint(privkeyBytes), " ", ",", -1), "),") + // fmt.Println(" data: Uint8Array.from(", strings.Replace(fmt.Sprint(data), " ", ",", -1), "),") + // fmt.Println(" signature: Uint8Array.from(", strings.Replace(fmt.Sprint(sig), " ", ",", -1), ")\n}") + // } + // + // The legacy key unnecessarily appends the publickey. (It's already included) See https://github.com/libp2p/js-libp2p-crypto/issues/175 + redundantPubKey: { + privateKey: Uint8Array.from([8, 1, 18, 96, 201, 208, 1, 110, 176, 16, 230, 37, 66, 184, 149, 252, 78, 56, 206, 136, 2, 38, 118, 152, 226, 197, 117, 200, 54, 189, 156, 218, 184, 7, 118, 57, 233, 49, 221, 97, 164, 158, 241, 129, 73, 166, 225, 255, 193, 118, 22, 84, 55, 15, 249, 168, 225, 180, 198, 191, 14, 75, 187, 243, 150, 91, 232, 37, 233, 49, 221, 97, 164, 158, 241, 129, 73, 166, 225, 255, 193, 118, 22, 84, 55, 15, 249, 168, 225, 180, 198, 191, 14, 75, 187, 243, 150, 91, 232, 37]), + publicKey: Uint8Array.from([8, 1, 18, 32, 233, 49, 221, 97, 164, 158, 241, 129, 73, 166, 225, 255, 193, 118, 22, 84, 55, 15, 249, 168, 225, 180, 198, 191, 14, 75, 187, 243, 150, 91, 232, 37]), + data: Uint8Array.from([104, 101, 108, 108, 111, 33, 32, 97, 110, 100, 32, 119, 101, 108, 99, 111, 109, 101, 32, 116, 111, 32, 115, 111, 109, 101, 32, 97, 119, 101, 115, 111, 109, 101, 32, 99, 114, 121, 112, 116, 111, 32, 112, 114, 105, 109, 105, 116, 105, 118, 101, 115]), + signature: Uint8Array.from([7, 230, 175, 164, 228, 58, 78, 208, 62, 243, 73, 142, 83, 195, 176, 217, 166, 62, 41, 165, 168, 164, 75, 179, 163, 86, 102, 32, 18, 84, 150, 237, 39, 207, 213, 20, 134, 237, 50, 41, 176, 183, 229, 133, 38, 255, 42, 228, 68, 186, 100, 14, 175, 156, 243, 118, 125, 125, 120, 212, 124, 103, 252, 12]) + }, + verify: { + publicKey: Uint8Array.from([8, 1, 18, 32, 163, 176, 195, 47, 254, 208, 49, 5, 192, 102, 32, 63, 58, 202, 171, 153, 146, 164, 25, 212, 25, 91, 146, 26, 117, 165, 148, 6, 207, 90, 217, 126]), + privateKey: Uint8Array.from([8, 1, 18, 64, 232, 56, 175, 20, 240, 160, 19, 47, 92, 88, 115, 221, 164, 13, 36, 162, 158, 136, 247, 31, 29, 231, 76, 143, 12, 91, 193, 4, 88, 33, 67, 23, 163, 176, 195, 47, 254, 208, 49, 5, 192, 102, 32, 63, 58, 202, 171, 153, 146, 164, 25, 212, 25, 91, 146, 26, 117, 165, 148, 6, 207, 90, 217, 126]), + data: Uint8Array.from([104, 101, 108, 108, 111, 33, 32, 97, 110, 100, 32, 119, 101, 108, 99, 111, 109, 101, 32, 116, 111, 32, 115, 111, 109, 101, 32, 97, 119, 101, 115, 111, 109, 101, 32, 99, 114, 121, 112, 116, 111, 32, 112, 114, 105, 109, 105, 116, 105, 118, 101, 115]), + signature: Uint8Array.from([160, 125, 30, 62, 213, 189, 239, 92, 87, 76, 205, 169, 251, 149, 187, 57, 96, 85, 175, 213, 22, 132, 229, 60, 196, 18, 117, 194, 12, 174, 135, 31, 39, 168, 174, 103, 78, 55, 37, 222, 37, 172, 222, 239, 153, 63, 197, 152, 67, 167, 191, 215, 161, 212, 216, 163, 81, 77, 45, 228, 151, 79, 101, 1]) + } +}; +//# sourceMappingURL=go-key-ed25519.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js.map new file mode 100644 index 000000000..c3a3e7dd8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-ed25519.js.map @@ -0,0 +1 @@ +{"version":3,"file":"go-key-ed25519.js","sourceRoot":"","sources":["../../../test/fixtures/go-key-ed25519.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,oGAAoG;IACpG,EAAE;IACF,eAAe;IACf,EAAE;IACF,WAAW;IACX,kBAAkB;IAClB,UAAU;IACV,cAAc;IAEd,8CAA8C;IAC9C,IAAI;IAEJ,gBAAgB;IAChB,2DAA2D;IAC3D,kCAAkC;IAClC,oCAAoC;IACpC,2EAA2E;IAC3E,8BAA8B;IAC9B,kHAAkH;IAClH,iHAAiH;IACjH,mGAAmG;IACnG,yGAAyG;IACzG,IAAI;IACJ,EAAE;IAEF,wIAAwI;IACxI,eAAe,EAAE;QACf,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,E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EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/Q,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;KACnU;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts new file mode 100644 index 000000000..a8140da00 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts @@ -0,0 +1,17 @@ +declare const _default: { + private: { + hash: Uint8Array; + key: Uint8Array; + }; + public: { + hash: Uint8Array; + key: Uint8Array; + }; + verify: { + signature: Uint8Array; + data: Uint8Array; + publicKey: Uint8Array; + }; +}; +export default _default; +//# sourceMappingURL=go-key-rsa.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts.map new file mode 100644 index 000000000..7b56ad32d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"go-key-rsa.d.ts","sourceRoot":"","sources":["../../../test/fixtures/go-key-rsa.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wBA4BC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js new file mode 100644 index 000000000..f7b8d02b1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js @@ -0,0 +1,30 @@ +export default { + private: { + hash: Uint8Array.from([ + 18, 32, 168, 125, 165, 65, 34, 157, 209, 4, 24, 158, 80, 196, 125, 86, 103, 0, 228, 145, 109, 252, 153, 7, 189, 9, 16, 37, 239, 36, 48, 78, 214, 212 + ]), + key: Uint8Array.from([ + 8, 0, 18, 192, 2, 48, 130, 1, 60, 2, 1, 0, 2, 65, 0, 230, 157, 160, 242, 74, 222, 87, 0, 77, 180, 91, 175, 217, 166, 2, 95, 193, 239, 195, 140, 224, 57, 84, 207, 46, 172, 113, 196, 20, 133, 117, 205, 45, 7, 224, 41, 40, 195, 254, 124, 14, 84, 223, 147, 67, 198, 48, 36, 53, 161, 112, 46, 153, 90, 19, 123, 94, 247, 5, 116, 1, 238, 32, 15, 2, 3, 1, 0, 1, 2, 65, 0, 191, 59, 140, 255, 254, 23, 123, 91, 148, 19, 240, 71, 213, 26, 181, 51, 68, 181, 150, 153, 214, 65, 148, 83, 45, 103, 239, 250, 225, 237, 125, 173, 111, 244, 37, 124, 87, 178, 86, 10, 14, 207, 63, 105, 213, 37, 81, 23, 230, 4, 222, 179, 144, 40, 252, 163, 190, 7, 241, 221, 28, 54, 225, 209, 2, 33, 0, 235, 132, 229, 150, 99, 182, 176, 194, 198, 65, 210, 160, 184, 70, 82, 49, 235, 199, 14, 11, 92, 66, 237, 45, 220, 72, 235, 1, 244, 145, 205, 57, 2, 33, 0, 250, 171, 146, 180, 188, 194, 14, 152, 52, 64, 38, 52, 158, 86, 46, 109, 66, 100, 122, 43, 88, 167, 143, 98, 104, 143, 160, 60, 171, 185, 31, 135, 2, 33, 0, 206, 47, 255, 203, 100, 170, 137, 31, 75, 240, 78, 84, 212, 95, 4, 16, 158, 73, 27, 27, 136, 255, 50, 163, 166, 169, 211, 204, 87, 111, 217, 201, 2, 33, 0, 177, 51, 194, 213, 3, 175, 7, 84, 47, 115, 189, 206, 106, 180, 47, 195, 203, 48, 110, 112, 224, 14, 43, 189, 124, 127, 51, 222, 79, 226, 225, 87, 2, 32, 67, 23, 190, 222, 106, 22, 115, 139, 217, 244, 178, 53, 153, 99, 5, 176, 72, 77, 193, 61, 67, 134, 37, 238, 69, 66, 159, 28, 39, 5, 238, 125 + ]) + }, + public: { + hash: Uint8Array.from([ + 18, 32, 112, 151, 163, 167, 204, 243, 175, 123, 208, 162, 90, 84, 199, 174, 202, 110, 0, 119, 27, 202, 7, 149, 161, 251, 215, 168, 163, 54, 93, 54, 195, 20 + ]), + key: Uint8Array.from([ + 8, 0, 18, 94, 48, 92, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 75, 0, 48, 72, 2, 65, 0, 230, 157, 160, 242, 74, 222, 87, 0, 77, 180, 91, 175, 217, 166, 2, 95, 193, 239, 195, 140, 224, 57, 84, 207, 46, 172, 113, 196, 20, 133, 117, 205, 45, 7, 224, 41, 40, 195, 254, 124, 14, 84, 223, 147, 67, 198, 48, 36, 53, 161, 112, 46, 153, 90, 19, 123, 94, 247, 5, 116, 1, 238, 32, 15, 2, 3, 1, 0, 1 + ]) + }, + verify: { + signature: Uint8Array.from([ + 3, 116, 81, 57, 91, 194, 7, 1, 230, 236, 229, 142, 36, 209, 208, 107, 47, 52, 164, 236, 139, 35, 155, 97, 43, 64, 145, 91, 19, 218, 149, 63, 99, 164, 191, 110, 145, 37, 18, 7, 98, 112, 144, 35, 29, 186, 169, 150, 165, 88, 145, 170, 197, 110, 42, 163, 188, 10, 42, 63, 34, 93, 91, 94, 199, 110, 10, 82, 238, 80, 93, 93, 77, 130, 22, 216, 229, 172, 36, 229, 82, 162, 20, 78, 19, 46, 82, 243, 43, 80, 115, 125, 145, 231, 194, 224, 30, 187, 55, 228, 74, 52, 203, 191, 254, 148, 136, 218, 62, 147, 171, 130, 251, 181, 105, 29, 238, 207, 197, 249, 61, 105, 202, 172, 160, 174, 43, 124, 115, 130, 169, 30, 76, 41, 52, 200, 2, 26, 53, 190, 43, 20, 203, 10, 217, 250, 47, 102, 92, 103, 197, 22, 108, 184, 74, 218, 82, 202, 180, 98, 13, 114, 12, 92, 1, 139, 150, 170, 8, 92, 32, 116, 168, 219, 157, 162, 28, 77, 29, 29, 74, 136, 144, 49, 173, 245, 253, 76, 167, 200, 169, 163, 7, 49, 133, 120, 99, 191, 53, 10, 66, 26, 234, 240, 139, 235, 134, 30, 55, 248, 150, 100, 242, 150, 159, 198, 44, 78, 150, 7, 133, 139, 59, 76, 3, 225, 94, 13, 89, 122, 34, 95, 95, 107, 74, 169, 171, 169, 222, 25, 191, 182, 148, 116, 66, 67, 102, 12, 193, 217, 247, 243, 148, 233, 161, 157 + ]), + data: Uint8Array.from([ + 10, 16, 27, 128, 228, 220, 147, 176, 53, 105, 175, 171, 32, 213, 35, 236, 203, 60, 18, 171, 2, 8, 0, 18, 166, 2, 48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 181, 113, 138, 108, 208, 103, 166, 102, 37, 36, 204, 250, 228, 165, 44, 64, 176, 210, 205, 141, 241, 55, 200, 110, 98, 68, 85, 199, 254, 19, 86, 204, 63, 250, 167, 38, 59, 249, 146, 228, 73, 171, 63, 18, 96, 104, 191, 137, 186, 244, 255, 90, 16, 119, 195, 52, 177, 213, 254, 187, 174, 84, 174, 173, 12, 236, 53, 234, 3, 209, 82, 37, 78, 111, 214, 135, 76, 195, 9, 242, 134, 188, 153, 84, 139, 231, 51, 146, 177, 60, 12, 25, 158, 91, 215, 152, 7, 0, 84, 35, 36, 230, 227, 67, 198, 72, 50, 110, 37, 209, 98, 193, 65, 93, 173, 199, 4, 198, 102, 99, 148, 144, 224, 217, 114, 53, 144, 245, 251, 114, 211, 20, 82, 163, 123, 75, 16, 192, 106, 213, 128, 2, 11, 200, 203, 84, 41, 199, 224, 155, 171, 217, 64, 109, 116, 188, 151, 183, 173, 52, 205, 164, 93, 13, 251, 65, 182, 160, 154, 185, 239, 33, 184, 84, 159, 105, 101, 173, 194, 251, 123, 84, 92, 66, 61, 180, 45, 104, 162, 224, 214, 233, 64, 220, 165, 2, 104, 116, 150, 2, 234, 203, 112, 21, 124, 23, 48, 66, 30, 63, 30, 36, 246, 135, 203, 218, 115, 22, 189, 39, 39, 125, 205, 65, 222, 220, 77, 18, 84, 121, 161, 153, 125, 25, 139, 137, 170, 239, 150, 106, 119, 168, 216, 140, 113, 121, 26, 53, 118, 110, 53, 192, 244, 252, 145, 85, 2, 3, 1, 0, 1, 26, 17, 80, 45, 50, 53, 54, 44, 80, 45, 51, 56, 52, 44, 80, 45, 53, 50, 49, 34, 24, 65, 69, 83, 45, 50, 53, 54, 44, 65, 69, 83, 45, 49, 50, 56, 44, 66, 108, 111, 119, 102, 105, 115, 104, 42, 13, 83, 72, 65, 50, 53, 54, 44, 83, 72, 65, 53, 49, 50, 10, 16, 220, 83, 240, 105, 6, 203, 78, 83, 210, 115, 6, 106, 98, 82, 1, 161, 18, 171, 2, 8, 0, 18, 166, 2, 48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 185, 234, 19, 191, 164, 33, 65, 94, 87, 42, 74, 83, 224, 25, 142, 44, 26, 7, 92, 242, 189, 42, 170, 197, 178, 92, 45, 240, 107, 141, 128, 59, 122, 252, 48, 140, 4, 85, 85, 203, 3, 197, 8, 127, 120, 98, 44, 169, 135, 196, 70, 137, 117, 180, 177, 134, 170, 35, 165, 88, 105, 30, 114, 138, 11, 96, 68, 99, 18, 149, 223, 166, 105, 12, 176, 77, 48, 214, 22, 236, 17, 154, 213, 209, 158, 169, 202, 5, 100, 210, 83, 90, 201, 38, 205, 246, 231, 106, 63, 86, 222, 143, 157, 173, 62, 4, 85, 232, 20, 188, 6, 209, 186, 132, 192, 117, 146, 181, 233, 26, 0, 240, 138, 206, 91, 170, 114, 137, 217, 132, 139, 242, 144, 213, 103, 101, 190, 146, 188, 250, 188, 134, 255, 70, 125, 78, 65, 136, 239, 190, 206, 139, 155, 140, 163, 233, 170, 247, 205, 87, 209, 19, 29, 173, 10, 147, 43, 28, 90, 46, 6, 197, 217, 186, 66, 68, 126, 76, 64, 184, 8, 170, 23, 79, 243, 223, 119, 133, 118, 50, 226, 44, 246, 176, 10, 161, 219, 83, 54, 68, 248, 5, 14, 177, 114, 54, 63, 11, 71, 136, 142, 56, 151, 123, 230, 61, 80, 15, 180, 42, 49, 220, 148, 99, 231, 20, 230, 220, 85, 207, 187, 37, 210, 137, 171, 125, 71, 14, 53, 100, 91, 83, 209, 50, 132, 165, 253, 25, 161, 5, 97, 164, 163, 83, 95, 53, 2, 3, 1, 0, 1, 26, 17, 80, 45, 50, 53, 54, 44, 80, 45, 51, 56, 52, 44, 80, 45, 53, 50, 49, 34, 15, 65, 69, 83, 45, 50, 53, 54, 44, 65, 69, 83, 45, 49, 50, 56, 42, 13, 83, 72, 65, 50, 53, 54, 44, 83, 72, 65, 53, 49, 50, 4, 97, 54, 203, 112, 136, 34, 231, 162, 19, 154, 131, 27, 105, 26, 121, 238, 120, 25, 203, 66, 232, 53, 198, 20, 19, 96, 119, 218, 90, 64, 170, 3, 132, 116, 1, 87, 116, 232, 165, 161, 198, 117, 167, 60, 145, 1, 253, 108, 50, 150, 117, 8, 140, 133, 48, 30, 236, 36, 84, 186, 22, 144, 87, 101 + ]), + publicKey: Uint8Array.from([ + 8, 0, 18, 166, 2, 48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 181, 113, 138, 108, 208, 103, 166, 102, 37, 36, 204, 250, 228, 165, 44, 64, 176, 210, 205, 141, 241, 55, 200, 110, 98, 68, 85, 199, 254, 19, 86, 204, 63, 250, 167, 38, 59, 249, 146, 228, 73, 171, 63, 18, 96, 104, 191, 137, 186, 244, 255, 90, 16, 119, 195, 52, 177, 213, 254, 187, 174, 84, 174, 173, 12, 236, 53, 234, 3, 209, 82, 37, 78, 111, 214, 135, 76, 195, 9, 242, 134, 188, 153, 84, 139, 231, 51, 146, 177, 60, 12, 25, 158, 91, 215, 152, 7, 0, 84, 35, 36, 230, 227, 67, 198, 72, 50, 110, 37, 209, 98, 193, 65, 93, 173, 199, 4, 198, 102, 99, 148, 144, 224, 217, 114, 53, 144, 245, 251, 114, 211, 20, 82, 163, 123, 75, 16, 192, 106, 213, 128, 2, 11, 200, 203, 84, 41, 199, 224, 155, 171, 217, 64, 109, 116, 188, 151, 183, 173, 52, 205, 164, 93, 13, 251, 65, 182, 160, 154, 185, 239, 33, 184, 84, 159, 105, 101, 173, 194, 251, 123, 84, 92, 66, 61, 180, 45, 104, 162, 224, 214, 233, 64, 220, 165, 2, 104, 116, 150, 2, 234, 203, 112, 21, 124, 23, 48, 66, 30, 63, 30, 36, 246, 135, 203, 218, 115, 22, 189, 39, 39, 125, 205, 65, 222, 220, 77, 18, 84, 121, 161, 153, 125, 25, 139, 137, 170, 239, 150, 106, 119, 168, 216, 140, 113, 121, 26, 53, 118, 110, 53, 192, 244, 252, 145, 85, 2, 3, 1, 0, 1 + ]) + } +}; +//# sourceMappingURL=go-key-rsa.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js.map new file mode 100644 index 000000000..dd4c52167 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-rsa.js.map @@ -0,0 +1 @@ +{"version":3,"file":"go-key-rsa.js","sourceRoot":"","sources":["../../../test/fixtures/go-key-rsa.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,OAAO,EAAE;QACP,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;YACpB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAA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,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;SACtzC,CAAC;KACH;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts new file mode 100644 index 000000000..87a0b33f4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts @@ -0,0 +1,8 @@ +declare const _default: { + privateKey: Uint8Array; + publicKey: Uint8Array; + message: Uint8Array; + signature: Uint8Array; +}; +export default _default; +//# sourceMappingURL=go-key-secp256k1.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts.map new file mode 100644 index 000000000..9a215099f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"go-key-secp256k1.d.ts","sourceRoot":"","sources":["../../../test/fixtures/go-key-secp256k1.ts"],"names":[],"mappings":";;;;;;AAuBA,wBAKC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js new file mode 100644 index 000000000..3e339bb57 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js @@ -0,0 +1,28 @@ +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +// The keypair and signature below were generated in a gore repl session (https://github.com/motemen/gore) +// using the secp256k1 fork of go-libp2p-crypto by github user @vyzo +// +// gore> :import github.com/vyzo/go-libp2p-crypto +// gore> :import crypto/rand +// gore> :import io/ioutil +// gore> priv, pub, err := crypto.GenerateKeyPairWithReader(crypto.Secp256k1, 256, rand.Reader) +// gore> privBytes, err := priv.Bytes() +// gore> pubBytes, err := pub.Bytes() +// gore> msg := []byte("hello! and welcome to some awesome crypto primitives") +// gore> sig, err := priv.Sign(msg) +// gore> ioutil.WriteFile("/tmp/secp-go-priv.bin", privBytes, 0644) +// gore> ioutil.WriteFile("/tmp/secp-go-pub.bin", pubBytes, 0644) +// gore> ioutil.WriteFile("/tmp/secp-go-sig.bin", sig, 0644) +// +// The generated files were then read in a node repl with e.g.: +// > fs.readFileSync('/tmp/secp-go-pub.bin').toString('hex') +// '08021221029c0ce5d53646ed47112560297a3e59b78b8cbd4bae37c7a0c236eeb91d0fbeaf' +// +// and the results copy/pasted in here +export default { + privateKey: uint8ArrayFromString('08021220358f15db8c2014d570e8e3a622454e2273975a3cca443ec0c45375b13d381d18', 'base16'), + publicKey: uint8ArrayFromString('08021221029c0ce5d53646ed47112560297a3e59b78b8cbd4bae37c7a0c236eeb91d0fbeaf', 'base16'), + message: uint8ArrayFromString('hello! and welcome to some awesome crypto primitives'), + signature: uint8ArrayFromString('304402200e4c629e9f5d99439115e60989cd40087f6978c36078b0b50cf3d30af5c38d4102204110342c8e7f0809897c1c7a66e49e1c6b7cb0a6ed6993640ec2fe742c1899a9', 'base16') +}; +//# sourceMappingURL=go-key-secp256k1.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js.map new file mode 100644 index 000000000..99e40b6e8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-key-secp256k1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"go-key-secp256k1.js","sourceRoot":"","sources":["../../../test/fixtures/go-key-secp256k1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,0GAA0G;AAC1G,oEAAoE;AACpE,EAAE;AACF,iDAAiD;AACjD,4BAA4B;AAC5B,0BAA0B;AAC1B,+FAA+F;AAC/F,uCAAuC;AACvC,qCAAqC;AACrC,8EAA8E;AAC9E,mCAAmC;AACnC,mEAAmE;AACnE,iEAAiE;AACjE,4DAA4D;AAC5D,EAAE;AACF,+DAA+D;AAC/D,4DAA4D;AAC5D,+EAA+E;AAC/E,EAAE;AACF,sCAAsC;AAEtC,eAAe;IACb,UAAU,EAAE,oBAAoB,CAAC,0EAA0E,EAAE,QAAQ,CAAC;IACtH,SAAS,EAAE,oBAAoB,CAAC,4EAA4E,EAAE,QAAQ,CAAC;IACvH,OAAO,EAAE,oBAAoB,CAAC,sDAAsD,CAAC;IACrF,SAAS,EAAE,oBAAoB,CAAC,8IAA8I,EAAE,QAAQ,CAAC;CAC1L,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts new file mode 100644 index 000000000..d3535180a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts @@ -0,0 +1,17 @@ +declare const _default: { + cipher: "AES-256"; + hash: "SHA256"; + secret: Uint8Array; + k1: { + iv: Uint8Array; + cipherKey: Uint8Array; + macKey: Uint8Array; + }; + k2: { + iv: Uint8Array; + cipherKey: Uint8Array; + macKey: Uint8Array; + }; +}[]; +export default _default; +//# sourceMappingURL=go-stretch-key.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts.map new file mode 100644 index 000000000..91d6159de --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"go-stretch-key.d.ts","sourceRoot":"","sources":["../../../test/fixtures/go-stretch-key.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wBA4BE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js new file mode 100644 index 000000000..3385a0ab1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js @@ -0,0 +1,30 @@ +export default [{ + cipher: 'AES-256', + hash: 'SHA256', + secret: Uint8Array.from([ + 195, 191, 209, 165, 209, 201, 127, 122, 136, 111, 31, 66, 111, 68, 38, 155, 216, 204, 46, 181, 200, 188, 170, 204, 104, 74, 239, 251, 173, 114, 222, 234 + ]), + k1: { + iv: Uint8Array.from([ + 208, 132, 203, 169, 253, 52, 40, 83, 161, 91, 17, 71, 33, 136, 67, 96 + ]), + cipherKey: Uint8Array.from([ + 156, 48, 241, 157, 92, 248, 153, 186, 114, 127, 195, 114, 106, 104, 215, 133, 35, 11, 131, 137, 123, 70, 74, 26, 15, 60, 189, 32, 67, 221, 115, 137 + ]), + macKey: Uint8Array.from([ + 6, 179, 91, 245, 224, 56, 153, 120, 77, 140, 29, 5, 15, 213, 187, 65, 137, 230, 202, 120 + ]) + }, + k2: { + iv: Uint8Array.from([ + 236, 17, 34, 141, 90, 106, 197, 56, 197, 184, 157, 135, 91, 88, 112, 19 + ]), + cipherKey: Uint8Array.from([ + 151, 145, 195, 219, 76, 195, 102, 109, 187, 231, 100, 150, 132, 245, 251, 130, 254, 37, 178, 55, 227, 34, 114, 39, 238, 34, 2, 193, 107, 130, 32, 87 + ]), + macKey: Uint8Array.from([ + 3, 229, 77, 212, 241, 217, 23, 113, 220, 126, 38, 255, 18, 117, 108, 205, 198, 89, 1, 236 + ]) + } + }]; +//# sourceMappingURL=go-stretch-key.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js.map new file mode 100644 index 000000000..de39f9725 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/go-stretch-key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"go-stretch-key.js","sourceRoot":"","sources":["../../../test/fixtures/go-stretch-key.ts"],"names":[],"mappings":"AAAA,eAAe,CAAC;QACd,MAAM,EAAE,SAAsB;QAC9B,IAAI,EAAE,QAAoB;QAC1B,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC;YACtB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE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ists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts new file mode 100644 index 000000000..d26426388 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts @@ -0,0 +1,6 @@ +import type { JWKKeyPair } from '../../src/keys/interface'; +/** + * A 8200 bit RSA key + */ +export declare const RSA_KEY_8200_BITS: JWKKeyPair; +//# sourceMappingURL=rsa.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts.map new file mode 100644 index 000000000..57e7cc7be --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa.d.ts","sourceRoot":"","sources":["../../../test/fixtures/rsa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAiB/B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js new file mode 100644 index 000000000..fd1c320e8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js @@ -0,0 +1,22 @@ +/** + * A 8200 bit RSA key + */ +export const RSA_KEY_8200_BITS = { + privateKey: { + kty: 'RSA', + n: 'AtSHgbWZ-5MHNh8LpVD4-2lOjLitwGjADZ8gEcs3EqskGl1E7Lna8oGRt6V-0yiGwicgNgWPVRW3M4aK8kXe9izb1O43I20A2QVfmZDZB7inS23hrj9P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H9pKArXwWu1FZBk8EG4o3uAB5rcxgk7Z_5sV3PAXQlAISZl3IwauWcDaWIgckDUU3AmzpdrddPn8IiqVtSpcTMISi2MkKJw1iom97iQk8V0dkPvCpFB1wzOoEJfL-gcl61ePeU5xohzy0eQcwjsGAtuK6XgT_TB_u7Q6_FbS0AwySISYz6JsnV-FHsb-0FMUjj6-jF0A3vb7El43xwZUrAhx7qqn_DuvrztjChsNWyE7dKWDceTwxIHDobEG7LDivMvsq-jkRYIzYoMJabrIzTgRjGBLruxBp8Zl1CuOepD4vFO6JBzbZl5Qy0hrpuP9YAlYBg3sBhwsYcrATZWVYcNRkJDsNIo-lSFNOl8DalFm7IsxW0A6AMuysLzm4oLZe2hDrmfRI9Mh5JBgio8cKetZan-0pLpoU5ezcMdIszlaUC4ggbOa2h7wVZCanTO79VoeiZLIrCimL4hbtlegpiX6A792jaD5G-cmPhMRGqn2rZcbwIx61e1z3Lz_Wag4lc8I2UwSMFUaIFi67OWN9608JgNNv2-W2uj5NpTFNJSBGUO6gfdOt1C-dgAafhXyPyyQ9m1Uq_0JMwaOkqkkTjW5UNKBacx8Hi9S2AVX7Ln9DN2mNFtFZVCmpnS2qKwd53yhcGQWr_1QL3kshTH5-hkpnLr7ntWIf094NGClp9l5Y2BOB-NqO7JecD_3WHxzjh_3jx6yAiSc3FqX9zmNmiOyIlENc6GHDe10a6p3NNZkI3jTO6C6fQfzOFCQ544htxF7JvxahKLazpSIBRkbf7Hxgdo5s8p8kH5S8HTpl5hdCOsMveJjH0rYU801iTF7Sv5rqn_Zd9FGkT98mjhGl8O4fhEHd967-GR9KupALmG9LtfA2jKwipAcwxyhaXFg2hobCpSvHx9KLOW-3gQt93PqNoE9TAGyIlYbHBFyN3IDsH5bKDYkL4C7RlXUFogBq64SpljjXoW3gYmH2guEaXMwMLf7Mogaoi0Or4ubitxd8EvFuhH2W1TekVc', + e: 'AQAB' + } +}; +//# sourceMappingURL=rsa.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js.map new file mode 100644 index 000000000..2ef3c32c0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/rsa.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa.js","sourceRoot":"","sources":["../../../test/fixtures/rsa.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAe;IAC3C,UAAU,EAAE;QACV,GAAG,EAAE,KAAK;QACV,CAAC,EAAE,y1CAAy1C;QAC51C,CAAC,EAAE,MAAM;QACT,CAAC,EAAE,w1CAAw1C;QAC31C,CAAC,EAAE,8qBAA8qB;QACjrB,CAAC,EAAE,8qBAA8qB;QACjrB,EAAE,EAAE,8qBAA8qB;QAClrB,EAAE,EAAE,6qBAA6qB;QACjrB,EAAE,EAAE,6qBAA6qB;KAClrB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,KAAK;QACV,CAAC,EAAE,y1CAAy1C;QAC51C,CAAC,EAAE,MAAM;KACV;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts new file mode 100644 index 000000000..053de42eb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts @@ -0,0 +1,6 @@ +declare const _default: { + pbmPrivateKey: Uint8Array; + pbmPublicKey: Uint8Array; +}; +export default _default; +//# sourceMappingURL=secp256k1.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts.map new file mode 100644 index 000000000..3773930d2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1.d.ts","sourceRoot":"","sources":["../../../test/fixtures/secp256k1.ts"],"names":[],"mappings":";;;;AAEA,wBAKC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js new file mode 100644 index 000000000..3888a2050 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js @@ -0,0 +1,8 @@ +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +export default { + // protobuf marshalled key pair generated with libp2p-crypto-secp256k1 + // and marshalled with libp2p-crypto.marshalPublicKey / marshalPrivateKey + pbmPrivateKey: uint8ArrayFromString('08021220e0600103010000000100000000000000be1dc82c2e000000e8d6030301000000', 'base16'), + pbmPublicKey: uint8ArrayFromString('0802122103a9a7272a726fa083abf31ba44037f8347fbc5e5d3113d62a7c6bc26752fd8ee1', 'base16') +}; +//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js.map new file mode 100644 index 000000000..49de85782 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/fixtures/secp256k1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["../../../test/fixtures/secp256k1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,eAAe;IACb,sEAAsE;IACtE,yEAAyE;IACzE,aAAa,EAAE,oBAAoB,CAAC,0EAA0E,EAAE,QAAQ,CAAC;IACzH,YAAY,EAAE,oBAAoB,CAAC,4EAA4E,EAAE,QAAQ,CAAC;CAC3H,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts new file mode 100644 index 000000000..09d183ee2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts @@ -0,0 +1,2 @@ +export declare function testGarbage(fncName: string, fnc: (...args: Uint8Array[]) => Promise, num?: number, skipBuffersAndStrings?: boolean): void; +//# sourceMappingURL=test-garbage-error-handling.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts.map new file mode 100644 index 000000000..60def0507 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-garbage-error-handling.d.ts","sourceRoot":"","sources":["../../../test/helpers/test-garbage-error-handling.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,CAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAqB/I"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js new file mode 100644 index 000000000..9e020b538 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js @@ -0,0 +1,27 @@ +/* eslint-env mocha */ +import util from 'util'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +const garbage = [uint8ArrayFromString('00010203040506070809', 'base16'), {}, null, false, undefined, true, 1, 0, uint8ArrayFromString(''), 'aGVsbG93b3JsZA==', 'helloworld', '']; +export function testGarbage(fncName, fnc, num, skipBuffersAndStrings) { + const count = num ?? 1; + garbage.forEach((garbage) => { + if (skipBuffersAndStrings === true && (garbage instanceof Uint8Array || (typeof garbage) === 'string')) { + // skip this garbage because it's a Uint8Array or a String and we were told do do that + return; + } + const args = []; + for (let i = 0; i < count; i++) { + args.push(garbage); + } + it(fncName + '(' + args.map(garbage => util.inspect(garbage)).join(', ') + ')', async () => { + try { + await fnc.apply(null, args); + } + catch (err) { + return; // expected + } + throw new Error('Expected error to be thrown'); + }); + }); +} +//# sourceMappingURL=test-garbage-error-handling.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js.map new file mode 100644 index 000000000..0e5b62121 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/helpers/test-garbage-error-handling.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-garbage-error-handling.js","sourceRoot":"","sources":["../../../test/helpers/test-garbage-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M,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts new file mode 100644 index 000000000..fa1cc5479 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=hmac.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts.map new file mode 100644 index 000000000..f9fdd067c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hmac.spec.d.ts","sourceRoot":"","sources":["../../../test/hmac/hmac.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js new file mode 100644 index 000000000..1998642bd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js @@ -0,0 +1,16 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import * as crypto from '../../src/index.js'; +const hashes = ['SHA1', 'SHA256', 'SHA512']; +describe('HMAC', () => { + hashes.forEach((hash) => { + it(`${hash} - sign and verify`, async () => { + const hmac = await crypto.hmac.create(hash, uint8ArrayFromString('secret')); + const sig = await hmac.digest(uint8ArrayFromString('hello world')); + expect(sig).to.have.length(hmac.length); + }); + }); +}); +//# sourceMappingURL=hmac.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js.map new file mode 100644 index 000000000..c31ce4050 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/hmac/hmac.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hmac.spec.js","sourceRoot":"","sources":["../../../test/hmac/hmac.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAE5C,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAiC,CAAA;AAE3E,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACtB,EAAE,CAAC,GAAG,IAAI,oBAAoB,EAAE,KAAK,IAAI,EAAE;YACzC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC3E,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAA;YAClE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts new file mode 100644 index 000000000..c7a9a8fb9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ed25519.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts.map new file mode 100644 index 000000000..6fec31920 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519.spec.d.ts","sourceRoot":"","sources":["../../../test/keys/ed25519.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js new file mode 100644 index 000000000..2b5b722f0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js @@ -0,0 +1,189 @@ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { Uint8ArrayList } from 'uint8arraylist'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import * as crypto from '../../src/index.js'; +import { Ed25519PrivateKey } from '../../src/keys/ed25519-class.js'; +import fixtures from '../fixtures/go-key-ed25519.js'; +import { testGarbage } from '../helpers/test-garbage-error-handling.js'; +const ed25519 = crypto.keys.supportedKeys.ed25519; +/** @typedef {import("libp2p-crypto").PrivateKey} PrivateKey */ +describe('ed25519', function () { + this.timeout(20 * 1000); + let key; + before(async () => { + const generated = await crypto.keys.generateKeyPair('Ed25519', 512); + if (!(generated instanceof Ed25519PrivateKey)) { + throw new Error('Key was incorrect type'); + } + key = generated; + }); + it('generates a valid key', async () => { + expect(key).to.be.an.instanceof(ed25519.Ed25519PrivateKey); + const digest = await key.hash(); + expect(digest).to.have.length(34); + }); + it('generates a valid key from seed', async () => { + const seed = crypto.randomBytes(32); + const seededkey = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed, 512); + expect(seededkey).to.be.an.instanceof(ed25519.Ed25519PrivateKey); + const digest = await seededkey.hash(); + expect(digest).to.have.length(34); + }); + it('generates the same key from the same seed', async () => { + const seed = crypto.randomBytes(32); + const seededkey1 = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed, 512); + const seededkey2 = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed, 512); + expect(seededkey1.equals(seededkey2)).to.eql(true); + expect(seededkey1.public.equals(seededkey2.public)).to.eql(true); + }); + it('generates different keys for different seeds', async () => { + const seed1 = crypto.randomBytes(32); + const seededkey1 = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed1, 512); + const seed2 = crypto.randomBytes(32); + const seededkey2 = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed2, 512); + expect(seededkey1.equals(seededkey2)).to.eql(false); + expect(seededkey1.public.equals(seededkey2.public)).to.eql(false); + }); + it('signs', async () => { + const text = crypto.randomBytes(512); + const sig = await key.sign(text); + const res = await key.public.verify(text, sig); + expect(res).to.be.eql(true); + }); + it('signs a list', async () => { + const text = new Uint8ArrayList(crypto.randomBytes(512), crypto.randomBytes(512)); + const sig = await key.sign(text); + await expect(key.sign(text.subarray())) + .to.eventually.deep.equal(sig, 'list did not have same signature as a single buffer'); + await expect(key.public.verify(text, sig)) + .to.eventually.be.true('did not verify message as list'); + await expect(key.public.verify(text.subarray(), sig)) + .to.eventually.be.true('did not verify message as single buffer'); + }); + it('encoding', () => { + const keyMarshal = key.marshal(); + const key2 = ed25519.unmarshalEd25519PrivateKey(keyMarshal); + const keyMarshal2 = key2.marshal(); + expect(keyMarshal).to.eql(keyMarshal2); + const pk = key.public; + const pkMarshal = pk.marshal(); + const pk2 = ed25519.unmarshalEd25519PublicKey(pkMarshal); + const pkMarshal2 = pk2.marshal(); + expect(pkMarshal).to.eql(pkMarshal2); + }); + it('key id', async () => { + const key = await crypto.keys.unmarshalPrivateKey(fixtures.verify.privateKey); + const id = await key.id(); + expect(id).to.eql('12D3KooWLqLxEfJ9nDdEe8Kh8PFvNPQRYDQBwyL7CMM7HhVd5LsX'); + }); + it('should export a password encrypted libp2p-key', async () => { + const key = await crypto.keys.generateKeyPair('Ed25519'); + if (!(key instanceof Ed25519PrivateKey)) { + throw new Error('Key was incorrect type'); + } + const encryptedKey = await key.export('my secret'); + // Import the key + const importedKey = await crypto.keys.importKey(encryptedKey, 'my secret'); + if (!(importedKey instanceof Ed25519PrivateKey)) { + throw new Error('Key was incorrect type'); + } + expect(key.equals(importedKey)).to.equal(true); + }); + it('should export a libp2p-key with no password to encrypt', async () => { + const key = await crypto.keys.generateKeyPair('Ed25519'); + if (!(key instanceof Ed25519PrivateKey)) { + throw new Error('Key was incorrect type'); + } + const encryptedKey = await key.export(''); + // Import the key + const importedKey = await crypto.keys.importKey(encryptedKey, ''); + if (!(importedKey instanceof Ed25519PrivateKey)) { + throw new Error('Key was incorrect type'); + } + expect(key.equals(importedKey)).to.equal(true); + }); + it('should fail to import libp2p-key with wrong password', async () => { + const key = await crypto.keys.generateKeyPair('Ed25519'); + const encryptedKey = await key.export('my secret', 'libp2p-key'); + try { + await crypto.keys.importKey(encryptedKey, 'not my secret'); + } + catch (err) { + expect(err).to.exist(); + return; + } + expect.fail('should have thrown'); + }); + describe('key equals', () => { + it('equals itself', () => { + expect(key.equals(key)).to.eql(true); + expect(key.public.equals(key.public)).to.eql(true); + }); + it('not equals other key', async () => { + const key2 = await crypto.keys.generateKeyPair('Ed25519', 512); + if (!(key2 instanceof Ed25519PrivateKey)) { + throw new Error('Key was incorrect type'); + } + expect(key.equals(key2)).to.eql(false); + expect(key2.equals(key)).to.eql(false); + expect(key.public.equals(key2.public)).to.eql(false); + expect(key2.public.equals(key.public)).to.eql(false); + }); + }); + it('sign and verify', async () => { + const data = uint8ArrayFromString('hello world'); + const sig = await key.sign(data); + const valid = await key.public.verify(data, sig); + expect(valid).to.eql(true); + }); + it('sign and verify from seed', async () => { + const seed = new Uint8Array(32).fill(1); + const seededkey = await crypto.keys.generateKeyPairFromSeed('Ed25519', seed); + const data = uint8ArrayFromString('hello world'); + const sig = await seededkey.sign(data); + const valid = await seededkey.public.verify(data, sig); + expect(valid).to.eql(true); + }); + it('fails to verify for different data', async () => { + const data = uint8ArrayFromString('hello world'); + const sig = await key.sign(data); + const valid = await key.public.verify(uint8ArrayFromString('hello'), sig); + expect(valid).to.be.eql(false); + }); + describe('throws error instead of crashing', () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.verify.publicKey); + testGarbage('key.verify', key.verify.bind(key), 2); + testGarbage('crypto.keys.unmarshalPrivateKey', crypto.keys.unmarshalPrivateKey.bind(crypto.keys)); + }); + describe('go interop', () => { + // @ts-check + it('verifies with data from go', async () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.verify.publicKey); + const ok = await key.verify(fixtures.verify.data, fixtures.verify.signature); + expect(ok).to.eql(true); + }); + it('does not include the redundant public key when marshalling privatekey', async () => { + const key = await crypto.keys.unmarshalPrivateKey(fixtures.redundantPubKey.privateKey); + const bytes = key.marshal(); + expect(bytes.length).to.equal(64); + expect(bytes.subarray(32)).to.eql(key.public.marshal()); + }); + it('verifies with data from go with redundant public key', async () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.redundantPubKey.publicKey); + const ok = await key.verify(fixtures.redundantPubKey.data, fixtures.redundantPubKey.signature); + expect(ok).to.eql(true); + }); + it('generates the same signature as go', async () => { + const key = await crypto.keys.unmarshalPrivateKey(fixtures.verify.privateKey); + const sig = await key.sign(fixtures.verify.data); + expect(sig).to.eql(fixtures.verify.signature); + }); + it('generates the same signature as go with redundant public key', async () => { + const key = await crypto.keys.unmarshalPrivateKey(fixtures.redundantPubKey.privateKey); + const sig = await key.sign(fixtures.redundantPubKey.data); + expect(sig).to.eql(fixtures.redundantPubKey.signature); + }); + }); +}); +//# sourceMappingURL=ed25519.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js.map new file mode 100644 index 000000000..499838895 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ed25519.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ed25519.spec.js","sourceRoot":"","sources":["../../../test/keys/ed25519.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,QAAQ,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAEvE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAA;A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C,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;YAC5E,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;YACtF,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;YACzD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts new file mode 100644 index 000000000..2da92e68e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ephemeral-keys.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts.map new file mode 100644 index 000000000..ed9988f39 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ephemeral-keys.spec.d.ts","sourceRoot":"","sources":["../../../test/keys/ephemeral-keys.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js new file mode 100644 index 000000000..4730fc7ce --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js @@ -0,0 +1,52 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import * as crypto from '../../src/index.js'; +import fixtures from '../fixtures/go-elliptic-key.js'; +const curves = ['P-256', 'P-384']; // 'P-521' fails in tests :( no clue why +const lengths = { + 'P-256': 65, + 'P-384': 97, + 'P-521': 133 +}; +const secretLengths = { + 'P-256': 32, + 'P-384': 48, + 'P-521': 66 +}; +describe('generateEphemeralKeyPair', () => { + curves.forEach((curve) => { + it(`generate and shared key ${curve}`, async () => { + const keys = await Promise.all([ + crypto.keys.generateEphemeralKeyPair(curve), + crypto.keys.generateEphemeralKeyPair(curve) + ]); + expect(keys[0].key).to.have.length(lengths[curve]); + expect(keys[1].key).to.have.length(lengths[curve]); + const shared = await keys[0].genSharedKey(keys[1].key); + expect(shared).to.have.length(secretLengths[curve]); + }); + }); + describe('go interop', () => { + it('generates a shared secret', async () => { + const curve = fixtures.curve; + const keys = await Promise.all([ + crypto.keys.generateEphemeralKeyPair(curve), + crypto.keys.generateEphemeralKeyPair(curve) + ]); + const alice = keys[0]; + const bob = keys[1]; + bob.key = fixtures.bob.public; + const secrets = await Promise.all([ + alice.genSharedKey(bob.key), + bob.genSharedKey(alice.key, fixtures.bob) + ]); + expect(secrets[0]).to.eql(secrets[1]); + expect(secrets[0]).to.have.length(32); + }); + }); + it('handles bad curve name', async () => { + await expect(crypto.keys.generateEphemeralKeyPair('bad name')).to.eventually.be.rejected.with.property('code', 'ERR_INVALID_CURVE'); + }); +}); +//# sourceMappingURL=ephemeral-keys.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js.map new file mode 100644 index 000000000..3194a3568 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/ephemeral-keys.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ephemeral-keys.spec.js","sourceRoot":"","sources":["../../../test/keys/ephemeral-keys.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,QAAQ,MAAM,gCAAgC,CAAA;AAErD,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA,CAAC,wCAAwC;AAC1E,MAAM,OAAO,GAA2B;IACtC,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,GAAG;CACb,CAAA;AAED,MAAM,aAAa,GAA2B;IAC5C,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,EAAE,CAAC,2BAA2B,KAAK,EAAE,EAAE,KAAK,IAAI,EAAE;YAChD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC7B,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;gBAC3C,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC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AY,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;aAC1C,CAAC,CAAA;YAEF,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YACrC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACrI,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts new file mode 100644 index 000000000..ae263ca47 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=importer.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts.map new file mode 100644 index 000000000..9e11d2714 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"importer.spec.d.ts","sourceRoot":"","sources":["../../../test/keys/importer.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js new file mode 100644 index 000000000..74fdaa6de --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js @@ -0,0 +1,19 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { exporter } from '../../src/keys/exporter.js'; +import { importer } from '../../src/keys/importer.js'; +describe('libp2p-crypto importer/exporter', function () { + it('roundtrips', async () => { + for (const password of ['', 'password']) { + const secret = new Uint8Array(32); + for (let i = 0; i < secret.length; i++) { + secret[i] = i; + } + const exported = await exporter(secret, password); + const imported = await importer(exported, password); + expect(imported).to.deep.equal(secret); + } + }); +}); +//# sourceMappingURL=importer.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js.map new file mode 100644 index 000000000..26729025f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/importer.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"importer.spec.js","sourceRoot":"","sources":["../../../test/keys/importer.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,QAAQ,CAAC,iCAAiC,EAAE;IAC1C,EAAE,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;QAC1B,KAAK,MAAM,QAAQ,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE;YACvC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAA;YACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aACd;YAED,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YACjD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YACnD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;SACvC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts new file mode 100644 index 000000000..b2aa6c5bb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=key-stretcher.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts.map new file mode 100644 index 000000000..0aae1992e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"key-stretcher.spec.d.ts","sourceRoot":"","sources":["../../../test/keys/key-stretcher.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js new file mode 100644 index 000000000..e0a54d9bb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js @@ -0,0 +1,51 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import * as crypto from '../../src/index.js'; +import fixtures from '../fixtures/go-stretch-key.js'; +describe('keyStretcher', () => { + describe('generate', () => { + const ciphers = ['AES-128', 'AES-256', 'Blowfish']; + const hashes = ['SHA1', 'SHA256', 'SHA512']; + let res; + let secret; + before(async () => { + res = await crypto.keys.generateEphemeralKeyPair('P-256'); + secret = await res.genSharedKey(res.key); + }); + ciphers.forEach((cipher) => { + hashes.forEach((hash) => { + it(`${cipher} - ${hash}`, async () => { + const keys = await crypto.keys.keyStretcher(cipher, hash, secret); + expect(keys.k1).to.exist(); + expect(keys.k2).to.exist(); + }); + }); + }); + it('handles invalid cipher type', () => { + // @ts-expect-error cipher name is invalid + return expect(crypto.keys.keyStretcher('invalid-cipher', 'SHA256', 'secret')).to.eventually.be.rejected().with.property('code', 'ERR_INVALID_CIPHER_TYPE'); + }); + it('handles missing hash type', () => { + // @ts-expect-error secret name is invalid + return expect(crypto.keys.keyStretcher('AES-128', undefined, 'secret')).to.eventually.be.rejected().with.property('code', 'ERR_MISSING_HASH_TYPE'); + }); + }); + describe('go interop', () => { + fixtures.forEach((test) => { + it(`${test.cipher} - ${test.hash}`, async () => { + const cipher = test.cipher; + const hash = test.hash; + const secret = test.secret; + const keys = await crypto.keys.keyStretcher(cipher, hash, secret); + expect(keys.k1.iv).to.be.eql(test.k1.iv); + expect(keys.k1.cipherKey).to.be.eql(test.k1.cipherKey); + expect(keys.k1.macKey).to.be.eql(test.k1.macKey); + expect(keys.k2.iv).to.be.eql(test.k2.iv); + expect(keys.k2.cipherKey).to.be.eql(test.k2.cipherKey); + expect(keys.k2.macKey).to.be.eql(test.k2.macKey); + }); + }); + }); +}); +//# sourceMappingURL=key-stretcher.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js.map new file mode 100644 index 000000000..20644c82e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/key-stretcher.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"key-stretcher.spec.js","sourceRoot":"","sources":["../../../test/keys/key-stretcher.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,QAAQ,MAAM,+BAA+B,CAAA;AAGpD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAA8C,CAAA;QAC/F,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAwC,CAAA;QAClF,IAAI,GAAY,CAAA;QAChB,IAAI,MAAkB,CAAA;QAEtB,MAAM,CAAC,KAAK,IAAI,EAAE;YAChB,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,O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C,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;YAClD,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts new file mode 100644 index 000000000..046177606 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=rsa.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts.map new file mode 100644 index 000000000..a7d6cb45c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa.spec.d.ts","sourceRoot":"","sources":["../../../test/keys/rsa.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js new file mode 100644 index 000000000..c4767d782 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js @@ -0,0 +1,395 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { Uint8ArrayList } from 'uint8arraylist'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import * as crypto from '../../src/index.js'; +import { MAX_KEY_SIZE, RsaPrivateKey, RsaPublicKey } from '../../src/keys/rsa-class.js'; +import fixtures from '../fixtures/go-key-rsa.js'; +import { RSA_KEY_8200_BITS } from '../fixtures/rsa.js'; +import { testGarbage } from '../helpers/test-garbage-error-handling.js'; +const rsa = crypto.keys.supportedKeys.rsa; +describe('RSA', function () { + this.timeout(20 * 1000); + let key; + before(async () => { + key = await rsa.generateKeyPair(512); + }); + it('generates a valid key', async () => { + expect(key).to.be.an.instanceof(rsa.RsaPrivateKey); + const digest = await key.hash(); + expect(digest).to.have.length(34); + }); + it('does not generate a big key', async () => { + await expect(rsa.generateKeyPair(MAX_KEY_SIZE + 1)).to.be.rejected(); + }); + it('does not unmarshal a big key', async () => { + const k = RSA_KEY_8200_BITS; + const sk = new RsaPrivateKey(k.privateKey, k.publicKey); + const pubk = new RsaPublicKey(k.publicKey); + const m = sk.marshal(); + const pubm = pubk.marshal(); + await expect(rsa.unmarshalRsaPrivateKey(m)).to.eventually.be.rejectedWith(/too large/); + expect(() => rsa.unmarshalRsaPublicKey(pubm)).to.throw(/too large/); + await expect(rsa.fromJwk(k.privateKey)).to.eventually.be.rejectedWith(/too large/); + }); + it('signs', async () => { + const text = key.genSecret(); + const sig = await key.sign(text); + const res = await key.public.verify(text, sig); + expect(res).to.be.eql(true); + }); + it('signs a list', async () => { + const text = new Uint8ArrayList(crypto.randomBytes(512), crypto.randomBytes(512)); + const sig = await key.sign(text); + await expect(key.sign(text.subarray())) + .to.eventually.deep.equal(sig, 'list did not have same signature as a single buffer'); + await expect(key.public.verify(text, sig)) + .to.eventually.be.true('did not verify message as list'); + await expect(key.public.verify(text.subarray(), sig)) + .to.eventually.be.true('did not verify message as single buffer'); + }); + it('encoding', async () => { + const keyMarshal = key.marshal(); + const key2 = await rsa.unmarshalRsaPrivateKey(keyMarshal); + const keyMarshal2 = key2.marshal(); + expect(keyMarshal).to.eql(keyMarshal2); + const pk = key.public; + const pkMarshal = pk.marshal(); + const pk2 = rsa.unmarshalRsaPublicKey(pkMarshal); + const pkMarshal2 = pk2.marshal(); + expect(pkMarshal).to.eql(pkMarshal2); + }); + it('key id', async () => { + const key = await crypto.keys.unmarshalPrivateKey(uint8ArrayFromString('CAASqAkwggSkAgEAAoIBAQCk0O+6oNRxhcdZe2GxEDrFBkDV4TZFZnp2ly/dL1cGMBql/8oXPZgei6h7+P5zzfDq2YCfwbjbf0IVY1AshRl6B5VGE1WS+9p1y1OZxJf5os6V1ENnTi6FTcyuBl4BN8dmIKOif0hqgqflaT5OhfYZDXfbJyVQj4vb2+Stu2Xpph3nwqAnTw/7GC/7jrt2Cq6Tu1PoZi36wSwEPYW3eQ1HAYxZjTYYDXl2iyHygnTcbkGRwAQ7vjk+mW7u60zyoolCm9f6Y7c/orJ33DDUocbaGJLlHcfd8bioBwaZy/2m7q43X8pQs0Q1/iwUt0HHZj1YARmHKbh0zR31ciFiV37dAgMBAAECggEADtJBNKnA4QKURj47r0YT2uLwkqtBi6UnDyISalQXAdXyl4n0nPlrhBewC5H9I+HZr+zmTbeIjaiYgz7el1pSy7AB4v7bG7AtWZlyx6mvtwHGjR+8/f3AXjl8Vgv5iSeAdXUq8fJ7SyS7v3wi38HZOzCEXj9bci6ud5ODMYJgLE4gZD0+i1+/V9cpuYfGpS/gLTLEMQLiw/9o8NSZ7sAnxg0UlYhotqaQY23hvXPBOe+0oa95zl2n6XTxCafa3dQl/B6CD1tUq9dhbQew4bxqMq/mhRO9pREEqZ083Uh+u4PTc1BeHgIQaS864pHPb+AY1F7KDvPtHhdojnghp8d70QKBgQDeRYFxo6sd04ohY86Z/i9icVYIyCvfXAKnaMKeGUjK7ou6sDJwFX8W97+CzXpZ/vffsk/l5GGhC50KqrITxHAy/h5IjyDODfps7NMIp0Dm9sO4PWibbw3OOVBRc8w3b3i7I8MrUUA1nLHE1T1HA1rKOTz5jYhE0fi9XKiT1ciKOQKBgQC903w+n9y7M7eaMW7Z5/13kZ7PS3HlM681eaPrk8J4J+c6miFF40/8HOsmarS38v0fgTeKkriPz5A7aLzRHhSiOnp350JNM6c3sLwPEs2qx/CRuWWx1rMERatfDdUH6mvlK6QHu0QgSfQR27EO6a6XvVSJXbvFmimjmtIaz/IpxQKBgQDWJ9HYVAGC81abZTaiWK3/A4QJYhQjWNuVwPICsgnYvI4Uib+PDqcs0ffLZ38DRw48kek5bxpBuJbOuDhro1EXUJCNCJpq7jzixituovd9kTRyR3iKii2bDM2+LPwOTXDdnk9lZRugjCEbrPkleq33Ob7uEtfAty4aBTTHe6uEwQKBgQCB+2q8RyMSXNuADhFlzOFXGrOwJm0bEUUMTPrduRQUyt4e1qOqA3klnXe3mqGcxBpnlEe/76/JacvNom6Ikxx16a0qpYRU8OWz0KU1fR6vrrEgV98241k5t6sdL4+MGA1Bo5xyXtzLb1hdUh3vpDwVU2OrnC+To3iXus/b5EBiMQKBgEI1OaBcFiyjgLGEyFKoZbtzH1mdatTExfrAQqCjOVjQByoMpGhHTXwEaosvyYu63Pa8AJPT7juSGaiKYEJFcXO9BiNyVfmQiqSHJcYeuh+fmO9IlHRHgy5xaIIC00AHS2vC/gXwmXAdPis6BZqDJeiCuOLWJ94QXn8JBT8IgGAI', 'base64pad')); + const id = await key.id(); + expect(id).to.eql('QmQgsppVMDUpe83wcAqaemKbYvHeF127gnSFQ1xFnBodVw'); + }); + describe('key equals', () => { + it('equals itself', () => { + expect(key.equals(key)).to.eql(true); + expect(key.public.equals(key.public)).to.eql(true); + }); + it('not equals other key', async () => { + const key2 = await crypto.keys.generateKeyPair('RSA', 512); + if (!(key2 instanceof RsaPrivateKey)) { + throw new Error('Key was incorrect type'); + } + expect(key.equals(key2)).to.eql(false); + expect(key2.equals(key)).to.eql(false); + expect(key.public.equals(key2.public)).to.eql(false); + expect(key2.public.equals(key.public)).to.eql(false); + }); + }); + it('sign and verify', async () => { + const data = uint8ArrayFromString('hello world'); + const sig = await key.sign(data); + const valid = await key.public.verify(data, sig); + expect(valid).to.be.eql(true); + }); + it('encrypt and decrypt', () => { + const data = uint8ArrayFromString('hello world'); + const enc = key.public.encrypt(data); + const dec = key.decrypt(enc); + expect(dec).to.be.eql(data); + }); + it('encrypt decrypt browser/node interop', async () => { + // @ts-check + /** + * @type {any} + */ + const id = await crypto.keys.unmarshalPrivateKey(uint8ArrayFromString('CAASqAkwggSkAgEAAoIBAQCk0O+6oNRxhcdZe2GxEDrFBkDV4TZFZnp2ly/dL1cGMBql/8oXPZgei6h7+P5zzfDq2YCfwbjbf0IVY1AshRl6B5VGE1WS+9p1y1OZxJf5os6V1ENnTi6FTcyuBl4BN8dmIKOif0hqgqflaT5OhfYZDXfbJyVQj4vb2+Stu2Xpph3nwqAnTw/7GC/7jrt2Cq6Tu1PoZi36wSwEPYW3eQ1HAYxZjTYYDXl2iyHygnTcbkGRwAQ7vjk+mW7u60zyoolCm9f6Y7c/orJ33DDUocbaGJLlHcfd8bioBwaZy/2m7q43X8pQs0Q1/iwUt0HHZj1YARmHKbh0zR31ciFiV37dAgMBAAECggEADtJBNKnA4QKURj47r0YT2uLwkqtBi6UnDyISalQXAdXyl4n0nPlrhBewC5H9I+HZr+zmTbeIjaiYgz7el1pSy7AB4v7bG7AtWZlyx6mvtwHGjR+8/f3AXjl8Vgv5iSeAdXUq8fJ7SyS7v3wi38HZOzCEXj9bci6ud5ODMYJgLE4gZD0+i1+/V9cpuYfGpS/gLTLEMQLiw/9o8NSZ7sAnxg0UlYhotqaQY23hvXPBOe+0oa95zl2n6XTxCafa3dQl/B6CD1tUq9dhbQew4bxqMq/mhRO9pREEqZ083Uh+u4PTc1BeHgIQaS864pHPb+AY1F7KDvPtHhdojnghp8d70QKBgQDeRYFxo6sd04ohY86Z/i9icVYIyCvfXAKnaMKeGUjK7ou6sDJwFX8W97+CzXpZ/vffsk/l5GGhC50KqrITxHAy/h5IjyDODfps7NMIp0Dm9sO4PWibbw3OOVBRc8w3b3i7I8MrUUA1nLHE1T1HA1rKOTz5jYhE0fi9XKiT1ciKOQKBgQC903w+n9y7M7eaMW7Z5/13kZ7PS3HlM681eaPrk8J4J+c6miFF40/8HOsmarS38v0fgTeKkriPz5A7aLzRHhSiOnp350JNM6c3sLwPEs2qx/CRuWWx1rMERatfDdUH6mvlK6QHu0QgSfQR27EO6a6XvVSJXbvFmimjmtIaz/IpxQKBgQDWJ9HYVAGC81abZTaiWK3/A4QJYhQjWNuVwPICsgnYvI4Uib+PDqcs0ffLZ38DRw48kek5bxpBuJbOuDhro1EXUJCNCJpq7jzixituovd9kTRyR3iKii2bDM2+LPwOTXDdnk9lZRugjCEbrPkleq33Ob7uEtfAty4aBTTHe6uEwQKBgQCB+2q8RyMSXNuADhFlzOFXGrOwJm0bEUUMTPrduRQUyt4e1qOqA3klnXe3mqGcxBpnlEe/76/JacvNom6Ikxx16a0qpYRU8OWz0KU1fR6vrrEgV98241k5t6sdL4+MGA1Bo5xyXtzLb1hdUh3vpDwVU2OrnC+To3iXus/b5EBiMQKBgEI1OaBcFiyjgLGEyFKoZbtzH1mdatTExfrAQqCjOVjQByoMpGhHTXwEaosvyYu63Pa8AJPT7juSGaiKYEJFcXO9BiNyVfmQiqSHJcYeuh+fmO9IlHRHgy5xaIIC00AHS2vC/gXwmXAdPis6BZqDJeiCuOLWJ94QXn8JBT8IgGAI', 'base64pad')); + if (!(id instanceof RsaPrivateKey)) { + throw new Error('Key was incorrect type'); + } + const msg = uint8ArrayFromString('hello'); + // browser + const dec1 = id.decrypt(uint8ArrayFromString('YRFUDx8UjbWSfDS84cDA4WowaaOmd1qFNAv5QutodCKYb9uPtU/tDiAvJzOGu5DCJRo2J0l/35P2weiB4/C2Cb1aZgXKMx/QQC+2jSJiymhqcZaYerjTvkCFwkjCaqthoVo/YXxsaFZ1q7bdTZUDH1TaJR7hWfSyzyPcA8c0w43MIsw16pY8ZaPSclvnCwhoTg1JGjMk6te3we7+wR8QU7VrPhs54mZWxrpu3NQ8xZ6xQqIedsEiNhBUccrCSzYghgsP0Ae/8iKyGyl3U6IegsJNn8jcocvzOJrmU03rgIFPjvuBdaqB38xDSTjbA123KadB28jNoSZh18q/yH3ZIg==', 'base64pad')); + expect(dec1).to.be.eql(msg); + // node + const dec2 = id.decrypt(uint8ArrayFromString('e6yxssqXsWc27ozDy0PGKtMkCS28KwFyES2Ijz89yiz+w6bSFkNOhHPKplpPzgQEuNoUGdbseKlJFyRYHjIT8FQFBHZM8UgSkgoimbY5on4xSxXs7E5/+twjqKdB7oNveTaTf7JCwaeUYnKSjbiYFEawtMiQE91F8sTT7TmSzOZ48tUhnddAAZ3Ac/O3Z9MSAKOCDipi+JdZtXRT8KimGt36/7hjjosYmPuHR1Xy/yMTL6SMbXtBM3yAuEgbQgP+q/7kHMHji3/JvTpYdIUU+LVtkMusXNasRA+UWG2zAht18vqjFMsm9JTiihZw9jRHD4vxAhf75M992tnC+0ZuQg==', 'base64pad')); + expect(dec2).to.be.eql(msg); + }); + it('fails to verify for different data', async () => { + const data = uint8ArrayFromString('hello world'); + const sig = await key.sign(data); + const valid = await key.public.verify(uint8ArrayFromString('hello'), sig); + expect(valid).to.be.eql(false); + }); + describe('export and import', () => { + it('password protected PKCS #8', async () => { + const pem = await key.export('my secret', 'pkcs-8'); + expect(pem).to.startsWith('-----BEGIN ENCRYPTED PRIVATE KEY-----'); + const clone = await crypto.keys.importKey(pem, 'my secret'); + if (!(clone instanceof RsaPrivateKey)) { + throw new Error('Wrong kind of key imported'); + } + expect(clone).to.exist(); + expect(key.equals(clone)).to.eql(true); + }); + it('defaults to PKCS #8', async () => { + const pem = await key.export('another secret'); + expect(pem).to.startsWith('-----BEGIN ENCRYPTED PRIVATE KEY-----'); + const clone = await crypto.keys.importKey(pem, 'another secret'); + if (!(clone instanceof RsaPrivateKey)) { + throw new Error('Wrong kind of key imported'); + } + expect(clone).to.exist(); + expect(key.equals(clone)).to.eql(true); + }); + it('should export a password encrypted libp2p-key', async () => { + const encryptedKey = await key.export('my secret', 'libp2p-key'); + // Import the key + const importedKey = await crypto.keys.importKey(encryptedKey, 'my secret'); + if (!(importedKey instanceof RsaPrivateKey)) { + throw new Error('Wrong kind of key imported'); + } + expect(key.equals(importedKey)).to.equal(true); + }); + it('should fail to import libp2p-key with wrong password', async () => { + const encryptedKey = await key.export('my secret', 'libp2p-key'); + try { + await crypto.keys.importKey(encryptedKey, 'not my secret'); + } + catch (err) { + expect(err).to.exist(); + return; + } + expect.fail('should have thrown'); + }); + it('needs correct password', async () => { + const pem = await key.export('another secret'); + try { + await crypto.keys.importKey(pem, 'not the secret'); + } + catch (err) { + return; // expected + } + throw new Error('Expected error to be thrown'); + }); + it('handles invalid export type', () => { + return expect(key.export('secret', 'invalid-type')).to.eventually.be.rejected.with.property('code', 'ERR_INVALID_EXPORT_FORMAT'); + }); + }); + describe('throws error instead of crashing', () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.verify.publicKey); + testGarbage('key.verify', key.verify.bind(key), 2, true); + testGarbage('crypto.keys.unmarshalPrivateKey', crypto.keys.unmarshalPrivateKey.bind(crypto.keys)); + }); + describe('go interop', () => { + it('verifies with data from go', async () => { + const key = crypto.keys.unmarshalPublicKey(fixtures.verify.publicKey); + const ok = await key.verify(fixtures.verify.data, fixtures.verify.signature); + expect(ok).to.equal(true); + }); + }); + describe('openssl interop', () => { + it('can read a private key', async () => { + /* + * Generated with + * openssl genpkey -algorithm RSA + * -pkeyopt rsa_keygen_bits:3072 + * -pkeyopt rsa_keygen_pubexp:65537 + */ + const pem = `-----BEGIN PRIVATE KEY----- +MIIG/wIBADANBgkqhkiG9w0BAQEFAASCBukwggblAgEAAoIBgQDp0Whyqa8KmdvK +0MsQGJEBzDAEHAZc0C6cr0rkb6Xwo+yB5kjZBRDORk0UXtYGE1pYt4JhUTmMzcWO +v2xTIsdbVMQlNtput2U8kIqS1cSTkX5HxOJtCiIzntMzuR/bGPSOexkyFQ8nCUqb +ROS7cln/ixprra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Vgyh27WxLr859ap8cKAH6Fb+UOPtZo3sUeeume60aebn +4pMwXeXP+LO8NIfRXV8mgrm86g== +-----END PRIVATE KEY----- +`; + const key = await crypto.keys.importKey(pem, ''); + expect(key).to.exist(); + const id = await key.id(); + expect(id).to.equal('QmfWu2Xp8DZzCkZZzoPB9rcrq4R4RZid6AWE6kmrUAzuHy'); + }); + // AssertionError: expected 'this only supports pkcs5PBES2' to not exist + it.skip('can read a private encrypted key (v1)', async () => { + /* + * Generated with + * openssl genpkey -algorithm RSA + * -pkeyopt rsa_keygen_bits:1024 + * -pkeyopt rsa_keygen_pubexp:65537 + * -out foo.pem + * openssl pkcs8 -in foo.pem -topk8 -passout pass:mypassword + */ + const pem = `-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICoTAbBgkqhkiG9w0BBQMwDgQI2563Jugj/KkCAggABIICgPxHkKtUUE8EWevq +eX9nTjqpbsv0QoXQMhegfxDELJLU8tj6V0bWNt7QDdfQ1n6FRgnNvNGick6gyqHH +yH9qC2oXwkDFP7OrHp2NEZd7DHQLLc+L4KJ/0dzsiZ1U9no7XzQMUay9Bc918ADE +pN2/EqigWkaG4gNjkAeKWr6+BNRevDXlSvls7YDboNcTiACi5zJkthivB9g3vT1m +gPdN6Gf/mmqtBTDHeqj5QsmXYqeCyo5b26JgYsziABVZDHph4ekPUsTvudRpE9Ex +baXwdYEAZxVpSbTvQ3A5qysjSZeM9ttfRTSSwL391q7dViz4+aujpk0Vj7piH+1B +CkfO8/XudRdRlnOe+KjMidktKCsMGCIOW92IlfMvIQ/Zn1GTYj9bRXONFNJ2WPND +UmCKnL7cmworwg/weRorrGKBWIGspU+tDASOPSvIGKo6Hoxm4CN1TpDRY7DAGlgm +Y3TEbMYfpXyzkPjvAhJDt03D3J9PrTO6uM5d7YUaaTmJ2TQFQVF2Lc3Uz8lDJLs0 +ZYtfQ/4H+YY2RrX7ua7t6ArUcYXZtv0J4lRYWjwV8fGPUVc0d8xLJU0Yjf4BD7K8 +rsavHo9b5YvBUX7SgUyxAEembEOe3SjQ+gPu2U5wovcjUuC9eItEEsXGrx30BQ0E +8BtK2+hp0eMkW5/BYckJkH+Yl8ypbzRGRRIZzLgeI4JveSx/mNhewfgTr+ORPThZ +mBdkD5r+ixWF174naw53L8U9wF8kiK7pIE1N9TR4USEeovLwX6Ni/2MMDZedOfof +2f77eUdLsK19/5/lcgAAYaXauXWhy2d2r3SayFrC9woy0lh2VLKRMBjcx1oWb7dp +0uxzo5Y= +-----END ENCRYPTED PRIVATE KEY----- +`; + const key = await crypto.keys.importKey(pem, 'mypassword'); + expect(key).to.exist(); + }); + it('can read a private encrypted key (v2 aes-128-cbc)', async () => { + /* + * Generated with + * openssl genpkey -algorithm RSA + * -pkeyopt rsa_keygen_bits:1024 + * -pkeyopt rsa_keygen_pubexp:65537 + * -out foo.pem + * openssl pkcs8 -in foo.pem -topk8 -v2 aes-128-cbc -passout pass:mypassword + */ + const pem = `-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIP5QK2RfqUl4CAggA +MB0GCWCGSAFlAwQBAgQQj3OyM9gnW2dd/eRHkxjGrgSCAoCpM5GZB0v27cxzZsGc +O4/xqgwB0c/bSJ6QogtYU2KVoc7ZNQ5q9jtzn3I4ONvneOkpm9arzYz0FWnJi2C3 +BPiF0D1NkfvjvMLv56bwiG2A1oBECacyAb2pXYeJY7SdtYKvcbgs3jx65uCm6TF2 +BylteH+n1ewTQN9DLfASp1n81Ajq9lQGaK03SN2MUtcAPp7N9gnxJrlmDGeqlPRs +KpQYRcot+kE6Ew8a5jAr7mAxwpqvr3SM4dMvADZmRQsM4Uc/9+YMUdI52DG87EWc +0OUB+fnQ8jw4DZgOE9KKM5/QTWc3aEw/dzXr/YJsrv01oLazhqVHnEMG0Nfr0+DP +q+qac1AsCsOb71VxaRlRZcVEkEfAq3gidSPD93qmlDrCnmLYTilcLanXUepda7ez +qhjkHtpwBLN5xRZxOn3oUuLGjk8VRwfmFX+RIMYCyihjdmbEDYpNUVkQVYFGi/F/ +1hxOyl9yhGdL0hb9pKHH10GGIgoqo4jSTLlb4ennihGMHCjehAjLdx/GKJkOWShy +V9hj8rAuYnRNb+tUW7ChXm1nLq14x9x1tX0ciVVn3ap/NoMkbFTr8M3pJ4bQlpAn +wCT2erYqwQtgSpOJcrFeph9TjIrNRVE7Zlmr7vayJrB/8/oPssVdhf82TXkna4fB +PcmO0YWLa117rfdeNM/Duy0ThSdTl39Qd+4FxqRZiHjbt+l0iSa/nOjTv1TZ/QqF +wqrO6EtcM45fbFJ1Y79o2ptC2D6MB4HKJq9WCt064/8zQCVx3XPbb3X8Z5o/6koy +ePGbz+UtSb9xczvqpRCOiFLh2MG1dUgWuHazjOtUcVWvilKnkjCMzZ9s1qG0sUDj +nPyn +-----END ENCRYPTED PRIVATE KEY----- +`; + const key = await crypto.keys.importKey(pem, 'mypassword'); + expect(key).to.exist(); + }); + it('can read a private encrypted key (v2 aes-256-cbc)', async () => { + /* + * Generated with + * openssl genpkey -algorithm RSA + * -pkeyopt rsa_keygen_bits:1024 + * -pkeyopt rsa_keygen_pubexp:65537 + * -out foo.pem + * openssl pkcs8 -in foo.pem -topk8 -v2 aes-256-cbc -passout pass:mypassword + */ + const pem = `-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIhuL894loRucCAggA +MB0GCWCGSAFlAwQBKgQQEoEtsjW3iC9/u0uGvkxX7wSCAoAsX3l6JoR2OGbT8CkY +YT3RQFqquOgItYOHw6E3tir2YrmxEAo99nxoL8pdto37KSC32eAGnfv5R1zmHHSx +0M3/y2AWiCBTX95EEzdtGC1hK3PBa/qpp/xEmcrsjYN6NXxMAkhC0hMP/HdvqMAg +ee7upvaYJsJcl8QLFNayAWr8b8cZA/RBhGEIRl59Eyj6nNtxDt3bCrfe06o1CPCV +50/fRZEwFOi/C6GYvPN6MrPZO3ALBWgopLT2yQqycTKtfxYWIdOsMBkAjKf2D6Pk +u2mqBsaP4b71jIIeT4euSJLsoJV+O39s8YHXtW8GtOqp7V5kIlnm90lZ9wzeLTZ7 +HJsD/jEdYto5J3YWm2wwEDccraffJSm7UDtJBvQdIx832kxeFCcGQjW38Zl1qqkg +iTH1PLTypxj2ZuviS2EkXVFb/kVU6leWwOt6fqWFC58UvJKeCk/6veazz3PDnTWM +92ClUqFd+CZn9VT4CIaJaAc6v5NLpPp+T9sRX9AtequPm7FyTeevY9bElfyk9gW9 +JDKgKxs6DGWDa16RL5vzwtU+G3o6w6IU+mEwa6/c+hN+pRFs/KBNLLSP9OHBx7BJ +X/32Ft+VFhJaK+lQ+f+hve7od/bgKnz4c/Vtp7Dh51DgWgCpBgb8p0vqu02vTnxD +BXtDv3h75l5PhvdWfVIzpMWRYFvPR+vJi066FjAz2sjYc0NMLSYtZWyWoIInjhoX +Dp5CQujCtw/ZSSlwde1DKEWAW4SeDZAOQNvuz0rU3eosNUJxEmh3aSrcrRtDpw+Y +mBUuWAZMpz7njBi7h+JDfmSW/GAaMwrVFC2gef5375R0TejAh+COAjItyoeYEvv8 +DQd8 +-----END ENCRYPTED PRIVATE KEY----- +`; + const key = await crypto.keys.importKey(pem, 'mypassword'); + expect(key).to.exist(); + }); + it('can read a private encrypted key (v2 des)', async () => { + /* + * Generated with + * openssl genpkey -algorithm RSA + * -pkeyopt rsa_keygen_bits:1024 + * -pkeyopt rsa_keygen_pubexp:65537 + * -out foo.pem + * openssl pkcs8 -in foo.pem -topk8 -v2 des -passout pass:mypassword + */ + const pem = `-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICwzA9BgkqhkiG9w0BBQ0wMDAbBgkqhkiG9w0BBQwwDgQI0lXp62ozXvwCAggA +MBEGBSsOAwIHBAiR3Id5vH0u4wSCAoDQQYOrrkPFPIa0S5fQGXnJw1F/66g92Gs1 +TkGydn4ouabWb++Vbi2chee1oyZsN2l8YNzDi0Gb2PfjsGpg2aJk0a3/efgA0u6T +leEH1dA/7Hr9NVspgHkaXpHt3X6wdbznLYJeAelfj7sDXpOkULGWCkCst0Txb6bi +Oxv4c0yYykiuUrp+2xvHbF9c2PrcDb58u/OBZcCg3QB1gTugQKM+ZIBRhcTEFLrm +8gWbzBfwYiUm6aJce4zoafP0NSlEOBbpbr73A08Q1IK6pISwltOUhhTvspSZnK41 +y2CHt5Drnpl1pfOw9Q0svO3VrUP+omxP1SFP17ZfaRGw2uHd08HJZs438x5dIQoH +QgjlZ8A5rcT3FjnytSh3fln2ZxAGuObghuzmOEL/+8fkGER9QVjmQlsL6OMfB4j4 +ZAkLf74uaTdegF3SqDQaGUwWgk7LyualmUXWTBoeP9kRIsRQLGzAEmd6duBPypED +HhKXP/ZFA1kVp3x1fzJ2llMFB3m1JBwy4PiohqrIJoR+YvKUvzVQtbOjxtCEAj87 +JFnlQj0wjTd6lfNn+okewMNjKINZx+08ui7XANNU/l18lHIIz3ssXJSmqMW+hRZ9 +9oB2tntLrnRMhkVZDVHadq7eMFOPu0rkekuaZm9CO2vu4V7Qa2h+gOoeczYza0H7 +A+qCKbprxyL8SKI5vug2hE+mfC1leXVRtUYm1DnE+oet99bFd0fN20NwTw0rOeRg +0Z+/ZpQNizrXxfd3sU7zaJypWCxZ6TD/U/AKBtcb2gqmUjObZhbfbWq6jU2Ye//w +EBqQkwAUXR1tNekF8CWLOrfC/wbLRxVRkayb8bQUfdgukLpz0bgw +-----END ENCRYPTED PRIVATE KEY----- +`; + const key = await crypto.keys.importKey(pem, 'mypassword'); + expect(key).to.exist(); + }); + it('can read a private encrypted key (v2 des3)', async () => { + /* + * Generated with + * openssl genpkey -algorithm RSA + * -pkeyopt rsa_keygen_bits:1024 + * -pkeyopt rsa_keygen_pubexp:65537 + * -out foo.pem + * openssl pkcs8 -in foo.pem -topk8 -v2 des3 -passout pass:mypassword + */ + const pem = `-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQISznrfHd+D58CAggA +MBQGCCqGSIb3DQMHBAhx0DnnUvDiHASCAoCceplm+Cmwlgvn4hNsv6e4c/S1iA7w +2hU7Jt8JgRCIMWjP2FthXOAFLa2fD4g3qncYXcDAFBXNyoh25OgOwstO14YkxhDi +wG4TeppGUt9IlyyCol6Z4WhQs1TGm5OcD5xDta+zBXsBnlgmKLD5ZXPEYB+3v/Dg +SvM4sQz6NgkVHN52hchERsnknwSOghiK9mIBH0RZU5LgzlDy2VoBCiEPVdZ7m4F2 +dft5e82zFS58vwDeNN/0r7fC54TyJf/8k3q94+4Hp0mseZ67LR39cvnEKuDuFROm +kLPLekWt5R2NGdunSQlA79BkrNB1ADruO8hQOOHMO9Y3/gNPWLKk+qrfHcUni+w3 +Ofq+rdfakHRb8D6PUmsp3wQj6fSOwOyq3S50VwP4P02gKcZ1om1RvEzTbVMyL3sh +hZcVB3vViu3DO2/56wo29lPVTpj9bSYjw/CO5jNpPBab0B/Gv7JAR0z4Q8gn6OPy +qf+ddyW4Kcb6QUtMrYepghDthOiS3YJV/zCNdL3gTtVs5Ku9QwQ8FeM0/5oJZPlC +TxGuOFEJnYRWqIdByCP8mp/qXS5alSR4uoYQSd7vZG4vkhkPNSAwux/qK1IWfqiW +3XlZzrbD//9IzFVqGRs4nRIFq85ULK0zAR57HEKIwGyn2brEJzrxpV6xsHBp+m4w +6r0+PtwuWA0NauTCUzJ1biUdH8t0TgBL6YLaMjlrfU7JstH3TpcZzhJzsjfy0+zV +NT2TO3kSzXpQ5M2VjOoHPm2fqxD/js+ThDB3QLi4+C7HqakfiTY1lYzXl9/vayt6 +DUD29r9pYL9ErB9tYko2rat54EY7k7Ts6S5jf+8G7Zz234We1APhvqaG +-----END ENCRYPTED PRIVATE KEY----- +`; + const key = await crypto.keys.importKey(pem, 'mypassword'); + expect(key).to.exist(); + }); + }); +}); +//# sourceMappingURL=rsa.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js.map new file mode 100644 index 000000000..9e4731a5e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/rsa.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rsa.spec.js","sourceRoot":"","sources":["../../../test/keys/rsa.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,QAAQ,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAEvE,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAA;AAEzC,QAAQ,CAAC,KAAK,EAAE;IACd,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IACvB,IAAI,GAAkB,CAAA;IAEtB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,GAAG,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CA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A;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts new file mode 100644 index 000000000..5f98c0932 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=secp256k1.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts.map new file mode 100644 index 000000000..5e0efdad4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1.spec.d.ts","sourceRoot":"","sources":["../../../test/keys/secp256k1.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js new file mode 100644 index 000000000..c92a962df --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js @@ -0,0 +1,183 @@ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { Uint8ArrayList } from 'uint8arraylist'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import * as crypto from '../../src/index.js'; +import * as Secp256k1 from '../../src/keys/secp256k1-class.js'; +import * as secp256k1Crypto from '../../src/keys/secp256k1.js'; +import fixtures from '../fixtures/go-key-secp256k1.js'; +const secp256k1 = crypto.keys.supportedKeys.secp256k1; +const keysPBM = crypto.keys.keysPBM; +const randomBytes = crypto.randomBytes; +describe('secp256k1 keys', () => { + let key; + before(async () => { + key = await secp256k1.generateKeyPair(); + }); + it('generates a valid key', async () => { + expect(key).to.be.an.instanceof(secp256k1.Secp256k1PrivateKey); + expect(key.public).to.be.an.instanceof(secp256k1.Secp256k1PublicKey); + const digest = await key.hash(); + expect(digest).to.have.length(34); + const publicDigest = await key.public.hash(); + expect(publicDigest).to.have.length(34); + }); + it('optionally accepts a `bits` argument when generating a key', async () => { + const _key = await secp256k1.generateKeyPair(); + expect(_key).to.be.an.instanceof(secp256k1.Secp256k1PrivateKey); + }); + it('signs', async () => { + const text = randomBytes(512); + const sig = await key.sign(text); + const res = await key.public.verify(text, sig); + expect(res).to.equal(true); + }); + it('signs a list', async () => { + const text = new Uint8ArrayList(crypto.randomBytes(512), crypto.randomBytes(512)); + const sig = await key.sign(text); + await expect(key.sign(text.subarray())) + .to.eventually.deep.equal(sig, 'list did not have same signature as a single buffer'); + await expect(key.public.verify(text, sig)) + .to.eventually.be.true('did not verify message as list'); + await expect(key.public.verify(text.subarray(), sig)) + .to.eventually.be.true('did not verify message as single buffer'); + }); + it('encoding', () => { + const keyMarshal = key.marshal(); + const key2 = secp256k1.unmarshalSecp256k1PrivateKey(keyMarshal); + const keyMarshal2 = key2.marshal(); + expect(keyMarshal).to.eql(keyMarshal2); + const pk = key.public; + const pkMarshal = pk.marshal(); + const pk2 = secp256k1.unmarshalSecp256k1PublicKey(pkMarshal); + const pkMarshal2 = pk2.marshal(); + expect(pkMarshal).to.eql(pkMarshal2); + }); + it('key id', async () => { + const decoded = keysPBM.PrivateKey.decode(fixtures.privateKey); + const key = secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data ?? new Uint8Array()); + const id = await key.id(); + expect(id).to.eql('QmPCyMBGEyifPtx5aa6k6wkY9N1eBf9vHK1eKfNc35q9uq'); + }); + it('should export a password encrypted libp2p-key', async () => { + const key = await crypto.keys.generateKeyPair('secp256k1'); + if (!(key instanceof Secp256k1.Secp256k1PrivateKey)) { + throw new Error('Generated wrong key type'); + } + const encryptedKey = await key.export('my secret'); + // Import the key + const importedKey = await crypto.keys.importKey(encryptedKey, 'my secret'); + if (!(importedKey instanceof Secp256k1.Secp256k1PrivateKey)) { + throw new Error('Imported wrong key type'); + } + expect(key.equals(importedKey)).to.equal(true); + }); + it('should fail to import libp2p-key with wrong password', async () => { + const key = await crypto.keys.generateKeyPair('secp256k1'); + const encryptedKey = await key.export('my secret', 'libp2p-key'); + await expect(crypto.keys.importKey(encryptedKey, 'not my secret')).to.eventually.be.rejected(); + }); + describe('key equals', () => { + it('equals itself', () => { + expect(key.equals(key)).to.eql(true); + expect(key.public.equals(key.public)).to.eql(true); + }); + it('not equals other key', async () => { + const key2 = await secp256k1.generateKeyPair(); + expect(key.equals(key2)).to.eql(false); + expect(key2.equals(key)).to.eql(false); + expect(key.public.equals(key2.public)).to.eql(false); + expect(key2.public.equals(key.public)).to.eql(false); + }); + }); + it('sign and verify', async () => { + const data = uint8ArrayFromString('hello world'); + const sig = await key.sign(data); + const valid = await key.public.verify(data, sig); + expect(valid).to.eql(true); + }); + it('fails to verify for different data', async () => { + const data = uint8ArrayFromString('hello world'); + const sig = await key.sign(data); + const valid = await key.public.verify(uint8ArrayFromString('hello'), sig); + expect(valid).to.eql(false); + }); +}); +describe('crypto functions', () => { + let privKey; + let pubKey; + before(() => { + privKey = secp256k1Crypto.generateKey(); + pubKey = secp256k1Crypto.computePublicKey(privKey); + }); + it('generates valid keys', () => { + expect(() => { + secp256k1Crypto.validatePrivateKey(privKey); + secp256k1Crypto.validatePublicKey(pubKey); + }).to.not.throw(); + }); + it('does not validate an invalid key', () => { + expect(() => { secp256k1Crypto.validatePublicKey(uint8ArrayFromString('42')); }).to.throw(); + expect(() => { secp256k1Crypto.validatePrivateKey(uint8ArrayFromString('42')); }).to.throw(); + }); + it('validates a correct signature', async () => { + const sig = await secp256k1Crypto.hashAndSign(privKey, uint8ArrayFromString('hello')); + const valid = await secp256k1Crypto.hashAndVerify(pubKey, sig, uint8ArrayFromString('hello')); + expect(valid).to.equal(true); + }); + it('does not validate when validating a message with an invalid signature', async () => { + const result = await secp256k1Crypto.hashAndVerify(pubKey, uint8ArrayFromString('invalid-sig'), uint8ArrayFromString('hello')); + expect(result).to.be.false(); + }); + it('errors if given a null Uint8Array to sign', async () => { + // @ts-expect-error incorrect args + await expect(secp256k1Crypto.hashAndSign(privKey, null)).to.eventually.be.rejected(); + }); + it('errors when signing with an invalid key', async () => { + await expect(secp256k1Crypto.hashAndSign(uint8ArrayFromString('42'), uint8ArrayFromString('Hello'))).to.eventually.be.rejected.with.property('code', 'ERR_INVALID_INPUT'); + }); + it('errors if given a null Uint8Array to validate', async () => { + const sig = await secp256k1Crypto.hashAndSign(privKey, uint8ArrayFromString('hello')); + // @ts-expect-error incorrect args + await expect(secp256k1Crypto.hashAndVerify(privKey, sig, null)).to.eventually.be.rejected(); + }); + it('throws when compressing an invalid public key', () => { + expect(() => secp256k1Crypto.compressPublicKey(uint8ArrayFromString('42'))).to.throw(); + }); + it('throws when decompressing an invalid public key', () => { + expect(() => secp256k1Crypto.decompressPublicKey(uint8ArrayFromString('42'))).to.throw(); + }); + it('compresses/decompresses a valid public key', () => { + const decompressed = secp256k1Crypto.decompressPublicKey(pubKey); + expect(decompressed).to.exist(); + expect(decompressed.length).to.be.eql(65); + const recompressed = secp256k1Crypto.compressPublicKey(decompressed); + expect(recompressed).to.eql(pubKey); + }); +}); +describe('go interop', () => { + it('loads a private key marshaled by go-libp2p-crypto', () => { + // we need to first extract the key data from the protobuf, which is + // normally handled by js-libp2p-crypto + const decoded = keysPBM.PrivateKey.decode(fixtures.privateKey); + expect(decoded.Type).to.eql(keysPBM.KeyType.Secp256k1); + const key = secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data ?? new Uint8Array()); + expect(key).to.be.an.instanceof(secp256k1.Secp256k1PrivateKey); + expect(key.bytes).to.eql(fixtures.privateKey); + }); + it('loads a public key marshaled by go-libp2p-crypto', () => { + const decoded = keysPBM.PublicKey.decode(fixtures.publicKey); + expect(decoded.Type).to.be.eql(keysPBM.KeyType.Secp256k1); + const key = secp256k1.unmarshalSecp256k1PublicKey(decoded.Data ?? new Uint8Array()); + expect(key).to.be.an.instanceof(secp256k1.Secp256k1PublicKey); + expect(key.bytes).to.eql(fixtures.publicKey); + }); + it('generates the same signature as go-libp2p-crypto', async () => { + const decoded = keysPBM.PrivateKey.decode(fixtures.privateKey); + expect(decoded.Type).to.eql(keysPBM.KeyType.Secp256k1); + const key = secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data ?? new Uint8Array()); + const sig = await key.sign(fixtures.message); + expect(sig).to.eql(fixtures.signature); + }); +}); +//# sourceMappingURL=secp256k1.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js.map new file mode 100644 index 000000000..b982aa0dc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/keys/secp256k1.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"secp256k1.spec.js","sourceRoot":"","sources":["../../../test/keys/secp256k1.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,mCAAmC,CAAA;AAC9D,OAAO,KAAK,eAAe,MAA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CAAA;IAEF,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;QAC9D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAEtD,MAAM,GAAG,GAAG,SAAS,CAAC,4BAA4B,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,UAAU,EAAE,CAAC,CAAA;QACpF,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC5C,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts new file mode 100644 index 000000000..a9f40bf06 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=random-bytes.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts.map new file mode 100644 index 000000000..1c7c1feb7 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"random-bytes.spec.d.ts","sourceRoot":"","sources":["../../test/random-bytes.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js new file mode 100644 index 000000000..a2de19934 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js @@ -0,0 +1,19 @@ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import randomBytes from '../src/random-bytes.js'; +describe('randomBytes', () => { + it('produces random bytes', () => { + expect(randomBytes(16)).to.have.length(16); + }); + it('throws if length is 0', () => { + expect(() => randomBytes(0)).to.throw(Error).with.property('code', 'ERR_INVALID_LENGTH'); + }); + it('throws if length is < 0', () => { + expect(() => randomBytes(-1)).to.throw(Error).with.property('code', 'ERR_INVALID_LENGTH'); + }); + it('throws if length is not a number', () => { + // @ts-expect-error invalid params + expect(() => randomBytes('hi')).to.throw(Error).with.property('code', 'ERR_INVALID_LENGTH'); + }); +}); +//# sourceMappingURL=random-bytes.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js.map new file mode 100644 index 000000000..f3f774c23 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/random-bytes.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"random-bytes.spec.js","sourceRoot":"","sources":["../../test/random-bytes.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,WAAW,MAAM,wBAAwB,CAAA;AAEhD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAC1F,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAC3F,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,kCAAkC;QAClC,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAC7F,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts new file mode 100644 index 000000000..1eb0beb42 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts @@ -0,0 +1,2 @@ +import 'node-forge/lib/jsbn.js'; +//# sourceMappingURL=util.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts.map new file mode 100644 index 000000000..69db1026a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.spec.d.ts","sourceRoot":"","sources":["../../test/util.spec.ts"],"names":[],"mappings":"AAGA,OAAO,wBAAwB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js new file mode 100644 index 000000000..c853b2c62 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js @@ -0,0 +1,29 @@ +/* eslint max-nested-callbacks: ["error", 8] */ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import 'node-forge/lib/jsbn.js'; +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js'; +import * as util from '../src/util.js'; +describe('Util', () => { + let bn; + before(() => { + bn = new forge.jsbn.BigInteger('dead', 16); + }); + it('should convert BigInteger to a uint base64url encoded string', () => { + expect(util.bigIntegerToUintBase64url(bn)).to.eql('3q0'); + }); + it('should convert BigInteger to a uint base64url encoded string with padding', () => { + const bnpad = new forge.jsbn.BigInteger('ff', 16); + expect(util.bigIntegerToUintBase64url(bnpad, 2)).to.eql('AP8'); + }); + it('should convert base64url encoded string to BigInteger', () => { + const num = util.base64urlToBigInteger('3q0'); + expect(num.equals(bn)).to.be.true(); + }); + it('should convert base64url encoded string to Uint8Array with padding', () => { + const buf = util.base64urlToBuffer('AP8', 2); + expect(Uint8Array.from([0, 255])).to.eql(buf); + }); +}); +//# sourceMappingURL=util.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js.map new file mode 100644 index 000000000..55d7f7924 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/util.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.spec.js","sourceRoot":"","sources":["../../test/util.spec.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,sBAAsB;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,wBAAwB,CAAA;AAC/B,qCAAqC;AACrC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAEtC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,IAAI,EAAgC,CAAA;IAEpC,MAAM,CAAC,GAAG,EAAE;QACV,EAAE,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;QACnF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACjD,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAA;QAC7C,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAC5C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts new file mode 100644 index 000000000..ab2037b16 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=workaround.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts.map new file mode 100644 index 000000000..dddfc7fd3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"workaround.spec.d.ts","sourceRoot":"","sources":["../../test/workaround.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js new file mode 100644 index 000000000..83d3301d4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js @@ -0,0 +1,17 @@ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { derivedEmptyPasswordKey } from '../src/ciphers/aes-gcm.browser.js'; +describe('Constant derived key is generated correctly', () => { + it('Generates correctly', async () => { + if ((typeof navigator !== 'undefined' && navigator.userAgent.includes('Safari')) || typeof crypto === 'undefined') { + // WebKit Linux can't generate this. Hence the workaround. + return; + } + const generatedKey = await crypto.subtle.exportKey('jwk', await crypto.subtle.deriveKey({ name: 'PBKDF2', salt: new Uint8Array(16), iterations: 32767, hash: { name: 'SHA-256' } }, await crypto.subtle.importKey('raw', new Uint8Array(0), { name: 'PBKDF2' }, false, ['deriveKey']), { name: 'AES-GCM', length: 128 }, true, ['encrypt', 'decrypt'])); + // Webkit macos flips these. Sort them so they match. + derivedEmptyPasswordKey.key_ops.sort(); + generatedKey?.key_ops?.sort(); + expect(generatedKey).to.eql(derivedEmptyPasswordKey); + }); +}); +//# sourceMappingURL=workaround.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js.map new file mode 100644 index 000000000..b6c722901 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/test/workaround.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workaround.spec.js","sourceRoot":"","sources":["../../test/workaround.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,M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/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/tsconfig.tsbuildinfo new file mode 100644 index 000000000..095918b6b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../interface/dist/src/errors.d.ts","../src/aes/cipher-mode.ts","../src/aes/ciphers.ts","../src/aes/index.ts","../src/hmac/lengths.ts","../src/hmac/index.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base58.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/identity.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/sha2.d.ts","../../../node_modules/uint8arrays/dist/src/equals.d.ts","../../../node_modules/uint8arrays/dist/src/to-string.d.ts","../src/keys/interface.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../src/keys/ed25519.ts","../../../node_modules/multiformats/dist/types/src/bases/base64.d.ts","../../../node_modules/uint8arrays/dist/src/concat.d.ts","../src/ciphers/interface.ts","../src/ciphers/aes-gcm.ts","../src/keys/exporter.ts","../../../node_modules/protons-runtime/dist/src/codec.d.ts","../../../node_modules/protons-runtime/dist/src/decode.d.ts","../../../node_modules/protons-runtime/dist/src/encode.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../../../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../../../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../../../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../../../node_modules/protons-runtime/dist/src/index.d.ts","../src/keys/keys.ts","../src/keys/ed25519-class.ts","../src/keys/ecdh.ts","../src/keys/ephemeral-keys.ts","../src/keys/importer.ts","../src/keys/key-stretcher.ts","../../../node_modules/@noble/hashes/utils.d.ts","../src/random-bytes.ts","../src/util.ts","../src/keys/rsa-utils.ts","../src/keys/rsa.ts","../src/keys/rsa-class.ts","../../../node_modules/@noble/curves/abstract/modular.d.ts","../../../node_modules/@noble/curves/abstract/utils.d.ts","../../../node_modules/@noble/curves/abstract/curve.d.ts","../../../node_modules/@noble/curves/abstract/weierstrass.d.ts","../../../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../../../node_modules/@noble/curves/secp256k1.d.ts","../src/keys/secp256k1.ts","../src/keys/secp256k1-class.ts","../../interface/dist/src/keys/index.d.ts","../src/keys/index.ts","../src/pbkdf2.ts","../src/index.ts","../src/webcrypto.ts","../src/aes/ciphers-browser.ts","../src/ciphers/aes-gcm.browser.ts","../src/hmac/index-browser.ts","../src/keys/ecdh-browser.ts","../../../node_modules/@noble/curves/abstract/edwards.d.ts","../../../node_modules/@noble/curves/abstract/montgomery.d.ts","../../../node_modules/@noble/curves/ed25519.d.ts","../src/keys/ed25519-browser.ts","../src/keys/jwk2pem.ts","../src/keys/rsa-browser.ts","../src/keys/secp256k1-browser.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../test/fixtures/go-key-rsa.ts","../test/crypto.spec.ts","../test/random-bytes.spec.ts","../test/util.spec.ts","../test/workaround.spec.ts","../test/fixtures/aes.ts","../test/fixtures/go-aes.ts","../test/aes/aes.spec.ts","../test/fixtures/go-elliptic-key.ts","../test/fixtures/go-key-ed25519.ts","../test/fixtures/go-key-secp256k1.ts","../test/fixtures/go-stretch-key.ts","../test/fixtures/rsa.ts","../test/fixtures/secp256k1.ts","../test/helpers/test-garbage-error-handling.ts","../test/hmac/hmac.spec.ts","../test/keys/ed25519.spec.ts","../test/keys/ephemeral-keys.spec.ts","../test/keys/importer.spec.ts","../test/keys/key-stretcher.spec.ts","../test/keys/rsa.spec.ts","../test/keys/secp256k1.spec.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363",{"version":"e75f8051539fe7f9bed97632ff7d9668e93ce3953f49e8e0f8996886b78118d3","signature":"650e9f43fcd998313e4cc45d8ba3ca4a7bf59ea1ea849a1451e78927f2f8a3e9"},{"version":"52b84a81b3eb83fa53f04666f5cc27a8f9446462276823caa08ee6e82139facc","signature":"14401a5bbffd25b01b5683a6155837bf9cea37b2297c7ed0540b8a9b7e4f2593"},{"version":"d1e9ce59204b2f96bc9179dbfde6438bf7b6498e062a94e70d5a41011c548b73","signature":"df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b"},{"version":"6ee37df02df390bdf74d6d28c07622e322cbaa2daa2d65ce5c738f9eb1cf4f91","signature":"d916c18a3b2973888f4bbd62f8c3ca1fddae82d11afb73e56c771bb2f9ad3d43"},{"version":"094a1d5ba7d0386d7b06ce37c9e1b532ce040295e1cca189c5576680e3861730","signature":"a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f","affba5d1776ab2a5987107bb73681d42b91e9ecdcf2224c527feb1de9a6cfc97","49f8066febb9001898b93a81dea3b2b3fe39bc3ca168e5fdea9ecefe1356f133","5b563db2a9fdba4950d49351dae9909146ca93bec867e748754d255769e169e0","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec",{"version":"9f2269ac40d987dbcd96cb66b5e95c84191fa493231500447fbe8c7306581b7a","signature":"7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311"},"176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d",{"version":"c8f8bcbd4ecea1251e4bb270b81082a47fe1c54317ae73245378a84ffd8ccbb2","signature":"afd5afd035ab506cf225585702d4954b0402a8df16d703ede98e407ae9f40846"},"cdad2dcfe6064dd1503b5420b0b3475c1a6074a7f83f84169eec21ca449e7e46","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650",{"version":"2e3b926e7912b8eb51c02044c1bc4a4199e291862ca8a260a519e0b978af29da","signature":"c367795c5d33accaeefe3d8c49fb78d0fbbc9a870cdfd8dbb1fc4308a9df216a"},{"version":"641cfda7614d7723da9f248f98e024101bb68cbf5100f6bef4337afcba4fb5ab","signature":"20484d8584c463c2d794dd7344824ea36d41b319a0dfa07545858228179504a1"},{"version":"f204d2ccdd28e80c9d33089d077370bbabdda2a3256296ceae6a5120a3f4859e","signature":"9667ab7ce1e7a225f555d76db05fc319afff8581c3372f451216f8671b92cc6a"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e",{"version":"453de5c3f3e2e0d21efc050f7f31fe89db57b2394306ccae87f31b3184942bc7","signature":"c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae"},{"version":"e24f664d2c09cdc97f261f2b5e92400978f2dd7669e8efb651a48cab1246b4c4","signature":"7b16a7c7a940bd42cf6120082f6b35c5dec35e483a51cb1af342ef0192743577"},{"version":"d23afeab85caf6f9bbec88419e12c751e834df3b0edee0a4a39ab80884292463","signature":"d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49"},{"version":"2ee5946e26bb3372bd1f48e88e173b02d774c47560be98d06ee8964585055820","signature":"a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77"},{"version":"5c7290feccdea53f51e4f3a12e63320723fd8aeb9214b1c4dcbc501caa59cea0","signature":"0f930918b67576aba64bcb5e86297d70222227dee8dd1f82526d704142a270fb"},{"version":"bc035ad0dd68d703234cf3ab7db9de9e449511ace5787f575b1158206aa1f9ed","signature":"5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252"},"3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6",{"version":"9af2b3f2b2b002fe98e2331dca6056ccc66c12700ec1eb9687b19983d12c041b","signature":"3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f"},{"version":"d7a4faf3ce39e9ffea6fe4e87e4fc68cfbade5d45a034c11c9db706148c95681","signature":"d2bd19836d3c8447052928f6caac3a9b8ecb22df65f18c8ca9b761e34b8032f6"},{"version":"c26922964ce3b949515046e2bc1f14fb9b0de98d089dbeea3f64117a5eb65a67","signature":"6a6c28edae18eefb6f0e59f5c969ce972d3aa8958a29a4e8e2fd1d7b74aa8fd4"},{"version":"d5327e993a9690822e1f7b988b5a96488a8177e65f040a4256c32de740cd295e","signature":"19475ad837fd351badce1f15b9ed48efcbbb9304c7c950c0c26cd8abbebc839b"},{"version":"9361b0f17713970364c210a64b1ec14bb702bdebdc20a4bb94aaa3c9bb3f3251","signature":"b1b6235704afa69cf1cc3dad74e423ffef52a7c95d349909287ecb2b4e61b732"},"eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","bcfddd21e4d4581086dc9a65575c2b3669c4cf79ac4dde87bf399e9e7555a073","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","5f0c47f49b3d55baf93062d5e59509a9e5404384891307d97cb9fab3f8d75c0f",{"version":"f3ddeea027e5cfa1b06b1b3b1a713e8764fce885f37768b2f862c200470ee98a","signature":"2773c9c298e3e396683a1ef4311ffceff2bf1a39889d7aedb032bb2aa80996f2"},{"version":"986f7ac80695be5a46a16023a7890dda00a8c22590eb2e190004e9860712e9b2","signature":"e0a7a6eb257be445fadd46381e7a6d7f46b79595fdb5471e8646247013c3ad2f"},"e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488",{"version":"d2be409e2807e78d7f7ff593e4f6e75a3ece949459e6b4b0b48501efba11c52b","signature":"df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659"},{"version":"41f7b30e73d0d8614b012a48c654012241da904d0671a5ddd4ad7341d5935b13","signature":"18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f"},{"version":"21be571b61cdeacb2497f86009c99040477a90784469dd7ca4d8a9b7fa1bd2f5","signature":"892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1"},{"version":"a106634128cd7396687c809e278031f500958ee7064204a6967e521a965dfd3e","signature":"75cb2e5f0cc9a58cabe068671cc4c810e6192c178dd2a5e366d9395abcb3d2a4"},{"version":"c5aad7a2d9dcad35250afe8465ab08ca53b62e8b2886e3e316778266ad063c70","signature":"92e51c1aa17e7e58ce6daac6d1343d75e49882a92b1c3940fbb8a872d4f0ea0c"},{"version":"0f29688a3b5749e91f68202b1bf6d13fc3fe0d349d364b094d03ab0bd5efe354","signature":"5b23f0624768b920e23755e0c57bf277f68bcf79716181bd4b564a16af893134"},{"version":"0f82122fcd07dbdbe710da0b9afde2bfcc7135067ab0c49e85a09a8059a0638e","signature":"36c3a0a131ab3f8d892242f19cc291193bf289865b9ec974fbc02d4cb357b33c"},{"version":"72b121519871f346c15c48f387d7cdfdcee84bcccb5d7c8d04252a7738faae49","signature":"02a13752595cce2beb7f25f26fbd2c71f7f18e9ea0df195b6423a9a1dd4f9c12"},"49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b",{"version":"f4513087a8e5af14267fb6a0c07854dc3e6638ad5f04bd872f67fdd50c16009e","signature":"9ac2f43313f0d275e767669a1ff6db0e6446dfc207cafa8050ccef5c1eda0e70"},{"version":"c4f9920c9b6851ecdd4ecde257099ad3aed9aeb1a39226412b3de379b868a2d1","signature":"2053fd168cad7d97258ede28f808460963c8de3d3a941bb2bea3661630b8911e"},{"version":"ad3c9acdb8cc8470bffd387865829eeb2d1c569b2daf1f9e56a577501396978f","signature":"2e2efb0dd055f8ca049fdb126a61db652b8e6fdf19686cb2919f80648c7ebbb0"},{"version":"b75bb309e84b6d9f8912abee36f1db81a6e98b88d1a71e946abd43f60e2a4f68","signature":"2773c9c298e3e396683a1ef4311ffceff2bf1a39889d7aedb032bb2aa80996f2"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d",{"version":"94e5262ce465356e57ed09cb3ebca7869a9abec5434f52418374c01213365e1e","signature":"21b0def3259632886df82ec6bb39be4500d3509abafbe32208b43a246e66dbe0"},{"version":"e91234f62bb9d519eabb014be38af1b5660048deea3c1cddccc87c872f1122e0","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"84c212d9abdebb92c5c4bb4a3a4e4e83d751f3a80b8bf1cbd6fe3933c745fa12","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"042afd0ce3483f4bcc818541c939cc2c5cf73adee8c93d1b5a0f5cb8972a23c9","signature":"b1aeec3006484139967df3aad12667583ab95cf1acb06b69a4dd075eaf787a09"},{"version":"7dd315f498be571653c71e8099f59b1647fa81faafa4c1de2048e4f0140ebe70","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e320a9a2be93ce1c8e710f7d471940d101cd0109c3e7b07413222b2c3fb60b95","signature":"3f71a0487e459db3d2b0f1487ee91e040b746bdbb5491aae1588f6f5a3128323"},{"version":"eddf62629066aa6ea01e491e5b63139a8a65c10986ec605f69dfcd4db2144f8b","signature":"fd889fbb8de16b02febac2290852ff90b1ab34ff746af2cda722ee5bc5c0a58c"},{"version":"cbca036c0aa465bc9c1cfc6a33dfdb2ec79bb72e82cc4a04e1cbb16c8b1223a6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"8dc4b8367d083d138dd3449b177316a3984e5497d16a3b4b75b462c5ab37b54e","signature":"ee8f104f7cbcbcd09910c8887f359b5f45939dbf73e729a70abf21cb903b0aaf"},{"version":"b08165e38a663f7b0df31f9ab26c90c340f63413a557585d38dc4a1360bd8448","signature":"f1f28b20d37dc56f9a182c3257dea1bbbafdf55a60fcd07dcd47ac91e2da4e99"},{"version":"5d7ee45a0fdc86ac617d9de7ae12e619706b288d7a192dd2e947dceb2c6d1098","signature":"6ce730d602a5296dbe73ea711da0d3858dc51b08c5324a61fd0b0af67835808d"},{"version":"261e13f98be5810529dfe80a2b4e09c81b617f1a7a53d18439ee845994bc076e","signature":"c6eeb6d3bcfd812f3648d25e1e0d52d345b166635cdec7a6943fba09e7131089"},{"version":"e2ef935f0a0ca7dacdd55ca85679cf7180dfd673fc7f6d7465f2631596be66ae","signature":"baaf77654ef9ce8dcd94e5d9bd38218327f3fff1ebee8d9d400cdde0b0e196d9"},{"version":"7b88e6f1da528b05e9393d94817a754dab7897898321eda4b9459a9ee97da3e1","signature":"e0d6d5cc5f914afb7b847aac6d7ea47b35407c1837cf3fcd7e26f38990a7cb64"},{"version":"ceb2efbb7e0525f966119c438e0b7c4ae8ab479da28f8a983d89a6195833fd10","signature":"4d7e1a1c4e0ce1906a75ea7f390e5301ce2f497c7ebce591f2b2d3b9489a329d"},{"version":"3af094df229cfe0f00f8df09b39dd914e92c95fa860c7452a2b6f8567853e5c5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3caa6afe4eb14fa9014516814012b944f223eb111fa1e6155e388c82c329ddbf","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"490f8b513f70014ced407d3c9dc9e7a05da51b7e183db29b4dfc3f9dfd97e503","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"16c1a9af169955bf1477fb3235bf86c90cd4fd83c2bc296757cc559de62494de","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"68387239a288d3db9321fe0440aab1c9e30813fb80a9a3fd61077aaeaac8bebb","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e34447b85e016da3c1cefa8e614d28b40c711e184dddc467015c207a7ac326db","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2996ad45bc64637a2708a7cf4a605a80e3654e5571bc9d3a8fe6937d1a831b43","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[[62,66],90,92,[95,97],[106,111],[113,117],124,125,[127,134],[138,141],[149,170]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[118,250],[118,119,120,250],[250],[119,120,122,135,136,250],[118,119,121,122,250],[220,223,249,250,257,258,259,260],[142,250],[250,262],[250,257],[220,250,257],[250,282],[250,270,272,273,274,275,276,277,278,279,280,281,282],[250,270,271,273,274,275,276,277,278,279,280,281,282],[250,271,272,273,274,275,276,277,278,279,280,281,282],[250,270,271,272,274,275,276,277,278,279,280,281,282],[250,270,271,272,273,275,276,277,278,279,280,281,282],[250,270,271,272,273,274,276,277,278,279,280,281,282],[250,270,271,272,273,274,275,277,278,279,280,281,282],[250,270,271,272,273,274,275,276,278,279,280,281,282],[250,270,271,272,273,274,275,276,277,279,280,281,282],[250,270,271,272,273,274,275,276,277,278,280,281,282],[250,270,271,272,273,274,275,276,277,278,279,281,282],[250,270,271,272,273,274,275,276,277,278,279,280,282],[250,270,271,272,273,274,275,276,277,278,279,280,281],[250,304],[250,289],[250,293,294,295],[250,292],[250,294],[250,269,290,291,296,299,301,302,303],[250,291,297,298,304],[250,297,300],[250,291,292,297,304],[250,291,304],[250,306],[250,285,286,287,288],[214,220,250,257,264],[171,250],[207,250],[208,213,241,250],[209,220,221,228,238,249,250],[209,210,220,228,250],[211,250],[212,213,221,229,250],[213,238,246,250],[214,216,220,228,250],[215,250],[216,217,250],[220,250],[218,220,250],[207,220,250],[220,221,222,238,249,250],[220,221,222,235,238,241,250],[205,250,254],[216,220,223,228,238,249,250],[220,221,223,224,228,238,246,249,250],[223,225,238,246,249,250],[171,172,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256],[220,226,250],[227,249,250,254],[216,220,228,238,250],[229,250],[230,250],[207,231,250],[232,248,250,254],[233,250],[234,250],[220,235,236,250],[235,237,250,252],[208,220,238,239,240,241,250],[208,238,240,250],[238,239,250],[241,250],[242,250],[207,238,250],[220,244,245,250],[244,245,250],[213,228,238,246,250],[247,250],[228,248,250],[208,223,234,249,250],[213,250],[238,250,251],[227,250,252],[250,253],[208,213,220,222,231,238,249,250,252,254],[238,250,255],[223,238,250,257],[250,315,354],[250,315,339,354],[250,354],[250,315],[250,315,340,354],[250,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353],[250,340,354],[142,250,356],[250,355],[220,223,225,238,246,249,250,255,257],[250,363],[220,238,250,257],[142,143,144,145,146,147,250],[142,143,250],[67,250],[81,250],[78,79,80,81,250],[69,70,250],[69,250],[71,250],[72,250],[68,250],[68,74,250],[74,250],[75,250],[70,73,74,75,76,77,250],[67,68,69,71,72,250],[67,68,71,250],[105,250],[98,250],[98,105,250],[91,98,250],[98,99,100,101,102,103,104,250],[91,105,250],[83,250],[78,82,250],[182,186,249,250],[182,238,249,250],[177,250],[179,182,246,249,250],[228,246,250],[177,250,257],[179,182,228,249,250],[174,175,178,181,208,220,238,249,250],[174,180,250],[178,182,208,241,249,250,257],[208,250,257],[198,208,250,257],[176,177,250,257],[182,250],[176,177,178,179,180,181,182,183,184,186,187,188,189,190,191,192,193,194,195,196,197,199,200,201,202,203,204,250],[182,189,190,250],[180,182,190,191,250],[181,250],[174,177,182,250],[182,186,190,191,250],[186,250],[180,182,185,249,250],[174,179,180,182,186,189,250],[208,238,250],[177,182,198,208,250,254,257],[61,250],[84,89,250],[62,63,250],[84,94,95,130,250],[84,94,95,213,250],[65,130,250],[65,213,250],[64,66,113,127,128,250],[61,88,89,90,94,114,130,250],[61,90,213,250],[90,91,137,250],[61,78,85,86,87,88,91,92,97,106,250],[84,89,90,91,213,250],[108,250],[78,93,96,250],[93,96,250],[61,84,106,107,109,110,111,117,125,126,250],[114,250],[61,66,84,90,94,250],[61,84,89,90,91,113,115,130,139,250],[61,78,87,88,89,91,97,106,116,250],[61,84,89,114,250],[61,90,91,113,115,213,250],[61,87,91,123,250],[61,78,87,88,89,91,97,106,124,250],[61,91,123,213,250],[61,112,250],[84,89,94,250],[64,129,148,154,155,250],[88,117,129,148,149,250],[84,250],[90,250],[84,129,148,250],[84,91,107,129,148,158,163,250],[129,148,157,250],[97,110,148,250],[90,129,148,160,250],[84,91,117,129,148,149,161,163,250],[84,91,124,125,129,148,159,250],[113,148,250],[114,148,250],[132,148,250],[213],[95],[64,66,113,127,128],[90],[90,91],[78,91],[108],[78],[106,107,109,111,117,125,126],[91,105],[90,91,113,115],[91]],"referencedMap":[[120,1],[135,2],[122,2],[118,3],[136,3],[119,3],[121,2],[137,4],[123,5],[112,3],[261,6],[143,7],[147,7],[145,7],[142,3],[263,8],[264,9],[259,3],[265,3],[266,3],[267,3],[268,10],[269,3],[283,11],[284,11],[271,12],[272,13],[270,14],[273,15],[274,16],[275,17],[276,18],[277,19],[278,20],[279,21],[280,22],[281,23],[282,24],[305,25],[290,26],[296,27],[294,3],[293,28],[295,29],[304,30],[299,31],[301,32],[302,33],[303,34],[297,3],[298,34],[300,34],[292,34],[291,3],[307,35],[286,3],[285,3],[288,26],[289,36],[287,26],[308,3],[309,3],[310,3],[262,3],[311,37],[171,38],[172,38],[207,39],[208,40],[209,41],[210,42],[211,43],[212,44],[213,45],[214,46],[215,47],[216,48],[217,48],[219,49],[218,50],[220,51],[221,52],[222,53],[206,54],[256,3],[223,55],[224,56],[225,57],[257,58],[226,59],[227,60],[228,61],[229,62],[230,63],[231,64],[232,65],[233,66],[234,67],[235,68],[236,68],[237,69],[238,70],[240,71],[239,72],[241,73],[242,74],[243,75],[244,76],[245,77],[246,78],[247,79],[248,80],[249,81],[250,82],[251,83],[252,84],[253,85],[254,86],[255,87],[312,3],[313,3],[260,88],[314,3],[339,89],[340,90],[315,91],[318,91],[337,89],[338,89],[328,89],[327,92],[325,89],[320,89],[333,89],[331,89],[335,89],[319,89],[332,89],[336,89],[321,89],[322,89],[334,89],[316,89],[323,89],[324,89],[326,89],[330,89],[341,93],[329,89],[317,89],[354,94],[353,3],[348,93],[350,95],[349,93],[342,93],[343,93],[345,93],[347,93],[351,95],[352,95],[344,95],[346,95],[357,96],[356,97],[355,3],[358,3],[359,3],[306,3],[360,3],[361,98],[362,9],[363,3],[364,99],[365,100],[148,101],[173,3],[146,7],[144,102],[258,49],[81,103],[85,104],[93,104],[67,3],[82,105],[71,106],[77,3],[70,107],[72,108],[80,109],[79,109],[74,110],[75,111],[86,112],[68,3],[87,113],[78,114],[73,115],[69,116],[76,3],[98,117],[101,118],[102,119],[99,120],[100,118],[105,121],[103,122],[104,117],[59,3],[60,3],[10,3],[11,3],[14,3],[13,3],[2,3],[15,3],[16,3],[17,3],[18,3],[19,3],[20,3],[21,3],[22,3],[3,3],[4,3],[23,3],[27,3],[24,3],[25,3],[26,3],[28,3],[29,3],[30,3],[5,3],[31,3],[32,3],[33,3],[34,3],[6,3],[38,3],[35,3],[36,3],[37,3],[39,3],[7,3],[40,3],[45,3],[46,3],[41,3],[42,3],[43,3],[44,3],[8,3],[50,3],[47,3],[48,3],[49,3],[51,3],[9,3],[52,3],[53,3],[54,3],[57,3],[55,3],[56,3],[1,3],[58,3],[12,3],[91,3],[94,3],[88,3],[84,123],[89,123],[83,124],[189,125],[196,126],[188,125],[203,127],[180,128],[179,129],[202,9],[197,130],[200,131],[182,132],[181,133],[177,134],[176,135],[199,136],[178,137],[183,138],[184,3],[187,138],[174,3],[205,139],[204,138],[191,140],[192,141],[194,142],[190,143],[193,144],[198,9],[185,145],[186,146],[195,147],[175,148],[201,149],[62,150],[131,151],[63,82],[64,152],[132,153],[96,154],[95,3],[133,155],[66,156],[65,3],[129,157],[134,158],[108,159],[138,160],[107,161],[92,162],[109,163],[97,164],[110,165],[127,166],[90,3],[139,167],[111,168],[106,122],[140,169],[117,170],[115,171],[116,172],[141,173],[125,174],[124,175],[128,150],[113,176],[114,177],[130,3],[156,178],[150,179],[154,180],[155,3],[157,3],[158,3],[149,3],[159,180],[160,3],[161,181],[162,180],[163,180],[164,182],[165,183],[166,184],[167,185],[168,186],[169,187],[170,188],[151,189],[152,190],[153,191],[61,3],[126,3]],"exportedModulesMap":[[120,1],[135,2],[122,2],[118,3],[136,3],[119,3],[121,2],[137,4],[123,5],[112,3],[261,6],[143,7],[147,7],[145,7],[142,3],[263,8],[264,9],[259,3],[265,3],[266,3],[267,3],[268,10],[269,3],[283,11],[284,11],[271,12],[272,13],[270,14],[273,15],[274,16],[275,17],[276,18],[277,19],[278,20],[279,21],[280,22],[281,23],[282,24],[305,25],[290,26],[296,27],[294,3],[293,28],[295,29],[304,30],[299,31],[301,32],[302,33],[303,34],[297,3],[298,34],[300,34],[292,34],[291,3],[307,35],[286,3],[285,3],[288,26],[289,36],[287,26],[308,3],[309,3],[310,3],[262,3],[311,37],[171,38],[172,38],[207,39],[208,40],[209,41],[210,42],[211,43],[212,44],[213,45],[214,46],[215,47],[216,48],[217,48],[219,49],[218,50],[220,51],[221,52],[222,53],[206,54],[256,3],[223,55],[224,56],[225,57],[257,58],[226,59],[227,60],[228,61],[229,62],[230,63],[231,64],[232,65],[233,66],[234,67],[235,68],[236,68],[237,69],[238,70],[240,71],[239,72],[241,73],[242,74],[243,75],[244,76],[245,77],[246,78],[247,79],[248,80],[249,81],[250,82],[251,83],[252,84],[253,85],[254,86],[255,87],[312,3],[313,3],[260,88],[314,3],[339,89],[340,90],[315,91],[318,91],[337,89],[338,89],[328,89],[327,92],[325,89],[320,89],[333,89],[331,89],[335,89],[319,89],[332,89],[336,89],[321,89],[322,89],[334,89],[316,89],[323,89],[324,89],[326,89],[330,89],[341,93],[329,89],[317,89],[354,94],[353,3],[348,93],[350,95],[349,93],[342,93],[343,93],[345,93],[347,93],[351,95],[352,95],[344,95],[346,95],[357,96],[356,97],[355,3],[358,3],[359,3],[306,3],[360,3],[361,98],[362,9],[363,3],[364,99],[365,100],[148,101],[173,3],[146,7],[144,102],[258,49],[81,103],[85,104],[93,104],[67,3],[82,105],[71,106],[77,3],[70,107],[72,108],[80,109],[79,109],[74,110],[75,111],[86,112],[68,3],[87,113],[78,114],[73,115],[69,116],[76,3],[98,117],[101,118],[102,119],[99,120],[100,118],[105,121],[103,122],[104,117],[59,3],[60,3],[10,3],[11,3],[14,3],[13,3],[2,3],[15,3],[16,3],[17,3],[18,3],[19,3],[20,3],[21,3],[22,3],[3,3],[4,3],[23,3],[27,3],[24,3],[25,3],[26,3],[28,3],[29,3],[30,3],[5,3],[31,3],[32,3],[33,3],[34,3],[6,3],[38,3],[35,3],[36,3],[37,3],[39,3],[7,3],[40,3],[45,3],[46,3],[41,3],[42,3],[43,3],[44,3],[8,3],[50,3],[47,3],[48,3],[49,3],[51,3],[9,3],[52,3],[53,3],[54,3],[57,3],[55,3],[56,3],[1,3],[58,3],[12,3],[91,3],[94,3],[88,3],[84,123],[89,123],[83,124],[189,125],[196,126],[188,125],[203,127],[180,128],[179,129],[202,9],[197,130],[200,131],[182,132],[181,133],[177,134],[176,135],[199,136],[178,137],[183,138],[184,3],[187,138],[174,3],[205,139],[204,138],[191,140],[192,141],[194,142],[190,143],[193,144],[198,9],[185,145],[186,146],[195,147],[175,148],[201,149],[63,192],[132,193],[96,193],[129,194],[134,195],[108,195],[138,196],[107,197],[92,196],[109,198],[97,199],[127,200],[111,195],[106,201],[140,202],[117,197],[116,202],[141,203],[125,197],[124,203],[161,195],[61,3],[126,3]],"semanticDiagnosticsPerFile":[120,135,122,118,136,119,121,137,123,112,261,143,147,145,142,263,264,259,265,266,267,268,269,283,284,271,272,270,273,274,275,276,277,278,279,280,281,282,305,290,296,294,293,295,304,299,301,302,303,297,298,300,292,291,307,286,285,288,289,287,308,309,310,262,311,171,172,207,208,209,210,211,212,213,214,215,216,217,219,218,220,221,222,206,256,223,224,225,257,226,227,228,229,230,231,232,233,234,235,236,237,238,240,239,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,312,313,260,314,339,340,315,318,337,338,328,327,325,320,333,331,335,319,332,336,321,322,334,316,323,324,326,330,341,329,317,354,353,348,350,349,342,343,345,347,351,352,344,346,357,356,355,358,359,306,360,361,362,363,364,365,148,173,146,144,258,81,85,93,67,82,71,77,70,72,80,79,74,75,86,68,87,78,73,69,76,98,101,102,99,100,105,103,104,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,91,94,88,84,89,83,189,196,188,203,180,179,202,197,200,182,181,177,176,199,178,183,184,187,174,205,204,191,192,194,190,193,198,185,186,195,175,201,62,131,63,64,132,96,95,133,66,65,129,134,108,138,107,92,109,97,110,127,90,139,111,106,140,117,115,116,141,125,124,128,113,114,130,156,150,154,155,157,158,149,159,160,161,162,163,164,165,166,167,168,169,170,151,152,153,61,126],"latestChangedDtsFile":"./src/keys/secp256k1-browser.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/package.json new file mode 100644 index 000000000..086b8f649 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/package.json @@ -0,0 +1,107 @@ +{ + "name": "@libp2p/crypto", + "version": "2.0.8", + "description": "Crypto primitives for libp2p", + "license": "Apache-2.0 OR MIT", + "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/crypto#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/libp2p/js-libp2p.git" + }, + "bugs": { + "url": "https://github.com/libp2p/js-libp2p/issues" + }, + "keywords": [ + "IPFS", + "crypto", + "libp2p", + "rsa", + "secp256k1" + ], + "type": "module", + "types": "./dist/src/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ], + "src/*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ] + } + }, + "files": [ + "src", + "dist", + "!dist/test", + "!**/*.tsbuildinfo" + ], + "exports": { + ".": { + "types": "./src/index.d.ts", + "import": "./dist/src/index.js" + }, + "./aes": { + "types": "./dist/src/aes/index.d.ts", + "import": "./dist/src/aes/index.js" + }, + "./hmac": { + "types": "./dist/src/hmac/index.d.ts", + "import": "./dist/src/hmac/index.js" + }, + "./keys": { + "types": "./dist/src/keys/index.d.ts", + "import": "./dist/src/keys/index.js" + } + }, + "eslintConfig": { + "extends": "ipfs", + "parserOptions": { + "project": true, + "sourceType": "module" + }, + "ignorePatterns": [ + "src/*.d.ts" + ] + }, + "scripts": { + "clean": "aegir clean", + "lint": "aegir lint", + "dep-check": "aegir dep-check", + "build": "aegir build", + "test": "aegir test", + "test:chrome": "aegir test -t browser", + "test:chrome-webworker": "aegir test -t webworker", + "test:firefox": "aegir test -t browser -- --browser firefox", + "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", + "test:webkit": "aegir test -t browser -- --browser webkit", + "test:node": "aegir test -t node --cov", + "test:electron-main": "aegir test -t electron-main", + "generate": "protons ./src/keys/keys.proto" + }, + "dependencies": { + "@libp2p/interface": "file:../interface", + "@noble/curves": "^1.1.0", + "@noble/hashes": "^1.3.1", + "multiformats": "^12.1.3", + "node-forge": "^1.1.0", + "protons-runtime": "^5.0.0", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^4.0.6" + }, + "browser": { + "./dist/src/aes/ciphers.js": "./dist/src/aes/ciphers-browser.js", + "./dist/src/ciphers/aes-gcm.js": "./dist/src/ciphers/aes-gcm.browser.js", + "./dist/src/hmac/index.js": "./dist/src/hmac/index-browser.js", + "./dist/src/keys/ecdh.js": "./dist/src/keys/ecdh-browser.js", + "./dist/src/keys/ed25519.js": "./dist/src/keys/ed25519-browser.js", + "./dist/src/keys/rsa.js": "./dist/src/keys/rsa-browser.js", + "./dist/src/keys/secp256k1.js": "./dist/src/keys/secp256k1-browser.js" + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/cipher-mode.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/cipher-mode.ts new file mode 100644 index 000000000..95eefd8cf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/cipher-mode.ts @@ -0,0 +1,15 @@ +import { CodeError } from '@libp2p/interface/errors' + +const CIPHER_MODES = { + 16: 'aes-128-ctr', + 32: 'aes-256-ctr' +} + +export function cipherMode (key: Uint8Array): string { + if (key.length === 16 || key.length === 32) { + return CIPHER_MODES[key.length] + } + + const modes = Object.entries(CIPHER_MODES).map(([k, v]) => `${k} (${v})`).join(' / ') + throw new CodeError(`Invalid key length ${key.length} bytes. Must be ${modes}`, 'ERR_INVALID_KEY_LENGTH') +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers-browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers-browser.ts new file mode 100644 index 000000000..da94b5085 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers-browser.ts @@ -0,0 +1,31 @@ +import 'node-forge/lib/aes.js' +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' + +export interface Cipher { + update(data: Uint8Array): Uint8Array +} + +export function createCipheriv (mode: any, key: Uint8Array, iv: Uint8Array): Cipher { + const cipher2 = forge.cipher.createCipher('AES-CTR', uint8ArrayToString(key, 'ascii')) + cipher2.start({ iv: uint8ArrayToString(iv, 'ascii') }) + return { + update: (data: Uint8Array) => { + cipher2.update(forge.util.createBuffer(uint8ArrayToString(data, 'ascii'))) + return uint8ArrayFromString(cipher2.output.getBytes(), 'ascii') + } + } +} + +export function createDecipheriv (mode: any, key: Uint8Array, iv: Uint8Array): Cipher { + const cipher2 = forge.cipher.createDecipher('AES-CTR', uint8ArrayToString(key, 'ascii')) + cipher2.start({ iv: uint8ArrayToString(iv, 'ascii') }) + return { + update: (data: Uint8Array) => { + cipher2.update(forge.util.createBuffer(uint8ArrayToString(data, 'ascii'))) + return uint8ArrayFromString(cipher2.output.getBytes(), 'ascii') + } + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers.ts new file mode 100644 index 000000000..c1a2cd74a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/ciphers.ts @@ -0,0 +1,4 @@ +import crypto from 'crypto' + +export const createCipheriv = crypto.createCipheriv +export const createDecipheriv = crypto.createDecipheriv diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/index.ts new file mode 100644 index 000000000..6a453cf07 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/aes/index.ts @@ -0,0 +1,70 @@ +/** + * @packageDocumentation + * + * Exposes an interface to AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197. + * + * This uses `CTR` mode. + * + * /** + * @example + * + * ```js + * import { create } from '@libp2p/crypto/aes' + * + * // Setting up Key and IV + * + * // A 16 bytes array, 128 Bits, AES-128 is chosen + * const key128 = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + * + * // A 16 bytes array, 128 Bits, + * const IV = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + * + * const decryptedMessage = 'Hello, world!' + * + * // Encrypting + * const cipher = await crypto.aes.create(key128, IV) + * const encryptedBuffer = await encrypt(Uint8Array.from(decryptedMessage)) + * console.log(encryptedBuffer) + * // prints: + * + * // Decrypting + * const decipher = await crypto.aes.create(key128, IV) + * const decryptedBuffer = await decrypt(encryptedBuffer) + * + * console.log(decryptedBuffer) + * // prints: + * + * console.log(decryptedBuffer.toString('utf-8')) + * // prints: Hello, world! + * ``` + */ + +import { cipherMode } from './cipher-mode.js' +import * as ciphers from './ciphers.js' + +export interface AESCipher { + encrypt(data: Uint8Array): Promise + decrypt(data: Uint8Array): Promise +} + +/** + * @param key - The key, if length `16` then `AES 128` is used. For length `32`, `AES 256` is used + * @param iv - Must have length `16` + */ +export async function create (key: Uint8Array, iv: Uint8Array): Promise { + const mode = cipherMode(key) + const cipher = ciphers.createCipheriv(mode, key, iv) + const decipher = ciphers.createDecipheriv(mode, key, iv) + + const res: AESCipher = { + async encrypt (data) { + return cipher.update(data) + }, + + async decrypt (data) { + return decipher.update(data) + } + } + + return res +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.browser.ts new file mode 100644 index 000000000..05a4fd463 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.browser.ts @@ -0,0 +1,109 @@ +import { concat } from 'uint8arrays/concat' +import { fromString } from 'uint8arrays/from-string' +import webcrypto from '../webcrypto.js' +import type { CreateOptions, AESCipher } from './interface.js' + +// WebKit on Linux does not support deriving a key from an empty PBKDF2 key. +// So, as a workaround, we provide the generated key as a constant. We test that +// this generated key is accurate in test/workaround.spec.ts +// Generated via: +// await crypto.subtle.exportKey('jwk', +// await crypto.subtle.deriveKey( +// { name: 'PBKDF2', salt: new Uint8Array(16), iterations: 32767, hash: { name: 'SHA-256' } }, +// await crypto.subtle.importKey('raw', new Uint8Array(0), { name: 'PBKDF2' }, false, ['deriveKey']), +// { name: 'AES-GCM', length: 128 }, true, ['encrypt', 'decrypt']) +// ) +export const derivedEmptyPasswordKey = { alg: 'A128GCM', ext: true, k: 'scm9jmO_4BJAgdwWGVulLg', key_ops: ['encrypt', 'decrypt'], kty: 'oct' } + +// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples + +export function create (opts?: CreateOptions): AESCipher { + const algorithm = opts?.algorithm ?? 'AES-GCM' + let keyLength = opts?.keyLength ?? 16 + const nonceLength = opts?.nonceLength ?? 12 + const digest = opts?.digest ?? 'SHA-256' + const saltLength = opts?.saltLength ?? 16 + const iterations = opts?.iterations ?? 32767 + + const crypto = webcrypto.get() + keyLength *= 8 // Browser crypto uses bits instead of bytes + + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to encrypt the data. + */ + async function encrypt (data: Uint8Array, password: string | Uint8Array): Promise { + const salt = crypto.getRandomValues(new Uint8Array(saltLength)) + const nonce = crypto.getRandomValues(new Uint8Array(nonceLength)) + const aesGcm = { name: algorithm, iv: nonce } + + if (typeof password === 'string') { + password = fromString(password) + } + + let cryptoKey: CryptoKey + if (password.length === 0) { + cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['encrypt']) + try { + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } } + const runtimeDerivedEmptyPassword = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']) + cryptoKey = await crypto.subtle.deriveKey(deriveParams, runtimeDerivedEmptyPassword, { name: algorithm, length: keyLength }, true, ['encrypt']) + } catch { + cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['encrypt']) + } + } else { + // Derive a key using PBKDF2. + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } } + const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']) + cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['encrypt']) + } + + // Encrypt the string. + const ciphertext = await crypto.subtle.encrypt(aesGcm, cryptoKey, data) + return concat([salt, aesGcm.iv, new Uint8Array(ciphertext)]) + } + + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to decrypt the data. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. + */ + async function decrypt (data: Uint8Array, password: string | Uint8Array): Promise { + const salt = data.subarray(0, saltLength) + const nonce = data.subarray(saltLength, saltLength + nonceLength) + const ciphertext = data.subarray(saltLength + nonceLength) + const aesGcm = { name: algorithm, iv: nonce } + + if (typeof password === 'string') { + password = fromString(password) + } + + let cryptoKey: CryptoKey + if (password.length === 0) { + try { + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } } + const runtimeDerivedEmptyPassword = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']) + cryptoKey = await crypto.subtle.deriveKey(deriveParams, runtimeDerivedEmptyPassword, { name: algorithm, length: keyLength }, true, ['decrypt']) + } catch { + cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['decrypt']) + } + } else { + // Derive the key using PBKDF2. + const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } } + const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']) + cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['decrypt']) + } + + // Decrypt the string. + const plaintext = await crypto.subtle.decrypt(aesGcm, cryptoKey, ciphertext) + return new Uint8Array(plaintext) + } + + const cipher: AESCipher = { + encrypt, + decrypt + } + + return cipher +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.ts new file mode 100644 index 000000000..cab47acfa --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/aes-gcm.ts @@ -0,0 +1,102 @@ +import crypto from 'crypto' +import { concat as uint8ArrayConcat } from 'uint8arrays/concat' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import type { CreateOptions, AESCipher } from './interface.js' + +// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples + +export function create (opts?: CreateOptions): AESCipher { + const algorithm = opts?.algorithm ?? 'aes-128-gcm' + const keyLength = opts?.keyLength ?? 16 + const nonceLength = opts?.nonceLength ?? 12 + const digest = opts?.digest ?? 'sha256' + const saltLength = opts?.saltLength ?? 16 + const iterations = opts?.iterations ?? 32767 + const algorithmTagLength = opts?.algorithmTagLength ?? 16 + + async function encryptWithKey (data: Uint8Array, key: Uint8Array): Promise { + const nonce = crypto.randomBytes(nonceLength) + + // Create the cipher instance. + const cipher = crypto.createCipheriv(algorithm, key, nonce) + + // Encrypt and prepend nonce. + const ciphertext = uint8ArrayConcat([cipher.update(data), cipher.final()]) + + // @ts-expect-error getAuthTag is not a function + return uint8ArrayConcat([nonce, ciphertext, cipher.getAuthTag()]) + } + + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to encrypt the data. + */ + async function encrypt (data: Uint8Array, password: string | Uint8Array): Promise { + // Generate a 128-bit salt using a CSPRNG. + const salt = crypto.randomBytes(saltLength) + + if (typeof password === 'string') { + password = uint8ArrayFromString(password) + } + + // Derive a key using PBKDF2. + const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest) + + // Encrypt and prepend salt. + return uint8ArrayConcat([salt, await encryptWithKey(Uint8Array.from(data), key)]) + } + + /** + * Decrypts the given cipher text with the provided key. The `key` should + * be a cryptographically safe key and not a plaintext password. To use + * a plaintext password, use `decrypt`. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. + */ + async function decryptWithKey (ciphertextAndNonce: Uint8Array, key: Uint8Array): Promise { + // Create Uint8Arrays of nonce, ciphertext and tag. + const nonce = ciphertextAndNonce.subarray(0, nonceLength) + const ciphertext = ciphertextAndNonce.subarray(nonceLength, ciphertextAndNonce.length - algorithmTagLength) + const tag = ciphertextAndNonce.subarray(ciphertext.length + nonceLength) + + // Create the cipher instance. + const cipher = crypto.createDecipheriv(algorithm, key, nonce) + + // Decrypt and return result. + // @ts-expect-error getAuthTag is not a function + cipher.setAuthTag(tag) + return uint8ArrayConcat([cipher.update(ciphertext), cipher.final()]) + } + + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to decrypt the data. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. + * + * @param {Uint8Array} data - The data to decrypt + * @param {string|Uint8Array} password - A plain password + */ + async function decrypt (data: Uint8Array, password: string | Uint8Array): Promise { + // Create Uint8Arrays of salt and ciphertextAndNonce. + const salt = data.subarray(0, saltLength) + const ciphertextAndNonce = data.subarray(saltLength) + + if (typeof password === 'string') { + password = uint8ArrayFromString(password) + } + + // Derive the key using PBKDF2. + const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest) + + // Decrypt and return result. + return decryptWithKey(ciphertextAndNonce, key) + } + + const cipher: AESCipher = { + encrypt, + decrypt + } + + return cipher +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/interface.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/interface.ts new file mode 100644 index 000000000..9f30045bf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/ciphers/interface.ts @@ -0,0 +1,14 @@ +export interface CreateOptions { + algorithm?: string + nonceLength?: number + keyLength?: number + digest?: string + saltLength?: number + iterations?: number + algorithmTagLength?: number +} + +export interface AESCipher { + encrypt(data: Uint8Array, password: string | Uint8Array): Promise + decrypt(data: Uint8Array, password: string | Uint8Array): Promise +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index-browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index-browser.ts new file mode 100644 index 000000000..69d7947d9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index-browser.ts @@ -0,0 +1,35 @@ +import webcrypto from '../webcrypto.js' +import lengths from './lengths.js' + +const hashTypes = { + SHA1: 'SHA-1', + SHA256: 'SHA-256', + SHA512: 'SHA-512' +} + +const sign = async (key: CryptoKey, data: Uint8Array): Promise => { + const buf = await webcrypto.get().subtle.sign({ name: 'HMAC' }, key, data) + return new Uint8Array(buf, 0, buf.byteLength) +} + +export async function create (hashType: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise<{ digest(data: Uint8Array): Promise, length: number }> { + const hash = hashTypes[hashType] + + const key = await webcrypto.get().subtle.importKey( + 'raw', + secret, + { + name: 'HMAC', + hash: { name: hash } + }, + false, + ['sign'] + ) + + return { + async digest (data: Uint8Array) { + return sign(key, data) + }, + length: lengths[hashType] + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index.ts new file mode 100644 index 000000000..f61e3c28f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/index.ts @@ -0,0 +1,37 @@ +/** + * @packageDocumentation + * + * Exposes an interface to the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198. An HMAC is a cryptographic hash that uses a key to sign a message. The receiver verifies the hash by recomputing it using the same key. + * + * @example + * + * ```js + * import { create } from '@libp2p/hmac' + * + * const hash = 'SHA1' // 'SHA256' || 'SHA512' + * const hmac = await crypto.hmac.create(hash, uint8ArrayFromString('secret')) + * const sig = await hmac.digest(uint8ArrayFromString('hello world')) + * console.log(sig) + * ``` + */ + +import crypto from 'crypto' +import lengths from './lengths.js' + +export interface HMAC { + digest(data: Uint8Array): Promise + length: number +} + +export async function create (hash: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise { + const res = { + async digest (data: Uint8Array) { + const hmac = crypto.createHmac(hash.toLowerCase(), secret) + hmac.update(data) + return hmac.digest() + }, + length: lengths[hash] + } + + return res +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/lengths.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/lengths.ts new file mode 100644 index 000000000..925cc690f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/hmac/lengths.ts @@ -0,0 +1,5 @@ +export default { + SHA1: 20, + SHA256: 32, + SHA512: 64 +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/index.ts new file mode 100644 index 000000000..6396d1dbd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/index.ts @@ -0,0 +1,21 @@ +/** + * @packageDocumentation + * + * The `libp2p-crypto` library depends on the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) in the browser. Web Crypto is available in all modern browsers, however browsers restrict its usage to [Secure Contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). + * + * *This means you will not be able to use some `@libp2p/crypto` functions in the browser when the page is served over HTTP.* + * + * To enable the Web Crypto API and allow `@libp2p/crypto` to work fully, please serve your page over HTTPS. + */ + +import * as aes from './aes/index.js' +import * as hmac from './hmac/index.js' +import * as keys from './keys/index.js' +import pbkdf2 from './pbkdf2.js' +import randomBytes from './random-bytes.js' + +export { aes } +export { hmac } +export { keys } +export { randomBytes } +export { pbkdf2 } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh-browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh-browser.ts new file mode 100644 index 000000000..e5c8c72ed --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh-browser.ts @@ -0,0 +1,137 @@ +import { CodeError } from '@libp2p/interface/errors' +import { concat as uint8ArrayConcat } from 'uint8arrays/concat' +import { equals as uint8ArrayEquals } from 'uint8arrays/equals' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { base64urlToBuffer } from '../util.js' +import webcrypto from '../webcrypto.js' +import type { ECDHKey, ECDHKeyPair, JWKEncodedPrivateKey, JWKEncodedPublicKey } from './interface.js' + +const bits = { + 'P-256': 256, + 'P-384': 384, + 'P-521': 521 +} + +const curveTypes = Object.keys(bits) +const names = curveTypes.join(' / ') + +export async function generateEphmeralKeyPair (curve: string): Promise { + if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') { + throw new CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE') + } + + const pair = await webcrypto.get().subtle.generateKey( + { + name: 'ECDH', + namedCurve: curve + }, + true, + ['deriveBits'] + ) + + // forcePrivate is used for testing only + const genSharedKey = async (theirPub: Uint8Array, forcePrivate?: ECDHKeyPair): Promise => { + let privateKey + + if (forcePrivate != null) { + privateKey = await webcrypto.get().subtle.importKey( + 'jwk', + unmarshalPrivateKey(curve, forcePrivate), + { + name: 'ECDH', + namedCurve: curve + }, + false, + ['deriveBits'] + ) + } else { + privateKey = pair.privateKey + } + + const key = await webcrypto.get().subtle.importKey( + 'jwk', + unmarshalPublicKey(curve, theirPub), + { + name: 'ECDH', + namedCurve: curve + }, + false, + [] + ) + + const buffer = await webcrypto.get().subtle.deriveBits( + { + name: 'ECDH', + // @ts-expect-error namedCurve is missing from the types + namedCurve: curve, + public: key + }, + privateKey, + bits[curve] + ) + + return new Uint8Array(buffer, 0, buffer.byteLength) + } + + const publicKey = await webcrypto.get().subtle.exportKey('jwk', pair.publicKey) + + const ecdhKey: ECDHKey = { + key: marshalPublicKey(publicKey), + genSharedKey + } + + return ecdhKey +} + +const curveLengths = { + 'P-256': 32, + 'P-384': 48, + 'P-521': 66 +} + +// Marshal converts a jwk encoded ECDH public key into the +// form specified in section 4.3.6 of ANSI X9.62. (This is the format +// go-ipfs uses) +function marshalPublicKey (jwk: JsonWebKey): Uint8Array { + if (jwk.crv == null || jwk.x == null || jwk.y == null) { + throw new CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS') + } + + if (jwk.crv !== 'P-256' && jwk.crv !== 'P-384' && jwk.crv !== 'P-521') { + throw new CodeError(`Unknown curve: ${jwk.crv}. Must be ${names}`, 'ERR_INVALID_CURVE') + } + + const byteLen = curveLengths[jwk.crv] + + return uint8ArrayConcat([ + Uint8Array.from([4]), // uncompressed point + base64urlToBuffer(jwk.x, byteLen), + base64urlToBuffer(jwk.y, byteLen) + ], 1 + byteLen * 2) +} + +// Unmarshal converts a point, serialized by Marshal, into an jwk encoded key +function unmarshalPublicKey (curve: string, key: Uint8Array): JWKEncodedPublicKey { + if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') { + throw new CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE') + } + + const byteLen = curveLengths[curve] + + if (!uint8ArrayEquals(key.subarray(0, 1), Uint8Array.from([4]))) { + throw new CodeError('Cannot unmarshal public key - invalid key format', 'ERR_INVALID_KEY_FORMAT') + } + + return { + kty: 'EC', + crv: curve, + x: uint8ArrayToString(key.subarray(1, byteLen + 1), 'base64url'), + y: uint8ArrayToString(key.subarray(1 + byteLen), 'base64url'), + ext: true + } +} + +const unmarshalPrivateKey = (curve: string, key: ECDHKeyPair): JWKEncodedPrivateKey => ({ + ...unmarshalPublicKey(curve, key.public), + d: uint8ArrayToString(key.private, 'base64url') +}) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh.ts new file mode 100644 index 000000000..992ee4777 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ecdh.ts @@ -0,0 +1,38 @@ +import crypto from 'crypto' +import { CodeError } from '@libp2p/interface/errors' +import type { ECDHKey, ECDHKeyPair } from './interface.js' + +const curves = { + 'P-256': 'prime256v1', + 'P-384': 'secp384r1', + 'P-521': 'secp521r1' +} + +const curveTypes = Object.keys(curves) +const names = curveTypes.join(' / ') + +/** + * Generates an ephemeral public key and returns a function that will compute the shared secret key. + * + * Focuses only on ECDH now, but can be made more general in the future. + */ +export async function generateEphmeralKeyPair (curve: string): Promise { + if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') { + throw new CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE') + } + + const ecdh = crypto.createECDH(curves[curve]) + ecdh.generateKeys() + + return { + key: ecdh.getPublicKey() as Uint8Array, + + async genSharedKey (theirPub: Uint8Array, forcePrivate?: ECDHKeyPair): Promise { + if (forcePrivate != null) { + ecdh.setPrivateKey(forcePrivate.private) + } + + return ecdh.computeSecret(theirPub) + } + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-browser.ts new file mode 100644 index 000000000..a58c3329f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-browser.ts @@ -0,0 +1,65 @@ +import { ed25519 as ed } from '@noble/curves/ed25519' +import type { Uint8ArrayKeyPair } from './interface' +import type { Uint8ArrayList } from 'uint8arraylist' + +const PUBLIC_KEY_BYTE_LENGTH = 32 +const PRIVATE_KEY_BYTE_LENGTH = 64 // private key is actually 32 bytes but for historical reasons we concat private and public keys +const KEYS_BYTE_LENGTH = 32 + +export { PUBLIC_KEY_BYTE_LENGTH as publicKeyLength } +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength } + +export async function generateKey (): Promise { + // the actual private key (32 bytes) + const privateKeyRaw = ed.utils.randomPrivateKey() + const publicKey = ed.getPublicKey(privateKeyRaw) + + // concatenated the public key to the private key + const privateKey = concatKeys(privateKeyRaw, publicKey) + + return { + privateKey, + publicKey + } +} + +/** + * Generate keypair from a 32 byte uint8array + */ +export async function generateKeyFromSeed (seed: Uint8Array): Promise { + if (seed.length !== KEYS_BYTE_LENGTH) { + throw new TypeError('"seed" must be 32 bytes in length.') + } else if (!(seed instanceof Uint8Array)) { + throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.') + } + + // based on node forges algorithm, the seed is used directly as private key + const privateKeyRaw = seed + const publicKey = ed.getPublicKey(privateKeyRaw) + + const privateKey = concatKeys(privateKeyRaw, publicKey) + + return { + privateKey, + publicKey + } +} + +export async function hashAndSign (privateKey: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + const privateKeyRaw = privateKey.subarray(0, KEYS_BYTE_LENGTH) + + return ed.sign(msg instanceof Uint8Array ? msg : msg.subarray(), privateKeyRaw) +} + +export async function hashAndVerify (publicKey: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + return ed.verify(sig, msg instanceof Uint8Array ? msg : msg.subarray(), publicKey) +} + +function concatKeys (privateKeyRaw: Uint8Array, publicKey: Uint8Array): Uint8Array { + const privateKey = new Uint8Array(PRIVATE_KEY_BYTE_LENGTH) + for (let i = 0; i < KEYS_BYTE_LENGTH; i++) { + privateKey[i] = privateKeyRaw[i] + privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i] + } + return privateKey +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-class.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-class.ts new file mode 100644 index 000000000..5533818b0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519-class.ts @@ -0,0 +1,147 @@ +import { CodeError } from '@libp2p/interface/errors' +import { base58btc } from 'multiformats/bases/base58' +import { identity } from 'multiformats/hashes/identity' +import { sha256 } from 'multiformats/hashes/sha2' +import { equals as uint8ArrayEquals } from 'uint8arrays/equals' +import * as crypto from './ed25519.js' +import { exporter } from './exporter.js' +import * as pbm from './keys.js' +import type { Multibase } from 'multiformats' +import type { Uint8ArrayList } from 'uint8arraylist' + +export class Ed25519PublicKey { + private readonly _key: Uint8Array + + constructor (key: Uint8Array) { + this._key = ensureKey(key, crypto.publicKeyLength) + } + + async verify (data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise { + return crypto.hashAndVerify(this._key, sig, data) + } + + marshal (): Uint8Array { + return this._key + } + + get bytes (): Uint8Array { + return pbm.PublicKey.encode({ + Type: pbm.KeyType.Ed25519, + Data: this.marshal() + }).subarray() + } + + equals (key: any): boolean { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash (): Promise { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } +} + +export class Ed25519PrivateKey { + private readonly _key: Uint8Array + private readonly _publicKey: Uint8Array + + // key - 64 byte Uint8Array containing private key + // publicKey - 32 byte Uint8Array containing public key + constructor (key: Uint8Array, publicKey: Uint8Array) { + this._key = ensureKey(key, crypto.privateKeyLength) + this._publicKey = ensureKey(publicKey, crypto.publicKeyLength) + } + + async sign (message: Uint8Array | Uint8ArrayList): Promise { + return crypto.hashAndSign(this._key, message) + } + + get public (): Ed25519PublicKey { + return new Ed25519PublicKey(this._publicKey) + } + + marshal (): Uint8Array { + return this._key + } + + get bytes (): Uint8Array { + return pbm.PrivateKey.encode({ + Type: pbm.KeyType.Ed25519, + Data: this.marshal() + }).subarray() + } + + equals (key: any): boolean { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash (): Promise { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } + + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the identity multihash containing its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + * + * @returns {Promise} + */ + async id (): Promise { + const encoding = identity.digest(this.public.bytes) + return base58btc.encode(encoding.bytes).substring(1) + } + + /** + * Exports the key into a password protected `format` + */ + async export (password: string, format = 'libp2p-key'): Promise> { + if (format === 'libp2p-key') { + return exporter(this.bytes, password) + } else { + throw new CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT') + } + } +} + +export function unmarshalEd25519PrivateKey (bytes: Uint8Array): Ed25519PrivateKey { + // Try the old, redundant public key version + if (bytes.length > crypto.privateKeyLength) { + bytes = ensureKey(bytes, crypto.privateKeyLength + crypto.publicKeyLength) + const privateKeyBytes = bytes.subarray(0, crypto.privateKeyLength) + const publicKeyBytes = bytes.subarray(crypto.privateKeyLength, bytes.length) + return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes) + } + + bytes = ensureKey(bytes, crypto.privateKeyLength) + const privateKeyBytes = bytes.subarray(0, crypto.privateKeyLength) + const publicKeyBytes = bytes.subarray(crypto.publicKeyLength) + return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes) +} + +export function unmarshalEd25519PublicKey (bytes: Uint8Array): Ed25519PublicKey { + bytes = ensureKey(bytes, crypto.publicKeyLength) + return new Ed25519PublicKey(bytes) +} + +export async function generateKeyPair (): Promise { + const { privateKey, publicKey } = await crypto.generateKey() + return new Ed25519PrivateKey(privateKey, publicKey) +} + +export async function generateKeyPairFromSeed (seed: Uint8Array): Promise { + const { privateKey, publicKey } = await crypto.generateKeyFromSeed(seed) + return new Ed25519PrivateKey(privateKey, publicKey) +} + +function ensureKey (key: Uint8Array, length: number): Uint8Array { + key = Uint8Array.from(key ?? []) + if (key.length !== length) { + throw new CodeError(`Key must be a Uint8Array of length ${length}, got ${key.length}`, 'ERR_INVALID_KEY_TYPE') + } + return key +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519.ts new file mode 100644 index 000000000..6d8fe8090 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ed25519.ts @@ -0,0 +1,138 @@ +import crypto from 'crypto' +import { promisify } from 'util' +import { fromString as uint8arrayFromString } from 'uint8arrays/from-string' +import { toString as uint8arrayToString } from 'uint8arrays/to-string' +import type { Uint8ArrayKeyPair } from './interface.js' +import type { Uint8ArrayList } from 'uint8arraylist' + +const keypair = promisify(crypto.generateKeyPair) + +const PUBLIC_KEY_BYTE_LENGTH = 32 +const PRIVATE_KEY_BYTE_LENGTH = 64 // private key is actually 32 bytes but for historical reasons we concat private and public keys +const KEYS_BYTE_LENGTH = 32 +const SIGNATURE_BYTE_LENGTH = 64 + +export { PUBLIC_KEY_BYTE_LENGTH as publicKeyLength } +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength } + +function derivePublicKey (privateKey: Uint8Array): Uint8Array { + const keyObject = crypto.createPrivateKey({ + format: 'jwk', + key: { + crv: 'Ed25519', + x: '', + d: uint8arrayToString(privateKey, 'base64url'), + kty: 'OKP' + } + }) + const jwk = keyObject.export({ + format: 'jwk' + }) + + if (jwk.x == null || jwk.x === '') { + throw new Error('Could not export JWK public key') + } + + return uint8arrayFromString(jwk.x, 'base64url') +} + +export async function generateKey (): Promise { + const key = await keypair('ed25519', { + publicKeyEncoding: { type: 'spki', format: 'jwk' }, + privateKeyEncoding: { type: 'pkcs8', format: 'jwk' } + }) + + // @ts-expect-error node types are missing jwk as a format + const privateKeyRaw = uint8arrayFromString(key.privateKey.d, 'base64url') + // @ts-expect-error node types are missing jwk as a format + const publicKeyRaw = uint8arrayFromString(key.privateKey.x, 'base64url') + + return { + privateKey: concatKeys(privateKeyRaw, publicKeyRaw), + publicKey: publicKeyRaw + } +} + +/** + * Generate keypair from a 32 byte uint8array + */ +export async function generateKeyFromSeed (seed: Uint8Array): Promise { + if (seed.length !== KEYS_BYTE_LENGTH) { + throw new TypeError('"seed" must be 32 bytes in length.') + } else if (!(seed instanceof Uint8Array)) { + throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.') + } + + // based on node forges algorithm, the seed is used directly as private key + const publicKeyRaw = derivePublicKey(seed) + + return { + privateKey: concatKeys(seed, publicKeyRaw), + publicKey: publicKeyRaw + } +} + +export async function hashAndSign (key: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + if (!(key instanceof Uint8Array)) { + throw new TypeError('"key" must be a node.js Buffer, or Uint8Array.') + } + + let privateKey: Uint8Array + let publicKey: Uint8Array + + if (key.byteLength === PRIVATE_KEY_BYTE_LENGTH) { + privateKey = key.subarray(0, 32) + publicKey = key.subarray(32) + } else if (key.byteLength === KEYS_BYTE_LENGTH) { + privateKey = key.subarray(0, 32) + publicKey = derivePublicKey(privateKey) + } else { + throw new TypeError('"key" must be 64 or 32 bytes in length.') + } + + const obj = crypto.createPrivateKey({ + format: 'jwk', + key: { + crv: 'Ed25519', + d: uint8arrayToString(privateKey, 'base64url'), + x: uint8arrayToString(publicKey, 'base64url'), + kty: 'OKP' + } + }) + + return crypto.sign(null, msg instanceof Uint8Array ? msg : msg.subarray(), obj) +} + +export async function hashAndVerify (key: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + if (key.byteLength !== PUBLIC_KEY_BYTE_LENGTH) { + throw new TypeError('"key" must be 32 bytes in length.') + } else if (!(key instanceof Uint8Array)) { + throw new TypeError('"key" must be a node.js Buffer, or Uint8Array.') + } + + if (sig.byteLength !== SIGNATURE_BYTE_LENGTH) { + throw new TypeError('"sig" must be 64 bytes in length.') + } else if (!(sig instanceof Uint8Array)) { + throw new TypeError('"sig" must be a node.js Buffer, or Uint8Array.') + } + + const obj = crypto.createPublicKey({ + format: 'jwk', + key: { + crv: 'Ed25519', + x: uint8arrayToString(key, 'base64url'), + kty: 'OKP' + } + }) + + return crypto.verify(null, msg instanceof Uint8Array ? msg : msg.subarray(), obj, sig) +} + +function concatKeys (privateKeyRaw: Uint8Array, publicKey: Uint8Array): Uint8Array { + const privateKey = new Uint8Array(PRIVATE_KEY_BYTE_LENGTH) + for (let i = 0; i < KEYS_BYTE_LENGTH; i++) { + privateKey[i] = privateKeyRaw[i] + privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i] + } + return privateKey +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ephemeral-keys.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ephemeral-keys.ts new file mode 100644 index 000000000..f60cc0f1a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/ephemeral-keys.ts @@ -0,0 +1,9 @@ +import { generateEphmeralKeyPair } from './ecdh.js' + +/** + * Generates an ephemeral public key and returns a function that will compute + * the shared secret key. + * + * Focuses only on ECDH now, but can be made more general in the future. + */ +export default generateEphmeralKeyPair diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/exporter.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/exporter.ts new file mode 100644 index 000000000..db62943f3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/exporter.ts @@ -0,0 +1,14 @@ +import { base64 } from 'multiformats/bases/base64' +import * as ciphers from '../ciphers/aes-gcm.js' +import type { Multibase } from 'multiformats' + +/** + * Exports the given PrivateKey as a base64 encoded string. + * The PrivateKey is encrypted via a password derived PBKDF2 key + * leveraging the aes-gcm cipher algorithm. + */ +export async function exporter (privateKey: Uint8Array, password: string): Promise> { + const cipher = ciphers.create() + const encryptedKey = await cipher.encrypt(privateKey, password) + return base64.encode(encryptedKey) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/importer.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/importer.ts new file mode 100644 index 000000000..d26b0226c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/importer.ts @@ -0,0 +1,13 @@ +import { base64 } from 'multiformats/bases/base64' +import * as ciphers from '../ciphers/aes-gcm.js' + +/** + * Attempts to decrypt a base64 encoded PrivateKey string + * with the given password. The privateKey must have been exported + * using the same password and underlying cipher (aes-gcm) + */ +export async function importer (privateKey: string, password: string): Promise { + const encryptedKey = base64.decode(privateKey) + const cipher = ciphers.create() + return cipher.decrypt(encryptedKey, password) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/index.ts new file mode 100644 index 000000000..f805d81af --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/index.ts @@ -0,0 +1,155 @@ +/** + * @packageDocumentation + * + * **Supported Key Types** + * + * The {@link generateKeyPair}, {@link marshalPublicKey}, and {@link marshalPrivateKey} functions accept a string `type` argument. + * + * Currently the `'RSA'`, `'ed25519'`, and `secp256k1` types are supported, although ed25519 and secp256k1 keys support only signing and verification of messages. + * + * For encryption / decryption support, RSA keys should be used. + */ + +import 'node-forge/lib/asn1.js' +import 'node-forge/lib/pbe.js' +import { CodeError } from '@libp2p/interface/errors' +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import * as Ed25519 from './ed25519-class.js' +import generateEphemeralKeyPair from './ephemeral-keys.js' +import { importer } from './importer.js' +import { keyStretcher } from './key-stretcher.js' +import * as keysPBM from './keys.js' +import * as RSA from './rsa-class.js' +import * as Secp256k1 from './secp256k1-class.js' +import type { PrivateKey, PublicKey } from '@libp2p/interface/keys' + +export { keyStretcher } +export { generateEphemeralKeyPair } +export { keysPBM } + +export type KeyTypes = 'RSA' | 'Ed25519' | 'secp256k1' + +export const supportedKeys = { + rsa: RSA, + ed25519: Ed25519, + secp256k1: Secp256k1 +} + +function unsupportedKey (type: string): CodeError> { + const supported = Object.keys(supportedKeys).join(' / ') + return new CodeError(`invalid or unsupported key type ${type}. Must be ${supported}`, 'ERR_UNSUPPORTED_KEY_TYPE') +} + +function typeToKey (type: string): typeof RSA | typeof Ed25519 | typeof Secp256k1 { + type = type.toLowerCase() + + if (type === 'rsa' || type === 'ed25519' || type === 'secp256k1') { + return supportedKeys[type] + } + + throw unsupportedKey(type) +} + +/** + * Generates a keypair of the given type and bitsize + * + * @param type + * @param bits - Minimum of 1024 + */ +export async function generateKeyPair (type: KeyTypes, bits?: number): Promise { + return typeToKey(type).generateKeyPair(bits ?? 2048) +} + +/** + * Generates a keypair of the given type and bitsize. + * + * Seed is a 32 byte uint8array + */ +export async function generateKeyPairFromSeed (type: KeyTypes, seed: Uint8Array, bits?: number): Promise { + if (type.toLowerCase() !== 'ed25519') { + throw new CodeError('Seed key derivation is unimplemented for RSA or secp256k1', 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE') + } + + return Ed25519.generateKeyPairFromSeed(seed) +} + +/** + * Converts a protobuf serialized public key into its representative object + */ +export function unmarshalPublicKey (buf: Uint8Array): PublicKey { + const decoded = keysPBM.PublicKey.decode(buf) + const data = decoded.Data ?? new Uint8Array() + + switch (decoded.Type) { + case keysPBM.KeyType.RSA: + return supportedKeys.rsa.unmarshalRsaPublicKey(data) + case keysPBM.KeyType.Ed25519: + return supportedKeys.ed25519.unmarshalEd25519PublicKey(data) + case keysPBM.KeyType.Secp256k1: + return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data) + default: + throw unsupportedKey(decoded.Type ?? 'unknown') + } +} + +/** + * Converts a public key object into a protobuf serialized public key + */ +export function marshalPublicKey (key: { bytes: Uint8Array }, type?: string): Uint8Array { + type = (type ?? 'rsa').toLowerCase() + typeToKey(type) // check type + return key.bytes +} + +/** + * Converts a protobuf serialized private key into its representative object + */ +export async function unmarshalPrivateKey (buf: Uint8Array): Promise { + const decoded = keysPBM.PrivateKey.decode(buf) + const data = decoded.Data ?? new Uint8Array() + + switch (decoded.Type) { + case keysPBM.KeyType.RSA: + return supportedKeys.rsa.unmarshalRsaPrivateKey(data) + case keysPBM.KeyType.Ed25519: + return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data) + case keysPBM.KeyType.Secp256k1: + return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data) + default: + throw unsupportedKey(decoded.Type ?? 'RSA') + } +} + +/** + * Converts a private key object into a protobuf serialized private key + */ +export function marshalPrivateKey (key: { bytes: Uint8Array }, type?: string): Uint8Array { + type = (type ?? 'rsa').toLowerCase() + typeToKey(type) // check type + return key.bytes +} + +/** + * Converts an exported private key into its representative object. + * + * Supported formats are 'pem' (RSA only) and 'libp2p-key'. + */ +export async function importKey (encryptedKey: string, password: string): Promise { + try { + const key = await importer(encryptedKey, password) + return await unmarshalPrivateKey(key) + } catch (_) { + // Ignore and try the old pem decrypt + } + + // Only rsa supports pem right now + const key = forge.pki.decryptRsaPrivateKey(encryptedKey, password) + if (key === null) { + throw new CodeError('Cannot read the key, most likely the password is wrong or not a RSA key', 'ERR_CANNOT_DECRYPT_PEM') + } + let der = forge.asn1.toDer(forge.pki.privateKeyToAsn1(key)) + der = uint8ArrayFromString(der.getBytes(), 'ascii') + return supportedKeys.rsa.unmarshalRsaPrivateKey(der) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/interface.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/interface.ts new file mode 100644 index 000000000..2cbfd5a12 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/interface.ts @@ -0,0 +1,34 @@ +export interface JWKKeyPair { + privateKey: JsonWebKey + publicKey: JsonWebKey +} + +export interface Uint8ArrayKeyPair { + privateKey: Uint8Array + publicKey: Uint8Array +} + +export interface ECDHKeyPair { + private: Uint8Array + public: Uint8Array +} + +export interface ECDHKey { + key: Uint8Array + genSharedKey(theirPub: Uint8Array, forcePrivate?: ECDHKeyPair): Promise +} + +export interface JWKEncodedPublicKey { kty: string, crv: 'P-256' | 'P-384' | 'P-521', x: string, y: string, ext: boolean } + +export interface JWKEncodedPrivateKey extends JWKEncodedPublicKey { d: string } + +export interface EnhancedKey { + iv: Uint8Array + cipherKey: Uint8Array + macKey: Uint8Array +} + +export interface EnhancedKeyPair { + k1: EnhancedKey + k2: EnhancedKey +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/jwk2pem.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/jwk2pem.ts new file mode 100644 index 000000000..d827f282d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/jwk2pem.ts @@ -0,0 +1,21 @@ +import 'node-forge/lib/rsa.js' +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js' +import { base64urlToBigInteger } from '../util.js' + +export interface JWK { + encrypt(msg: string): string + decrypt(msg: string): string +} + +function convert (key: any, types: string[]): Array { + return types.map(t => base64urlToBigInteger(key[t])) +} + +export function jwk2priv (key: JsonWebKey): JWK { + return forge.pki.setRsaPrivateKey(...convert(key, ['n', 'e', 'd', 'p', 'q', 'dp', 'dq', 'qi'])) +} + +export function jwk2pub (key: JsonWebKey): JWK { + return forge.pki.setRsaPublicKey(...convert(key, ['n', 'e'])) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/key-stretcher.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/key-stretcher.ts new file mode 100644 index 000000000..3b04f9c57 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/key-stretcher.ts @@ -0,0 +1,78 @@ +import { CodeError } from '@libp2p/interface/errors' +import { concat as uint8ArrayConcat } from 'uint8arrays/concat' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import * as hmac from '../hmac/index.js' +import type { EnhancedKey, EnhancedKeyPair } from './interface.js' + +const cipherMap = { + 'AES-128': { + ivSize: 16, + keySize: 16 + }, + 'AES-256': { + ivSize: 16, + keySize: 32 + }, + Blowfish: { + ivSize: 8, + keySize: 32 + } +} + +/** + * Generates a set of keys for each party by stretching the shared key. + * (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey) + */ +export async function keyStretcher (cipherType: 'AES-128' | 'AES-256' | 'Blowfish', hash: 'SHA1' | 'SHA256' | 'SHA512', secret: Uint8Array): Promise { + const cipher = cipherMap[cipherType] + + if (cipher == null) { + const allowed = Object.keys(cipherMap).join(' / ') + throw new CodeError(`unknown cipher type '${cipherType}'. Must be ${allowed}`, 'ERR_INVALID_CIPHER_TYPE') + } + + if (hash == null) { + throw new CodeError('missing hash type', 'ERR_MISSING_HASH_TYPE') + } + + const cipherKeySize = cipher.keySize + const ivSize = cipher.ivSize + const hmacKeySize = 20 + const seed = uint8ArrayFromString('key expansion') + const resultLength = 2 * (ivSize + cipherKeySize + hmacKeySize) + + const m = await hmac.create(hash, secret) + let a = await m.digest(seed) + + const result = [] + let j = 0 + + while (j < resultLength) { + const b = await m.digest(uint8ArrayConcat([a, seed])) + let todo = b.length + + if (j + todo > resultLength) { + todo = resultLength - j + } + + result.push(b) + j += todo + a = await m.digest(a) + } + + const half = resultLength / 2 + const resultBuffer = uint8ArrayConcat(result) + const r1 = resultBuffer.subarray(0, half) + const r2 = resultBuffer.subarray(half, resultLength) + + const createKey = (res: Uint8Array): EnhancedKey => ({ + iv: res.subarray(0, ivSize), + cipherKey: res.subarray(ivSize, ivSize + cipherKeySize), + macKey: res.subarray(ivSize + cipherKeySize) + }) + + return { + k1: createKey(r1), + k2: createKey(r2) + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.proto b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.proto new file mode 100644 index 000000000..7f4997165 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +enum KeyType { + RSA = 0; + Ed25519 = 1; + Secp256k1 = 2; +} +message PublicKey { + // the proto2 version of this field is "required" which means it will have + // no default value. the default for proto3 is "singluar" which omits the + // value on the wire if it's the default so for proto3 we make it "optional" + // to ensure a value is always written on to the wire + optional KeyType Type = 1; + + // the proto2 version of this field is "required" which means it will have + // no default value. the default for proto3 is "singluar" which omits the + // value on the wire if it's the default so for proto3 we make it "optional" + // to ensure a value is always written on to the wire + optional bytes Data = 2; +} +message PrivateKey { + // the proto2 version of this field is "required" which means it will have + // no default value. the default for proto3 is "singluar" which omits the + // value on the wire if it's the default so for proto3 we make it "optional" + // to ensure a value is always written on to the wire + optional KeyType Type = 1; + + // the proto2 version of this field is "required" which means it will have + // no default value. the default for proto3 is "singluar" which omits the + // value on the wire if it's the default so for proto3 we make it "optional" + // to ensure a value is always written on to the wire + optional bytes Data = 2; +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.ts new file mode 100644 index 000000000..0d9fcd41e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/keys.ts @@ -0,0 +1,156 @@ +/* eslint-disable import/export */ +/* eslint-disable complexity */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + +import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime' +import type { Codec } from 'protons-runtime' +import type { Uint8ArrayList } from 'uint8arraylist' + +export enum KeyType { + RSA = 'RSA', + Ed25519 = 'Ed25519', + Secp256k1 = 'Secp256k1' +} + +enum __KeyTypeValues { + RSA = 0, + Ed25519 = 1, + Secp256k1 = 2 +} + +export namespace KeyType { + export const codec = (): Codec => { + return enumeration(__KeyTypeValues) + } +} +export interface PublicKey { + Type?: KeyType + Data?: Uint8Array +} + +export namespace PublicKey { + let _codec: Codec + + export const codec = (): Codec => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork() + } + + if (obj.Type != null) { + w.uint32(8) + KeyType.codec().encode(obj.Type, w) + } + + if (obj.Data != null) { + w.uint32(18) + w.bytes(obj.Data) + } + + if (opts.lengthDelimited !== false) { + w.ldelim() + } + }, (reader, length) => { + const obj: any = {} + + const end = length == null ? reader.len : reader.pos + length + + while (reader.pos < end) { + const tag = reader.uint32() + + switch (tag >>> 3) { + case 1: + obj.Type = KeyType.codec().decode(reader) + break + case 2: + obj.Data = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + + return obj + }) + } + + return _codec + } + + export const encode = (obj: Partial): Uint8Array => { + return encodeMessage(obj, PublicKey.codec()) + } + + export const decode = (buf: Uint8Array | Uint8ArrayList): PublicKey => { + return decodeMessage(buf, PublicKey.codec()) + } +} + +export interface PrivateKey { + Type?: KeyType + Data?: Uint8Array +} + +export namespace PrivateKey { + let _codec: Codec + + export const codec = (): Codec => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork() + } + + if (obj.Type != null) { + w.uint32(8) + KeyType.codec().encode(obj.Type, w) + } + + if (obj.Data != null) { + w.uint32(18) + w.bytes(obj.Data) + } + + if (opts.lengthDelimited !== false) { + w.ldelim() + } + }, (reader, length) => { + const obj: any = {} + + const end = length == null ? reader.len : reader.pos + length + + while (reader.pos < end) { + const tag = reader.uint32() + + switch (tag >>> 3) { + case 1: + obj.Type = KeyType.codec().decode(reader) + break + case 2: + obj.Data = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + + return obj + }) + } + + return _codec + } + + export const encode = (obj: Partial): Uint8Array => { + return encodeMessage(obj, PrivateKey.codec()) + } + + export const decode = (buf: Uint8Array | Uint8ArrayList): PrivateKey => { + return decodeMessage(buf, PrivateKey.codec()) + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-browser.ts new file mode 100644 index 000000000..854c4abf4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-browser.ts @@ -0,0 +1,168 @@ +import { CodeError } from '@libp2p/interface/errors' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import randomBytes from '../random-bytes.js' +import webcrypto from '../webcrypto.js' +import { jwk2pub, jwk2priv } from './jwk2pem.js' +import * as utils from './rsa-utils.js' +import type { JWKKeyPair } from './interface.js' +import type { Uint8ArrayList } from 'uint8arraylist' + +export { utils } + +export async function generateKey (bits: number): Promise { + const pair = await webcrypto.get().subtle.generateKey( + { + name: 'RSASSA-PKCS1-v1_5', + modulusLength: bits, + publicExponent: new Uint8Array([0x01, 0x00, 0x01]), + hash: { name: 'SHA-256' } + }, + true, + ['sign', 'verify'] + ) + + const keys = await exportKey(pair) + + return { + privateKey: keys[0], + publicKey: keys[1] + } +} + +// Takes a jwk key +export async function unmarshalPrivateKey (key: JsonWebKey): Promise { + const privateKey = await webcrypto.get().subtle.importKey( + 'jwk', + key, + { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, + true, + ['sign'] + ) + + const pair = [ + privateKey, + await derivePublicFromPrivate(key) + ] + + const keys = await exportKey({ + privateKey: pair[0], + publicKey: pair[1] + }) + + return { + privateKey: keys[0], + publicKey: keys[1] + } +} + +export { randomBytes as getRandomValues } + +export async function hashAndSign (key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Promise { + const privateKey = await webcrypto.get().subtle.importKey( + 'jwk', + key, + { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, + false, + ['sign'] + ) + + const sig = await webcrypto.get().subtle.sign( + { name: 'RSASSA-PKCS1-v1_5' }, + privateKey, + msg instanceof Uint8Array ? msg : msg.subarray() + ) + + return new Uint8Array(sig, 0, sig.byteLength) +} + +export async function hashAndVerify (key: JsonWebKey, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + const publicKey = await webcrypto.get().subtle.importKey( + 'jwk', + key, + { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, + false, + ['verify'] + ) + + return webcrypto.get().subtle.verify( + { name: 'RSASSA-PKCS1-v1_5' }, + publicKey, + sig, + msg instanceof Uint8Array ? msg : msg.subarray() + ) +} + +async function exportKey (pair: CryptoKeyPair): Promise<[JsonWebKey, JsonWebKey]> { + if (pair.privateKey == null || pair.publicKey == null) { + throw new CodeError('Private and public key are required', 'ERR_INVALID_PARAMETERS') + } + + return Promise.all([ + webcrypto.get().subtle.exportKey('jwk', pair.privateKey), + webcrypto.get().subtle.exportKey('jwk', pair.publicKey) + ]) +} + +async function derivePublicFromPrivate (jwKey: JsonWebKey): Promise { + return webcrypto.get().subtle.importKey( + 'jwk', + { + kty: jwKey.kty, + n: jwKey.n, + e: jwKey.e + }, + { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + }, + true, + ['verify'] + ) +} + +/* + +RSA encryption/decryption for the browser with webcrypto workaround +"bloody dark magic. webcrypto's why." + +Explanation: + - Convert JWK to nodeForge + - Convert msg Uint8Array to nodeForge buffer: ByteBuffer is a "binary-string backed buffer", so let's make our Uint8Array a binary string + - Convert resulting nodeForge buffer to Uint8Array: it returns a binary string, turn that into a Uint8Array + +*/ + +function convertKey (key: JsonWebKey, pub: boolean, msg: Uint8Array | Uint8ArrayList, handle: (msg: string, key: { encrypt(msg: string): string, decrypt(msg: string): string }) => string): Uint8Array { + const fkey = pub ? jwk2pub(key) : jwk2priv(key) + const fmsg = uint8ArrayToString(msg instanceof Uint8Array ? msg : msg.subarray(), 'ascii') + const fomsg = handle(fmsg, fkey) + return uint8ArrayFromString(fomsg, 'ascii') +} + +export function encrypt (key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Uint8Array { + return convertKey(key, true, msg, (msg, key) => key.encrypt(msg)) +} + +export function decrypt (key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Uint8Array { + return convertKey(key, false, msg, (msg, key) => key.decrypt(msg)) +} + +export function keySize (jwk: JsonWebKey): number { + if (jwk.kty !== 'RSA') { + throw new CodeError('invalid key type', 'ERR_INVALID_KEY_TYPE') + } else if (jwk.n == null) { + throw new CodeError('invalid key modulus', 'ERR_INVALID_KEY_MODULUS') + } + const bytes = uint8ArrayFromString(jwk.n, 'base64url') + return bytes.length * 8 +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-class.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-class.ts new file mode 100644 index 000000000..e48021c84 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-class.ts @@ -0,0 +1,179 @@ +import { CodeError } from '@libp2p/interface/errors' +import { sha256 } from 'multiformats/hashes/sha2' +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js' +import { equals as uint8ArrayEquals } from 'uint8arrays/equals' +import 'node-forge/lib/sha512.js' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { exporter } from './exporter.js' +import * as pbm from './keys.js' +import * as crypto from './rsa.js' +import type { Multibase } from 'multiformats' +import type { Uint8ArrayList } from 'uint8arraylist' + +export const MAX_KEY_SIZE = 8192 + +export class RsaPublicKey { + private readonly _key: JsonWebKey + + constructor (key: JsonWebKey) { + this._key = key + } + + async verify (data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise { + return crypto.hashAndVerify(this._key, sig, data) + } + + marshal (): Uint8Array { + return crypto.utils.jwkToPkix(this._key) + } + + get bytes (): Uint8Array { + return pbm.PublicKey.encode({ + Type: pbm.KeyType.RSA, + Data: this.marshal() + }).subarray() + } + + encrypt (bytes: Uint8Array | Uint8ArrayList): Uint8Array { + return crypto.encrypt(this._key, bytes) + } + + equals (key: any): boolean { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash (): Promise { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } +} + +export class RsaPrivateKey { + private readonly _key: JsonWebKey + private readonly _publicKey: JsonWebKey + + constructor (key: JsonWebKey, publicKey: JsonWebKey) { + this._key = key + this._publicKey = publicKey + } + + genSecret (): Uint8Array { + return crypto.getRandomValues(16) + } + + async sign (message: Uint8Array | Uint8ArrayList): Promise { + return crypto.hashAndSign(this._key, message) + } + + get public (): RsaPublicKey { + if (this._publicKey == null) { + throw new CodeError('public key not provided', 'ERR_PUBKEY_NOT_PROVIDED') + } + + return new RsaPublicKey(this._publicKey) + } + + decrypt (bytes: Uint8Array | Uint8ArrayList): Uint8Array { + return crypto.decrypt(this._key, bytes) + } + + marshal (): Uint8Array { + return crypto.utils.jwkToPkcs1(this._key) + } + + get bytes (): Uint8Array { + return pbm.PrivateKey.encode({ + Type: pbm.KeyType.RSA, + Data: this.marshal() + }).subarray() + } + + equals (key: any): boolean { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash (): Promise { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } + + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + async id (): Promise { + const hash = await this.public.hash() + return uint8ArrayToString(hash, 'base58btc') + } + + /** + * Exports the key into a password protected PEM format + */ + async export (password: string, format = 'pkcs-8'): Promise> { + if (format === 'pkcs-8') { + const buffer = new forge.util.ByteBuffer(this.marshal()) + const asn1 = forge.asn1.fromDer(buffer) + const privateKey = forge.pki.privateKeyFromAsn1(asn1) + + const options = { + algorithm: 'aes256', + count: 10000, + saltSize: 128 / 8, + prfAlgorithm: 'sha512' + } + return forge.pki.encryptRsaPrivateKey(privateKey, password, options) + } else if (format === 'libp2p-key') { + return exporter(this.bytes, password) + } else { + throw new CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT') + } + } +} + +export async function unmarshalRsaPrivateKey (bytes: Uint8Array): Promise { + const jwk = crypto.utils.pkcs1ToJwk(bytes) + + if (crypto.keySize(jwk) > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE') + } + + const keys = await crypto.unmarshalPrivateKey(jwk) + + return new RsaPrivateKey(keys.privateKey, keys.publicKey) +} + +export function unmarshalRsaPublicKey (bytes: Uint8Array): RsaPublicKey { + const jwk = crypto.utils.pkixToJwk(bytes) + + if (crypto.keySize(jwk) > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE') + } + + return new RsaPublicKey(jwk) +} + +export async function fromJwk (jwk: JsonWebKey): Promise { + if (crypto.keySize(jwk) > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE') + } + + const keys = await crypto.unmarshalPrivateKey(jwk) + + return new RsaPrivateKey(keys.privateKey, keys.publicKey) +} + +export async function generateKeyPair (bits: number): Promise { + if (bits > MAX_KEY_SIZE) { + throw new CodeError('key size is too large', 'ERR_KEY_SIZE_TOO_LARGE') + } + + const keys = await crypto.generateKey(bits) + + return new RsaPrivateKey(keys.privateKey, keys.publicKey) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-utils.ts new file mode 100644 index 000000000..70b97c740 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa-utils.ts @@ -0,0 +1,74 @@ +import 'node-forge/lib/asn1.js' +import 'node-forge/lib/rsa.js' +import { CodeError } from '@libp2p/interface/errors' +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { bigIntegerToUintBase64url, base64urlToBigInteger } from './../util.js' + +// Convert a PKCS#1 in ASN1 DER format to a JWK key +export function pkcs1ToJwk (bytes: Uint8Array): JsonWebKey { + const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')) + const privateKey = forge.pki.privateKeyFromAsn1(asn1) + + // https://tools.ietf.org/html/rfc7518#section-6.3.1 + return { + kty: 'RSA', + n: bigIntegerToUintBase64url(privateKey.n), + e: bigIntegerToUintBase64url(privateKey.e), + d: bigIntegerToUintBase64url(privateKey.d), + p: bigIntegerToUintBase64url(privateKey.p), + q: bigIntegerToUintBase64url(privateKey.q), + dp: bigIntegerToUintBase64url(privateKey.dP), + dq: bigIntegerToUintBase64url(privateKey.dQ), + qi: bigIntegerToUintBase64url(privateKey.qInv), + alg: 'RS256' + } +} + +// Convert a JWK key into PKCS#1 in ASN1 DER format +export function jwkToPkcs1 (jwk: JsonWebKey): Uint8Array { + if (jwk.n == null || jwk.e == null || jwk.d == null || jwk.p == null || jwk.q == null || jwk.dp == null || jwk.dq == null || jwk.qi == null) { + throw new CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS') + } + + const asn1 = forge.pki.privateKeyToAsn1({ + n: base64urlToBigInteger(jwk.n), + e: base64urlToBigInteger(jwk.e), + d: base64urlToBigInteger(jwk.d), + p: base64urlToBigInteger(jwk.p), + q: base64urlToBigInteger(jwk.q), + dP: base64urlToBigInteger(jwk.dp), + dQ: base64urlToBigInteger(jwk.dq), + qInv: base64urlToBigInteger(jwk.qi) + }) + + return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii') +} + +// Convert a PKCIX in ASN1 DER format to a JWK key +export function pkixToJwk (bytes: Uint8Array): JsonWebKey { + const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')) + const publicKey = forge.pki.publicKeyFromAsn1(asn1) + + return { + kty: 'RSA', + n: bigIntegerToUintBase64url(publicKey.n), + e: bigIntegerToUintBase64url(publicKey.e) + } +} + +// Convert a JWK key to PKCIX in ASN1 DER format +export function jwkToPkix (jwk: JsonWebKey): Uint8Array { + if (jwk.n == null || jwk.e == null) { + throw new CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS') + } + + const asn1 = forge.pki.publicKeyToAsn1({ + n: base64urlToBigInteger(jwk.n), + e: base64urlToBigInteger(jwk.e) + }) + + return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii') +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa.ts new file mode 100644 index 000000000..b57c314da --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/rsa.ts @@ -0,0 +1,106 @@ +import crypto from 'crypto' +import { promisify } from 'util' +import { CodeError } from '@libp2p/interface/errors' +import randomBytes from '../random-bytes.js' +import * as utils from './rsa-utils.js' +import type { JWKKeyPair } from './interface.js' +import type { Uint8ArrayList } from 'uint8arraylist' + +const keypair = promisify(crypto.generateKeyPair) + +export { utils } + +export async function generateKey (bits: number): Promise { + // @ts-expect-error node types are missing jwk as a format + const key = await keypair('rsa', { + modulusLength: bits, + publicKeyEncoding: { type: 'pkcs1', format: 'jwk' }, + privateKeyEncoding: { type: 'pkcs1', format: 'jwk' } + }) + + return { + // @ts-expect-error node types are missing jwk as a format + privateKey: key.privateKey, + // @ts-expect-error node types are missing jwk as a format + publicKey: key.publicKey + } +} + +// Takes a jwk key +export async function unmarshalPrivateKey (key: JsonWebKey): Promise { + if (key == null) { + throw new CodeError('Missing key parameter', 'ERR_MISSING_KEY') + } + return { + privateKey: key, + publicKey: { + kty: key.kty, + n: key.n, + e: key.e + } + } +} + +export { randomBytes as getRandomValues } + +export async function hashAndSign (key: JsonWebKey, msg: Uint8Array | Uint8ArrayList): Promise { + const hash = crypto.createSign('RSA-SHA256') + + if (msg instanceof Uint8Array) { + hash.update(msg) + } else { + for (const buf of msg) { + hash.update(buf) + } + } + + // @ts-expect-error node types are missing jwk as a format + return hash.sign({ format: 'jwk', key }) +} + +export async function hashAndVerify (key: JsonWebKey, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + const hash = crypto.createVerify('RSA-SHA256') + + if (msg instanceof Uint8Array) { + hash.update(msg) + } else { + for (const buf of msg) { + hash.update(buf) + } + } + + // @ts-expect-error node types are missing jwk as a format + return hash.verify({ format: 'jwk', key }, sig) +} + +const padding = crypto.constants.RSA_PKCS1_PADDING + +export function encrypt (key: JsonWebKey, bytes: Uint8Array | Uint8ArrayList): Uint8Array { + if (bytes instanceof Uint8Array) { + // @ts-expect-error node types are missing jwk as a format + return crypto.publicEncrypt({ format: 'jwk', key, padding }, bytes) + } else { + // @ts-expect-error node types are missing jwk as a format + return crypto.publicEncrypt({ format: 'jwk', key, padding }, bytes.subarray()) + } +} + +export function decrypt (key: JsonWebKey, bytes: Uint8Array | Uint8ArrayList): Uint8Array { + if (bytes instanceof Uint8Array) { + // @ts-expect-error node types are missing jwk as a format + return crypto.privateDecrypt({ format: 'jwk', key, padding }, bytes) + } else { + // @ts-expect-error node types are missing jwk as a format + return crypto.privateDecrypt({ format: 'jwk', key, padding }, bytes.subarray()) + } +} + +export function keySize (jwk: JsonWebKey): number { + if (jwk.kty !== 'RSA') { + throw new CodeError('invalid key type', 'ERR_INVALID_KEY_TYPE') + } else if (jwk.n == null) { + throw new CodeError('invalid key modulus', 'ERR_INVALID_KEY_MODULUS') + } + const modulus = Buffer.from(jwk.n, 'base64') + return modulus.length * 8 +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-browser.ts new file mode 100644 index 000000000..c7de16c56 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-browser.ts @@ -0,0 +1,71 @@ +import { CodeError } from '@libp2p/interface/errors' +import { secp256k1 as secp } from '@noble/curves/secp256k1' +import { sha256 } from 'multiformats/hashes/sha2' +import type { Uint8ArrayList } from 'uint8arraylist' + +const PRIVATE_KEY_BYTE_LENGTH = 32 + +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength } + +export function generateKey (): Uint8Array { + return secp.utils.randomPrivateKey() +} + +/** + * Hash and sign message with private key + */ +export async function hashAndSign (key: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + const { digest } = await sha256.digest(msg instanceof Uint8Array ? msg : msg.subarray()) + try { + const signature = secp.sign(digest, key) + return signature.toDERRawBytes() + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT') + } +} + +/** + * Hash message and verify signature with public key + */ +export async function hashAndVerify (key: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + try { + const { digest } = await sha256.digest(msg instanceof Uint8Array ? msg : msg.subarray()) + return secp.verify(sig, digest, key) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT') + } +} + +export function compressPublicKey (key: Uint8Array): Uint8Array { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(true) + return point +} + +export function decompressPublicKey (key: Uint8Array): Uint8Array { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(false) + return point +} + +export function validatePrivateKey (key: Uint8Array): void { + try { + secp.getPublicKey(key, true) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY') + } +} + +export function validatePublicKey (key: Uint8Array): void { + try { + secp.ProjectivePoint.fromHex(key) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PUBLIC_KEY') + } +} + +export function computePublicKey (privateKey: Uint8Array): Uint8Array { + try { + return secp.getPublicKey(privateKey, true) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY') + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-class.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-class.ts new file mode 100644 index 000000000..6dc8cf84f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1-class.ts @@ -0,0 +1,120 @@ +import { CodeError } from '@libp2p/interface/errors' +import { sha256 } from 'multiformats/hashes/sha2' +import { equals as uint8ArrayEquals } from 'uint8arrays/equals' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { exporter } from './exporter.js' +import * as keysProtobuf from './keys.js' +import * as crypto from './secp256k1.js' +import type { Multibase } from 'multiformats' +import type { Uint8ArrayList } from 'uint8arraylist' + +export class Secp256k1PublicKey { + private readonly _key: Uint8Array + + constructor (key: Uint8Array) { + crypto.validatePublicKey(key) + this._key = key + } + + async verify (data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise { + return crypto.hashAndVerify(this._key, sig, data) + } + + marshal (): Uint8Array { + return crypto.compressPublicKey(this._key) + } + + get bytes (): Uint8Array { + return keysProtobuf.PublicKey.encode({ + Type: keysProtobuf.KeyType.Secp256k1, + Data: this.marshal() + }).subarray() + } + + equals (key: any): boolean { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash (): Promise { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } +} + +export class Secp256k1PrivateKey { + private readonly _key: Uint8Array + private readonly _publicKey: Uint8Array + + constructor (key: Uint8Array, publicKey?: Uint8Array) { + this._key = key + this._publicKey = publicKey ?? crypto.computePublicKey(key) + crypto.validatePrivateKey(this._key) + crypto.validatePublicKey(this._publicKey) + } + + async sign (message: Uint8Array | Uint8ArrayList): Promise { + return crypto.hashAndSign(this._key, message) + } + + get public (): Secp256k1PublicKey { + return new Secp256k1PublicKey(this._publicKey) + } + + marshal (): Uint8Array { + return this._key + } + + get bytes (): Uint8Array { + return keysProtobuf.PrivateKey.encode({ + Type: keysProtobuf.KeyType.Secp256k1, + Data: this.marshal() + }).subarray() + } + + equals (key: any): boolean { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash (): Promise { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } + + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + async id (): Promise { + const hash = await this.public.hash() + return uint8ArrayToString(hash, 'base58btc') + } + + /** + * Exports the key into a password protected `format` + */ + async export (password: string, format = 'libp2p-key'): Promise> { + if (format === 'libp2p-key') { + return exporter(this.bytes, password) + } else { + throw new CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT') + } + } +} + +export function unmarshalSecp256k1PrivateKey (bytes: Uint8Array): Secp256k1PrivateKey { + return new Secp256k1PrivateKey(bytes) +} + +export function unmarshalSecp256k1PublicKey (bytes: Uint8Array): Secp256k1PublicKey { + return new Secp256k1PublicKey(bytes) +} + +export async function generateKeyPair (): Promise { + const privateKeyBytes = crypto.generateKey() + return new Secp256k1PrivateKey(privateKeyBytes) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1.ts new file mode 100644 index 000000000..c42855ae3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/keys/secp256k1.ts @@ -0,0 +1,93 @@ +import crypto from 'node:crypto' +import { CodeError } from '@libp2p/interface/errors' +import { secp256k1 as secp } from '@noble/curves/secp256k1' +import type { Uint8ArrayList } from 'uint8arraylist' + +const PRIVATE_KEY_BYTE_LENGTH = 32 + +export { PRIVATE_KEY_BYTE_LENGTH as privateKeyLength } + +export function generateKey (): Uint8Array { + return secp.utils.randomPrivateKey() +} + +/** + * Hash and sign message with private key + */ +export async function hashAndSign (key: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + const hash = crypto.createHash('sha256') + + if (msg instanceof Uint8Array) { + hash.update(msg) + } else { + for (const buf of msg) { + hash.update(buf) + } + } + + const digest = hash.digest() + + try { + const signature = secp.sign(digest, key) + return signature.toDERRawBytes() + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT') + } +} + +/** + * Hash message and verify signature with public key + */ +export async function hashAndVerify (key: Uint8Array, sig: Uint8Array, msg: Uint8Array | Uint8ArrayList): Promise { + const hash = crypto.createHash('sha256') + + if (msg instanceof Uint8Array) { + hash.update(msg) + } else { + for (const buf of msg) { + hash.update(buf) + } + } + + const digest = hash.digest() + + try { + return secp.verify(sig, digest, key) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_INPUT') + } +} + +export function compressPublicKey (key: Uint8Array): Uint8Array { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(true) + return point +} + +export function decompressPublicKey (key: Uint8Array): Uint8Array { + const point = secp.ProjectivePoint.fromHex(key).toRawBytes(false) + return point +} + +export function validatePrivateKey (key: Uint8Array): void { + try { + secp.getPublicKey(key, true) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY') + } +} + +export function validatePublicKey (key: Uint8Array): void { + try { + secp.ProjectivePoint.fromHex(key) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PUBLIC_KEY') + } +} + +export function computePublicKey (privateKey: Uint8Array): Uint8Array { + try { + return secp.getPublicKey(privateKey, true) + } catch (err) { + throw new CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY') + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/pbkdf2.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/pbkdf2.ts new file mode 100644 index 000000000..c7b6a5702 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/pbkdf2.ts @@ -0,0 +1,39 @@ +import { CodeError } from '@libp2p/interface/errors' +// @ts-expect-error types are missing +import forgePbkdf2 from 'node-forge/lib/pbkdf2.js' +// @ts-expect-error types are missing +import forgeUtil from 'node-forge/lib/util.js' + +/** + * Maps an IPFS hash name to its node-forge equivalent. + * + * See https://github.com/multiformats/multihash/blob/master/hashtable.csv + * + * @private + */ +const hashName = { + sha1: 'sha1', + 'sha2-256': 'sha256', + 'sha2-512': 'sha512' +} + +/** + * Computes the Password-Based Key Derivation Function 2. + */ +export default function pbkdf2 (password: string, salt: string, iterations: number, keySize: number, hash: string): string { + if (hash !== 'sha1' && hash !== 'sha2-256' && hash !== 'sha2-512') { + const types = Object.keys(hashName).join(' / ') + throw new CodeError(`Hash '${hash}' is unknown or not supported. Must be ${types}`, 'ERR_UNSUPPORTED_HASH_TYPE') + } + + const hasher = hashName[hash] + const dek = forgePbkdf2( + password, + salt, + iterations, + keySize, + hasher + ) + + return forgeUtil.encode64(dek, null) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/random-bytes.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/random-bytes.ts new file mode 100644 index 000000000..5de614474 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/random-bytes.ts @@ -0,0 +1,12 @@ +import { CodeError } from '@libp2p/interface/errors' +import { randomBytes as randB } from '@noble/hashes/utils' + +/** + * Generates a Uint8Array with length `number` populated by random bytes + */ +export default function randomBytes (length: number): Uint8Array { + if (isNaN(length) || length <= 0) { + throw new CodeError('random bytes length must be a Number bigger than 0', 'ERR_INVALID_LENGTH') + } + return randB(length) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/util.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/util.ts new file mode 100644 index 000000000..0dab953f8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/util.ts @@ -0,0 +1,42 @@ +import 'node-forge/lib/util.js' +import 'node-forge/lib/jsbn.js' +// @ts-expect-error types are missing +import forge from 'node-forge/lib/forge.js' +import { concat as uint8ArrayConcat } from 'uint8arrays/concat' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' + +export function bigIntegerToUintBase64url (num: { abs(): any }, len?: number): string { + // Call `.abs()` to convert to unsigned + let buf = Uint8Array.from(num.abs().toByteArray()) // toByteArray converts to big endian + + // toByteArray() gives us back a signed array, which will include a leading 0 + // byte if the most significant bit of the number is 1: + // https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer + // Our number will always be positive so we should remove the leading padding. + buf = buf[0] === 0 ? buf.subarray(1) : buf + + if (len != null) { + if (buf.length > len) throw new Error('byte array longer than desired length') + buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]) + } + + return uint8ArrayToString(buf, 'base64url') +} + +// Convert a base64url encoded string to a BigInteger +export function base64urlToBigInteger (str: string): typeof forge.jsbn.BigInteger { + const buf = base64urlToBuffer(str) + return new forge.jsbn.BigInteger(uint8ArrayToString(buf, 'base16'), 16) +} + +export function base64urlToBuffer (str: string, len?: number): Uint8Array { + let buf = uint8ArrayFromString(str, 'base64urlpad') + + if (len != null) { + if (buf.length > len) throw new Error('byte array longer than desired length') + buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]) + } + + return buf +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/webcrypto.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/webcrypto.ts new file mode 100644 index 000000000..746e35b75 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/crypto/src/webcrypto.ts @@ -0,0 +1,24 @@ +/* eslint-env browser */ + +// Check native crypto exists and is enabled (In insecure context `self.crypto` +// exists but `self.crypto.subtle` does not). +export default { + get (win = globalThis) { + const nativeCrypto = win.crypto + + if (nativeCrypto == null || nativeCrypto.subtle == null) { + throw Object.assign( + new Error( + 'Missing Web Crypto API. ' + + 'The most likely cause of this error is that this page is being accessed ' + + 'from an insecure context (i.e. not HTTPS). For more information and ' + + 'possible resolutions see ' + + 'https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api' + ), + { code: 'ERR_MISSING_WEB_CRYPTO' } + ) + } + + return nativeCrypto + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/index.min.js new file mode 100644 index 000000000..26c9bba1f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/index.min.js @@ -0,0 +1,3 @@ +(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () { +"use strict";var Libp2PInterface=(()=>{var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(o,e,x,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of b(e))!c.call(o,p)&&p!==x&&t(o,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return o};var f=o=>d(t({},"__esModule",{value:!0}),o);var g={};return f(g);})(); +return Libp2PInterface})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts new file mode 100644 index 000000000..ca5c64b08 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts @@ -0,0 +1,29 @@ +import type { MultiaddrConnection } from '../connection/index.js'; +import type { PeerId } from '../peer-id/index.js'; +import type { Duplex } from 'it-stream-types'; +import type { Uint8ArrayList } from 'uint8arraylist'; +/** + * A libp2p connection encrypter module must be compliant to this interface + * to ensure all exchanged data between two peers is encrypted. + */ +export interface ConnectionEncrypter { + protocol: string; + /** + * Encrypt outgoing data to the remote party. If the remote PeerId is known, + * pass it for extra verification, otherwise it will be determined during + * the handshake. + */ + secureOutbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; + /** + * Decrypt incoming data. If the remote PeerId is known, + * pass it for extra verification, otherwise it will be determined during + * the handshake + */ + secureInbound> = MultiaddrConnection>(localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise>; +} +export interface SecuredConnection { + conn: Stream; + remoteExtensions?: Extension; + remotePeer: PeerId; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts.map new file mode 100644 index 000000000..536286441 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-encrypter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,OAAO;IACtD,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAErN;;;;OAIG;IACH,aAAa,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;CACrN;AAED,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;CACnB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js.map new file mode 100644 index 000000000..a7cc95190 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-encrypter/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection-encrypter/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts new file mode 100644 index 000000000..a7ee7e6d4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts @@ -0,0 +1,117 @@ +import type { MultiaddrConnection } from '../connection/index.js'; +import type { PeerId } from '../peer-id/index.js'; +import type { Multiaddr } from '@multiformats/multiaddr'; +export interface ConnectionGater { + /** + * denyDialPeer tests whether we're permitted to Dial the + * specified peer. + * + * This is called by the dialer.connectToPeer implementation before + * dialling a peer. + * + * Return true to prevent dialing the passed peer. + */ + denyDialPeer?(peerId: PeerId): Promise; + /** + * denyDialMultiaddr tests whether we're permitted to dial the specified + * multiaddr. + * + * This is called by the connection manager - if the peer id of the remote + * node is known it will be present in the multiaddr. + * + * Return true to prevent dialing the passed peer on the passed multiaddr. + */ + denyDialMultiaddr?(multiaddr: Multiaddr): Promise; + /** + * denyInboundConnection tests whether an incipient inbound connection is allowed. + * + * This is called by the upgrader, or by the transport directly (e.g. QUIC, + * Bluetooth), straight after it has accepted a connection from its socket. + * + * Return true to deny the incoming passed connection. + */ + denyInboundConnection?(maConn: MultiaddrConnection): Promise; + /** + * denyOutboundConnection tests whether an incipient outbound connection is allowed. + * + * This is called by the upgrader, or by the transport directly (e.g. QUIC, + * Bluetooth), straight after it has created a connection with its socket. + * + * Return true to deny the incoming passed connection. + */ + denyOutboundConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise; + /** + * denyInboundEncryptedConnection tests whether a given connection, now encrypted, + * is allowed. + * + * This is called by the upgrader, after it has performed the security + * handshake, and before it negotiates the muxer, or by the directly by the + * transport, at the exact same checkpoint. + * + * Return true to deny the passed secured connection. + */ + denyInboundEncryptedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise; + /** + * denyOutboundEncryptedConnection tests whether a given connection, now encrypted, + * is allowed. + * + * This is called by the upgrader, after it has performed the security + * handshake, and before it negotiates the muxer, or by the directly by the + * transport, at the exact same checkpoint. + * + * Return true to deny the passed secured connection. + */ + denyOutboundEncryptedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise; + /** + * denyInboundUpgradedConnection tests whether a fully capable connection is allowed. + * + * This is called after encryption has been negotiated and the connection has been + * multiplexed, if a multiplexer is configured. + * + * Return true to deny the passed upgraded connection. + */ + denyInboundUpgradedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise; + /** + * denyOutboundUpgradedConnection tests whether a fully capable connection is allowed. + * + * This is called after encryption has been negotiated and the connection has been + * multiplexed, if a multiplexer is configured. + * + * Return true to deny the passed upgraded connection. + */ + denyOutboundUpgradedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise; + /** + * denyInboundRelayReservation tests whether a remote peer is allowed make a + * relay reservation on this node. + * + * Return true to deny the relay reservation. + */ + denyInboundRelayReservation?(source: PeerId): Promise; + /** + * denyOutboundRelayedConnection tests whether a remote peer is allowed to open a relayed + * connection to the destination node. + * + * This is invoked on the relay server when a source client with a reservation instructs + * the server to relay a connection to a destination peer. + * + * Return true to deny the relayed connection. + */ + denyOutboundRelayedConnection?(source: PeerId, destination: PeerId): Promise; + /** + * denyInboundRelayedConnection tests whether a remote peer is allowed to open a relayed + * connection to this node. + * + * This is invoked on the relay client when a remote relay has received an instruction to + * relay a connection to the client. + * + * Return true to deny the relayed connection. + */ + denyInboundRelayedConnection?(relay: PeerId, remotePeer: PeerId): Promise; + /** + * Used by the address book to filter passed addresses. + * + * Return true to allow storing the passed multiaddr for the passed peer. + */ + filterMultiaddrForPeer?(peer: PeerId, multiaddr: Multiaddr): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.d.ts.map new file mode 100644 index 000000000..e93b02a50 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.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;;;;;OAKG;IACH,2BAA2B,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE9D;;;;;;;;OAQG;IACH,6BAA6B,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAErF;;;;;;;;OAQG;IACH,4BAA4B,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAElF;;;;OAIG;IACH,sBAAsB,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js.map new file mode 100644 index 000000000..6c3f4c6dc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection-gater/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection-gater/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts new file mode 100644 index 000000000..616d938a7 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts @@ -0,0 +1,291 @@ +import type { AbortOptions, Logger } from '../index.js'; +import type { PeerId } from '../peer-id/index.js'; +import type { Multiaddr } from '@multiformats/multiaddr'; +import type { Duplex, Source } from 'it-stream-types'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export interface ConnectionTimeline { + /** + * When the connection was opened + */ + open: number; + /** + * When the MultiaddrConnection was upgraded to a Connection - e.g. the type + * of connection encryption and multiplexing was negotiated. + */ + upgraded?: number; + /** + * When the connection was closed. + */ + close?: number; +} +/** + * Outbound connections are opened by the local node, inbound streams are opened by the remote + */ +export type Direction = 'inbound' | 'outbound'; +export interface StreamTimeline { + /** + * A timestamp of when the stream was opened + */ + open: number; + /** + * A timestamp of when the stream was closed for both reading and writing + */ + close?: number; + /** + * A timestamp of when the stream was closed for reading + */ + closeRead?: number; + /** + * A timestamp of when the stream was closed for writing + */ + closeWrite?: number; + /** + * A timestamp of when the stream was reset + */ + reset?: number; + /** + * A timestamp of when the stream was aborted + */ + abort?: number; +} +/** + * The states a stream can be in + */ +export type StreamStatus = 'open' | 'closing' | 'closed' | 'aborted' | 'reset'; +/** + * The states the readable end of a stream can be in + * + * ready - the readable end is ready for reading + * closing - the readable end is closing + * closed - the readable end has closed + */ +export type ReadStatus = 'ready' | 'closing' | 'closed'; +/** + * The states the writable end of a stream can be in + * + * ready - the writable end is ready for writing + * writing - the writable end is in the process of being written to + * done - the source passed to the `.sink` function yielded all values without error + * closing - the writable end is closing + * closed - the writable end has closed + */ +export type WriteStatus = 'ready' | 'writing' | 'done' | 'closing' | 'closed'; +/** + * A Stream is a data channel between two peers that + * can be written to and read from at both ends. + * + * It may be encrypted and multiplexed depending on the + * configuration of the nodes. + */ +export interface Stream extends Duplex, Source, Promise> { + /** + * Closes the stream for **reading** *and* **writing**. + * + * Any buffered data in the source can still be consumed and the stream will end normally. + * + * This will cause a `CLOSE` message to be sent to the remote, *unless* the sink has already ended. + * + * The sink and the source will return normally. + */ + close(options?: AbortOptions): Promise; + /** + * Closes the stream for **reading**. If iterating over the source of this stream in a `for await of` loop, it will return (exit the loop) after any buffered data has been consumed. + * + * This function is called automatically by the muxer when it receives a `CLOSE` message from the remote. + * + * The source will return normally, the sink will continue to consume. + */ + closeRead(options?: AbortOptions): Promise; + /** + * Closes the stream for **writing**. If iterating over the source of this stream in a `for await of` loop, it will return (exit the loop) after any buffered data has been consumed. + * + * The source will return normally, the sink will continue to consume. + */ + closeWrite(options?: AbortOptions): Promise; + /** + * Closes the stream for **reading** *and* **writing**. This should be called when a *local error* has occurred. + * + * Note, if called without an error any buffered data in the source can still be consumed and the stream will end normally. + * + * This will cause a `RESET` message to be sent to the remote, *unless* the sink has already ended. + * + * The sink will return and the source will throw if an error is passed or return normally if not. + */ + abort(err: Error): void; + /** + * Unique identifier for a stream. Identifiers are not unique across muxers. + */ + id: string; + /** + * Outbound streams are opened by the local node, inbound streams are opened by the remote + */ + direction: Direction; + /** + * Lifecycle times for the stream + */ + timeline: StreamTimeline; + /** + * The protocol negotiated for this stream + */ + protocol?: string; + /** + * User defined stream metadata + */ + metadata: Record; + /** + * The current status of the stream + */ + status: StreamStatus; + /** + * The current status of the readable end of the stream + */ + readStatus: ReadStatus; + /** + * The current status of the writable end of the stream + */ + writeStatus: WriteStatus; + /** + * The stream logger + */ + log: Logger; +} +export interface NewStreamOptions extends AbortOptions { + /** + * If specified, and no handler has been registered with the registrar for the + * successfully negotiated protocol, use this as the max outbound stream limit + * for the protocol + */ + maxOutboundStreams?: number; + /** + * Opt-in to running over a transient connection - one that has time/data limits + * placed on it. + */ + runOnTransientConnection?: boolean; +} +export type ConnectionStatus = 'open' | 'closing' | 'closed'; +/** + * A Connection is a high-level representation of a connection + * to a remote peer that may have been secured by encryption and + * multiplexed, depending on the configuration of the nodes + * between which the connection is made. + */ +export interface Connection { + /** + * The unique identifier for this connection + */ + id: string; + /** + * The address of the remote end of the connection + */ + remoteAddr: Multiaddr; + /** + * The id of the peer at the remote end of the connection + */ + remotePeer: PeerId; + /** + * A list of tags applied to this connection + */ + tags: string[]; + /** + * A list of open streams on this connection + */ + streams: Stream[]; + /** + * Outbound conections are opened by the local node, inbound streams are opened by the remote + */ + direction: Direction; + /** + * Lifecycle times for the connection + */ + timeline: ConnectionTimeline; + /** + * The multiplexer negotiated for this connection + */ + multiplexer?: string; + /** + * The encryption protocol negotiated for this connection + */ + encryption?: string; + /** + * The current status of the connection + */ + status: ConnectionStatus; + /** + * A transient connection is one that is not expected to be open for very long + * or one that cannot transfer very much data, such as one being used as a + * circuit relay connection. Protocols need to explicitly opt-in to being run + * over transient connections. + */ + transient: boolean; + /** + * Create a new stream on this connection and negotiate one of the passed protocols + */ + newStream(protocols: string | string[], options?: NewStreamOptions): Promise; + /** + * Gracefully close the connection. All queued data will be written to the + * underlying transport. + */ + close(options?: AbortOptions): Promise; + /** + * Immediately close the connection, any queued data will be discarded + */ + abort(err: Error): void; + /** + * The connection logger + */ + log: Logger; +} +export declare const symbol: unique symbol; +export declare function isConnection(other: any): other is Connection; +export interface ConnectionProtector { + /** + * Takes a given Connection and creates a private encryption stream + * between its two peers from the PSK the Protector instance was + * created with. + */ + protect(connection: MultiaddrConnection): Promise; +} +export interface MultiaddrConnectionTimeline { + /** + * When the connection was opened + */ + open: number; + /** + * When the MultiaddrConnection was upgraded to a Connection - the type of + * connection encryption and multiplexing was negotiated. + */ + upgraded?: number; + /** + * When the connection was closed. + */ + close?: number; +} +/** + * A MultiaddrConnection is returned by transports after dialing + * a peer. It is a low-level primitive and is the raw connection + * without encryption or stream multiplexing. + */ +export interface MultiaddrConnection extends Duplex> { + /** + * Gracefully close the connection. All queued data will be written to the + * underlying transport. + */ + close(options?: AbortOptions): Promise; + /** + * Immediately close the connection, any queued data will be discarded + */ + abort(err: Error): void; + /** + * The address of the remote end of the connection + */ + remoteAddr: Multiaddr; + /** + * When connection lifecycle events occurred + */ + timeline: MultiaddrConnectionTimeline; + /** + * The multiaddr connection logger + */ + log: Logger; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts.map new file mode 100644 index 000000000..d4f001550 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE9C,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM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tD,wBAAgB,YAAY,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,UAAU,CAE7D;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACvE;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC;IAC9F;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAA;IAErB;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAA;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js new file mode 100644 index 000000000..a87de598e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js @@ -0,0 +1,5 @@ +export const symbol = Symbol.for('@libp2p/connection'); +export function isConnection(other) { + return other != null && Boolean(other[symbol]); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js.map new file mode 100644 index 000000000..f53748e8e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/connection/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AA0RA,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEtD,MAAM,UAAU,YAAY,CAAE,KAAU;IACtC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts new file mode 100644 index 000000000..7f91b4125 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts @@ -0,0 +1,79 @@ +import type { AbortOptions } from '../index.js'; +import type { PeerInfo } from '../peer-info/index.js'; +import type { CID } from 'multiformats/cid'; +/** + * Any object that implements this Symbol as a property should return a + * ContentRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { contentRouting, ContentRouting } from '@libp2p/content-routing' + * + * class MyContentRouter implements ContentRouting { + * get [contentRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export declare const contentRouting: unique symbol; +export interface ContentRouting { + /** + * The implementation of this method should ensure that network peers know the + * caller can provide content that corresponds to the passed CID. + * + * @example + * + * ```js + * // ... + * await contentRouting.provide(cid) + * ``` + */ + provide(cid: CID, options?: AbortOptions): Promise; + /** + * Find the providers of the passed CID. + * + * @example + * + * ```js + * // Iterate over the providers found for the given cid + * for await (const provider of contentRouting.findProviders(cid)) { + * console.log(provider.id, provider.multiaddrs) + * } + * ``` + */ + findProviders(cid: CID, options?: AbortOptions): AsyncIterable; + /** + * Puts a value corresponding to the passed key in a way that can later be + * retrieved by another network peer using the get method. + * + * @example + * + * ```js + * // ... + * const key = '/key' + * const value = uint8ArrayFromString('oh hello there') + * + * await contentRouting.put(key, value) + * ``` + */ + put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise; + /** + * Retrieves a value from the network corresponding to the passed key. + * + * @example + * + * ```js + * // ... + * + * const key = '/key' + * const value = await contentRouting.get(key) + * ``` + */ + get(key: Uint8Array, options?: AbortOptions): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts.map new file mode 100644 index 000000000..1a8bec489 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,eAAwC,CAAA;AAEnE,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExD;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;IAExE;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE9E;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CAClE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js new file mode 100644 index 000000000..8cee13599 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js @@ -0,0 +1,21 @@ +/** + * Any object that implements this Symbol as a property should return a + * ContentRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { contentRouting, ContentRouting } from '@libp2p/content-routing' + * + * class MyContentRouter implements ContentRouting { + * get [contentRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export const contentRouting = Symbol.for('@libp2p/content-routing'); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js.map new file mode 100644 index 000000000..8638ec3cc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/content-routing/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts new file mode 100644 index 000000000..add656329 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts @@ -0,0 +1,37 @@ +/** + * When this error is thrown it means an operation was aborted, + * usually in response to the `abort` event being emitted by an + * AbortSignal. + */ +export declare class AbortError extends Error { + readonly code: string; + readonly type: string; + constructor(message?: string); + static readonly code = "ABORT_ERR"; + static readonly type = "aborted"; +} +export declare class CodeError = Record> extends Error { + readonly code: string; + readonly props: T; + constructor(message: string, code: string, props?: T); +} +export declare class UnexpectedPeerError extends Error { + code: string; + constructor(message?: string); + static readonly code = "ERR_UNEXPECTED_PEER"; +} +export declare class InvalidCryptoExchangeError extends Error { + code: string; + constructor(message?: string); + static readonly code = "ERR_INVALID_CRYPTO_EXCHANGE"; +} +export declare class InvalidCryptoTransmissionError extends Error { + code: string; + constructor(message?: string); + static readonly code = "ERR_INVALID_CRYPTO_TRANSMISSION"; +} +export declare const ERR_TIMEOUT = "ERR_TIMEOUT"; +export declare const ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS"; +export declare const ERR_NOT_FOUND = "ERR_NOT_FOUND"; +export declare const ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE"; +//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts.map new file mode 100644 index 000000000..91e24ca81 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAA;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAA;gBAEf,OAAO,GAAE,MAAoC;IAM1D,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAc;IAElC,MAAM,CAAC,QAAQ,CAAC,IAAI,aAAY;CACjC;AAED,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,KAAK;aAKvE,IAAI,EAAE,MAAM;IAJ9B,SAAgB,KAAK,EAAE,CAAC,CAAA;gBAGtB,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAoB;IAKxC,MAAM,CAAC,QAAQ,CAAC,IAAI,yBAAwB;CAC7C;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAA4B;IAKhD,MAAM,CAAC,QAAQ,CAAC,IAAI,iCAAgC;CACrD;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IAChD,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAgC;IAKpD,MAAM,CAAC,QAAQ,CAAC,IAAI,qCAAoC;CACzD;AAID,eAAO,MAAM,WAAW,gBAAgB,CAAA;AACxC,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,aAAa,kBAAkB,CAAA;AAC5C,eAAO,MAAM,mBAAmB,wBAAwB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js new file mode 100644 index 000000000..cc233bc5d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js @@ -0,0 +1,56 @@ +/** + * When this error is thrown it means an operation was aborted, + * usually in response to the `abort` event being emitted by an + * AbortSignal. + */ +export class AbortError extends Error { + code; + type; + constructor(message = 'The operation was aborted') { + super(message); + this.code = AbortError.code; + this.type = AbortError.type; + } + static code = 'ABORT_ERR'; + static type = 'aborted'; +} +export class CodeError extends Error { + code; + props; + constructor(message, code, props) { + super(message); + this.code = code; + this.name = props?.name ?? 'CodeError'; + this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions + } +} +export class UnexpectedPeerError extends Error { + code; + constructor(message = 'Unexpected Peer') { + super(message); + this.code = UnexpectedPeerError.code; + } + static code = 'ERR_UNEXPECTED_PEER'; +} +export class InvalidCryptoExchangeError extends Error { + code; + constructor(message = 'Invalid crypto exchange') { + super(message); + this.code = InvalidCryptoExchangeError.code; + } + static code = 'ERR_INVALID_CRYPTO_EXCHANGE'; +} +export class InvalidCryptoTransmissionError extends Error { + code; + constructor(message = 'Invalid crypto transmission') { + super(message); + this.code = InvalidCryptoTransmissionError.code; + } + static code = 'ERR_INVALID_CRYPTO_TRANSMISSION'; +} +// Error codes +export const ERR_TIMEOUT = 'ERR_TIMEOUT'; +export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS'; +export const ERR_NOT_FOUND = 'ERR_NOT_FOUND'; +export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE'; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js.map new file mode 100644 index 000000000..f4b3eb815 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnB,IAAI,CAAQ;IACZ,IAAI,CAAQ;IAE5B,YAAa,UAAkB,2BAA2B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IAC7B,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,WAAW,CAAA;IAElC,MAAM,CAAU,IAAI,GAAG,SAAS,CAAA;;AAGlC,MAAM,OAAO,SAAiE,SAAQ,KAAK;IAKvE;IAJF,KAAK,CAAG;IAExB,YACE,OAAe,EACC,IAAY,EAC5B,KAAS;QAET,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,SAAI,GAAJ,IAAI,CAAQ;QAK5B,IAAI,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,WAAW,CAAA;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAO,CAAA,CAAC,oEAAoE;IACpG,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACrC,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,iBAAiB;QACtC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,qBAAqB,CAAA;;AAG9C,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,yBAAyB;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAA;IAC7C,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,6BAA6B,CAAA;;AAGtD,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAChD,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,6BAA6B;QAClD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC,IAAI,CAAA;IACjD,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,iCAAiC,CAAA;;AAG1D,cAAc;AAEd,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts new file mode 100644 index 000000000..d11b54651 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts @@ -0,0 +1,3 @@ +/** Noop for browser compatibility */ +export declare function setMaxListeners(): void; +//# sourceMappingURL=events.browser.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts.map new file mode 100644 index 000000000..de70e7dbb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"events.browser.d.ts","sourceRoot":"","sources":["../../src/events.browser.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,wBAAgB,eAAe,IAAK,IAAI,CAAG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js new file mode 100644 index 000000000..835cf0bbc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js @@ -0,0 +1,3 @@ +/** Noop for browser compatibility */ +export function setMaxListeners() { } +//# sourceMappingURL=events.browser.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js.map new file mode 100644 index 000000000..eb4a1760b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.browser.js","sourceRoot":"","sources":["../../src/events.browser.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,UAAU,eAAe,KAAW,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts new file mode 100644 index 000000000..a825206d1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts @@ -0,0 +1,43 @@ +/// +import { setMaxListeners as nodeSetMaxListeners } from 'events'; +export interface EventCallback { + (evt: EventType): void; +} +export interface EventObject { + handleEvent: EventCallback; +} +export type EventHandler = EventCallback | EventObject; +/** + * Adds types to the EventTarget class. Hopefully this won't be necessary forever. + * + * https://github.com/microsoft/TypeScript/issues/28357 + * https://github.com/microsoft/TypeScript/issues/43477 + * https://github.com/microsoft/TypeScript/issues/299 + * etc + */ +export interface TypedEventTarget> extends EventTarget { + addEventListener(type: K, listener: EventHandler | null, options?: boolean | AddEventListenerOptions): void; + listenerCount(type: string): number; + removeEventListener(type: K, listener?: EventHandler | null, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener?: EventHandler, options?: boolean | EventListenerOptions): void; + safeDispatchEvent(type: keyof EventMap, detail: CustomEventInit): boolean; +} +/** + * An implementation of a typed event target + * etc + */ +export declare class TypedEventEmitter> extends EventTarget implements TypedEventTarget { + #private; + listenerCount(type: string): number; + addEventListener(type: K, listener: EventHandler | null, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener?: EventHandler | null, options?: boolean | EventListenerOptions): void; + dispatchEvent(event: Event): boolean; + safeDispatchEvent(type: keyof EventMap, detail: CustomEventInit): boolean; +} +export declare const CustomEvent: { + new (type: string, eventInitDict?: CustomEventInit | undefined): CustomEvent; + prototype: CustomEvent; +}; +export { TypedEventEmitter as EventEmitter }; +export declare const setMaxListeners: typeof nodeSetMaxListeners; +//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts.map new file mode 100644 index 000000000..2de522a67 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAE/D,MAAM,WAAW,aAAa,CAAC,SAAS;IAAI,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE;AACpE,MAAM,WAAW,WAAW,CAAC,SAAS;IAAI,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;CAAE;AACjF,MAAM,MAAM,YAAY,CAA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,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI;IAiBlJ,mBAAmB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI;IAcnJ,aAAa,CAAE,KAAK,EAAE,KAAK,GAAG,OAAO;IAerC,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,OAAO;CAG1F;AAoBD,eAAO,MAAM,WAAW;;;CAAgD,CAAA;AAGxE,OAAO,EAAE,iBAAiB,IAAI,YAAY,EAAE,CAAA;AAG5C,eAAO,MAAM,eAAe,EAAE,OAAO,mBAMpC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js new file mode 100644 index 000000000..f3dbed6ed --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js @@ -0,0 +1,78 @@ +import { setMaxListeners as nodeSetMaxListeners } from 'events'; +/** + * An implementation of a typed event target + * etc + */ +export class TypedEventEmitter extends EventTarget { + #listeners = new Map(); + listenerCount(type) { + const listeners = this.#listeners.get(type); + if (listeners == null) { + return 0; + } + return listeners.length; + } + addEventListener(type, listener, options) { + super.addEventListener(type, listener, options); + let list = this.#listeners.get(type); + if (list == null) { + list = []; + this.#listeners.set(type, list); + } + list.push({ + callback: listener, + once: (options !== true && options !== false && options?.once) ?? false + }); + } + removeEventListener(type, listener, options) { + super.removeEventListener(type.toString(), listener ?? null, options); + let list = this.#listeners.get(type); + if (list == null) { + return; + } + list = list.filter(({ callback }) => callback !== listener); + this.#listeners.set(type, list); + } + dispatchEvent(event) { + const result = super.dispatchEvent(event); + let list = this.#listeners.get(event.type); + if (list == null) { + return result; + } + list = list.filter(({ once }) => !once); + this.#listeners.set(event.type, list); + return result; + } + safeDispatchEvent(type, detail) { + return this.dispatchEvent(new CustomEvent(type, detail)); + } +} +/** + * CustomEvent is a standard event but it's not supported by node. + * + * Remove this when https://github.com/nodejs/node/issues/40678 is closed. + * + * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent + */ +class CustomEventPolyfill extends Event { + /** Returns any custom data event was created with. Typically used for synthetic events. */ + detail; + constructor(message, data) { + super(message, data); + // @ts-expect-error could be undefined + this.detail = data?.detail; + } +} +export const CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill; +// TODO: remove this in v1 +export { TypedEventEmitter as EventEmitter }; +// create a setMaxListeners that doesn't break browser usage +export const setMaxListeners = (n, ...eventTargets) => { + try { + nodeSetMaxListeners(n, ...eventTargets); + } + catch { + // swallow error, gulp + } +}; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js.map new file mode 100644 index 000000000..ebf34583b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AA+B/D;;;GAGG;AACH,MAAM,OAAO,iBAAwD,SAAQ,WAAW;IACtF,UAAU,GAAG,IAAI,GAAG,EAAmB,CAAA;IAEvC,aAAa,CAAE,IAAY;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC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.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts new file mode 100644 index 000000000..af9364f9a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts @@ -0,0 +1,604 @@ +/** + * @packageDocumentation + * + * Exports a `Libp2p` type for modules to use as a type argument. + * + * @example + * + * ```typescript + * import type { Libp2p } from '@libp2p/interface' + * + * function doSomethingWithLibp2p (node: Libp2p) { + * // ... + * } + * ``` + */ +import type { Connection, NewStreamOptions, Stream } from './connection/index.js'; +import type { ContentRouting } from './content-routing/index.js'; +import type { TypedEventTarget } from './events.js'; +import type { Metrics } from './metrics/index.js'; +import type { PeerId } from './peer-id/index.js'; +import type { PeerInfo } from './peer-info/index.js'; +import type { PeerRouting } from './peer-routing/index.js'; +import type { Address, Peer, PeerStore } from './peer-store/index.js'; +import type { Startable } from './startable.js'; +import type { StreamHandler, StreamHandlerOptions } from './stream-handler/index.js'; +import type { Topology } from './topology/index.js'; +import type { Listener } from './transport/index.js'; +import type { Multiaddr } from '@multiformats/multiaddr'; +/** + * Used by the connection manager to sort addresses into order before dialling + */ +export interface AddressSorter { + (a: Address, b: Address): -1 | 0 | 1; +} +/** + * Event detail emitted when peer data changes + */ +export interface PeerUpdate { + peer: Peer; + previous?: Peer; +} +/** + * Peer data signed by the remote Peer's public key + */ +export interface SignedPeerRecord { + addresses: Multiaddr[]; + seq: bigint; +} +/** + * Data returned from a successful identify response + */ +export interface IdentifyResult { + /** + * The remote Peer's PeerId + */ + peerId: PeerId; + /** + * The unsigned addresses they are listening on. Note - any multiaddrs present + * in the signed peer record should be preferred to the value here. + */ + listenAddrs: Multiaddr[]; + /** + * The protocols the remote peer supports + */ + protocols: string[]; + /** + * The remote protocol version + */ + protocolVersion?: string; + /** + * The remote agent version + */ + agentVersion?: string; + /** + * The public key part of the remote PeerId - this is only useful for older + * RSA-based PeerIds, the more modern Ed25519 and secp256k1 types have the + * public key embedded in them + */ + publicKey?: Uint8Array; + /** + * If set this is the address that the remote peer saw the identify request + * originate from + */ + observedAddr?: Multiaddr; + /** + * If sent by the remote peer this is the deserialized signed peer record + */ + signedPeerRecord?: SignedPeerRecord; + /** + * The connection that the identify protocol ran over + */ + connection: Connection; +} +/** + * Logger component for libp2p + */ +export interface Logger { + (formatter: any, ...args: any[]): void; + error(formatter: any, ...args: any[]): void; + trace(formatter: any, ...args: any[]): void; + enabled: boolean; +} +/** + * Peer logger component for libp2p + */ +export interface ComponentLogger { + forComponent(name: string): Logger; +} +/** + * Once you have a libp2p instance, you can listen to several events it emits, + * so that you can be notified of relevant network events. + * + * Event names are `noun:verb` so the first part is the name of the object + * being acted on and the second is the action. + */ +export interface Libp2pEvents { + /** + * This event is dispatched when a new network peer is discovered. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:discovery', (event) => { + * const peerInfo = event.detail + * // ... + * }) + * ``` + */ + 'peer:discovery': CustomEvent; + /** + * This event will be triggered any time a new peer connects. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:connect', (event) => { + * const peerId = event.detail + * // ... + * }) + * ``` + */ + 'peer:connect': CustomEvent; + /** + * This event will be triggered any time we are disconnected from another peer, regardless of + * the circumstances of that disconnection. If we happen to have multiple connections to a + * peer, this event will **only** be triggered when the last connection is closed. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:disconnect', (event) => { + * const peerId = event.detail + * // ... + * }) + * ``` + */ + 'peer:disconnect': CustomEvent; + /** + * This event is dispatched after a remote peer has successfully responded to the identify + * protocol. Note that for this to be emitted, both peers must have an identify service + * configured. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:identify', (event) => { + * const identifyResult = event.detail + * // ... + * }) + * ``` + */ + 'peer:identify': CustomEvent; + /** + * This event is dispatched when the peer store data for a peer has been + * updated - e.g. their multiaddrs, protocols etc have changed. + * + * If they were previously known to this node, the old peer data will be + * set in the `previous` field. + * + * This may be in response to the identify protocol running, a manual + * update or some other event. + */ + 'peer:update': CustomEvent; + /** + * This event is dispatched when the current node's peer record changes - + * for example a transport started listening on a new address or a new + * protocol handler was registered. + * + * @example + * + * ```js + * libp2p.addEventListener('self:peer:update', (event) => { + * const { peer } = event.detail + * // ... + * }) + * ``` + */ + 'self:peer:update': CustomEvent; + /** + * This event is dispatched when a transport begins listening on a new address + */ + 'transport:listening': CustomEvent; + /** + * This event is dispatched when a transport stops listening on an address + */ + 'transport:close': CustomEvent; + /** + * This event is dispatched when the connection manager has more than the + * configured allowable max connections and has closed some connections to + * bring the node back under the limit. + */ + 'connection:prune': CustomEvent; + /** + * This event notifies listeners when new incoming or outgoing connections + * are opened. + */ + 'connection:open': CustomEvent; + /** + * This event notifies listeners when incoming or outgoing connections are + * closed. + */ + 'connection:close': CustomEvent; + /** + * This event notifies listeners that the node has started + * + * ```js + * libp2p.addEventListener('start', (event) => { + * console.info(libp2p.isStarted()) // true + * }) + * ``` + */ + 'start': CustomEvent>; + /** + * This event notifies listeners that the node has stopped + * + * ```js + * libp2p.addEventListener('stop', (event) => { + * console.info(libp2p.isStarted()) // false + * }) + * ``` + */ + 'stop': CustomEvent>; +} +/** + * A map of user defined services available on the libp2p node via the + * `services` key + * + * @example + * + * ```js + * const node = await createLibp2p({ + * // ...other options + * services: { + * myService: myService({ + * // ...service options + * }) + * } + * }) + * + * // invoke methods on the service + * node.services.myService.anOperation() + * ``` + */ +export type ServiceMap = Record; +export type PendingDialStatus = 'queued' | 'active' | 'error' | 'success'; +/** + * An item in the dial queue + */ +export interface PendingDial { + /** + * A unique identifier for this dial + */ + id: string; + /** + * The current status of the dial + */ + status: PendingDialStatus; + /** + * If known, this is the peer id that libp2p expects to be dialling + */ + peerId?: PeerId; + /** + * The list of multiaddrs that will be dialled. The returned connection will + * use the first address that succeeds, all other dials part of this pending + * dial will be cancelled. + */ + multiaddrs: Multiaddr[]; +} +/** + * Libp2p nodes implement this interface. + */ +export interface Libp2p extends Startable, TypedEventTarget> { + /** + * The PeerId is a unique identifier for a node on the network. + * + * It is the hash of an RSA public key or, for Ed25519 or secp256k1 keys, + * the key itself. + * + * @example + * + * ```js + * console.info(libp2p.peerId) + * // PeerId(12D3Foo...) + * ```` + */ + peerId: PeerId; + /** + * The peer store holds information we know about other peers on the network. + * - multiaddrs, supported protocols, etc. + * + * @example + * + * ```js + * const peer = await libp2p.peerStore.get(peerId) + * console.info(peer) + * // { id: PeerId(12D3Foo...), addresses: [] ... } + * ``` + */ + peerStore: PeerStore; + /** + * The peer routing subsystem allows the user to find peers on the network + * or to find peers close to binary keys. + * + * @example + * + * ```js + * const peerInfo = await libp2p.peerRouting.findPeer(peerId) + * console.info(peerInfo) + * // { id: PeerId(12D3Foo...), multiaddrs: [] ... } + * ``` + * + * @example + * + * ```js + * for await (const peerInfo of libp2p.peerRouting.getClosestPeers(key)) { + * console.info(peerInfo) + * // { id: PeerId(12D3Foo...), multiaddrs: [] ... } + * } + * ``` + */ + peerRouting: PeerRouting; + /** + * The content routing subsystem allows the user to find providers for content, + * let the network know they are providers for content, and get/put values to + * the DHT. + * + * @example + * + * ```js + * for await (const peerInfo of libp2p.contentRouting.findProviders(cid)) { + * console.info(peerInfo) + * // { id: PeerId(12D3Foo...), multiaddrs: [] ... } + * } + * ``` + */ + contentRouting: ContentRouting; + /** + * The metrics subsystem allows recording values to assess the health/performance + * of the running node. + * + * @example + * + * ```js + * const metric = libp2p.metrics.registerMetric({ + * 'my-metric' + * }) + * + * // later + * metric.update(5) + * ``` + */ + metrics?: Metrics; + logger: ComponentLogger; + /** + * Get a deduplicated list of peer advertising multiaddrs by concatenating + * the listen addresses used by transports with any configured + * announce addresses as well as observed addresses reported by peers. + * + * If Announce addrs are specified, configured listen addresses will be + * ignored though observed addresses will still be included. + * + * @example + * + * ```js + * const listenMa = libp2p.getMultiaddrs() + * // [ ] + * ``` + */ + getMultiaddrs(): Multiaddr[]; + /** + * Returns a list of supported protocols + * + * @example + * + * ```js + * const protocols = libp2p.getProtocols() + * // [ '/ipfs/ping/1.0.0', '/ipfs/id/1.0.0' ] + * ``` + */ + getProtocols(): string[]; + /** + * Return a list of all connections this node has open, optionally filtering + * by a PeerId + * + * @example + * + * ```js + * for (const connection of libp2p.getConnections()) { + * console.log(peerId, connection.remoteAddr.toString()) + * // Logs the PeerId string and the observed remote multiaddr of each Connection + * } + * ``` + */ + getConnections(peerId?: PeerId): Connection[]; + /** + * Return the list of dials currently in progress or queued to start + * + * @example + * + * ```js + * for (const pendingDial of libp2p.getDialQueue()) { + * console.log(pendingDial) + * } + * ``` + */ + getDialQueue(): PendingDial[]; + /** + * Return a list of all peers we currently have a connection open to + */ + getPeers(): PeerId[]; + /** + * Dials to the provided peer. If successful, the known metadata of the + * peer will be added to the nodes `peerStore`. + * + * If a PeerId is passed as the first argument, the peer will need to have known multiaddrs for it in the PeerStore. + * + * @example + * + * ```js + * const conn = await libp2p.dial(remotePeerId) + * + * // create a new stream within the connection + * const { stream, protocol } = await conn.newStream(['/echo/1.1.0', '/echo/1.0.0']) + * + * // protocol negotiated: 'echo/1.0.0' means that the other party only supports the older version + * + * // ... + * await conn.close() + * ``` + */ + dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise; + /** + * Dials to the provided peer and tries to handshake with the given protocols in order. + * If successful, the known metadata of the peer will be added to the nodes `peerStore`, + * and the `MuxedStream` will be returned together with the successful negotiated protocol. + * + * @example + * + * ```js + * import { pipe } from 'it-pipe' + * + * const { stream, protocol } = await libp2p.dialProtocol(remotePeerId, protocols) + * + * // Use this new stream like any other duplex stream + * pipe([1, 2, 3], stream, consume) + * ``` + */ + dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise; + /** + * Attempts to gracefully close an open connection to the given peer. If the + * connection is not closed in the grace period, it will be forcefully closed. + * + * An AbortSignal can optionally be passed to control when the connection is + * forcefully closed. + * + * @example + * + * ```js + * await libp2p.hangUp(remotePeerId) + * ``` + */ + hangUp(peer: PeerId | Multiaddr, options?: AbortOptions): Promise; + /** + * Sets up [multistream-select routing](https://github.com/multiformats/multistream-select) of protocols to their application handlers. Whenever a stream is opened on one of the provided protocols, the handler will be called. `handle` must be called in order to register a handler and support for a given protocol. This also informs other peers of the protocols you support. + * + * `libp2p.handle(protocols, handler, options)` + * + * In the event of a new handler for the same protocol being added, the first one is discarded. + * + * @example + * + * ```js + * const handler = ({ connection, stream, protocol }) => { + * // use stream or connection according to the needs + * } + * + * libp2p.handle('/echo/1.0.0', handler, { + * maxInboundStreams: 5, + * maxOutboundStreams: 5 + * }) + * ``` + */ + handle(protocol: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise; + /** + * Removes the handler for each protocol. The protocol + * will no longer be supported on streams. + * + * @example + * + * ```js + * libp2p.unhandle(['/echo/1.0.0']) + * ``` + */ + unhandle(protocols: string[] | string): Promise; + /** + * Register a topology to be informed when peers are encountered that + * support the specified protocol + * + * @example + * + * ```js + * const id = await libp2p.register('/echo/1.0.0', { + * onConnect: (peer, connection) => { + * // handle connect + * }, + * onDisconnect: (peer, connection) => { + * // handle disconnect + * } + * }) + * ``` + */ + register(protocol: string, topology: Topology): Promise; + /** + * Unregister topology to no longer be informed when peers connect or + * disconnect. + * + * @example + * + * ```js + * const id = await libp2p.register(...) + * + * libp2p.unregister(id) + * ``` + */ + unregister(id: string): void; + /** + * Returns the public key for the passed PeerId. If the PeerId is of the 'RSA' type + * this may mean searching the DHT if the key is not present in the KeyStore. + * A set of user defined services + */ + getPublicKey(peer: PeerId, options?: AbortOptions): Promise; + /** + * A set of user defined services + */ + services: T; +} +/** + * Metadata about the current node + */ +export interface NodeInfo { + /** + * The implementation name + */ + name: string; + /** + * The implementation version + */ + version: string; +} +/** + * An object that contains an AbortSignal as + * the optional `signal` property. + * + * @example + * + * ```js + * const controller = new AbortController() + * + * aLongRunningOperation({ + * signal: controller.signal + * }) + * + * // later + * + * controller.abort() + */ +export interface AbortOptions { + signal?: AbortSignal; +} +/** + * An object that contains a Logger as the `log` property. + */ +export interface LoggerOptions { + log: Logger; +} +/** + * Returns a new type with all fields marked optional. + * + * Borrowed from the tsdef module. + */ +export type RecursivePartial = { + [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts.map new file mode 100644 index 000000000..d6f8cb0b8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBA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AE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;KAC/B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjJ,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js new file mode 100644 index 000000000..3da4c634e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js @@ -0,0 +1,17 @@ +/** + * @packageDocumentation + * + * Exports a `Libp2p` type for modules to use as a type argument. + * + * @example + * + * ```typescript + * import type { Libp2p } from '@libp2p/interface' + * + * function doSomethingWithLibp2p (node: Libp2p) { + * // ... + * } + * ``` + */ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js.map new file mode 100644 index 000000000..966767d77 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts new file mode 100644 index 000000000..e37c4a435 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts @@ -0,0 +1,36 @@ +import type { Uint8ArrayList } from 'uint8arraylist'; +export interface PublicKey { + readonly bytes: Uint8Array; + verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise; + marshal(): Uint8Array; + equals(key: PublicKey): boolean; + hash(): Promise; +} +/** + * Generic private key interface + */ +export interface PrivateKey { + readonly public: PublicKey; + readonly bytes: Uint8Array; + sign(data: Uint8Array | Uint8ArrayList): Promise; + marshal(): Uint8Array; + equals(key: PrivateKey): boolean; + hash(): Promise; + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + id(): Promise; + /** + * Exports the password protected key in the format specified. + */ + export(password: string, format?: 'pkcs-8' | string): Promise; +} +export declare const Ed25519 = "Ed25519"; +export declare const RSA = "RSA"; +export declare const secp256k1 = "secp256k1"; +export type KeyType = typeof Ed25519 | typeof RSA | typeof secp256k1; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts.map new file mode 100644 index 000000000..e1e88337b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.d.ts.map @@ -0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uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js new file mode 100644 index 000000000..a5eba7d20 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js @@ -0,0 +1,4 @@ +export const Ed25519 = 'Ed25519'; +export const RSA = 'RSA'; +export const secp256k1 = 'secp256k1'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js.map new file mode 100644 index 000000000..b2aec80e0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/keys/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keys/index.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAA;AAChC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAA;AACxB,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts new file mode 100644 index 000000000..14445fc89 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts @@ -0,0 +1,165 @@ +import type { MultiaddrConnection, Stream, Connection } from '../connection/index.js'; +/** + * Create tracked metrics with these options. Loosely based on the + * interfaces exposed by the prom-client module + */ +export interface MetricOptions { + /** + * Optional label for the metric + */ + label?: string; + /** + * Optional help for the metric + */ + help?: string; +} +/** + * A function that returns a tracked metric which may be expensive + * to calculate so it is only invoked when metrics are being scraped + */ +export type CalculateMetric = (() => T) | (() => Promise); +/** + * Create tracked metrics that are expensive to calculate by passing + * a function that is only invoked when metrics are being scraped + */ +export interface CalculatedMetricOptions extends MetricOptions { + /** + * An optional function invoked to calculate the component metric instead of + * using `.update`, `.increment`, and `.decrement` + */ + calculate: CalculateMetric; +} +/** + * Call this function to stop the timer returned from the `.timer` method + * on the metric + */ +export interface StopTimer { + (): void; +} +/** + * A tracked metric loosely based on the interfaces exposed by the + * prom-client module + */ +export interface Metric { + /** + * Update the stored metric to the passed value + */ + update(value: number): void; + /** + * Increment the metric by the passed value or 1 + */ + increment(value?: number): void; + /** + * Decrement the metric by the passed value or 1 + */ + decrement(value?: number): void; + /** + * Reset this metric to its default value + */ + reset(): void; + /** + * Start a timed metric, call the returned function to + * stop the timer + */ + timer(): StopTimer; +} +/** + * A group of related metrics loosely based on the interfaces exposed by the + * prom-client module + */ +export interface MetricGroup { + /** + * Update the stored metric group to the passed value + */ + update(values: Record): void; + /** + * Increment the metric group keys by the passed number or + * any non-numeric value to increment by 1 + */ + increment(values: Record): void; + /** + * Decrement the metric group keys by the passed number or + * any non-numeric value to decrement by 1 + */ + decrement(values: Record): void; + /** + * Reset the passed key in this metric group to its default value + * or all keys if no key is passed + */ + reset(): void; + /** + * Start a timed metric for the named key in the group, call + * the returned function to stop the timer + */ + timer(key: string): StopTimer; +} +/** + * A tracked counter loosely based on the Counter interface exposed + * by the prom-client module - counters are metrics that only go up + */ +export interface Counter { + /** + * Increment the metric by the passed value or 1 + */ + increment(value?: number): void; + /** + * Reset this metric to its default value + */ + reset(): void; +} +/** + * A group of tracked counters loosely based on the Counter interface + * exposed by the prom-client module - counters are metrics that only + * go up + */ +export interface CounterGroup { + /** + * Increment the metric group keys by the passed number or + * any non-numeric value to increment by 1 + */ + increment(values: Record): void; + /** + * Reset the passed key in this metric group to its default value + * or all keys if no key is passed + */ + reset(): void; +} +/** + * The libp2p metrics tracking object. This interface is only concerned + * with the collection of metrics, please see the individual implementations + * for how to extract metrics for viewing. + */ +export interface Metrics { + /** + * Track a newly opened multiaddr connection + */ + trackMultiaddrConnection(maConn: MultiaddrConnection): void; + /** + * Track a newly opened protocol stream + */ + trackProtocolStream(stream: Stream, connection: Connection): void; + /** + * Register an arbitrary metric. Call this to set help/labels for metrics + * and update/increment/decrement/etc them by calling methods on the returned + * metric object + */ + registerMetric: ((name: string, options?: MetricOptions) => Metric) & ((name: string, options: CalculatedMetricOptions) => void); + /** + * Register a a group of related metrics. Call this to set help/labels for + * groups of related metrics that will be updated with by calling `.update`, + * `.increment` and/or `.decrement` methods on the returned metric group object + */ + registerMetricGroup: ((name: string, options?: MetricOptions) => MetricGroup) & ((name: string, options: CalculatedMetricOptions>) => void); + /** + * Register an arbitrary counter. Call this to set help/labels for counters + * and increment them by calling methods on the returned counter object + */ + registerCounter: ((name: string, options?: MetricOptions) => Counter) & ((name: string, options: CalculatedMetricOptions) => void); + /** + * Register a a group of related counters. Call this to set help/labels for + * groups of related counters that will be updated with by calling the `.increment` + * method on the returned counter group object + */ + registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions>) => void); +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts.map new file mode 100644 index 000000000..eca6dec13 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAErF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KA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I;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;CACrK"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js.map new file mode 100644 index 000000000..71da5f3cf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metrics/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts new file mode 100644 index 000000000..60d82903e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts @@ -0,0 +1,17 @@ +import type { Metrics } from './index.js'; +export interface TrackedMapInit { + name: string; + metrics: Metrics; +} +export interface CreateTrackedMapInit { + /** + * The metric name to use + */ + name: string; + /** + * A metrics implementation + */ + metrics?: Metrics; +} +export declare function trackedMap(config: CreateTrackedMapInit): Map; +//# sourceMappingURL=tracked-map.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts.map new file mode 100644 index 000000000..8a6918f6e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tracked-map.d.ts","sourceRoot":"","sources":["../../../src/metrics/tracked-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,YAAY,CAAA;AAEjD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;CACjB;AAoCD,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAE,CAAC,EAAE,CAAC,EAAG,MAAM,EAAE,oBAAoB,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAW1E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js new file mode 100644 index 000000000..94a79b8db --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js @@ -0,0 +1,38 @@ +class TrackedMap extends Map { + metric; + constructor(init) { + super(); + const { name, metrics } = init; + this.metric = metrics.registerMetric(name); + this.updateComponentMetric(); + } + set(key, value) { + super.set(key, value); + this.updateComponentMetric(); + return this; + } + delete(key) { + const deleted = super.delete(key); + this.updateComponentMetric(); + return deleted; + } + clear() { + super.clear(); + this.updateComponentMetric(); + } + updateComponentMetric() { + this.metric.update(this.size); + } +} +export function trackedMap(config) { + const { name, metrics } = config; + let map; + if (metrics != null) { + map = new TrackedMap({ name, metrics }); + } + else { + map = new Map(); + } + return map; +} +//# sourceMappingURL=tracked-map.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js.map new file mode 100644 index 000000000..5304df11b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/metrics/tracked-map.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tracked-map.js","sourceRoot":"","sources":["../../../src/metrics/tracked-map.ts"],"names":[],"mappings":"AAOA,MAAM,UAAiB,SAAQ,GAAS;IACrB,MAAM,CAAQ;IAE/B,YAAa,IAAoB;QAC/B,KAAK,EAAE,CAAA;QAEP,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAE9B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,CAAC,qBAAqB,EAAE,CAAA;IAC9B,CAAC;IAED,GAAG,CAAE,GAAM,EAAE,KAAQ;QACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACrB,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAE,GAAM;QACZ,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACjC,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC5B,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,KAAK;QACH,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,IAAI,CAAC,qBAAqB,EAAE,CAAA;IAC9B,CAAC;IAEO,qBAAqB;QAC3B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF;AAcD,MAAM,UAAU,UAAU,CAAS,MAA4B;IAC7D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAChC,IAAI,GAAc,CAAA;IAElB,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,GAAG,GAAG,IAAI,UAAU,CAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;KAC9C;SAAM;QACL,GAAG,GAAG,IAAI,GAAG,EAAQ,CAAA;KACtB;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts new file mode 100644 index 000000000..131693e14 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts @@ -0,0 +1,28 @@ +import type { TypedEventTarget } from '../events.js'; +import type { PeerInfo } from '../peer-info/index.js'; +/** + * Any object that implements this Symbol as a property should return a + * PeerDiscovery instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerDiscovery, PeerDiscovery } from '@libp2p/peer-discovery' + * + * class MyPeerDiscoverer implements PeerDiscovery { + * get [peerDiscovery] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export declare const peerDiscovery: unique symbol; +export interface PeerDiscoveryEvents { + 'peer': CustomEvent; +} +export interface PeerDiscovery extends TypedEventTarget { +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts.map new file mode 100644 index 000000000..72a43ce84 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,eAAuC,CAAA;AAEjE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB,CAAC,mBAAmB,CAAC;CAAG"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js new file mode 100644 index 000000000..1da84462f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js @@ -0,0 +1,21 @@ +/** + * Any object that implements this Symbol as a property should return a + * PeerDiscovery instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerDiscovery, PeerDiscovery } from '@libp2p/peer-discovery' + * + * class MyPeerDiscoverer implements PeerDiscovery { + * get [peerDiscovery] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export const peerDiscovery = Symbol.for('@libp2p/peer-discovery'); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js.map new file mode 100644 index 000000000..8409fc6bb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-discovery/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-discovery/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts new file mode 100644 index 000000000..4729313cf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts @@ -0,0 +1,30 @@ +import type { CID } from 'multiformats/cid'; +import type { MultihashDigest } from 'multiformats/hashes/interface'; +export type PeerIdType = 'RSA' | 'Ed25519' | 'secp256k1'; +interface BasePeerId { + readonly type: PeerIdType; + readonly multihash: MultihashDigest; + readonly privateKey?: Uint8Array; + readonly publicKey?: Uint8Array; + toString(): string; + toCID(): CID; + toBytes(): Uint8Array; + equals(other: PeerId | Uint8Array | string): boolean; +} +export interface RSAPeerId extends BasePeerId { + readonly type: 'RSA'; + readonly publicKey?: Uint8Array; +} +export interface Ed25519PeerId extends BasePeerId { + readonly type: 'Ed25519'; + readonly publicKey: Uint8Array; +} +export interface Secp256k1PeerId extends BasePeerId { + readonly type: 'secp256k1'; + readonly publicKey: Uint8Array; +} +export type PeerId = RSAPeerId | Ed25519PeerId | Secp256k1PeerId; +export declare const symbol: unique symbol; +export declare function isPeerId(other: any): other is PeerId; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts.map new file mode 100644 index 000000000..035782f56 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAA;AAExD,UAAU,UAAU;IAClB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAA;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAA;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAA;IAE/B,QAAQ,IAAI,MAAM,CAAA;IAClB,KAAK,IAAI,GAAG,CAAA;IACZ,OAAO,IAAI,UAAU,CAAA;IACrB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAA;CACrD;AAED,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAA;CAChC;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,eAAe,CAAA;AAEhE,eAAO,MAAM,MAAM,eAAgC,CAAA;AAEnD,wBAAgB,QAAQ,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAErD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js new file mode 100644 index 000000000..8ce6a7530 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js @@ -0,0 +1,5 @@ +export const symbol = Symbol.for('@libp2p/peer-id'); +export function isPeerId(other) { + return other != null && Boolean(other[symbol]); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js.map new file mode 100644 index 000000000..9fb0e5bf5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-id/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAEnD,MAAM,UAAU,QAAQ,CAAE,KAAU;IAClC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts new file mode 100644 index 000000000..f87b2dabd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts @@ -0,0 +1,19 @@ +import type { PeerId } from '../peer-id/index.js'; +import type { Multiaddr } from '@multiformats/multiaddr'; +/** + * A `PeerInfo` is a lightweight object that represents a remote peer, it can be + * obtained from peer discovery mechanisms, HTTP RPC endpoints, etc. + * + * @see https://docs.libp2p.io/concepts/fundamentals/peers/#peer-info + */ +export interface PeerInfo { + /** + * The identifier of the remote peer + */ + id: PeerId; + /** + * The multiaddrs a peer is listening on + */ + multiaddrs: Multiaddr[]; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts.map new file mode 100644 index 000000000..ba5bca996 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-info/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js.map new file mode 100644 index 000000000..631a41712 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-info/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-info/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts new file mode 100644 index 000000000..b84d704fe --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts @@ -0,0 +1,51 @@ +import type { AbortOptions } from '../index.js'; +import type { PeerId } from '../peer-id/index.js'; +import type { PeerInfo } from '../peer-info/index.js'; +/** + * Any object that implements this Symbol as a property should return a + * PeerRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerRouting, PeerRouting } from '@libp2p/peer-routing' + * + * class MyPeerRouter implements PeerRouting { + * get [peerRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export declare const peerRouting: unique symbol; +export interface PeerRouting { + /** + * Searches the network for peer info corresponding to the passed peer id. + * + * @example + * + * ```js + * // ... + * const peer = await peerRouting.findPeer(peerId, options) + * ``` + */ + findPeer(peerId: PeerId, options?: AbortOptions): Promise; + /** + * Search the network for peers that are closer to the passed key. Peer + * info should be yielded in ever-increasing closeness to the key. + * + * @example + * + * ```js + * // Iterate over the closest peers found for the given key + * for await (const peer of peerRouting.getClosestPeers(key)) { + * console.log(peer.id, peer.multiaddrs) + * } + * ``` + */ + getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts.map new file mode 100644 index 000000000..8338a85d4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,eAAqC,CAAA;AAE7D,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAEnE;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;CAClF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js new file mode 100644 index 000000000..2338ef809 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js @@ -0,0 +1,21 @@ +/** + * Any object that implements this Symbol as a property should return a + * PeerRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerRouting, PeerRouting } from '@libp2p/peer-routing' + * + * class MyPeerRouter implements PeerRouting { + * get [peerRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export const peerRouting = Symbol.for('@libp2p/peer-routing'); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js.map new file mode 100644 index 000000000..b73d8e812 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-routing/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-routing/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts new file mode 100644 index 000000000..b4c9f081b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts @@ -0,0 +1,247 @@ +import type { PeerId } from '../peer-id/index.js'; +import type { Multiaddr } from '@multiformats/multiaddr'; +/** + * A multiaddr with an optional flag that indicates if its trustworthy + */ +export interface Address { + /** + * Peer multiaddr + */ + multiaddr: Multiaddr; + /** + * Obtained from a signed peer record + */ + isCertified: boolean; +} +/** + * Data stored in the peer store about peers + */ +export interface Peer { + /** + * Peer's peer-id instance + */ + id: PeerId; + /** + * Peer's addresses containing a list of multiaddrs and a isCertified field + * indicating if the address was loaded from a signed peer record or not + */ + addresses: Address[]; + /** + * Peer's supported protocols + */ + protocols: string[]; + /** + * Peer's metadata map + */ + metadata: Map; + /** + * Tags a peer has + */ + tags: Map; + /** + * The last peer record envelope received + */ + peerRecordEnvelope?: Uint8Array; +} +/** + * Peer data used to update the peer store + */ +export interface PeerData { + /** + * Peer's addresses containing its multiaddrs and metadata - multiaddrs + * passed here can be treated as certified if the `isCertifed` value is + * set to true. + * + * If both addresses and multiaddrs are specified they will be merged + * together with entries in addresses taking precedence. + */ + addresses?: Address[]; + /** + * Peer's multiaddrs - any multiaddrs passed here will be treated as + * uncertified. + * + * If both addresses and multiaddrs are specified they will be merged + * together with entries in addresses taking precedence. + */ + multiaddrs?: Multiaddr[]; + /** + * Peer's supported protocols + */ + protocols?: string[]; + /** + * Peer's metadata map. When merging pass undefined as values to remove metadata. + */ + metadata?: Map | Record; + /** + * Peer tags. When merging pass undefined as values to remove tags. + */ + tags?: Map | Record; + /** + * If this Peer has an RSA key, it's public key can be set with this property + */ + publicKey?: Uint8Array; + /** + * The last peer record envelope received + */ + peerRecordEnvelope?: Uint8Array; +} +export interface TagOptions { + /** + * An optional tag value (1-100) + */ + value?: number; + /** + * An optional duration in ms after which the tag will expire + */ + ttl?: number; +} +export interface Tag { + /** + * The tag value + */ + value: number; +} +/** + * A predicate by which to filter lists of peers + */ +export interface PeerQueryFilter { + (peer: Peer): boolean; +} +/** + * A predicate by which to sort lists of peers + */ +export interface PeerQueryOrder { + (a: Peer, b: Peer): -1 | 0 | 1; +} +/** + * A query for getting lists of peers + */ +export interface PeerQuery { + filters?: PeerQueryFilter[]; + orders?: PeerQueryOrder[]; + limit?: number; + offset?: number; +} +export interface PeerStore { + /** + * Loop over every peer - the looping is async because we read from a + * datastore but the peer operation is sync, this is to prevent + * long-lived peer operations causing deadlocks over the datastore + * which can happen if they try to access the peer store during the + * loop + * + * @example + * + * ```js + * await peerStore.forEach(peer => { + * // ... + * }) + * ``` + */ + forEach(fn: (peer: Peer) => void, query?: PeerQuery): Promise; + /** + * Returns all peers in the peer store. + * + * @example + * + * ```js + * for (const peer of await peerStore.all()) { + * // ... + * } + * ``` + */ + all(query?: PeerQuery): Promise; + /** + * Delete all data stored for the passed peer + * + * @example + * + * ```js + * await peerStore.addressBook.set(peerId, multiaddrs) + * await peerStore.addressBook.get(peerId) + * // multiaddrs[] + * + * await peerStore.delete(peerId) + * + * await peerStore.addressBook.get(peerId) + * // [] + * ``` + */ + delete(peerId: PeerId): Promise; + /** + * Returns true if the passed PeerId is in the peer store + * + * @example + * + * ```js + * await peerStore.has(peerId) + * // false + * await peerStore.addressBook.add(peerId, multiaddrs) + * await peerStore.has(peerId) + * // true + * ``` + */ + has(peerId: PeerId): Promise; + /** + * Returns all data stored for the passed PeerId + * + * @example + * + * ```js + * const peer = await peerStore.get(peerId) + * // { .. } + * ``` + */ + get(peerId: PeerId): Promise; + /** + * Adds a peer to the peer store, overwriting any existing data + * + * @example + * + * ```js + * await peerStore.save(peerId, { + * multiaddrs + * }) + * ``` + */ + save(id: PeerId, data: PeerData): Promise; + /** + * Adds a peer to the peer store, overwriting only the passed fields + * + * @example + * + * ```js + * await peerStore.patch(peerId, { + * multiaddrs + * }) + * ``` + */ + patch(id: PeerId, data: PeerData): Promise; + /** + * Adds a peer to the peer store, deeply merging any existing data. + * + * @example + * + * ```js + * await peerStore.merge(peerId, { + * multiaddrs + * }) + * ``` + */ + merge(id: PeerId, data: PeerData): Promise; + /** + * Unmarshal and verify a signed peer record, extract the multiaddrs and + * overwrite the stored addresses for the peer. + * + * Optionally pass an expected PeerId to verify that the peer record was + * signed by that peer. + * + * @example + * + * ```js + * await peerStore.consumePeerRecord(buf, expectedPeer) + * ``` + */ + consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts.map new file mode 100644 index 000000000..9f3180dc1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-store/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IAEpB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;;OAGG;IACH,SAAS,EAAE,OAAO,EAAE,CAAA;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAA;IAEnB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEjC;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAEtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,UAAU,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,EAAE,CAAA;IAErB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,EA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AS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnE;;;;;;;;;;OAUG;IACH,GAAG,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IAEvC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErC;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAErC;;;;;;;;;OASG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhD;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC5E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js.map new file mode 100644 index 000000000..fd95b16db --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-store/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts new file mode 100644 index 000000000..1c91998af --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts @@ -0,0 +1,2 @@ +export declare const KEEP_ALIVE = "keep-alive"; +//# sourceMappingURL=tags.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts.map new file mode 100644 index 000000000..8c5d675b8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/peer-store/tags.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,eAAe,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js new file mode 100644 index 000000000..b4a96ae79 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js @@ -0,0 +1,2 @@ +export const KEEP_ALIVE = 'keep-alive'; +//# sourceMappingURL=tags.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js.map new file mode 100644 index 000000000..be96e0dd0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/peer-store/tags.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../src/peer-store/tags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts new file mode 100644 index 000000000..bc6816f9f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts @@ -0,0 +1,236 @@ +import type { Stream } from '../connection/index.js'; +import type { TypedEventTarget } from '../events.js'; +import type { PeerId } from '../peer-id/index.js'; +import type { Pushable } from 'it-pushable'; +import type { Uint8ArrayList } from 'uint8arraylist'; +/** + * On the producing side: + * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields. + * + * On the consuming side: + * * Enforce the fields to be present, reject otherwise. + * * Propagate only if the fields are valid and signature can be verified, reject otherwise. + */ +export declare const StrictSign = "StrictSign"; +/** + * On the producing side: + * * Build messages without the signature, key, from and seqno fields. + * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty. + * + * On the consuming side: + * * Enforce the fields to be absent, reject otherwise. + * * Propagate only if the fields are absent, reject otherwise. + * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash. + */ +export declare const StrictNoSign = "StrictNoSign"; +export type SignaturePolicy = typeof StrictSign | typeof StrictNoSign; +export interface SignedMessage { + type: 'signed'; + from: PeerId; + topic: string; + data: Uint8Array; + sequenceNumber: bigint; + signature: Uint8Array; + key: Uint8Array; +} +export interface UnsignedMessage { + type: 'unsigned'; + topic: string; + data: Uint8Array; +} +export type Message = SignedMessage | UnsignedMessage; +export interface PubSubRPCMessage { + from?: Uint8Array; + topic?: string; + data?: Uint8Array; + sequenceNumber?: Uint8Array; + signature?: Uint8Array; + key?: Uint8Array; +} +export interface PubSubRPCSubscription { + subscribe?: boolean; + topic?: string; +} +export interface PubSubRPC { + subscriptions: PubSubRPCSubscription[]; + messages: PubSubRPCMessage[]; +} +export interface PeerStreams extends TypedEventTarget { + id: PeerId; + protocol: string; + outboundStream?: Pushable; + inboundStream?: AsyncIterable; + isWritable: boolean; + close(): void; + write(buf: Uint8Array | Uint8ArrayList): void; + attachInboundStream(stream: Stream): AsyncIterable; + attachOutboundStream(stream: Stream): Promise>; +} +export interface PubSubInit { + enabled?: boolean; + multicodecs?: string[]; + /** + * defines how signatures should be handled + */ + globalSignaturePolicy?: SignaturePolicy; + /** + * if can relay messages not subscribed + */ + canRelayMessage?: boolean; + /** + * if publish should emit to self, if subscribed + */ + emitSelf?: boolean; + /** + * handle this many incoming pubsub messages concurrently + */ + messageProcessingConcurrency?: number; + /** + * How many parallel incoming streams to allow on the pubsub protocol per-connection + */ + maxInboundStreams?: number; + /** + * How many parallel outgoing streams to allow on the pubsub protocol per-connection + */ + maxOutboundStreams?: number; +} +interface Subscription { + topic: string; + subscribe: boolean; +} +export interface SubscriptionChangeData { + peerId: PeerId; + subscriptions: Subscription[]; +} +export interface PubSubEvents { + 'subscription-change': CustomEvent; + 'message': CustomEvent; +} +export interface PublishResult { + recipients: PeerId[]; +} +export declare enum TopicValidatorResult { + /** + * The message is considered valid, and it should be delivered and forwarded to the network + */ + Accept = "accept", + /** + * The message is neither delivered nor forwarded to the network + */ + Ignore = "ignore", + /** + * The message is considered invalid, and it should be rejected + */ + Reject = "reject" +} +export interface TopicValidatorFn { + (peer: PeerId, message: Message): TopicValidatorResult | Promise; +} +export interface PubSub = PubSubEvents> extends TypedEventTarget { + /** + * The global signature policy controls whether or not we sill send and receive + * signed or unsigned messages. + * + * Signed messages prevent spoofing message senders and should be preferred to + * using unsigned messages. + */ + globalSignaturePolicy: typeof StrictSign | typeof StrictNoSign; + /** + * A list of multicodecs that contain the pubsub protocol name. + */ + multicodecs: string[]; + /** + * Pubsub routers support message validators per topic, which will validate the message + * before its propagations. They are stored in a map where keys are the topic name and + * values are the validators. + * + * @example + * + * ```js + * const topic = 'topic' + * const validateMessage = (msgTopic, msg) => { + * const input = uint8ArrayToString(msg.data) + * const validInputs = ['a', 'b', 'c'] + * + * if (!validInputs.includes(input)) { + * throw new Error('no valid input received') + * } + * } + * libp2p.pubsub.topicValidators.set(topic, validateMessage) + * ``` + */ + topicValidators: Map; + getPeers(): PeerId[]; + /** + * Gets a list of topics the node is subscribed to. + * + * ```js + * const topics = libp2p.pubsub.getTopics() + * ``` + */ + getTopics(): string[]; + /** + * Subscribes to a pubsub topic. + * + * @example + * + * ```js + * const topic = 'topic' + * const handler = (msg) => { + * if (msg.topic === topic) { + * // msg.data - pubsub data received + * } + * } + * + * libp2p.pubsub.addEventListener('message', handler) + * libp2p.pubsub.subscribe(topic) + * ``` + */ + subscribe(topic: string): void; + /** + * Unsubscribes from a pubsub topic. + * + * @example + * + * ```js + * const topic = 'topic' + * const handler = (msg) => { + * // msg.data - pubsub data received + * } + * + * libp2p.pubsub.removeEventListener(topic handler) + * libp2p.pubsub.unsubscribe(topic) + * ``` + */ + unsubscribe(topic: string): void; + /** + * Gets a list of the PeerIds that are subscribed to one topic. + * + * @example + * + * ```js + * const peerIds = libp2p.pubsub.getSubscribers(topic) + * ``` + */ + getSubscribers(topic: string): PeerId[]; + /** + * Publishes messages to the given topic. + * + * @example + * + * ```js + * const topic = 'topic' + * const data = uint8ArrayFromString('data') + * + * await libp2p.pubsub.publish(topic, data) + * ``` + */ + publish(topic: string, data: Uint8Array): Promise; +} +export interface PeerStreamEvents { + 'stream:inbound': CustomEvent; + 'stream:outbound': CustomEvent; + 'close': CustomEvent; +} +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts.map new file mode 100644 index 000000000..84f61de62 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pubsub/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,eAAe,CAAA;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAA;AAE1C,MAAM,MAAM,eAAe,GAAG,OAAO,UAAU,GAAG,OAAO,YAAY,CAAA;AAErE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,UAAU,CAAA;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G;IACH,WAAW,EAAE,MAAM,EAAE,CAAA;IAErB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAE9C,QAAQ,IAAI,MAAM,EAAE,CAAA;IAEpB;;;;;;OAMG;IACH,SAAS,IAAI,MAAM,EAAE,CAAA;IAErB;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAE9B;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAEhC;;;;;;;;OAQG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAEvC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CACjE;AAED,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;IACpC,iBAAiB,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;IACrC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;CAC5B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js new file mode 100644 index 000000000..7aff5200b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js @@ -0,0 +1,36 @@ +/** + * On the producing side: + * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields. + * + * On the consuming side: + * * Enforce the fields to be present, reject otherwise. + * * Propagate only if the fields are valid and signature can be verified, reject otherwise. + */ +export const StrictSign = 'StrictSign'; +/** + * On the producing side: + * * Build messages without the signature, key, from and seqno fields. + * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty. + * + * On the consuming side: + * * Enforce the fields to be absent, reject otherwise. + * * Propagate only if the fields are absent, reject otherwise. + * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash. + */ +export const StrictNoSign = 'StrictNoSign'; +export var TopicValidatorResult; +(function (TopicValidatorResult) { + /** + * The message is considered valid, and it should be delivered and forwarded to the network + */ + TopicValidatorResult["Accept"] = "accept"; + /** + * The message is neither delivered nor forwarded to the network + */ + TopicValidatorResult["Ignore"] = "ignore"; + /** + * The message is considered invalid, and it should be rejected + */ + TopicValidatorResult["Reject"] = "reject"; +})(TopicValidatorResult || (TopicValidatorResult = {})); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js.map new file mode 100644 index 000000000..140a591b8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/pubsub/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pubsub/index.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA;AAEtC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAA;AA6G1C,MAAM,CAAN,IAAY,oBAaX;AAbD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,yCAAiB,CAAA;IACjB;;OAEG;IACH,yCAAiB,CAAA;IACjB;;OAEG;IACH,yCAAiB,CAAA;AACnB,CAAC,EAbW,oBAAoB,KAApB,oBAAoB,QAa/B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts new file mode 100644 index 000000000..db7f18ab0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts @@ -0,0 +1,33 @@ +import type { PeerId } from '../peer-id/index.js'; +import type { Uint8ArrayList } from 'uint8arraylist'; +/** + * Record is the base implementation of a record that can be used as the payload of a libp2p envelope. + */ +export interface Record { + /** + * signature domain. + */ + domain: string; + /** + * identifier of the type of record + */ + codec: Uint8Array; + /** + * Marshal a record to be used in an envelope. + */ + marshal(): Uint8Array; + /** + * Verifies if the other provided Record is identical to this one. + */ + equals(other: Record): boolean; +} +export interface Envelope { + peerId: PeerId; + payloadType: Uint8Array | Uint8ArrayList; + payload: Uint8Array; + signature: Uint8Array | Uint8ArrayList; + marshal(): Uint8Array; + validate(domain: string): Promise; + equals(other: Envelope): boolean; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts.map new file mode 100644 index 000000000..10a5aebd4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,OAAO,IAAI,UAAU,CAAA;IACrB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,UAAU,GAAG,cAAc,CAAA;IACxC,OAAO,EAAE,UAAU,CAAA;IACnB,SAAS,EAAE,UAAU,GAAG,cAAc,CAAA;IAEtC,OAAO,IAAI,UAAU,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAA;CACjC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js.map new file mode 100644 index 000000000..ce591a24b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/record/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts new file mode 100644 index 000000000..46c4f7072 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts @@ -0,0 +1,45 @@ +/** + * Implemented by components that have a lifecycle + */ +export interface Startable { + /** + * If implemented, this method will be invoked before the start method. + * + * It should not assume any other components have been started. + */ + beforeStart?(): void | Promise; + /** + * This method will be invoked to start the component. + * + * It should not assume that any other components have been started. + */ + start(): void | Promise; + /** + * If implemented, this method will be invoked after the start method. + * + * All other components will have had their start method invoked before this method is called. + */ + afterStart?(): void | Promise; + /** + * If implemented, this method will be invoked before the stop method. + * + * Any other components will still be running when this method is called. + */ + beforeStop?(): void | Promise; + /** + * This method will be invoked to stop the component. + * + * It should not assume any other components are running when it is called. + */ + stop(): void | Promise; + /** + * If implemented, this method will be invoked after the stop method. + * + * All other components will have had their stop method invoked before this method is called. + */ + afterStop?(): void | Promise; +} +export declare function isStartable(obj: any): obj is Startable; +export declare function start(...objs: any[]): Promise; +export declare function stop(...objs: any[]): Promise; +//# sourceMappingURL=startable.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts.map new file mode 100644 index 000000000..b9bc0122e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"startable.d.ts","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,WAAW,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7B;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,IAAI,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;;;OAIG;IACH,SAAS,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnC;AAED,wBAAgB,WAAW,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,SAAS,CAEvD;AAED,wBAAsB,KAAK,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B1D;AAED,wBAAsB,IAAI,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BzD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js new file mode 100644 index 000000000..cd5034ff4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js @@ -0,0 +1,46 @@ +export function isStartable(obj) { + return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function'; +} +export async function start(...objs) { + const startables = []; + for (const obj of objs) { + if (isStartable(obj)) { + startables.push(obj); + } + } + await Promise.all(startables.map(async (s) => { + if (s.beforeStart != null) { + await s.beforeStart(); + } + })); + await Promise.all(startables.map(async (s) => { + await s.start(); + })); + await Promise.all(startables.map(async (s) => { + if (s.afterStart != null) { + await s.afterStart(); + } + })); +} +export async function stop(...objs) { + const startables = []; + for (const obj of objs) { + if (isStartable(obj)) { + startables.push(obj); + } + } + await Promise.all(startables.map(async (s) => { + if (s.beforeStop != null) { + await s.beforeStop(); + } + })); + await Promise.all(startables.map(async (s) => { + await s.stop(); + })); + await Promise.all(startables.map(async (s) => { + if (s.afterStop != null) { + await s.afterStop(); + } + })); +} +//# sourceMappingURL=startable.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js.map new file mode 100644 index 000000000..555a30de1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/startable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"startable.js","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,WAAW,CAAE,GAAQ;IACnC,OAAO,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAA;AACzF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAE,GAAG,IAAW;IACzC,MAAM,UAAU,GAAgB,EAAE,CAAA;IAElC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;YACpB,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACrB;KACF;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,EAAE;YACzB,MAAM,CAAC,CAAC,WAAW,EAAE,CAAA;SACtB;IACH,CAAC,CAAC,CACH,CAAA;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,MAAM,CAAC,CAAC,KAAK,EAAE,CAAA;IACjB,CAAC,CAAC,CACH,CAAA;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,CAAC,UAAU,EAAE,CAAA;SACrB;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAE,GAAG,IAAW;IACxC,MAAM,UAAU,GAAgB,EAAE,CAAA;IAElC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;YACpB,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACrB;KACF;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,CAAC,UAAU,EAAE,CAAA;SACrB;IACH,CAAC,CAAC,CACH,CAAA;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC,CAAC,CACH,CAAA;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,EAAE;YACvB,MAAM,CAAC,CAAC,SAAS,EAAE,CAAA;SACpB;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts new file mode 100644 index 000000000..51b6ffda4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts @@ -0,0 +1,28 @@ +import type { Connection, Stream } from '../connection/index.js'; +export interface IncomingStreamData { + stream: Stream; + connection: Connection; +} +export interface StreamHandler { + (data: IncomingStreamData): void; +} +export interface StreamHandlerOptions { + /** + * How many incoming streams can be open for this protocol at the same time on each connection (default: 32) + */ + maxInboundStreams?: number; + /** + * How many outgoing streams can be open for this protocol at the same time on each connection (default: 64) + */ + maxOutboundStreams?: number; + /** + * Opt-in to running over a transient connection - one that has time/data limits + * placed on it. + */ + runOnTransientConnection?: boolean; +} +export interface StreamHandlerRecord { + handler: StreamHandler; + options: StreamHandlerOptions; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts.map new file mode 100644 index 000000000..4392ba6e7 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream-handler/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,EAAE,oBAAoB,CAAA;CAC9B"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js.map new file mode 100644 index 000000000..e2c9fc866 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-handler/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stream-handler/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts new file mode 100644 index 000000000..59263788e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts @@ -0,0 +1,55 @@ +import type { Direction, Stream } from '../connection/index.js'; +import type { AbortOptions } from '../index.js'; +import type { Duplex } from 'it-stream-types'; +import type { Uint8ArrayList } from 'uint8arraylist'; +export interface StreamMuxerFactory { + /** + * The protocol used to select this muxer during connection opening + */ + protocol: string; + /** + * Creates a new stream muxer to be used with a new connection + */ + createStreamMuxer(init?: StreamMuxerInit): StreamMuxer; +} +/** + * A libp2p stream muxer + */ +export interface StreamMuxer extends Duplex> { + /** + * The protocol used to select this muxer during connection opening + */ + protocol: string; + /** + * A list of streams that are currently open. Closed streams will not be returned. + */ + readonly streams: Stream[]; + /** + * Initiate a new stream with the given name. If no name is + * provided, the id of the stream will be used. + */ + newStream(name?: string): Stream | Promise; + /** + * Close or abort all tracked streams and stop the muxer + */ + close(options?: AbortOptions): Promise; + /** + * Close or abort all tracked streams and stop the muxer + */ + abort(err: Error): void; +} +export interface StreamMuxerInit { + /** + * A callback function invoked every time an incoming stream is opened + */ + onIncomingStream?(stream: Stream): void; + /** + * A callback function invoke every time a stream ends + */ + onStreamEnd?(stream: Stream): void; + /** + * Outbound stream muxers are opened by the local node, inbound stream muxers are opened by the remote + */ + direction?: Direction; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts.map new file mode 100644 index 000000000..bacf54ab3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream-muxer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,iBAAiB,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,CAAA;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA;IAC1B;;;OAGG;IACH,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAElD;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvC;;OAEG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js.map new file mode 100644 index 000000000..c91c5c888 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stream-muxer/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts new file mode 100644 index 000000000..f6a0dd264 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts @@ -0,0 +1,3 @@ +export type AbstractStreamInit = any; +export declare const AbstractStream: any; +//# sourceMappingURL=stream.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts.map new file mode 100644 index 000000000..ead03be2b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/stream-muxer/stream.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAEpC,eAAO,MAAM,cAAc,KAAmB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js new file mode 100644 index 000000000..2e5cad7dc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js @@ -0,0 +1,9 @@ +// TODO: remove this file and the dep-check override in package.json for +// @libp2p/utils when yamux is updated. +// This is a hack to defeat TypeScript trying to inspect the types for +// @libp2p/utils/abstract-stream which depends on this module - making the +// import path only resolvable at runtime breaks the transpile time circular +// dependency +const s = await import('@libp2p/utils' + '/abstract-stream'); +export const AbstractStream = s.AbstractStream; +//# sourceMappingURL=stream.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js.map new file mode 100644 index 000000000..7e2263cff --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/stream-muxer/stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/stream-muxer/stream.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,uCAAuC;AACvC,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,aAAa;AACb,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,eAAe,GAAG,kBAAkB,CAAC,CAAA;AAI5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,cAAc,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts new file mode 100644 index 000000000..75d9f401f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts @@ -0,0 +1,20 @@ +import type { Connection } from '../connection/index.js'; +import type { PeerId } from '../peer-id/index.js'; +export interface Topology { + /** + * If true, invoke `onConnect` for this topology on transient (e.g. short-lived + * and/or data-limited) connections. (default: false) + */ + notifyOnTransient?: boolean; + /** + * Invoked when a new connection is opened to a peer that supports the + * registered protocol + */ + onConnect?(peerId: PeerId, conn: Connection): void; + /** + * Invoked when the last connection to a peer that supports the registered + * protocol closes + */ + onDisconnect?(peerId: PeerId): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts.map new file mode 100644 index 000000000..94dfe1649 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/topology/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B;;;OAGG;IACH,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IAElD;;;OAGG;IACH,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js.map new file mode 100644 index 000000000..94461f908 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/topology/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/topology/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts new file mode 100644 index 000000000..4ba470077 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts @@ -0,0 +1,101 @@ +import type { Connection, MultiaddrConnection } from '../connection/index.js'; +import type { TypedEventTarget } from '../events.js'; +import type { AbortOptions } from '../index.js'; +import type { StreamMuxerFactory } from '../stream-muxer/index.js'; +import type { Multiaddr } from '@multiformats/multiaddr'; +export interface ListenerEvents { + 'connection': CustomEvent; + 'listening': CustomEvent; + 'error': CustomEvent; + 'close': CustomEvent; +} +export interface Listener extends TypedEventTarget { + /** + * Start a listener + */ + listen(multiaddr: Multiaddr): Promise; + /** + * Get listen addresses + */ + getAddrs(): Multiaddr[]; + /** + * Close listener + * + * @returns {Promise} + */ + close(): Promise; +} +export declare const symbol: unique symbol; +export interface ConnectionHandler { + (connection: Connection): void; +} +export interface MultiaddrFilter { + (multiaddrs: Multiaddr[]): Multiaddr[]; +} +export interface CreateListenerOptions { + handler?: ConnectionHandler; + upgrader: Upgrader; +} +export interface DialOptions extends AbortOptions { + upgrader: Upgrader; +} +/** + * A libp2p transport is understood as something that offers a dial and listen interface to establish connections. + */ +export interface Transport { + /** + * Used to identify the transport + */ + [Symbol.toStringTag]: string; + /** + * Used by the isTransport function + */ + [symbol]: true; + /** + * Dial a given multiaddr. + */ + dial(ma: Multiaddr, options: DialOptions): Promise; + /** + * Create transport listeners. + */ + createListener(options: CreateListenerOptions): Listener; + /** + * Takes a list of `Multiaddr`s and returns only valid addresses for the transport + */ + filter: MultiaddrFilter; +} +export declare function isTransport(other: any): other is Transport; +/** + * Enum Transport Manager Fault Tolerance values + */ +export declare enum FaultTolerance { + /** + * should be used for failing in any listen circumstance + */ + FATAL_ALL = 0, + /** + * should be used for not failing when not listening + */ + NO_FATAL = 1 +} +export interface UpgraderOptions { + skipEncryption?: boolean; + skipProtection?: boolean; + muxerFactory?: StreamMuxerFactory; + /** + * The passed MultiaddrConnection has limits place on duration and/or data + * transfer amounts so is not expected to be open for very long. + */ + transient?: boolean; +} +export interface Upgrader { + /** + * Upgrades an outbound connection on `transport.dial`. + */ + upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; + /** + * Upgrades an inbound connection on transport listener. + */ + upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts.map new file mode 100644 index 000000000..5f36d77d9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IACrC,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;IAC3B,OAAO,EAAE,WAAW,CAAA;CACrB;AAED,MAAM,WAAW,QAAS,SAAQ,gBAAgB,CAAC,cAAc,CAAC;IAChE;;OAEG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ACxB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IAEjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAEzF;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACzF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js new file mode 100644 index 000000000..4f7366c60 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js @@ -0,0 +1,19 @@ +export const symbol = Symbol.for('@libp2p/transport'); +export function isTransport(other) { + return other != null && Boolean(other[symbol]); +} +/** + * Enum Transport Manager Fault Tolerance values + */ +export var FaultTolerance; +(function (FaultTolerance) { + /** + * should be used for failing in any listen circumstance + */ + FaultTolerance[FaultTolerance["FATAL_ALL"] = 0] = "FATAL_ALL"; + /** + * should be used for not failing when not listening + */ + FaultTolerance[FaultTolerance["NO_FATAL"] = 1] = "NO_FATAL"; +})(FaultTolerance || (FaultTolerance = {})); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js.map new file mode 100644 index 000000000..b8b5b6122 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/src/transport/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AA6CrD,MAAM,UAAU,WAAW,CAAE,KAAU;IACrC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB;;OAEG;IACH,6DAAa,CAAA;IAEb;;OAEG;IACH,2DAAQ,CAAA;AACV,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts new file mode 100644 index 000000000..775f9d572 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts @@ -0,0 +1,9 @@ +interface Logger { + (): void; + error(): void; + trace(): void; + enabled: boolean; +} +export declare function logger(): Logger; +export {}; +//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts.map new file mode 100644 index 000000000..43c0a375a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../test/fixtures/logger.ts"],"names":[],"mappings":"AACA,UAAU,MAAM;IACd,IAAI,IAAI,CAAA;IACR,KAAK,IAAI,IAAI,CAAA;IACb,KAAK,IAAI,IAAI,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,MAAM,IAAK,MAAM,CAOhC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js new file mode 100644 index 000000000..1944105bc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js @@ -0,0 +1,8 @@ +export function logger() { + const output = () => { }; + output.trace = () => { }; + output.error = () => { }; + output.enabled = false; + return output; +} +//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js.map new file mode 100644 index 000000000..4dbc5b676 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/fixtures/logger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../test/fixtures/logger.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,MAAM;IACpB,MAAM,MAAM,GAAG,GAAS,EAAE,GAAE,CAAC,CAAA;IAC7B,MAAM,CAAC,KAAK,GAAG,GAAS,EAAE,GAAE,CAAC,CAAA;IAC7B,MAAM,CAAC,KAAK,GAAG,GAAS,EAAE,GAAE,CAAC,CAAA;IAC7B,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA;IAEtB,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts new file mode 100644 index 000000000..b05eaa119 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=tracked-map.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts.map new file mode 100644 index 000000000..3f904d6a2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tracked-map.spec.d.ts","sourceRoot":"","sources":["../../../test/metrics/tracked-map.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js new file mode 100644 index 000000000..3a6283baf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js @@ -0,0 +1,68 @@ +import { expect } from 'aegir/chai'; +import { stubInterface } from 'sinon-ts'; +import { trackedMap } from '../../src/metrics/tracked-map.js'; +describe('tracked-map', () => { + let metrics; + beforeEach(() => { + metrics = stubInterface(); + }); + it('should return a map with metrics', () => { + const name = 'system_component_metric'; + const metric = stubInterface(); + // @ts-expect-error the wrong overload is selected + metrics.registerMetric.withArgs(name).returns(metric); + const map = trackedMap({ + name, + metrics + }); + expect(map).to.be.an.instanceOf(Map); + expect(metrics.registerMetric.calledWith(name)).to.be.true(); + }); + it('should return a map without metrics', () => { + const name = 'system_component_metric'; + const metric = stubInterface(); + // @ts-expect-error the wrong overload is selected + metrics.registerMetric.withArgs(name).returns(metric); + const map = trackedMap({ + name + }); + expect(map).to.be.an.instanceOf(Map); + expect(metrics.registerMetric.called).to.be.false(); + }); + it('should track metrics', () => { + const name = 'system_component_metric'; + let value = 0; + let callCount = 0; + const metric = stubInterface(); + // @ts-expect-error the wrong overload is selected + metrics.registerMetric.withArgs(name).returns(metric); + metric.update.callsFake((v) => { + if (typeof v === 'number') { + value = v; + } + callCount++; + }); + const map = trackedMap({ + name, + metrics + }); + expect(map).to.be.an.instanceOf(Map); + expect(callCount).to.equal(1); + map.set('key1', 'value1'); + expect(value).to.equal(1); + expect(callCount).to.equal(2); + map.set('key1', 'value2'); + expect(value).to.equal(1); + expect(callCount).to.equal(3); + map.set('key2', 'value3'); + expect(value).to.equal(2); + expect(callCount).to.equal(4); + map.delete('key2'); + expect(value).to.equal(1); + expect(callCount).to.equal(5); + map.clear(); + expect(value).to.equal(0); + expect(callCount).to.equal(6); + }); +}); +//# sourceMappingURL=tracked-map.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js.map new file mode 100644 index 000000000..520317b7f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/test/metrics/tracked-map.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tracked-map.spec.js","sourceRoot":"","sources":["../../../test/metrics/tracked-map.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAI7D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,OAAsC,CAAA;IAE1C,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,aAAa,EAAW,CAAA;IACpC,CAA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CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE7B,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAElB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACzB,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE7B,GAAG,CAAC,KAAK,EAAE,CAAA;QAEX,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACzB,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/tsconfig.tsbuildinfo new file mode 100644 index 000000000..66240b655 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/errors.ts","../src/events.browser.ts","../src/events.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../src/peer-id/index.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../src/connection/index.ts","../src/peer-info/index.ts","../src/content-routing/index.ts","../src/metrics/index.ts","../src/peer-routing/index.ts","../src/peer-store/index.ts","../src/startable.ts","../src/stream-handler/index.ts","../src/topology/index.ts","../src/stream-muxer/index.ts","../src/transport/index.ts","../src/index.ts","../src/connection-encrypter/index.ts","../src/connection-gater/index.ts","../src/keys/index.ts","../src/metrics/tracked-map.ts","../src/peer-discovery/index.ts","../src/peer-store/tags.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../src/pubsub/index.ts","../src/record/index.ts","../src/stream-muxer/stream.ts","../test/fixtures/logger.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/sinon-ts/dist/src/index.d.ts","../test/metrics/tracked-map.spec.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"efbf6ff74068742873e01925eabea6649f84e34070353bf45e9f1b616caeedb7","signature":"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363"},{"version":"9f89767218029758d8178852364c071669a78912f952e4beefe38962ed7865e3","signature":"14c7b2047585d90a515507e12ecdeeb0f51899aa24e8651aaebbcf3f56fcd9d4"},{"version":"3490f44c846d8dcfd3fe600de9460e88895649d937bcf219f7bf6e9b3fd7aadf","signature":"b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e",{"version":"eb0cdbcd3b2b39174f1bfce952f589aa0bce4c732cb9f31ff09da78f75666b2a","signature":"3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a"},"5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d",{"version":"c122126e12a3e954bbd372b04bff3cc2ae5c316f47e7e782a0a25e34af6e3ca4","signature":"eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9"},{"version":"cc3b8ae48e2075e94dd1ee37fc1a8b8b55793a110528467475dae7f55175a422","signature":"99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2"},{"version":"66823ee7431a13b8cc0c6b7b835440d04d6327a27f8804d5d0bb29abaa77d7f0","signature":"d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d"},{"version":"9e2cd8c2988e1b9a45d405ecae3d9aa50ae6204108565a5ef879eaa20411851f","signature":"8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373"},{"version":"c907c733516f60d89aa7f11ecaf9ee6684a7360903c3ed6de2959096c5880104","signature":"650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34"},{"version":"0b74dc15435ee53a083bd3e0fc867e76ba2efbcdc575e176e9b16b16eef18249","signature":"a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0"},{"version":"46f6407e5fdbbd6e2fdd45d0ebcd8150a444cea62e130cc033c651bddb7e7018","signature":"230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad"},{"version":"3f83da3da12f3540c1fc84329bf86a7e83cdcaefe7ad74edaa0c108620f1f9f0","signature":"85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1"},{"version":"44bb7e682a6d36cfe86722cfe6aed59eeebfbf388a9142c00cd4507c75883a55","signature":"d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114"},{"version":"371dbe1e1f11ed2c5f0ba77fff1cdedfadcea39f23194e971eeacdf8da63ea27","signature":"1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433"},{"version":"578c54e6f4a6ed7df77a9a1bdf6b914785065430135806342580d2bea16036b3","signature":"6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967"},{"version":"e1eb8c4811b6c18c50395f49507194009c3d37a6e2c9a5e8acd91253d75d76c1","signature":"a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1"},{"version":"73d2478959e9cef2394e08f2fe40aa0308f842b0e7fe5951fb7cd8b38154fe93","signature":"f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3"},{"version":"3eecdcdce825f8a6a82e3f3a2f301bb76ca7d217822c88de96780d64367b9d52","signature":"7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596"},{"version":"af874cd18aa94dac5c5c153032abf09f1da05cbbaf63b0eb6dd95e72cf74b8c0","signature":"b8f44b2f7459b20574c73911097dbed93e55e455cd53e9b3a2a7ff5b8c456cd8"},{"version":"951eb576b38955430ebd4bcccd9f1120191f91e5bde39029d92b5ee283d2036d","signature":"4dd9ae44b5db6481b9e4b97d73a11c70bc73b9872fcbe7afd294ac144524327a"},{"version":"1d5bb57544a6b491098350373863450a103efac1deacbb49faefe561457ce390","signature":"40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30"},{"version":"57226d144c168e241546aa3429142043a714b227a09ec79934bae7c4dbeca693","signature":"55e5a976b594dc02f054860fb59a5299872a5b3c8c90e96733a5c9c9d4ed1fb8"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979",{"version":"15cb739a62e868608e89372187f7100f152973441ab7138c835abc27b5345038","signature":"03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867"},{"version":"84b36018faf0cbefa9e7db09ff7da15e61b90d2627a204b504abbbf964aabfbb","signature":"cdebdc5861de7a07ddfbd6740a7ad3415068522e19a82bc652ae313c76e4f83d"},{"version":"e29562bde66c308332dfecf28e6cb5ff833590683be390d1237c13aedeff2399","signature":"37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484"},{"version":"ca13cbb01ad54db99464c04875cc7559e7f5a001545bea2c23a60a3cbfc45534","signature":"546a314abad90439917304f592bf9944f2d75f4be52e3fda9a8e9cb5603cf9b6"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","8d16e3ff29dd0650435766702b01c2f7e9d1f289a48fcbf8e93687d6ecf33f26",{"version":"032afc396dce690807e0af57698c84ef4bc8e78f9b9fe7463761326603c5a3a1","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[[61,63],69,[75,92],[94,97],108],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[72,188],[70,71,188],[158,161,187,188,195,196,197,198],[98,188],[188],[188,200],[188,195],[158,188,195],[188,220],[188,208,210,211,212,213,214,215,216,217,218,219,220],[188,208,209,211,212,213,214,215,216,217,218,219,220],[188,209,210,211,212,213,214,215,216,217,218,219,220],[188,208,209,210,212,213,214,215,216,217,218,219,220],[188,208,209,210,211,213,214,215,216,217,218,219,220],[188,208,209,210,211,212,214,215,216,217,218,219,220],[188,208,209,210,211,212,213,215,216,217,218,219,220],[188,208,209,210,211,212,213,214,216,217,218,219,220],[188,208,209,210,211,212,213,214,215,217,218,219,220],[188,208,209,210,211,212,213,214,215,216,218,219,220],[188,208,209,210,211,212,213,214,215,216,217,219,220],[188,208,209,210,211,212,213,214,215,216,217,218,220],[188,208,209,210,211,212,213,214,215,216,217,218,219],[188,242],[188,227],[188,231,232,233],[188,230],[188,232],[188,207,228,229,234,237,239,240,241],[188,229,235,236,242],[188,235,238],[188,229,230,235,242],[188,229,242],[188,244],[188,223,224,225,226],[152,158,188,195,202],[109,188],[145,188],[146,151,179,188],[147,158,159,166,176,187,188],[147,148,158,166,188],[149,188],[150,151,159,167,188],[151,176,184,188],[152,154,158,166,188],[153,188],[154,155,188],[158,188],[156,158,188],[145,158,188],[158,159,160,176,187,188],[158,159,160,173,176,179,188],[143,188,192],[154,158,161,166,176,187,188],[158,159,161,162,166,176,184,187,188],[161,163,176,184,187,188],[109,110,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194],[158,164,188],[165,187,188,192],[154,158,166,176,188],[167,188],[168,188],[145,169,188],[170,186,188,192],[171,188],[172,188],[158,173,174,188],[173,175,188,190],[146,158,176,177,178,179,188],[146,176,178,188],[176,177,188],[179,188],[180,188],[145,176,188],[158,182,183,188],[182,183,188],[151,166,176,184,188],[185,188],[166,186,188],[146,161,172,187,188],[151,188],[176,188,189],[165,188,190],[188,191],[146,151,158,160,169,176,187,188,190,192],[176,188,193],[161,176,188,195],[188,253,292],[188,253,277,292],[188,292],[188,253],[188,253,278,292],[188,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291],[188,278,292],[98,106,188],[105,188],[158,161,163,176,184,187,188,193,195],[188,299],[158,176,188,195],[98,99,100,101,102,103,188],[98,99,188],[67,68,188],[67,188],[64,65,66,188],[106,188],[120,124,187,188],[120,176,187,188],[115,188],[117,120,184,187,188],[166,184,188],[115,188,195],[117,120,166,187,188],[112,113,116,119,146,158,176,187,188],[112,118,188],[116,120,146,179,187,188,195],[146,188,195],[136,146,188,195],[114,115,188,195],[120,188],[114,115,116,117,118,119,120,121,122,124,125,126,127,128,129,130,131,132,133,134,135,137,138,139,140,141,142,188],[120,127,128,188],[118,120,128,129,188],[119,188],[112,115,120,188],[120,124,128,129,188],[124,188],[118,120,123,187,188],[112,117,118,120,124,127,188],[146,176,188],[115,120,136,146,188,192,195],[69,73,74,75,188],[69,72,75,188],[69,72,73,74,86,188],[68,76,86,188],[63,69,72,75,76,77,78,79,80,81,82,83,85,188],[74,188],[75,188],[78,188],[63,76,188],[66,68,188],[69,72,188],[69,76,86,188],[63,69,74,75,93,188],[69,74,188],[73,74,75,86,188],[69,75,188],[63,72,75,84,86,188],[78,90,104,106,107,188],[69,73,74,75],[69,72,75],[69,72,73,74,86],[68,76,86],[158],[63,69,72,75,76,77,78,79,80,81,82,83,85],[74],[75],[78],[63,76],[66,68],[69,72],[69,76,86],[63,69,74,75,93],[69,74],[73,74,75,86],[69,75],[63,72,75,84,86]],"referencedMap":[[71,1],[72,2],[70,1],[199,3],[99,4],[103,4],[101,4],[98,5],[201,6],[202,7],[197,5],[203,5],[204,5],[205,5],[206,8],[207,5],[221,9],[222,9],[209,10],[210,11],[208,12],[211,13],[212,14],[213,15],[214,16],[215,17],[216,18],[217,19],[218,20],[219,21],[220,22],[243,23],[228,24],[234,25],[232,5],[231,26],[233,27],[242,28],[237,29],[239,30],[240,31],[241,32],[235,5],[236,32],[238,32],[230,32],[229,5],[245,33],[224,5],[223,5],[226,24],[227,34],[225,24],[246,5],[247,5],[248,5],[200,5],[249,35],[109,36],[110,36],[145,37],[146,38],[147,39],[148,40],[149,41],[150,42],[151,43],[152,44],[153,45],[154,46],[155,46],[157,47],[156,48],[158,49],[159,50],[160,51],[144,52],[194,5],[161,53],[162,54],[163,55],[195,56],[164,57],[165,58],[166,59],[167,60],[168,61],[169,62],[170,63],[171,64],[172,65],[173,66],[174,66],[175,67],[176,68],[178,69],[177,70],[179,71],[180,72],[181,73],[182,74],[183,75],[184,76],[185,77],[186,78],[187,79],[188,80],[189,81],[190,82],[191,83],[192,84],[193,85],[250,5],[251,5],[198,86],[252,5],[277,87],[278,88],[253,89],[256,89],[275,87],[276,87],[266,87],[265,90],[263,87],[258,87],[271,87],[269,87],[273,87],[257,87],[270,87],[274,87],[259,87],[260,87],[272,87],[254,87],[261,87],[262,87],[264,87],[268,87],[279,91],[267,87],[255,87],[292,92],[291,5],[286,91],[288,93],[287,91],[280,91],[281,91],[283,91],[285,91],[289,93],[290,93],[282,93],[284,93],[293,94],[106,95],[105,5],[294,5],[295,5],[244,5],[296,5],[297,96],[298,7],[299,5],[300,97],[301,98],[104,99],[111,5],[102,4],[100,100],[93,5],[73,5],[196,47],[64,5],[65,101],[68,102],[66,5],[67,103],[107,104],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[74,5],[127,105],[134,106],[126,105],[141,107],[118,108],[117,109],[140,7],[135,110],[138,111],[120,112],[119,113],[115,114],[114,115],[137,116],[116,117],[121,118],[122,5],[125,118],[112,5],[143,119],[142,118],[129,120],[130,121],[132,122],[128,123],[131,124],[136,7],[123,125],[124,126],[133,127],[113,128],[139,129],[87,130],[88,131],[75,132],[77,133],[61,5],[62,5],[63,47],[86,134],[89,135],[78,136],[90,137],[91,138],[69,139],[76,140],[79,141],[80,140],[92,5],[94,142],[95,143],[81,5],[82,136],[84,144],[96,5],[83,145],[85,146],[97,5],[108,147]],"exportedModulesMap":[[71,1],[72,2],[70,1],[199,3],[99,4],[103,4],[101,4],[98,5],[201,6],[202,7],[197,5],[203,5],[204,5],[205,5],[206,8],[207,5],[221,9],[222,9],[209,10],[210,11],[208,12],[211,13],[212,14],[213,15],[214,16],[215,17],[216,18],[217,19],[218,20],[219,21],[220,22],[243,23],[228,24],[234,25],[232,5],[231,26],[233,27],[242,28],[237,29],[239,30],[240,31],[241,32],[235,5],[236,32],[238,32],[230,32],[229,5],[245,33],[224,5],[223,5],[226,24],[227,34],[225,24],[246,5],[247,5],[248,5],[200,5],[249,35],[109,36],[110,36],[145,37],[146,38],[147,39],[148,40],[149,41],[150,42],[151,43],[152,44],[153,45],[154,46],[155,46],[157,47],[156,48],[158,49],[159,50],[160,51],[144,52],[194,5],[161,53],[162,54],[163,55],[195,56],[164,57],[165,58],[166,59],[167,60],[168,61],[169,62],[170,63],[171,64],[172,65],[173,66],[174,66],[175,67],[176,68],[178,69],[177,70],[179,71],[180,72],[181,73],[182,74],[183,75],[184,76],[185,77],[186,78],[187,79],[188,80],[189,81],[190,82],[191,83],[192,84],[193,85],[250,5],[251,5],[198,86],[252,5],[277,87],[278,88],[253,89],[256,89],[275,87],[276,87],[266,87],[265,90],[263,87],[258,87],[271,87],[269,87],[273,87],[257,87],[270,87],[274,87],[259,87],[260,87],[272,87],[254,87],[261,87],[262,87],[264,87],[268,87],[279,91],[267,87],[255,87],[292,92],[291,5],[286,91],[288,93],[287,91],[280,91],[281,91],[283,91],[285,91],[289,93],[290,93],[282,93],[284,93],[293,94],[106,95],[105,5],[294,5],[295,5],[244,5],[296,5],[297,96],[298,7],[299,5],[300,97],[301,98],[104,99],[111,5],[102,4],[100,100],[93,5],[73,5],[196,47],[64,5],[65,101],[68,102],[66,5],[67,103],[107,104],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[74,5],[127,105],[134,106],[126,105],[141,107],[118,108],[117,109],[140,7],[135,110],[138,111],[120,112],[119,113],[115,114],[114,115],[137,116],[116,117],[121,118],[122,5],[125,118],[112,5],[143,119],[142,118],[129,120],[130,121],[132,122],[128,123],[131,124],[136,7],[123,125],[124,126],[133,127],[113,128],[139,129],[87,148],[88,149],[75,150],[77,151],[63,152],[86,153],[89,154],[78,155],[90,156],[91,157],[69,158],[76,159],[79,160],[80,159],[94,161],[95,162],[82,155],[84,163],[83,164],[85,165]],"semanticDiagnosticsPerFile":[71,72,70,199,99,103,101,98,201,202,197,203,204,205,206,207,221,222,209,210,208,211,212,213,214,215,216,217,218,219,220,243,228,234,232,231,233,242,237,239,240,241,235,236,238,230,229,245,224,223,226,227,225,246,247,248,200,249,109,110,145,146,147,148,149,150,151,152,153,154,155,157,156,158,159,160,144,194,161,162,163,195,164,165,166,167,168,169,170,171,172,173,174,175,176,178,177,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,250,251,198,252,277,278,253,256,275,276,266,265,263,258,271,269,273,257,270,274,259,260,272,254,261,262,264,268,279,267,255,292,291,286,288,287,280,281,283,285,289,290,282,284,293,106,105,294,295,244,296,297,298,299,300,301,104,111,102,100,93,73,196,64,65,68,66,67,107,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,74,127,134,126,141,118,117,140,135,138,120,119,115,114,137,116,121,122,125,112,143,142,129,130,132,128,131,136,123,124,133,113,139,87,88,75,77,61,62,63,86,89,78,90,91,69,76,79,80,92,94,95,81,82,84,96,83,85,97,108],"latestChangedDtsFile":"./src/keys/index.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/package.json new file mode 100644 index 000000000..b3428dd6a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/package.json @@ -0,0 +1,170 @@ +{ + "name": "@libp2p/interface", + "version": "0.1.6", + "description": "The interface implemented by a libp2p node", + "license": "Apache-2.0 OR MIT", + "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/libp2p/js-libp2p.git" + }, + "bugs": { + "url": "https://github.com/libp2p/js-libp2p/issues" + }, + "keywords": [ + "interface", + "libp2p" + ], + "type": "module", + "types": "./dist/src/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ], + "src/*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ] + } + }, + "files": [ + "src", + "dist", + "!dist/test", + "!**/*.tsbuildinfo" + ], + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "import": "./dist/src/index.js" + }, + "./connection": { + "types": "./dist/src/connection/index.d.ts", + "import": "./dist/src/connection/index.js" + }, + "./connection-encrypter": { + "types": "./dist/src/connection-encrypter/index.d.ts", + "import": "./dist/src/connection-encrypter/index.js" + }, + "./connection-gater": { + "types": "./dist/src/connection-gater/index.d.ts", + "import": "./dist/src/connection-gater/index.js" + }, + "./content-routing": { + "types": "./dist/src/content-routing/index.d.ts", + "import": "./dist/src/content-routing/index.js" + }, + "./errors": { + "types": "./dist/src/errors.d.ts", + "import": "./dist/src/errors.js" + }, + "./events": { + "types": "./dist/src/events.d.ts", + "import": "./dist/src/events.js" + }, + "./keychain": { + "types": "./dist/src/keychain/index.d.ts", + "import": "./dist/src/keychain/index.js" + }, + "./keys": { + "types": "./dist/src/keys/index.d.ts", + "import": "./dist/src/keys/index.js" + }, + "./metrics": { + "types": "./dist/src/metrics/index.d.ts", + "import": "./dist/src/metrics/index.js" + }, + "./metrics/tracked-map": { + "types": "./dist/src/metrics/tracked-map.d.ts", + "import": "./dist/src/metrics/tracked-map.js" + }, + "./peer-discovery": { + "types": "./dist/src/peer-discovery/index.d.ts", + "import": "./dist/src/peer-discovery/index.js" + }, + "./peer-id": { + "types": "./dist/src/peer-id/index.d.ts", + "import": "./dist/src/peer-id/index.js" + }, + "./peer-info": { + "types": "./dist/src/peer-info/index.d.ts", + "import": "./dist/src/peer-info/index.js" + }, + "./peer-routing": { + "types": "./dist/src/peer-routing/index.d.ts", + "import": "./dist/src/peer-routing/index.js" + }, + "./peer-store": { + "types": "./dist/src/peer-store/index.d.ts", + "import": "./dist/src/peer-store/index.js" + }, + "./peer-store/tags": { + "types": "./dist/src/peer-store/tags.d.ts", + "import": "./dist/src/peer-store/tags.js" + }, + "./pubsub": { + "types": "./dist/src/pubsub/index.d.ts", + "import": "./dist/src/pubsub/index.js" + }, + "./record": { + "types": "./dist/src/record/index.d.ts", + "import": "./dist/src/record/index.js" + }, + "./startable": { + "types": "./dist/src/startable.d.ts", + "import": "./dist/src/startable.js" + }, + "./stream-handler": { + "types": "./dist/src/stream-handler/index.d.ts", + "import": "./dist/src/stream-handler/index.js" + }, + "./stream-muxer": { + "types": "./dist/src/stream-muxer/index.d.ts", + "import": "./dist/src/stream-muxer/index.js" + }, + "./stream-muxer/stream": { + "types": "./dist/src/stream-muxer/stream.d.ts", + "import": "./dist/src/stream-muxer/stream.js" + }, + "./transport": { + "types": "./dist/src/transport/index.d.ts", + "import": "./dist/src/transport/index.js" + } + }, + "eslintConfig": { + "extends": "ipfs", + "parserOptions": { + "project": true, + "sourceType": "module" + } + }, + "scripts": { + "clean": "aegir clean", + "lint": "aegir lint", + "dep-check": "aegir dep-check -i @libp2p/utils", + "build": "aegir build", + "test": "aegir test", + "test:chrome": "aegir test -t browser --cov", + "test:chrome-webworker": "aegir test -t webworker", + "test:firefox": "aegir test -t browser -- --browser firefox", + "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", + "test:node": "aegir test -t node --cov", + "test:electron-main": "aegir test -t electron-main" + }, + "dependencies": { + "@multiformats/multiaddr": "^12.1.10", + "it-pushable": "^3.2.1", + "it-stream-types": "^2.0.1", + "multiformats": "^12.1.3", + "uint8arraylist": "^2.4.3" + }, + "browser": { + "events": "./dist/src/events.browser.js" + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-encrypter/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-encrypter/index.ts new file mode 100644 index 000000000..8b2aac472 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-encrypter/index.ts @@ -0,0 +1,32 @@ +import type { MultiaddrConnection } from '../connection/index.js' +import type { PeerId } from '../peer-id/index.js' +import type { Duplex } from 'it-stream-types' +import type { Uint8ArrayList } from 'uint8arraylist' + +/** + * A libp2p connection encrypter module must be compliant to this interface + * to ensure all exchanged data between two peers is encrypted. + */ +export interface ConnectionEncrypter { + protocol: string + + /** + * Encrypt outgoing data to the remote party. If the remote PeerId is known, + * pass it for extra verification, otherwise it will be determined during + * the handshake. + */ + secureOutbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> + + /** + * Decrypt incoming data. If the remote PeerId is known, + * pass it for extra verification, otherwise it will be determined during + * the handshake + */ + secureInbound > = MultiaddrConnection> (localPeer: PeerId, connection: Stream, remotePeer?: PeerId): Promise> +} + +export interface SecuredConnection { + conn: Stream + remoteExtensions?: Extension + remotePeer: PeerId +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-gater/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-gater/index.ts new file mode 100644 index 000000000..1b59de4f3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection-gater/index.ts @@ -0,0 +1,128 @@ +import type { MultiaddrConnection } from '../connection/index.js' +import type { PeerId } from '../peer-id/index.js' +import type { Multiaddr } from '@multiformats/multiaddr' + +export interface ConnectionGater { + /** + * denyDialPeer tests whether we're permitted to Dial the + * specified peer. + * + * This is called by the dialer.connectToPeer implementation before + * dialling a peer. + * + * Return true to prevent dialing the passed peer. + */ + denyDialPeer?(peerId: PeerId): Promise + + /** + * denyDialMultiaddr tests whether we're permitted to dial the specified + * multiaddr. + * + * This is called by the connection manager - if the peer id of the remote + * node is known it will be present in the multiaddr. + * + * Return true to prevent dialing the passed peer on the passed multiaddr. + */ + denyDialMultiaddr?(multiaddr: Multiaddr): Promise + + /** + * denyInboundConnection tests whether an incipient inbound connection is allowed. + * + * This is called by the upgrader, or by the transport directly (e.g. QUIC, + * Bluetooth), straight after it has accepted a connection from its socket. + * + * Return true to deny the incoming passed connection. + */ + denyInboundConnection?(maConn: MultiaddrConnection): Promise + + /** + * denyOutboundConnection tests whether an incipient outbound connection is allowed. + * + * This is called by the upgrader, or by the transport directly (e.g. QUIC, + * Bluetooth), straight after it has created a connection with its socket. + * + * Return true to deny the incoming passed connection. + */ + denyOutboundConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise + + /** + * denyInboundEncryptedConnection tests whether a given connection, now encrypted, + * is allowed. + * + * This is called by the upgrader, after it has performed the security + * handshake, and before it negotiates the muxer, or by the directly by the + * transport, at the exact same checkpoint. + * + * Return true to deny the passed secured connection. + */ + denyInboundEncryptedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise + + /** + * denyOutboundEncryptedConnection tests whether a given connection, now encrypted, + * is allowed. + * + * This is called by the upgrader, after it has performed the security + * handshake, and before it negotiates the muxer, or by the directly by the + * transport, at the exact same checkpoint. + * + * Return true to deny the passed secured connection. + */ + denyOutboundEncryptedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise + + /** + * denyInboundUpgradedConnection tests whether a fully capable connection is allowed. + * + * This is called after encryption has been negotiated and the connection has been + * multiplexed, if a multiplexer is configured. + * + * Return true to deny the passed upgraded connection. + */ + denyInboundUpgradedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise + + /** + * denyOutboundUpgradedConnection tests whether a fully capable connection is allowed. + * + * This is called after encryption has been negotiated and the connection has been + * multiplexed, if a multiplexer is configured. + * + * Return true to deny the passed upgraded connection. + */ + denyOutboundUpgradedConnection?(peerId: PeerId, maConn: MultiaddrConnection): Promise + + /** + * denyInboundRelayReservation tests whether a remote peer is allowed make a + * relay reservation on this node. + * + * Return true to deny the relay reservation. + */ + denyInboundRelayReservation?(source: PeerId): Promise + + /** + * denyOutboundRelayedConnection tests whether a remote peer is allowed to open a relayed + * connection to the destination node. + * + * This is invoked on the relay server when a source client with a reservation instructs + * the server to relay a connection to a destination peer. + * + * Return true to deny the relayed connection. + */ + denyOutboundRelayedConnection?(source: PeerId, destination: PeerId): Promise + + /** + * denyInboundRelayedConnection tests whether a remote peer is allowed to open a relayed + * connection to this node. + * + * This is invoked on the relay client when a remote relay has received an instruction to + * relay a connection to the client. + * + * Return true to deny the relayed connection. + */ + denyInboundRelayedConnection?(relay: PeerId, remotePeer: PeerId): Promise + + /** + * Used by the address book to filter passed addresses. + * + * Return true to allow storing the passed multiaddr for the passed peer. + */ + filterMultiaddrForPeer?(peer: PeerId, multiaddr: Multiaddr): Promise +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection/index.ts new file mode 100644 index 000000000..459a63bb1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/connection/index.ts @@ -0,0 +1,347 @@ +import type { AbortOptions, Logger } from '../index.js' +import type { PeerId } from '../peer-id/index.js' +import type { Multiaddr } from '@multiformats/multiaddr' +import type { Duplex, Source } from 'it-stream-types' +import type { Uint8ArrayList } from 'uint8arraylist' + +export interface ConnectionTimeline { + /** + * When the connection was opened + */ + open: number + + /** + * When the MultiaddrConnection was upgraded to a Connection - e.g. the type + * of connection encryption and multiplexing was negotiated. + */ + upgraded?: number + + /** + * When the connection was closed. + */ + close?: number +} + +/** + * Outbound connections are opened by the local node, inbound streams are opened by the remote + */ +export type Direction = 'inbound' | 'outbound' + +export interface StreamTimeline { + /** + * A timestamp of when the stream was opened + */ + open: number + + /** + * A timestamp of when the stream was closed for both reading and writing + */ + close?: number + + /** + * A timestamp of when the stream was closed for reading + */ + closeRead?: number + + /** + * A timestamp of when the stream was closed for writing + */ + closeWrite?: number + + /** + * A timestamp of when the stream was reset + */ + reset?: number + + /** + * A timestamp of when the stream was aborted + */ + abort?: number +} + +/** + * The states a stream can be in + */ +export type StreamStatus = 'open' | 'closing' | 'closed' | 'aborted' | 'reset' + +/** + * The states the readable end of a stream can be in + * + * ready - the readable end is ready for reading + * closing - the readable end is closing + * closed - the readable end has closed + */ +export type ReadStatus = 'ready' | 'closing' | 'closed' + +/** + * The states the writable end of a stream can be in + * + * ready - the writable end is ready for writing + * writing - the writable end is in the process of being written to + * done - the source passed to the `.sink` function yielded all values without error + * closing - the writable end is closing + * closed - the writable end has closed + */ +export type WriteStatus = 'ready' | 'writing' | 'done' | 'closing' | 'closed' + +/** + * A Stream is a data channel between two peers that + * can be written to and read from at both ends. + * + * It may be encrypted and multiplexed depending on the + * configuration of the nodes. + */ +export interface Stream extends Duplex, Source, Promise> { + /** + * Closes the stream for **reading** *and* **writing**. + * + * Any buffered data in the source can still be consumed and the stream will end normally. + * + * This will cause a `CLOSE` message to be sent to the remote, *unless* the sink has already ended. + * + * The sink and the source will return normally. + */ + close(options?: AbortOptions): Promise + + /** + * Closes the stream for **reading**. If iterating over the source of this stream in a `for await of` loop, it will return (exit the loop) after any buffered data has been consumed. + * + * This function is called automatically by the muxer when it receives a `CLOSE` message from the remote. + * + * The source will return normally, the sink will continue to consume. + */ + closeRead(options?: AbortOptions): Promise + + /** + * Closes the stream for **writing**. If iterating over the source of this stream in a `for await of` loop, it will return (exit the loop) after any buffered data has been consumed. + * + * The source will return normally, the sink will continue to consume. + */ + closeWrite(options?: AbortOptions): Promise + + /** + * Closes the stream for **reading** *and* **writing**. This should be called when a *local error* has occurred. + * + * Note, if called without an error any buffered data in the source can still be consumed and the stream will end normally. + * + * This will cause a `RESET` message to be sent to the remote, *unless* the sink has already ended. + * + * The sink will return and the source will throw if an error is passed or return normally if not. + */ + abort(err: Error): void + + /** + * Unique identifier for a stream. Identifiers are not unique across muxers. + */ + id: string + + /** + * Outbound streams are opened by the local node, inbound streams are opened by the remote + */ + direction: Direction + + /** + * Lifecycle times for the stream + */ + timeline: StreamTimeline + + /** + * The protocol negotiated for this stream + */ + protocol?: string + + /** + * User defined stream metadata + */ + metadata: Record + + /** + * The current status of the stream + */ + status: StreamStatus + + /** + * The current status of the readable end of the stream + */ + readStatus: ReadStatus + + /** + * The current status of the writable end of the stream + */ + writeStatus: WriteStatus + + /** + * The stream logger + */ + log: Logger +} + +export interface NewStreamOptions extends AbortOptions { + /** + * If specified, and no handler has been registered with the registrar for the + * successfully negotiated protocol, use this as the max outbound stream limit + * for the protocol + */ + maxOutboundStreams?: number + + /** + * Opt-in to running over a transient connection - one that has time/data limits + * placed on it. + */ + runOnTransientConnection?: boolean +} + +export type ConnectionStatus = 'open' | 'closing' | 'closed' + +/** + * A Connection is a high-level representation of a connection + * to a remote peer that may have been secured by encryption and + * multiplexed, depending on the configuration of the nodes + * between which the connection is made. + */ +export interface Connection { + /** + * The unique identifier for this connection + */ + id: string + + /** + * The address of the remote end of the connection + */ + remoteAddr: Multiaddr + + /** + * The id of the peer at the remote end of the connection + */ + remotePeer: PeerId + + /** + * A list of tags applied to this connection + */ + tags: string[] + + /** + * A list of open streams on this connection + */ + streams: Stream[] + + /** + * Outbound conections are opened by the local node, inbound streams are opened by the remote + */ + direction: Direction + + /** + * Lifecycle times for the connection + */ + timeline: ConnectionTimeline + + /** + * The multiplexer negotiated for this connection + */ + multiplexer?: string + + /** + * The encryption protocol negotiated for this connection + */ + encryption?: string + + /** + * The current status of the connection + */ + status: ConnectionStatus + + /** + * A transient connection is one that is not expected to be open for very long + * or one that cannot transfer very much data, such as one being used as a + * circuit relay connection. Protocols need to explicitly opt-in to being run + * over transient connections. + */ + transient: boolean + + /** + * Create a new stream on this connection and negotiate one of the passed protocols + */ + newStream(protocols: string | string[], options?: NewStreamOptions): Promise + + /** + * Gracefully close the connection. All queued data will be written to the + * underlying transport. + */ + close(options?: AbortOptions): Promise + + /** + * Immediately close the connection, any queued data will be discarded + */ + abort(err: Error): void + + /** + * The connection logger + */ + log: Logger +} + +export const symbol = Symbol.for('@libp2p/connection') + +export function isConnection (other: any): other is Connection { + return other != null && Boolean(other[symbol]) +} + +export interface ConnectionProtector { + /** + * Takes a given Connection and creates a private encryption stream + * between its two peers from the PSK the Protector instance was + * created with. + */ + protect(connection: MultiaddrConnection): Promise +} + +export interface MultiaddrConnectionTimeline { + /** + * When the connection was opened + */ + open: number + + /** + * When the MultiaddrConnection was upgraded to a Connection - the type of + * connection encryption and multiplexing was negotiated. + */ + upgraded?: number + + /** + * When the connection was closed. + */ + close?: number +} + +/** + * A MultiaddrConnection is returned by transports after dialing + * a peer. It is a low-level primitive and is the raw connection + * without encryption or stream multiplexing. + */ +export interface MultiaddrConnection extends Duplex> { + /** + * Gracefully close the connection. All queued data will be written to the + * underlying transport. + */ + close(options?: AbortOptions): Promise + + /** + * Immediately close the connection, any queued data will be discarded + */ + abort(err: Error): void + + /** + * The address of the remote end of the connection + */ + remoteAddr: Multiaddr + + /** + * When connection lifecycle events occurred + */ + timeline: MultiaddrConnectionTimeline + + /** + * The multiaddr connection logger + */ + log: Logger +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/content-routing/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/content-routing/index.ts new file mode 100644 index 000000000..0d38d5814 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/content-routing/index.ts @@ -0,0 +1,83 @@ +import type { AbortOptions } from '../index.js' +import type { PeerInfo } from '../peer-info/index.js' +import type { CID } from 'multiformats/cid' + +/** + * Any object that implements this Symbol as a property should return a + * ContentRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { contentRouting, ContentRouting } from '@libp2p/content-routing' + * + * class MyContentRouter implements ContentRouting { + * get [contentRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export const contentRouting = Symbol.for('@libp2p/content-routing') + +export interface ContentRouting { + /** + * The implementation of this method should ensure that network peers know the + * caller can provide content that corresponds to the passed CID. + * + * @example + * + * ```js + * // ... + * await contentRouting.provide(cid) + * ``` + */ + provide(cid: CID, options?: AbortOptions): Promise + + /** + * Find the providers of the passed CID. + * + * @example + * + * ```js + * // Iterate over the providers found for the given cid + * for await (const provider of contentRouting.findProviders(cid)) { + * console.log(provider.id, provider.multiaddrs) + * } + * ``` + */ + findProviders(cid: CID, options?: AbortOptions): AsyncIterable + + /** + * Puts a value corresponding to the passed key in a way that can later be + * retrieved by another network peer using the get method. + * + * @example + * + * ```js + * // ... + * const key = '/key' + * const value = uint8ArrayFromString('oh hello there') + * + * await contentRouting.put(key, value) + * ``` + */ + put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise + + /** + * Retrieves a value from the network corresponding to the passed key. + * + * @example + * + * ```js + * // ... + * + * const key = '/key' + * const value = await contentRouting.get(key) + * ``` + */ + get(key: Uint8Array, options?: AbortOptions): Promise +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/errors.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/errors.ts new file mode 100644 index 000000000..8a1a4dafe --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/errors.ts @@ -0,0 +1,74 @@ +/** + * When this error is thrown it means an operation was aborted, + * usually in response to the `abort` event being emitted by an + * AbortSignal. + */ +export class AbortError extends Error { + public readonly code: string + public readonly type: string + + constructor (message: string = 'The operation was aborted') { + super(message) + this.code = AbortError.code + this.type = AbortError.type + } + + static readonly code = 'ABORT_ERR' + + static readonly type = 'aborted' +} + +export class CodeError = Record> extends Error { + public readonly props: T + + constructor ( + message: string, + public readonly code: string, + props?: T + ) { + super(message) + + this.name = props?.name ?? 'CodeError' + this.props = props ?? {} as T // eslint-disable-line @typescript-eslint/consistent-type-assertions + } +} + +export class UnexpectedPeerError extends Error { + public code: string + + constructor (message = 'Unexpected Peer') { + super(message) + this.code = UnexpectedPeerError.code + } + + static readonly code = 'ERR_UNEXPECTED_PEER' +} + +export class InvalidCryptoExchangeError extends Error { + public code: string + + constructor (message = 'Invalid crypto exchange') { + super(message) + this.code = InvalidCryptoExchangeError.code + } + + static readonly code = 'ERR_INVALID_CRYPTO_EXCHANGE' +} + +export class InvalidCryptoTransmissionError extends Error { + public code: string + + constructor (message = 'Invalid crypto transmission') { + super(message) + this.code = InvalidCryptoTransmissionError.code + } + + static readonly code = 'ERR_INVALID_CRYPTO_TRANSMISSION' +} + +// Error codes + +export const ERR_TIMEOUT = 'ERR_TIMEOUT' +export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS' +export const ERR_NOT_FOUND = 'ERR_NOT_FOUND' +export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.browser.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.browser.ts new file mode 100644 index 000000000..7c1fabd36 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.browser.ts @@ -0,0 +1,2 @@ +/** Noop for browser compatibility */ +export function setMaxListeners (): void {} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.ts new file mode 100644 index 000000000..4c4a498fc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/events.ts @@ -0,0 +1,130 @@ +import { setMaxListeners as nodeSetMaxListeners } from 'events' + +export interface EventCallback { (evt: EventType): void } +export interface EventObject { handleEvent: EventCallback } +export type EventHandler = EventCallback | EventObject + +interface Listener { + once: boolean + callback: any +} + +/** + * Adds types to the EventTarget class. Hopefully this won't be necessary forever. + * + * https://github.com/microsoft/TypeScript/issues/28357 + * https://github.com/microsoft/TypeScript/issues/43477 + * https://github.com/microsoft/TypeScript/issues/299 + * etc + */ +export interface TypedEventTarget > extends EventTarget { + addEventListener(type: K, listener: EventHandler | null, options?: boolean | AddEventListenerOptions): void + + listenerCount (type: string): number + + removeEventListener(type: K, listener?: EventHandler | null, options?: boolean | EventListenerOptions): void + + removeEventListener (type: string, listener?: EventHandler, options?: boolean | EventListenerOptions): void + + safeDispatchEvent(type: keyof EventMap, detail: CustomEventInit): boolean +} + +/** + * An implementation of a typed event target + * etc + */ +export class TypedEventEmitter> extends EventTarget implements TypedEventTarget { + #listeners = new Map() + + listenerCount (type: string): number { + const listeners = this.#listeners.get(type) + + if (listeners == null) { + return 0 + } + + return listeners.length + } + + addEventListener(type: K, listener: EventHandler | null, options?: boolean | AddEventListenerOptions): void + addEventListener (type: string, listener: EventHandler, options?: boolean | AddEventListenerOptions): void { + super.addEventListener(type, listener, options) + + let list = this.#listeners.get(type) + + if (list == null) { + list = [] + this.#listeners.set(type, list) + } + + list.push({ + callback: listener, + once: (options !== true && options !== false && options?.once) ?? false + }) + } + + removeEventListener(type: K, listener?: EventHandler | null, options?: boolean | EventListenerOptions): void + removeEventListener (type: string, listener?: EventHandler, options?: boolean | EventListenerOptions): void { + super.removeEventListener(type.toString(), listener ?? null, options) + + let list = this.#listeners.get(type) + + if (list == null) { + return + } + + list = list.filter(({ callback }) => callback !== listener) + this.#listeners.set(type, list) + } + + dispatchEvent (event: Event): boolean { + const result = super.dispatchEvent(event) + + let list = this.#listeners.get(event.type) + + if (list == null) { + return result + } + + list = list.filter(({ once }) => !once) + this.#listeners.set(event.type, list) + + return result + } + + safeDispatchEvent(type: keyof EventMap, detail: CustomEventInit): boolean { + return this.dispatchEvent(new CustomEvent(type as string, detail)) + } +} + +/** + * CustomEvent is a standard event but it's not supported by node. + * + * Remove this when https://github.com/nodejs/node/issues/40678 is closed. + * + * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent + */ +class CustomEventPolyfill extends Event { + /** Returns any custom data event was created with. Typically used for synthetic events. */ + public detail: T + + constructor (message: string, data?: EventInit & { detail: T }) { + super(message, data) + // @ts-expect-error could be undefined + this.detail = data?.detail + } +} + +export const CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill + +// TODO: remove this in v1 +export { TypedEventEmitter as EventEmitter } + +// create a setMaxListeners that doesn't break browser usage +export const setMaxListeners: typeof nodeSetMaxListeners = (n, ...eventTargets) => { + try { + nodeSetMaxListeners(n, ...eventTargets) + } catch { + // swallow error, gulp + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/index.ts new file mode 100644 index 000000000..2389ffc1e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/index.ts @@ -0,0 +1,662 @@ +/** + * @packageDocumentation + * + * Exports a `Libp2p` type for modules to use as a type argument. + * + * @example + * + * ```typescript + * import type { Libp2p } from '@libp2p/interface' + * + * function doSomethingWithLibp2p (node: Libp2p) { + * // ... + * } + * ``` + */ + +import type { Connection, NewStreamOptions, Stream } from './connection/index.js' +import type { ContentRouting } from './content-routing/index.js' +import type { TypedEventTarget } from './events.js' +import type { Metrics } from './metrics/index.js' +import type { PeerId } from './peer-id/index.js' +import type { PeerInfo } from './peer-info/index.js' +import type { PeerRouting } from './peer-routing/index.js' +import type { Address, Peer, PeerStore } from './peer-store/index.js' +import type { Startable } from './startable.js' +import type { StreamHandler, StreamHandlerOptions } from './stream-handler/index.js' +import type { Topology } from './topology/index.js' +import type { Listener } from './transport/index.js' +import type { Multiaddr } from '@multiformats/multiaddr' + +/** + * Used by the connection manager to sort addresses into order before dialling + */ +export interface AddressSorter { + (a: Address, b: Address): -1 | 0 | 1 +} + +/** + * Event detail emitted when peer data changes + */ +export interface PeerUpdate { + peer: Peer + previous?: Peer +} + +/** + * Peer data signed by the remote Peer's public key + */ +export interface SignedPeerRecord { + addresses: Multiaddr[] + seq: bigint +} + +/** + * Data returned from a successful identify response + */ +export interface IdentifyResult { + /** + * The remote Peer's PeerId + */ + peerId: PeerId + + /** + * The unsigned addresses they are listening on. Note - any multiaddrs present + * in the signed peer record should be preferred to the value here. + */ + listenAddrs: Multiaddr[] + + /** + * The protocols the remote peer supports + */ + protocols: string[] + + /** + * The remote protocol version + */ + protocolVersion?: string + + /** + * The remote agent version + */ + agentVersion?: string + + /** + * The public key part of the remote PeerId - this is only useful for older + * RSA-based PeerIds, the more modern Ed25519 and secp256k1 types have the + * public key embedded in them + */ + publicKey?: Uint8Array + + /** + * If set this is the address that the remote peer saw the identify request + * originate from + */ + observedAddr?: Multiaddr + + /** + * If sent by the remote peer this is the deserialized signed peer record + */ + signedPeerRecord?: SignedPeerRecord + + /** + * The connection that the identify protocol ran over + */ + connection: Connection +} + +/** + * Logger component for libp2p + */ +export interface Logger { + (formatter: any, ...args: any[]): void + error(formatter: any, ...args: any[]): void + trace(formatter: any, ...args: any[]): void + enabled: boolean +} + +/** + * Peer logger component for libp2p + */ +export interface ComponentLogger { + forComponent(name: string): Logger +} + +/** + * Once you have a libp2p instance, you can listen to several events it emits, + * so that you can be notified of relevant network events. + * + * Event names are `noun:verb` so the first part is the name of the object + * being acted on and the second is the action. + */ +export interface Libp2pEvents { + /** + * This event is dispatched when a new network peer is discovered. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:discovery', (event) => { + * const peerInfo = event.detail + * // ... + * }) + * ``` + */ + 'peer:discovery': CustomEvent + + /** + * This event will be triggered any time a new peer connects. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:connect', (event) => { + * const peerId = event.detail + * // ... + * }) + * ``` + */ + 'peer:connect': CustomEvent + + /** + * This event will be triggered any time we are disconnected from another peer, regardless of + * the circumstances of that disconnection. If we happen to have multiple connections to a + * peer, this event will **only** be triggered when the last connection is closed. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:disconnect', (event) => { + * const peerId = event.detail + * // ... + * }) + * ``` + */ + 'peer:disconnect': CustomEvent + + /** + * This event is dispatched after a remote peer has successfully responded to the identify + * protocol. Note that for this to be emitted, both peers must have an identify service + * configured. + * + * @example + * + * ```js + * libp2p.addEventListener('peer:identify', (event) => { + * const identifyResult = event.detail + * // ... + * }) + * ``` + */ + 'peer:identify': CustomEvent + + /** + * This event is dispatched when the peer store data for a peer has been + * updated - e.g. their multiaddrs, protocols etc have changed. + * + * If they were previously known to this node, the old peer data will be + * set in the `previous` field. + * + * This may be in response to the identify protocol running, a manual + * update or some other event. + */ + 'peer:update': CustomEvent + + /** + * This event is dispatched when the current node's peer record changes - + * for example a transport started listening on a new address or a new + * protocol handler was registered. + * + * @example + * + * ```js + * libp2p.addEventListener('self:peer:update', (event) => { + * const { peer } = event.detail + * // ... + * }) + * ``` + */ + 'self:peer:update': CustomEvent + + /** + * This event is dispatched when a transport begins listening on a new address + */ + 'transport:listening': CustomEvent + + /** + * This event is dispatched when a transport stops listening on an address + */ + 'transport:close': CustomEvent + + /** + * This event is dispatched when the connection manager has more than the + * configured allowable max connections and has closed some connections to + * bring the node back under the limit. + */ + 'connection:prune': CustomEvent + + /** + * This event notifies listeners when new incoming or outgoing connections + * are opened. + */ + 'connection:open': CustomEvent + + /** + * This event notifies listeners when incoming or outgoing connections are + * closed. + */ + 'connection:close': CustomEvent + + /** + * This event notifies listeners that the node has started + * + * ```js + * libp2p.addEventListener('start', (event) => { + * console.info(libp2p.isStarted()) // true + * }) + * ``` + */ + 'start': CustomEvent> + + /** + * This event notifies listeners that the node has stopped + * + * ```js + * libp2p.addEventListener('stop', (event) => { + * console.info(libp2p.isStarted()) // false + * }) + * ``` + */ + 'stop': CustomEvent> +} + +/** + * A map of user defined services available on the libp2p node via the + * `services` key + * + * @example + * + * ```js + * const node = await createLibp2p({ + * // ...other options + * services: { + * myService: myService({ + * // ...service options + * }) + * } + * }) + * + * // invoke methods on the service + * node.services.myService.anOperation() + * ``` + */ +export type ServiceMap = Record + +export type PendingDialStatus = 'queued' | 'active' | 'error' | 'success' + +/** + * An item in the dial queue + */ +export interface PendingDial { + /** + * A unique identifier for this dial + */ + id: string + + /** + * The current status of the dial + */ + status: PendingDialStatus + + /** + * If known, this is the peer id that libp2p expects to be dialling + */ + peerId?: PeerId + + /** + * The list of multiaddrs that will be dialled. The returned connection will + * use the first address that succeeds, all other dials part of this pending + * dial will be cancelled. + */ + multiaddrs: Multiaddr[] +} + +/** + * Libp2p nodes implement this interface. + */ +export interface Libp2p extends Startable, TypedEventTarget> { + /** + * The PeerId is a unique identifier for a node on the network. + * + * It is the hash of an RSA public key or, for Ed25519 or secp256k1 keys, + * the key itself. + * + * @example + * + * ```js + * console.info(libp2p.peerId) + * // PeerId(12D3Foo...) + * ```` + */ + peerId: PeerId + + /** + * The peer store holds information we know about other peers on the network. + * - multiaddrs, supported protocols, etc. + * + * @example + * + * ```js + * const peer = await libp2p.peerStore.get(peerId) + * console.info(peer) + * // { id: PeerId(12D3Foo...), addresses: [] ... } + * ``` + */ + peerStore: PeerStore + + /** + * The peer routing subsystem allows the user to find peers on the network + * or to find peers close to binary keys. + * + * @example + * + * ```js + * const peerInfo = await libp2p.peerRouting.findPeer(peerId) + * console.info(peerInfo) + * // { id: PeerId(12D3Foo...), multiaddrs: [] ... } + * ``` + * + * @example + * + * ```js + * for await (const peerInfo of libp2p.peerRouting.getClosestPeers(key)) { + * console.info(peerInfo) + * // { id: PeerId(12D3Foo...), multiaddrs: [] ... } + * } + * ``` + */ + peerRouting: PeerRouting + + /** + * The content routing subsystem allows the user to find providers for content, + * let the network know they are providers for content, and get/put values to + * the DHT. + * + * @example + * + * ```js + * for await (const peerInfo of libp2p.contentRouting.findProviders(cid)) { + * console.info(peerInfo) + * // { id: PeerId(12D3Foo...), multiaddrs: [] ... } + * } + * ``` + */ + contentRouting: ContentRouting + + /** + * The metrics subsystem allows recording values to assess the health/performance + * of the running node. + * + * @example + * + * ```js + * const metric = libp2p.metrics.registerMetric({ + * 'my-metric' + * }) + * + * // later + * metric.update(5) + * ``` + */ + metrics?: Metrics + + logger: ComponentLogger + + /** + * Get a deduplicated list of peer advertising multiaddrs by concatenating + * the listen addresses used by transports with any configured + * announce addresses as well as observed addresses reported by peers. + * + * If Announce addrs are specified, configured listen addresses will be + * ignored though observed addresses will still be included. + * + * @example + * + * ```js + * const listenMa = libp2p.getMultiaddrs() + * // [ ] + * ``` + */ + getMultiaddrs(): Multiaddr[] + + /** + * Returns a list of supported protocols + * + * @example + * + * ```js + * const protocols = libp2p.getProtocols() + * // [ '/ipfs/ping/1.0.0', '/ipfs/id/1.0.0' ] + * ``` + */ + getProtocols(): string[] + + /** + * Return a list of all connections this node has open, optionally filtering + * by a PeerId + * + * @example + * + * ```js + * for (const connection of libp2p.getConnections()) { + * console.log(peerId, connection.remoteAddr.toString()) + * // Logs the PeerId string and the observed remote multiaddr of each Connection + * } + * ``` + */ + getConnections(peerId?: PeerId): Connection[] + + /** + * Return the list of dials currently in progress or queued to start + * + * @example + * + * ```js + * for (const pendingDial of libp2p.getDialQueue()) { + * console.log(pendingDial) + * } + * ``` + */ + getDialQueue(): PendingDial[] + + /** + * Return a list of all peers we currently have a connection open to + */ + getPeers(): PeerId[] + + /** + * Dials to the provided peer. If successful, the known metadata of the + * peer will be added to the nodes `peerStore`. + * + * If a PeerId is passed as the first argument, the peer will need to have known multiaddrs for it in the PeerStore. + * + * @example + * + * ```js + * const conn = await libp2p.dial(remotePeerId) + * + * // create a new stream within the connection + * const { stream, protocol } = await conn.newStream(['/echo/1.1.0', '/echo/1.0.0']) + * + * // protocol negotiated: 'echo/1.0.0' means that the other party only supports the older version + * + * // ... + * await conn.close() + * ``` + */ + dial(peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions): Promise + + /** + * Dials to the provided peer and tries to handshake with the given protocols in order. + * If successful, the known metadata of the peer will be added to the nodes `peerStore`, + * and the `MuxedStream` will be returned together with the successful negotiated protocol. + * + * @example + * + * ```js + * import { pipe } from 'it-pipe' + * + * const { stream, protocol } = await libp2p.dialProtocol(remotePeerId, protocols) + * + * // Use this new stream like any other duplex stream + * pipe([1, 2, 3], stream, consume) + * ``` + */ + dialProtocol(peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: NewStreamOptions): Promise + + /** + * Attempts to gracefully close an open connection to the given peer. If the + * connection is not closed in the grace period, it will be forcefully closed. + * + * An AbortSignal can optionally be passed to control when the connection is + * forcefully closed. + * + * @example + * + * ```js + * await libp2p.hangUp(remotePeerId) + * ``` + */ + hangUp(peer: PeerId | Multiaddr, options?: AbortOptions): Promise + + /** + * Sets up [multistream-select routing](https://github.com/multiformats/multistream-select) of protocols to their application handlers. Whenever a stream is opened on one of the provided protocols, the handler will be called. `handle` must be called in order to register a handler and support for a given protocol. This also informs other peers of the protocols you support. + * + * `libp2p.handle(protocols, handler, options)` + * + * In the event of a new handler for the same protocol being added, the first one is discarded. + * + * @example + * + * ```js + * const handler = ({ connection, stream, protocol }) => { + * // use stream or connection according to the needs + * } + * + * libp2p.handle('/echo/1.0.0', handler, { + * maxInboundStreams: 5, + * maxOutboundStreams: 5 + * }) + * ``` + */ + handle(protocol: string | string[], handler: StreamHandler, options?: StreamHandlerOptions): Promise + + /** + * Removes the handler for each protocol. The protocol + * will no longer be supported on streams. + * + * @example + * + * ```js + * libp2p.unhandle(['/echo/1.0.0']) + * ``` + */ + unhandle(protocols: string[] | string): Promise + + /** + * Register a topology to be informed when peers are encountered that + * support the specified protocol + * + * @example + * + * ```js + * const id = await libp2p.register('/echo/1.0.0', { + * onConnect: (peer, connection) => { + * // handle connect + * }, + * onDisconnect: (peer, connection) => { + * // handle disconnect + * } + * }) + * ``` + */ + register(protocol: string, topology: Topology): Promise + + /** + * Unregister topology to no longer be informed when peers connect or + * disconnect. + * + * @example + * + * ```js + * const id = await libp2p.register(...) + * + * libp2p.unregister(id) + * ``` + */ + unregister(id: string): void + + /** + * Returns the public key for the passed PeerId. If the PeerId is of the 'RSA' type + * this may mean searching the DHT if the key is not present in the KeyStore. + * A set of user defined services + */ + getPublicKey(peer: PeerId, options?: AbortOptions): Promise + + /** + * A set of user defined services + */ + services: T +} + +/** + * Metadata about the current node + */ +export interface NodeInfo { + /** + * The implementation name + */ + name: string + + /** + * The implementation version + */ + version: string +} + +/** + * An object that contains an AbortSignal as + * the optional `signal` property. + * + * @example + * + * ```js + * const controller = new AbortController() + * + * aLongRunningOperation({ + * signal: controller.signal + * }) + * + * // later + * + * controller.abort() + */ +export interface AbortOptions { + signal?: AbortSignal +} + +/** + * An object that contains a Logger as the `log` property. + */ +export interface LoggerOptions { + log: Logger +} + +/** + * Returns a new type with all fields marked optional. + * + * Borrowed from the tsdef module. + */ +export type RecursivePartial = { + [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/keys/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/keys/index.ts new file mode 100644 index 000000000..63d489a09 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/keys/index.ts @@ -0,0 +1,39 @@ +import type { Uint8ArrayList } from 'uint8arraylist' + +export interface PublicKey { + readonly bytes: Uint8Array + verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): Promise + marshal(): Uint8Array + equals(key: PublicKey): boolean + hash(): Promise +} + +/** + * Generic private key interface + */ +export interface PrivateKey { + readonly public: PublicKey + readonly bytes: Uint8Array + sign(data: Uint8Array | Uint8ArrayList): Promise + marshal(): Uint8Array + equals(key: PrivateKey): boolean + hash(): Promise + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + */ + id(): Promise + /** + * Exports the password protected key in the format specified. + */ + export(password: string, format?: 'pkcs-8' | string): Promise +} + +export const Ed25519 = 'Ed25519' +export const RSA = 'RSA' +export const secp256k1 = 'secp256k1' + +export type KeyType = typeof Ed25519 | typeof RSA | typeof secp256k1 diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/index.ts new file mode 100644 index 000000000..930eaecc9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/index.ts @@ -0,0 +1,187 @@ +import type { MultiaddrConnection, Stream, Connection } from '../connection/index.js' + +/** + * Create tracked metrics with these options. Loosely based on the + * interfaces exposed by the prom-client module + */ +export interface MetricOptions { + /** + * Optional label for the metric + */ + label?: string + + /** + * Optional help for the metric + */ + help?: string +} + +/** + * A function that returns a tracked metric which may be expensive + * to calculate so it is only invoked when metrics are being scraped + */ +export type CalculateMetric = (() => T) | (() => Promise) + +/** + * Create tracked metrics that are expensive to calculate by passing + * a function that is only invoked when metrics are being scraped + */ +export interface CalculatedMetricOptions extends MetricOptions { + /** + * An optional function invoked to calculate the component metric instead of + * using `.update`, `.increment`, and `.decrement` + */ + calculate: CalculateMetric +} + +/** + * Call this function to stop the timer returned from the `.timer` method + * on the metric + */ +export interface StopTimer { (): void } + +/** + * A tracked metric loosely based on the interfaces exposed by the + * prom-client module + */ +export interface Metric { + /** + * Update the stored metric to the passed value + */ + update(value: number): void + + /** + * Increment the metric by the passed value or 1 + */ + increment(value?: number): void + + /** + * Decrement the metric by the passed value or 1 + */ + decrement(value?: number): void + + /** + * Reset this metric to its default value + */ + reset(): void + + /** + * Start a timed metric, call the returned function to + * stop the timer + */ + timer(): StopTimer +} + +/** + * A group of related metrics loosely based on the interfaces exposed by the + * prom-client module + */ +export interface MetricGroup { + /** + * Update the stored metric group to the passed value + */ + update(values: Record): void + + /** + * Increment the metric group keys by the passed number or + * any non-numeric value to increment by 1 + */ + increment(values: Record): void + + /** + * Decrement the metric group keys by the passed number or + * any non-numeric value to decrement by 1 + */ + decrement(values: Record): void + + /** + * Reset the passed key in this metric group to its default value + * or all keys if no key is passed + */ + reset(): void + + /** + * Start a timed metric for the named key in the group, call + * the returned function to stop the timer + */ + timer(key: string): StopTimer +} + +/** + * A tracked counter loosely based on the Counter interface exposed + * by the prom-client module - counters are metrics that only go up + */ +export interface Counter { + /** + * Increment the metric by the passed value or 1 + */ + increment(value?: number): void + + /** + * Reset this metric to its default value + */ + reset(): void +} + +/** + * A group of tracked counters loosely based on the Counter interface + * exposed by the prom-client module - counters are metrics that only + * go up + */ +export interface CounterGroup { + /** + * Increment the metric group keys by the passed number or + * any non-numeric value to increment by 1 + */ + increment(values: Record): void + + /** + * Reset the passed key in this metric group to its default value + * or all keys if no key is passed + */ + reset(): void +} + +/** + * The libp2p metrics tracking object. This interface is only concerned + * with the collection of metrics, please see the individual implementations + * for how to extract metrics for viewing. + */ +export interface Metrics { + /** + * Track a newly opened multiaddr connection + */ + trackMultiaddrConnection(maConn: MultiaddrConnection): void + + /** + * Track a newly opened protocol stream + */ + trackProtocolStream(stream: Stream, connection: Connection): void + + /** + * Register an arbitrary metric. Call this to set help/labels for metrics + * and update/increment/decrement/etc them by calling methods on the returned + * metric object + */ + registerMetric: ((name: string, options?: MetricOptions) => Metric) & ((name: string, options: CalculatedMetricOptions) => void) + + /** + * Register a a group of related metrics. Call this to set help/labels for + * groups of related metrics that will be updated with by calling `.update`, + * `.increment` and/or `.decrement` methods on the returned metric group object + */ + registerMetricGroup: ((name: string, options?: MetricOptions) => MetricGroup) & ((name: string, options: CalculatedMetricOptions>) => void) + + /** + * Register an arbitrary counter. Call this to set help/labels for counters + * and increment them by calling methods on the returned counter object + */ + registerCounter: ((name: string, options?: MetricOptions) => Counter) & ((name: string, options: CalculatedMetricOptions) => void) + + /** + * Register a a group of related counters. Call this to set help/labels for + * groups of related counters that will be updated with by calling the `.increment` + * method on the returned counter group object + */ + registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions>) => void) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/tracked-map.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/tracked-map.ts new file mode 100644 index 000000000..82959e33e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/metrics/tracked-map.ts @@ -0,0 +1,65 @@ +import type { Metric, Metrics } from './index.js' + +export interface TrackedMapInit { + name: string + metrics: Metrics +} + +class TrackedMap extends Map { + private readonly metric: Metric + + constructor (init: TrackedMapInit) { + super() + + const { name, metrics } = init + + this.metric = metrics.registerMetric(name) + this.updateComponentMetric() + } + + set (key: K, value: V): this { + super.set(key, value) + this.updateComponentMetric() + return this + } + + delete (key: K): boolean { + const deleted = super.delete(key) + this.updateComponentMetric() + return deleted + } + + clear (): void { + super.clear() + this.updateComponentMetric() + } + + private updateComponentMetric (): void { + this.metric.update(this.size) + } +} + +export interface CreateTrackedMapInit { + /** + * The metric name to use + */ + name: string + + /** + * A metrics implementation + */ + metrics?: Metrics +} + +export function trackedMap (config: CreateTrackedMapInit): Map { + const { name, metrics } = config + let map: Map + + if (metrics != null) { + map = new TrackedMap({ name, metrics }) + } else { + map = new Map() + } + + return map +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-discovery/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-discovery/index.ts new file mode 100644 index 000000000..55b1227eb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-discovery/index.ts @@ -0,0 +1,29 @@ +import type { TypedEventTarget } from '../events.js' +import type { PeerInfo } from '../peer-info/index.js' + +/** + * Any object that implements this Symbol as a property should return a + * PeerDiscovery instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerDiscovery, PeerDiscovery } from '@libp2p/peer-discovery' + * + * class MyPeerDiscoverer implements PeerDiscovery { + * get [peerDiscovery] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export const peerDiscovery = Symbol.for('@libp2p/peer-discovery') + +export interface PeerDiscoveryEvents { + 'peer': CustomEvent +} + +export interface PeerDiscovery extends TypedEventTarget {} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-id/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-id/index.ts new file mode 100644 index 000000000..931c34bc8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-id/index.ts @@ -0,0 +1,39 @@ +import type { CID } from 'multiformats/cid' +import type { MultihashDigest } from 'multiformats/hashes/interface' + +export type PeerIdType = 'RSA' | 'Ed25519' | 'secp256k1' + +interface BasePeerId { + readonly type: PeerIdType + readonly multihash: MultihashDigest + readonly privateKey?: Uint8Array + readonly publicKey?: Uint8Array + + toString(): string + toCID(): CID + toBytes(): Uint8Array + equals(other: PeerId | Uint8Array | string): boolean +} + +export interface RSAPeerId extends BasePeerId { + readonly type: 'RSA' + readonly publicKey?: Uint8Array +} + +export interface Ed25519PeerId extends BasePeerId { + readonly type: 'Ed25519' + readonly publicKey: Uint8Array +} + +export interface Secp256k1PeerId extends BasePeerId { + readonly type: 'secp256k1' + readonly publicKey: Uint8Array +} + +export type PeerId = RSAPeerId | Ed25519PeerId | Secp256k1PeerId + +export const symbol = Symbol.for('@libp2p/peer-id') + +export function isPeerId (other: any): other is PeerId { + return other != null && Boolean(other[symbol]) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-info/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-info/index.ts new file mode 100644 index 000000000..5b7c8cce9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-info/index.ts @@ -0,0 +1,20 @@ +import type { PeerId } from '../peer-id/index.js' +import type { Multiaddr } from '@multiformats/multiaddr' + +/** + * A `PeerInfo` is a lightweight object that represents a remote peer, it can be + * obtained from peer discovery mechanisms, HTTP RPC endpoints, etc. + * + * @see https://docs.libp2p.io/concepts/fundamentals/peers/#peer-info + */ +export interface PeerInfo { + /** + * The identifier of the remote peer + */ + id: PeerId + + /** + * The multiaddrs a peer is listening on + */ + multiaddrs: Multiaddr[] +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-routing/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-routing/index.ts new file mode 100644 index 000000000..dcaa68eaa --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-routing/index.ts @@ -0,0 +1,53 @@ +import type { AbortOptions } from '../index.js' +import type { PeerId } from '../peer-id/index.js' +import type { PeerInfo } from '../peer-info/index.js' + +/** + * Any object that implements this Symbol as a property should return a + * PeerRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerRouting, PeerRouting } from '@libp2p/peer-routing' + * + * class MyPeerRouter implements PeerRouting { + * get [peerRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` + */ +export const peerRouting = Symbol.for('@libp2p/peer-routing') + +export interface PeerRouting { + /** + * Searches the network for peer info corresponding to the passed peer id. + * + * @example + * + * ```js + * // ... + * const peer = await peerRouting.findPeer(peerId, options) + * ``` + */ + findPeer(peerId: PeerId, options?: AbortOptions): Promise + + /** + * Search the network for peers that are closer to the passed key. Peer + * info should be yielded in ever-increasing closeness to the key. + * + * @example + * + * ```js + * // Iterate over the closest peers found for the given key + * for await (const peer of peerRouting.getClosestPeers(key)) { + * console.log(peer.id, peer.multiaddrs) + * } + * ``` + */ + getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/index.ts new file mode 100644 index 000000000..ba0a683c5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/index.ts @@ -0,0 +1,272 @@ +import type { PeerId } from '../peer-id/index.js' +import type { Multiaddr } from '@multiformats/multiaddr' + +/** + * A multiaddr with an optional flag that indicates if its trustworthy + */ +export interface Address { + /** + * Peer multiaddr + */ + multiaddr: Multiaddr + + /** + * Obtained from a signed peer record + */ + isCertified: boolean +} + +/** + * Data stored in the peer store about peers + */ +export interface Peer { + /** + * Peer's peer-id instance + */ + id: PeerId + + /** + * Peer's addresses containing a list of multiaddrs and a isCertified field + * indicating if the address was loaded from a signed peer record or not + */ + addresses: Address[] + + /** + * Peer's supported protocols + */ + protocols: string[] + + /** + * Peer's metadata map + */ + metadata: Map + + /** + * Tags a peer has + */ + tags: Map + + /** + * The last peer record envelope received + */ + peerRecordEnvelope?: Uint8Array +} + +/** + * Peer data used to update the peer store + */ +export interface PeerData { + /** + * Peer's addresses containing its multiaddrs and metadata - multiaddrs + * passed here can be treated as certified if the `isCertifed` value is + * set to true. + * + * If both addresses and multiaddrs are specified they will be merged + * together with entries in addresses taking precedence. + */ + addresses?: Address[] + + /** + * Peer's multiaddrs - any multiaddrs passed here will be treated as + * uncertified. + * + * If both addresses and multiaddrs are specified they will be merged + * together with entries in addresses taking precedence. + */ + multiaddrs?: Multiaddr[] + + /** + * Peer's supported protocols + */ + protocols?: string[] + + /** + * Peer's metadata map. When merging pass undefined as values to remove metadata. + */ + metadata?: Map | Record + + /** + * Peer tags. When merging pass undefined as values to remove tags. + */ + tags?: Map | Record + + /** + * If this Peer has an RSA key, it's public key can be set with this property + */ + publicKey?: Uint8Array + + /** + * The last peer record envelope received + */ + peerRecordEnvelope?: Uint8Array +} + +export interface TagOptions { + /** + * An optional tag value (1-100) + */ + value?: number + + /** + * An optional duration in ms after which the tag will expire + */ + ttl?: number +} + +export interface Tag { + /** + * The tag value + */ + value: number +} + +/** + * A predicate by which to filter lists of peers + */ +export interface PeerQueryFilter { (peer: Peer): boolean } + +/** + * A predicate by which to sort lists of peers + */ +export interface PeerQueryOrder { (a: Peer, b: Peer): -1 | 0 | 1 } + +/** + * A query for getting lists of peers + */ +export interface PeerQuery { + filters?: PeerQueryFilter[] + orders?: PeerQueryOrder[] + limit?: number + offset?: number +} + +export interface PeerStore { + /** + * Loop over every peer - the looping is async because we read from a + * datastore but the peer operation is sync, this is to prevent + * long-lived peer operations causing deadlocks over the datastore + * which can happen if they try to access the peer store during the + * loop + * + * @example + * + * ```js + * await peerStore.forEach(peer => { + * // ... + * }) + * ``` + */ + forEach(fn: (peer: Peer) => void, query?: PeerQuery): Promise + + /** + * Returns all peers in the peer store. + * + * @example + * + * ```js + * for (const peer of await peerStore.all()) { + * // ... + * } + * ``` + */ + all(query?: PeerQuery): Promise + + /** + * Delete all data stored for the passed peer + * + * @example + * + * ```js + * await peerStore.addressBook.set(peerId, multiaddrs) + * await peerStore.addressBook.get(peerId) + * // multiaddrs[] + * + * await peerStore.delete(peerId) + * + * await peerStore.addressBook.get(peerId) + * // [] + * ``` + */ + delete(peerId: PeerId): Promise + + /** + * Returns true if the passed PeerId is in the peer store + * + * @example + * + * ```js + * await peerStore.has(peerId) + * // false + * await peerStore.addressBook.add(peerId, multiaddrs) + * await peerStore.has(peerId) + * // true + * ``` + */ + has(peerId: PeerId): Promise + + /** + * Returns all data stored for the passed PeerId + * + * @example + * + * ```js + * const peer = await peerStore.get(peerId) + * // { .. } + * ``` + */ + get(peerId: PeerId): Promise + + /** + * Adds a peer to the peer store, overwriting any existing data + * + * @example + * + * ```js + * await peerStore.save(peerId, { + * multiaddrs + * }) + * ``` + */ + save(id: PeerId, data: PeerData): Promise + + /** + * Adds a peer to the peer store, overwriting only the passed fields + * + * @example + * + * ```js + * await peerStore.patch(peerId, { + * multiaddrs + * }) + * ``` + */ + patch(id: PeerId, data: PeerData): Promise + + /** + * Adds a peer to the peer store, deeply merging any existing data. + * + * @example + * + * ```js + * await peerStore.merge(peerId, { + * multiaddrs + * }) + * ``` + */ + merge(id: PeerId, data: PeerData): Promise + + /** + * Unmarshal and verify a signed peer record, extract the multiaddrs and + * overwrite the stored addresses for the peer. + * + * Optionally pass an expected PeerId to verify that the peer record was + * signed by that peer. + * + * @example + * + * ```js + * await peerStore.consumePeerRecord(buf, expectedPeer) + * ``` + */ + consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId): Promise +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/tags.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/tags.ts new file mode 100644 index 000000000..771e33935 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/peer-store/tags.ts @@ -0,0 +1 @@ +export const KEEP_ALIVE = 'keep-alive' diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/pubsub/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/pubsub/index.ts new file mode 100644 index 000000000..1ce9464b6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/pubsub/index.ts @@ -0,0 +1,269 @@ +import type { Stream } from '../connection/index.js' +import type { TypedEventTarget } from '../events.js' +import type { PeerId } from '../peer-id/index.js' +import type { Pushable } from 'it-pushable' +import type { Uint8ArrayList } from 'uint8arraylist' + +/** + * On the producing side: + * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields. + * + * On the consuming side: + * * Enforce the fields to be present, reject otherwise. + * * Propagate only if the fields are valid and signature can be verified, reject otherwise. + */ +export const StrictSign = 'StrictSign' + +/** + * On the producing side: + * * Build messages without the signature, key, from and seqno fields. + * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty. + * + * On the consuming side: + * * Enforce the fields to be absent, reject otherwise. + * * Propagate only if the fields are absent, reject otherwise. + * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash. + */ +export const StrictNoSign = 'StrictNoSign' + +export type SignaturePolicy = typeof StrictSign | typeof StrictNoSign + +export interface SignedMessage { + type: 'signed' + from: PeerId + topic: string + data: Uint8Array + sequenceNumber: bigint + signature: Uint8Array + key: Uint8Array +} + +export interface UnsignedMessage { + type: 'unsigned' + topic: string + data: Uint8Array +} + +export type Message = SignedMessage | UnsignedMessage + +export interface PubSubRPCMessage { + from?: Uint8Array + topic?: string + data?: Uint8Array + sequenceNumber?: Uint8Array + signature?: Uint8Array + key?: Uint8Array +} + +export interface PubSubRPCSubscription { + subscribe?: boolean + topic?: string +} + +export interface PubSubRPC { + subscriptions: PubSubRPCSubscription[] + messages: PubSubRPCMessage[] +} + +export interface PeerStreams extends TypedEventTarget { + id: PeerId + protocol: string + outboundStream?: Pushable + inboundStream?: AsyncIterable + isWritable: boolean + + close(): void + write(buf: Uint8Array | Uint8ArrayList): void + attachInboundStream(stream: Stream): AsyncIterable + attachOutboundStream(stream: Stream): Promise> +} + +export interface PubSubInit { + enabled?: boolean + + multicodecs?: string[] + + /** + * defines how signatures should be handled + */ + globalSignaturePolicy?: SignaturePolicy + + /** + * if can relay messages not subscribed + */ + canRelayMessage?: boolean + + /** + * if publish should emit to self, if subscribed + */ + emitSelf?: boolean + + /** + * handle this many incoming pubsub messages concurrently + */ + messageProcessingConcurrency?: number + + /** + * How many parallel incoming streams to allow on the pubsub protocol per-connection + */ + maxInboundStreams?: number + + /** + * How many parallel outgoing streams to allow on the pubsub protocol per-connection + */ + maxOutboundStreams?: number +} + +interface Subscription { + topic: string + subscribe: boolean +} + +export interface SubscriptionChangeData { + peerId: PeerId + subscriptions: Subscription[] +} + +export interface PubSubEvents { + 'subscription-change': CustomEvent + 'message': CustomEvent +} + +export interface PublishResult { + recipients: PeerId[] +} + +export enum TopicValidatorResult { + /** + * The message is considered valid, and it should be delivered and forwarded to the network + */ + Accept = 'accept', + /** + * The message is neither delivered nor forwarded to the network + */ + Ignore = 'ignore', + /** + * The message is considered invalid, and it should be rejected + */ + Reject = 'reject' +} + +export interface TopicValidatorFn { + (peer: PeerId, message: Message): TopicValidatorResult | Promise +} + +export interface PubSub = PubSubEvents> extends TypedEventTarget { + /** + * The global signature policy controls whether or not we sill send and receive + * signed or unsigned messages. + * + * Signed messages prevent spoofing message senders and should be preferred to + * using unsigned messages. + */ + globalSignaturePolicy: typeof StrictSign | typeof StrictNoSign + + /** + * A list of multicodecs that contain the pubsub protocol name. + */ + multicodecs: string[] + + /** + * Pubsub routers support message validators per topic, which will validate the message + * before its propagations. They are stored in a map where keys are the topic name and + * values are the validators. + * + * @example + * + * ```js + * const topic = 'topic' + * const validateMessage = (msgTopic, msg) => { + * const input = uint8ArrayToString(msg.data) + * const validInputs = ['a', 'b', 'c'] + * + * if (!validInputs.includes(input)) { + * throw new Error('no valid input received') + * } + * } + * libp2p.pubsub.topicValidators.set(topic, validateMessage) + * ``` + */ + topicValidators: Map + + getPeers(): PeerId[] + + /** + * Gets a list of topics the node is subscribed to. + * + * ```js + * const topics = libp2p.pubsub.getTopics() + * ``` + */ + getTopics(): string[] + + /** + * Subscribes to a pubsub topic. + * + * @example + * + * ```js + * const topic = 'topic' + * const handler = (msg) => { + * if (msg.topic === topic) { + * // msg.data - pubsub data received + * } + * } + * + * libp2p.pubsub.addEventListener('message', handler) + * libp2p.pubsub.subscribe(topic) + * ``` + */ + subscribe(topic: string): void + + /** + * Unsubscribes from a pubsub topic. + * + * @example + * + * ```js + * const topic = 'topic' + * const handler = (msg) => { + * // msg.data - pubsub data received + * } + * + * libp2p.pubsub.removeEventListener(topic handler) + * libp2p.pubsub.unsubscribe(topic) + * ``` + */ + unsubscribe(topic: string): void + + /** + * Gets a list of the PeerIds that are subscribed to one topic. + * + * @example + * + * ```js + * const peerIds = libp2p.pubsub.getSubscribers(topic) + * ``` + */ + getSubscribers(topic: string): PeerId[] + + /** + * Publishes messages to the given topic. + * + * @example + * + * ```js + * const topic = 'topic' + * const data = uint8ArrayFromString('data') + * + * await libp2p.pubsub.publish(topic, data) + * ``` + */ + publish(topic: string, data: Uint8Array): Promise +} + +export interface PeerStreamEvents { + 'stream:inbound': CustomEvent + 'stream:outbound': CustomEvent + 'close': CustomEvent +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/record/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/record/index.ts new file mode 100644 index 000000000..5698d546b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/record/index.ts @@ -0,0 +1,35 @@ +import type { PeerId } from '../peer-id/index.js' +import type { Uint8ArrayList } from 'uint8arraylist' + +/** + * Record is the base implementation of a record that can be used as the payload of a libp2p envelope. + */ +export interface Record { + /** + * signature domain. + */ + domain: string + /** + * identifier of the type of record + */ + codec: Uint8Array + /** + * Marshal a record to be used in an envelope. + */ + marshal(): Uint8Array + /** + * Verifies if the other provided Record is identical to this one. + */ + equals(other: Record): boolean +} + +export interface Envelope { + peerId: PeerId + payloadType: Uint8Array | Uint8ArrayList + payload: Uint8Array + signature: Uint8Array | Uint8ArrayList + + marshal(): Uint8Array + validate(domain: string): Promise + equals(other: Envelope): boolean +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/startable.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/startable.ts new file mode 100644 index 000000000..7923b1d55 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/startable.ts @@ -0,0 +1,114 @@ +/** + * Implemented by components that have a lifecycle + */ +export interface Startable { + /** + * If implemented, this method will be invoked before the start method. + * + * It should not assume any other components have been started. + */ + beforeStart?(): void | Promise + + /** + * This method will be invoked to start the component. + * + * It should not assume that any other components have been started. + */ + start(): void | Promise + + /** + * If implemented, this method will be invoked after the start method. + * + * All other components will have had their start method invoked before this method is called. + */ + afterStart?(): void | Promise + + /** + * If implemented, this method will be invoked before the stop method. + * + * Any other components will still be running when this method is called. + */ + beforeStop?(): void | Promise + + /** + * This method will be invoked to stop the component. + * + * It should not assume any other components are running when it is called. + */ + stop(): void | Promise + + /** + * If implemented, this method will be invoked after the stop method. + * + * All other components will have had their stop method invoked before this method is called. + */ + afterStop?(): void | Promise +} + +export function isStartable (obj: any): obj is Startable { + return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function' +} + +export async function start (...objs: any[]): Promise { + const startables: Startable[] = [] + + for (const obj of objs) { + if (isStartable(obj)) { + startables.push(obj) + } + } + + await Promise.all( + startables.map(async s => { + if (s.beforeStart != null) { + await s.beforeStart() + } + }) + ) + + await Promise.all( + startables.map(async s => { + await s.start() + }) + ) + + await Promise.all( + startables.map(async s => { + if (s.afterStart != null) { + await s.afterStart() + } + }) + ) +} + +export async function stop (...objs: any[]): Promise { + const startables: Startable[] = [] + + for (const obj of objs) { + if (isStartable(obj)) { + startables.push(obj) + } + } + + await Promise.all( + startables.map(async s => { + if (s.beforeStop != null) { + await s.beforeStop() + } + }) + ) + + await Promise.all( + startables.map(async s => { + await s.stop() + }) + ) + + await Promise.all( + startables.map(async s => { + if (s.afterStop != null) { + await s.afterStop() + } + }) + ) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-handler/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-handler/index.ts new file mode 100644 index 000000000..e4ca91c6b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-handler/index.ts @@ -0,0 +1,33 @@ +import type { Connection, Stream } from '../connection/index.js' + +export interface IncomingStreamData { + stream: Stream + connection: Connection +} + +export interface StreamHandler { + (data: IncomingStreamData): void +} + +export interface StreamHandlerOptions { + /** + * How many incoming streams can be open for this protocol at the same time on each connection (default: 32) + */ + maxInboundStreams?: number + + /** + * How many outgoing streams can be open for this protocol at the same time on each connection (default: 64) + */ + maxOutboundStreams?: number + + /** + * Opt-in to running over a transient connection - one that has time/data limits + * placed on it. + */ + runOnTransientConnection?: boolean +} + +export interface StreamHandlerRecord { + handler: StreamHandler + options: StreamHandlerOptions +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/index.ts new file mode 100644 index 000000000..0d2b41117 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/index.ts @@ -0,0 +1,63 @@ +import type { Direction, Stream } from '../connection/index.js' +import type { AbortOptions } from '../index.js' +import type { Duplex } from 'it-stream-types' +import type { Uint8ArrayList } from 'uint8arraylist' + +export interface StreamMuxerFactory { + /** + * The protocol used to select this muxer during connection opening + */ + protocol: string + + /** + * Creates a new stream muxer to be used with a new connection + */ + createStreamMuxer(init?: StreamMuxerInit): StreamMuxer +} + +/** + * A libp2p stream muxer + */ +export interface StreamMuxer extends Duplex> { + /** + * The protocol used to select this muxer during connection opening + */ + protocol: string + + /** + * A list of streams that are currently open. Closed streams will not be returned. + */ + readonly streams: Stream[] + /** + * Initiate a new stream with the given name. If no name is + * provided, the id of the stream will be used. + */ + newStream(name?: string): Stream | Promise + + /** + * Close or abort all tracked streams and stop the muxer + */ + close(options?: AbortOptions): Promise + + /** + * Close or abort all tracked streams and stop the muxer + */ + abort(err: Error): void +} + +export interface StreamMuxerInit { + /** + * A callback function invoked every time an incoming stream is opened + */ + onIncomingStream?(stream: Stream): void + + /** + * A callback function invoke every time a stream ends + */ + onStreamEnd?(stream: Stream): void + + /** + * Outbound stream muxers are opened by the local node, inbound stream muxers are opened by the remote + */ + direction?: Direction +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/stream.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/stream.ts new file mode 100644 index 000000000..1e70ed9cc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/stream-muxer/stream.ts @@ -0,0 +1,11 @@ +// TODO: remove this file and the dep-check override in package.json for +// @libp2p/utils when yamux is updated. +// This is a hack to defeat TypeScript trying to inspect the types for +// @libp2p/utils/abstract-stream which depends on this module - making the +// import path only resolvable at runtime breaks the transpile time circular +// dependency +const s = await import('@libp2p/utils' + '/abstract-stream') + +export type AbstractStreamInit = any + +export const AbstractStream = s.AbstractStream diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/topology/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/topology/index.ts new file mode 100644 index 000000000..76bb64c1e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/topology/index.ts @@ -0,0 +1,22 @@ +import type { Connection } from '../connection/index.js' +import type { PeerId } from '../peer-id/index.js' + +export interface Topology { + /** + * If true, invoke `onConnect` for this topology on transient (e.g. short-lived + * and/or data-limited) connections. (default: false) + */ + notifyOnTransient?: boolean + + /** + * Invoked when a new connection is opened to a peer that supports the + * registered protocol + */ + onConnect?(peerId: PeerId, conn: Connection): void + + /** + * Invoked when the last connection to a peer that supports the registered + * protocol closes + */ + onDisconnect?(peerId: PeerId): void +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/transport/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/transport/index.ts new file mode 100644 index 000000000..22ab1a803 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/interface/src/transport/index.ts @@ -0,0 +1,117 @@ +import type { Connection, MultiaddrConnection } from '../connection/index.js' +import type { TypedEventTarget } from '../events.js' +import type { AbortOptions } from '../index.js' +import type { StreamMuxerFactory } from '../stream-muxer/index.js' +import type { Multiaddr } from '@multiformats/multiaddr' + +export interface ListenerEvents { + 'connection': CustomEvent + 'listening': CustomEvent + 'error': CustomEvent + 'close': CustomEvent +} + +export interface Listener extends TypedEventTarget { + /** + * Start a listener + */ + listen(multiaddr: Multiaddr): Promise + /** + * Get listen addresses + */ + getAddrs(): Multiaddr[] + /** + * Close listener + * + * @returns {Promise} + */ + close(): Promise +} + +export const symbol = Symbol.for('@libp2p/transport') + +export interface ConnectionHandler { (connection: Connection): void } + +export interface MultiaddrFilter { (multiaddrs: Multiaddr[]): Multiaddr[] } + +export interface CreateListenerOptions { + handler?: ConnectionHandler + upgrader: Upgrader +} + +export interface DialOptions extends AbortOptions { + upgrader: Upgrader +} + +/** + * A libp2p transport is understood as something that offers a dial and listen interface to establish connections. + */ +export interface Transport { + /** + * Used to identify the transport + */ + [Symbol.toStringTag]: string + + /** + * Used by the isTransport function + */ + [symbol]: true + + /** + * Dial a given multiaddr. + */ + dial(ma: Multiaddr, options: DialOptions): Promise + + /** + * Create transport listeners. + */ + createListener(options: CreateListenerOptions): Listener + + /** + * Takes a list of `Multiaddr`s and returns only valid addresses for the transport + */ + filter: MultiaddrFilter +} + +export function isTransport (other: any): other is Transport { + return other != null && Boolean(other[symbol]) +} + +/** + * Enum Transport Manager Fault Tolerance values + */ +export enum FaultTolerance { + /** + * should be used for failing in any listen circumstance + */ + FATAL_ALL = 0, + + /** + * should be used for not failing when not listening + */ + NO_FATAL +} + +export interface UpgraderOptions { + skipEncryption?: boolean + skipProtection?: boolean + muxerFactory?: StreamMuxerFactory + + /** + * The passed MultiaddrConnection has limits place on duration and/or data + * transfer amounts so is not expected to be open for very long. + */ + transient?: boolean +} + +export interface Upgrader { + /** + * Upgrades an outbound connection on `transport.dial`. + */ + upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise + + /** + * Upgrades an inbound connection on transport listener. + */ + upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/libp2p/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/libp2p/package.json index 3e8023769..1cb455c95 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/libp2p/package.json +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/libp2p/package.json @@ -61,16 +61,16 @@ "test:interop": "aegir test -t node -f dist/test/interop.js" }, "dependencies": { - "@libp2p/crypto": "^2.0.8", - "@libp2p/interface": "^0.1.6", - "@libp2p/interface-internal": "^0.1.9", - "@libp2p/logger": "^3.1.0", - "@libp2p/multistream-select": "^4.0.6", - "@libp2p/peer-collections": "^4.0.8", - "@libp2p/peer-id": "^3.0.6", - "@libp2p/peer-id-factory": "^3.0.8", - "@libp2p/peer-store": "^9.0.9", - "@libp2p/utils": "^4.0.7", + "@libp2p/crypto": "file:../crypto", + "@libp2p/interface": "file:../interface", + "@libp2p/interface-internal": "next", + "@libp2p/logger": "next", + "@libp2p/multistream-select": "next", + "@libp2p/peer-collections": "next", + "@libp2p/peer-id": "next", + "@libp2p/peer-id-factory": "next", + "@libp2p/peer-store": "next", + "@libp2p/utils": "file:../utils", "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr-matcher": "^1.1.0", @@ -95,34 +95,6 @@ "uint8arraylist": "^2.4.3", "uint8arrays": "^4.0.6" }, - "devDependencies": { - "@chainsafe/libp2p-gossipsub": "^10.0.0", - "@chainsafe/libp2p-noise": "^13.0.2", - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/bootstrap": "^9.0.12", - "@libp2p/circuit-relay-v2": "^0.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/floodsub": "^8.0.13", - "@libp2p/identify": "^0.0.0", - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/interop": "^9.0.0", - "@libp2p/kad-dht": "^10.0.15", - "@libp2p/mdns": "^9.0.14", - "@libp2p/mplex": "^9.0.12", - "@libp2p/plaintext": "^0.0.0", - "@libp2p/tcp": "^8.0.13", - "@libp2p/websockets": "^7.0.13", - "aegir": "^41.0.2", - "execa": "^8.0.1", - "go-libp2p": "^1.1.1", - "it-pushable": "^3.2.1", - "p-event": "^6.0.0", - "p-times": "^4.0.0", - "p-wait-for": "^5.0.2", - "sinon": "^17.0.0", - "sinon-ts": "^2.0.0" - }, "browser": { "./dist/src/connection-manager/constants.js": "./dist/src/connection-manager/constants.browser.js", "./dist/src/config/connection-gater.js": "./dist/src/config/connection-gater.browser.js" diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js index cd5ccfacd..9fe1be247 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/index.min.js @@ -1,18 +1,18 @@ (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ChainsafeLibp2PNoise = factory()}(typeof self !== 'undefined' ? self : this, function () { -"use strict";var ChainsafeLibp2PNoise=(()=>{var xu=Object.create;var On=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_t=(t,e)=>{for(var r in e)On(t,r,{get:e[r],enumerable:!0})},ha=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!wu.call(t,i)&&i!==r&&On(t,i,{get:()=>e[i],enumerable:!(n=mu(e,i))||n.enumerable});return t};var zt=(t,e,r)=>(r=t!=null?xu(vu(t)):{},ha(e||!t||!t.__esModule?On(r,"default",{value:t,enumerable:!0}):r,t)),Eu=t=>ha(On({},"__esModule",{value:!0}),t);var xa=ht((og,ga)=>{"use strict";function ya(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lu(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ya(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),ya(new i,r)}}ga.exports=Lu});var lt=ht((h2,m0)=>{m0.exports={options:{usePureJavaScript:!1}}});var w0=ht((l2,v0)=>{var ks={};v0.exports=ks;var b0={};ks.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=il(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(f%s),f=f/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r -`)}return n};ks.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=b0[e];if(!r){r=b0[e]=[];for(var n=0;n>=8;for(;f>0;)o.push(f&255),f>>=8}for(var u=0;t[u]===s&&u0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var Bt=ht((d2,A0)=>{var E0=lt(),S0=w0(),b=A0.exports=E0.util=E0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){b.nextTick=process.nextTick,typeof setImmediate=="function"?b.setImmediate=setImmediate:b.setImmediate=b.nextTick;return}if(typeof setImmediate=="function"){b.setImmediate=function(){return setImmediate.apply(void 0,arguments)},b.nextTick=function(a){return setImmediate(a)};return}if(b.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(u){u()})}};var o=a,t="forge.setImmediate",e=[];b.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(i,{attributes:!0});var s=b.setImmediate;b.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}b.nextTick=b.setImmediate})();b.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;b.globalScope=function(){return b.isNodejs?globalThis:typeof self>"u"?window:self}();b.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};b.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};b.isArrayBufferView=function(t){return t&&b.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function yn(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}b.ByteBuffer=Ps;function Ps(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(b.isArrayBuffer(t)||b.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rsl&&(this.data.substr(0,1),this._constructedStringLength=0)};b.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};b.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};b.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};b.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};b.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};b.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(b.encodeUtf8(t))};b.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};b.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};b.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};b.ByteStringBuffer.prototype.putInt=function(t,e){yn(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};b.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};b.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};b.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};b.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};b.ByteStringBuffer.prototype.copy=function(){var t=b.createBuffer(this.data);return t.read=this.read,t};b.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};b.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};b.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};b.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};b.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};b.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};b.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};b.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};b.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};b.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};b.DataBuffer.prototype.putInt=function(t,e){yn(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};b.DataBuffer.prototype.putSignedInt=function(t,e){return yn(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};b.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};b.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};b.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};b.DataBuffer.prototype.copy=function(){return new b.DataBuffer(this)};b.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};b.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};b.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};b.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};b.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};b.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],B0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +"use strict";var ChainsafeLibp2PNoise=(()=>{var xu=Object.create;var Mn=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,wu=Object.prototype.hasOwnProperty;var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Lt=(t,e)=>{for(var r in e)Mn(t,r,{get:e[r],enumerable:!0})},ha=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!wu.call(t,i)&&i!==r&&Mn(t,i,{get:()=>e[i],enumerable:!(n=mu(e,i))||n.enumerable});return t};var Gt=(t,e,r)=>(r=t!=null?xu(vu(t)):{},ha(e||!t||!t.__esModule?Mn(r,"default",{value:t,enumerable:!0}):r,t)),Eu=t=>ha(Mn({},"__esModule",{value:!0}),t);var xa=ht((og,ga)=>{"use strict";function ya(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lu(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ya(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),ya(new i,r)}}ga.exports=Lu});var lt=ht((h2,m0)=>{m0.exports={options:{usePureJavaScript:!1}}});var w0=ht((l2,v0)=>{var ks={};v0.exports=ks;var b0={};ks.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=il(t,e);else{var i=0,s=e.length,o=e.charAt(0),a=[0];for(i=0;i0;)a.push(f%s),f=f/s|0}for(i=0;t[i]===0&&i=0;--i)n+=e[a[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r +`)}return n};ks.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=b0[e];if(!r){r=b0[e]=[];for(var n=0;n>=8;for(;f>0;)o.push(f&255),f>>=8}for(var u=0;t[u]===s&&u0;)s.push(a%n),a=a/n|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var At=ht((d2,A0)=>{var E0=lt(),S0=w0(),b=A0.exports=E0.util=E0.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){b.nextTick=process.nextTick,typeof setImmediate=="function"?b.setImmediate=setImmediate:b.setImmediate=b.nextTick;return}if(typeof setImmediate=="function"){b.setImmediate=function(){return setImmediate.apply(void 0,arguments)},b.nextTick=function(a){return setImmediate(a)};return}if(b.setImmediate=function(a){setTimeout(a,0)},typeof window<"u"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(u){u()})}};var o=a,t="forge.setImmediate",e=[];b.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(i,{attributes:!0});var s=b.setImmediate;b.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}b.nextTick=b.setImmediate})();b.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;b.globalScope=function(){return b.isNodejs?globalThis:typeof self>"u"?window:self}();b.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};b.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};b.isArrayBufferView=function(t){return t&&b.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function gn(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}b.ByteBuffer=Ps;function Ps(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(b.isArrayBuffer(t)||b.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rsl&&(this.data.substr(0,1),this._constructedStringLength=0)};b.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};b.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};b.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};b.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};b.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};b.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(b.encodeUtf8(t))};b.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};b.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};b.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};b.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};b.ByteStringBuffer.prototype.putInt=function(t,e){gn(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};b.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};b.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};b.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};b.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};b.ByteStringBuffer.prototype.copy=function(){var t=b.createBuffer(this.data);return t.read=this.read,t};b.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};b.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};b.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};b.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};b.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};b.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};b.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};b.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};b.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};b.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};b.DataBuffer.prototype.putInt=function(t,e){gn(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};b.DataBuffer.prototype.putSignedInt=function(t,e){return gn(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};b.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};b.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};b.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};b.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};b.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};b.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};b.DataBuffer.prototype.copy=function(){return new b.DataBuffer(this)};b.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};b.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};b.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};b.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};b.xorBytes=function(t,e,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n};b.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],B0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.encode64=function(t,e){for(var r="",n="",i,s,o,a=0;a>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r `,r=r.substr(e));return n+=r,n};b.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,s,o=0;o>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};b.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};b.decodeUtf8=function(t){return decodeURIComponent(escape(t))};b.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:S0.encode,decode:S0.decode}};b.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};b.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s>2),r+=$e.charAt((i&3)<<4|s>>4),isNaN(s)?r+="==":(r+=$e.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":$e.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};b.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,f=r;c>4,o!==64&&(n[f++]=(s&15)<<4|o>>2,a!==64&&(n[f++]=(o&3)<<6|a));return e?f-r:n.subarray(0,f)};b.binary.base58.encode=function(t,e){return b.binary.baseN.encode(t,B0,e)};b.binary.base58.decode=function(t,e){return b.binary.baseN.decode(t,B0,e)};b.text={utf8:{},utf16:{}};b.text.utf8.encode=function(t,e,r){t=b.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};b.setItem=function(t,e,r,n,i){pi(al,arguments,i)};b.getItem=function(t,e,r,n){return pi(cl,arguments,n)};b.removeItem=function(t,e,r,n){pi(fl,arguments,n)};b.clearItems=function(t,e,r){pi(ul,arguments,r)};b.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};b.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};b.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return c+(u?f.substr(0,u)+a:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-f).toFixed(s).slice(2):"")};b.formatSize=function(t){return t>=1073741824?t=b.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=b.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=b.formatNumber(t/1024,0)+" KiB":t=b.formatNumber(t,0)+" bytes",t};b.bytesFromIP=function(t){return t.indexOf(".")!==-1?b.bytesFromIPv4(t):t.indexOf(":")!==-1?b.bytesFromIPv6(t):null};b.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=b.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};b.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in b&&!t.update)return e(null,b.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return b.cores=navigator.hardwareConcurrency,e(null,b.cores);if(typeof Worker>"u")return b.cores=1,e(null,b.cores);if(typeof Blob>"u")return b.cores=2,e(null,b.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()g.st&&u.stu.st&&g.st{var gn=lt();gn.pki=gn.pki||{};var Os=C0.exports=gn.pki.oids=gn.oids=gn.oids||{};function k(t,e){Os[t]=e,Os[e]=t}function ft(t,e){Os[t]=e}k("1.2.840.113549.1.1.1","rsaEncryption");k("1.2.840.113549.1.1.4","md5WithRSAEncryption");k("1.2.840.113549.1.1.5","sha1WithRSAEncryption");k("1.2.840.113549.1.1.7","RSAES-OAEP");k("1.2.840.113549.1.1.8","mgf1");k("1.2.840.113549.1.1.9","pSpecified");k("1.2.840.113549.1.1.10","RSASSA-PSS");k("1.2.840.113549.1.1.11","sha256WithRSAEncryption");k("1.2.840.113549.1.1.12","sha384WithRSAEncryption");k("1.2.840.113549.1.1.13","sha512WithRSAEncryption");k("1.3.101.112","EdDSA25519");k("1.2.840.10040.4.3","dsa-with-sha1");k("1.3.14.3.2.7","desCBC");k("1.3.14.3.2.26","sha1");k("1.3.14.3.2.29","sha1WithRSASignature");k("2.16.840.1.101.3.4.2.1","sha256");k("2.16.840.1.101.3.4.2.2","sha384");k("2.16.840.1.101.3.4.2.3","sha512");k("2.16.840.1.101.3.4.2.4","sha224");k("2.16.840.1.101.3.4.2.5","sha512-224");k("2.16.840.1.101.3.4.2.6","sha512-256");k("1.2.840.113549.2.2","md2");k("1.2.840.113549.2.5","md5");k("1.2.840.113549.1.7.1","data");k("1.2.840.113549.1.7.2","signedData");k("1.2.840.113549.1.7.3","envelopedData");k("1.2.840.113549.1.7.4","signedAndEnvelopedData");k("1.2.840.113549.1.7.5","digestedData");k("1.2.840.113549.1.7.6","encryptedData");k("1.2.840.113549.1.9.1","emailAddress");k("1.2.840.113549.1.9.2","unstructuredName");k("1.2.840.113549.1.9.3","contentType");k("1.2.840.113549.1.9.4","messageDigest");k("1.2.840.113549.1.9.5","signingTime");k("1.2.840.113549.1.9.6","counterSignature");k("1.2.840.113549.1.9.7","challengePassword");k("1.2.840.113549.1.9.8","unstructuredAddress");k("1.2.840.113549.1.9.14","extensionRequest");k("1.2.840.113549.1.9.20","friendlyName");k("1.2.840.113549.1.9.21","localKeyId");k("1.2.840.113549.1.9.22.1","x509Certificate");k("1.2.840.113549.1.12.10.1.1","keyBag");k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");k("1.2.840.113549.1.12.10.1.3","certBag");k("1.2.840.113549.1.12.10.1.4","crlBag");k("1.2.840.113549.1.12.10.1.5","secretBag");k("1.2.840.113549.1.12.10.1.6","safeContentsBag");k("1.2.840.113549.1.5.13","pkcs5PBES2");k("1.2.840.113549.1.5.12","pkcs5PBKDF2");k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");k("1.2.840.113549.2.7","hmacWithSHA1");k("1.2.840.113549.2.8","hmacWithSHA224");k("1.2.840.113549.2.9","hmacWithSHA256");k("1.2.840.113549.2.10","hmacWithSHA384");k("1.2.840.113549.2.11","hmacWithSHA512");k("1.2.840.113549.3.7","des-EDE3-CBC");k("2.16.840.1.101.3.4.1.2","aes128-CBC");k("2.16.840.1.101.3.4.1.22","aes192-CBC");k("2.16.840.1.101.3.4.1.42","aes256-CBC");k("2.5.4.3","commonName");k("2.5.4.4","surname");k("2.5.4.5","serialNumber");k("2.5.4.6","countryName");k("2.5.4.7","localityName");k("2.5.4.8","stateOrProvinceName");k("2.5.4.9","streetAddress");k("2.5.4.10","organizationName");k("2.5.4.11","organizationalUnitName");k("2.5.4.12","title");k("2.5.4.13","description");k("2.5.4.15","businessCategory");k("2.5.4.17","postalCode");k("2.5.4.42","givenName");k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");k("2.16.840.1.113730.1.1","nsCertType");k("2.16.840.1.113730.1.13","nsComment");ft("2.5.29.1","authorityKeyIdentifier");ft("2.5.29.2","keyAttributes");ft("2.5.29.3","certificatePolicies");ft("2.5.29.4","keyUsageRestriction");ft("2.5.29.5","policyMapping");ft("2.5.29.6","subtreesConstraint");ft("2.5.29.7","subjectAltName");ft("2.5.29.8","issuerAltName");ft("2.5.29.9","subjectDirectoryAttributes");ft("2.5.29.10","basicConstraints");ft("2.5.29.11","nameConstraints");ft("2.5.29.12","policyConstraints");ft("2.5.29.13","basicConstraints");k("2.5.29.14","subjectKeyIdentifier");k("2.5.29.15","keyUsage");ft("2.5.29.16","privateKeyUsagePeriod");k("2.5.29.17","subjectAltName");k("2.5.29.18","issuerAltName");k("2.5.29.19","basicConstraints");ft("2.5.29.20","cRLNumber");ft("2.5.29.21","cRLReason");ft("2.5.29.22","expirationDate");ft("2.5.29.23","instructionCode");ft("2.5.29.24","invalidityDate");ft("2.5.29.25","cRLDistributionPoints");ft("2.5.29.26","issuingDistributionPoint");ft("2.5.29.27","deltaCRLIndicator");ft("2.5.29.28","issuingDistributionPoint");ft("2.5.29.29","certificateIssuer");ft("2.5.29.30","nameConstraints");k("2.5.29.31","cRLDistributionPoints");k("2.5.29.32","certificatePolicies");ft("2.5.29.33","policyMappings");ft("2.5.29.34","policyConstraints");k("2.5.29.35","authorityKeyIdentifier");ft("2.5.29.36","policyConstraints");k("2.5.29.37","extKeyUsage");ft("2.5.29.46","freshestCRL");ft("2.5.29.54","inhibitAnyPolicy");k("1.3.6.1.4.1.11129.2.4.2","timestampList");k("1.3.6.1.5.5.7.1.1","authorityInfoAccess");k("1.3.6.1.5.5.7.3.1","serverAuth");k("1.3.6.1.5.5.7.3.2","clientAuth");k("1.3.6.1.5.5.7.3.3","codeSigning");k("1.3.6.1.5.5.7.3.4","emailProtection");k("1.3.6.1.5.5.7.3.8","timeStamping")});var mn=ht((y2,T0)=>{var xt=lt();Bt();yi();var F=T0.exports=xt.asn1=xt.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};F.create=function(t,e,r,n,i){if(xt.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var hl=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;xn(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};F.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.length(),n=gi(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function gi(t,e,r,n){var i;xn(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=hl(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=c,f}c=e}var u,h,l=(s&32)===32;if(l)if(u=[],c===void 0)for(;;){if(xn(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(gi(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),u.push(gi(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(u===void 0&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&(h=t.bytes(c)),u===void 0&&n.decodeBitStrings&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&c>1){var g=t.read,d=e,p=0;if(a===F.Type.BITSTRING&&(xn(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},x=gi(t,e,r+1,y),v=i-t.length();e-=v,a==F.Type.BITSTRING&&v++;var m=x.tagClass;v===c&&(m===F.Class.UNIVERSAL||m===F.Class.CONTEXT_SPECIFIC)&&(u=[x])}catch{}u===void 0&&(t.read=g,e=d)}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===F.Type.BMPSTRING)for(u="";c>0;c-=2)xn(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(c),e-=c}var A=h===void 0?null:{bitStringContents:h};return F.create(o,a,l,u,A)}F.toDer=function(t){var e=xt.util.createBuffer(),r=t.tagClass|t.type,n=xt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=F.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};F.oidToDer=function(t){var e=t.split("."),r=xt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};F.derToOid=function(t){var e;typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};F.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),f=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),f&&(c=t.charAt(f),c==="+"||c==="-")){var u=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),l=u*60+h;l*=6e4,c==="+"?e.setTime(+e-l):e.setTime(+e+l)}return e};F.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,f=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,l=t.charAt(h);if(l==="+"||l==="-"){var g=parseInt(t.substr(h+1,2),10),d=parseInt(t.substr(h+4,2),10);f=g*60+d,f*=6e4,l==="+"&&(f*=-1),u=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};F.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};F.derToInteger=function(t){typeof t=="string"&&(t=xt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};F.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&xt.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` +`,r=r.substr(e));return n+=r,n};b.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,s,o,a,c=0,f=r;c>4,o!==64&&(n[f++]=(s&15)<<4|o>>2,a!==64&&(n[f++]=(o&3)<<6|a));return e?f-r:n.subarray(0,f)};b.binary.base58.encode=function(t,e){return b.binary.baseN.encode(t,B0,e)};b.binary.base58.decode=function(t,e){return b.binary.baseN.decode(t,B0,e)};b.text={utf8:{},utf16:{}};b.text.utf8.encode=function(t,e,r){t=b.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,s=0;s"u"&&(r=["web","flash"]);var i,s=!1,o=null;for(var a in r){i=r[a];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(c){o=c}if(s)break}if(!s)throw o;return n};b.setItem=function(t,e,r,n,i){pi(al,arguments,i)};b.getItem=function(t,e,r,n){return pi(cl,arguments,n)};b.removeItem=function(t,e,r,n){pi(fl,arguments,n)};b.clearItems=function(t,e,r){pi(ul,arguments,r)};b.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};b.format=function(t){for(var e=/%./g,r,n,i=0,s=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&s.push(n),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};b.formatNumber=function(t,e,r,n){var i=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=n===void 0?".":n,c=i<0?"-":"",f=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",u=f.length>3?f.length%3:0;return c+(u?f.substr(0,u)+a:"")+f.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-f).toFixed(s).slice(2):"")};b.formatSize=function(t){return t>=1073741824?t=b.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=b.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=b.formatNumber(t/1024,0)+" KiB":t=b.formatNumber(t,0)+" bytes",t};b.bytesFromIP=function(t){return t.indexOf(".")!==-1?b.bytesFromIPv4(t):t.indexOf(":")!==-1?b.bytesFromIPv6(t):null};b.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=b.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};b.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in b&&!t.update)return e(null,b.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return b.cores=navigator.hardwareConcurrency,e(null,b.cores);if(typeof Worker>"u")return b.cores=1,e(null,b.cores);if(typeof Blob>"u")return b.cores=2,e(null,b.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()g.st&&u.stu.st&&g.st{var xn=lt();xn.pki=xn.pki||{};var Os=C0.exports=xn.pki.oids=xn.oids=xn.oids||{};function k(t,e){Os[t]=e,Os[e]=t}function ft(t,e){Os[t]=e}k("1.2.840.113549.1.1.1","rsaEncryption");k("1.2.840.113549.1.1.4","md5WithRSAEncryption");k("1.2.840.113549.1.1.5","sha1WithRSAEncryption");k("1.2.840.113549.1.1.7","RSAES-OAEP");k("1.2.840.113549.1.1.8","mgf1");k("1.2.840.113549.1.1.9","pSpecified");k("1.2.840.113549.1.1.10","RSASSA-PSS");k("1.2.840.113549.1.1.11","sha256WithRSAEncryption");k("1.2.840.113549.1.1.12","sha384WithRSAEncryption");k("1.2.840.113549.1.1.13","sha512WithRSAEncryption");k("1.3.101.112","EdDSA25519");k("1.2.840.10040.4.3","dsa-with-sha1");k("1.3.14.3.2.7","desCBC");k("1.3.14.3.2.26","sha1");k("1.3.14.3.2.29","sha1WithRSASignature");k("2.16.840.1.101.3.4.2.1","sha256");k("2.16.840.1.101.3.4.2.2","sha384");k("2.16.840.1.101.3.4.2.3","sha512");k("2.16.840.1.101.3.4.2.4","sha224");k("2.16.840.1.101.3.4.2.5","sha512-224");k("2.16.840.1.101.3.4.2.6","sha512-256");k("1.2.840.113549.2.2","md2");k("1.2.840.113549.2.5","md5");k("1.2.840.113549.1.7.1","data");k("1.2.840.113549.1.7.2","signedData");k("1.2.840.113549.1.7.3","envelopedData");k("1.2.840.113549.1.7.4","signedAndEnvelopedData");k("1.2.840.113549.1.7.5","digestedData");k("1.2.840.113549.1.7.6","encryptedData");k("1.2.840.113549.1.9.1","emailAddress");k("1.2.840.113549.1.9.2","unstructuredName");k("1.2.840.113549.1.9.3","contentType");k("1.2.840.113549.1.9.4","messageDigest");k("1.2.840.113549.1.9.5","signingTime");k("1.2.840.113549.1.9.6","counterSignature");k("1.2.840.113549.1.9.7","challengePassword");k("1.2.840.113549.1.9.8","unstructuredAddress");k("1.2.840.113549.1.9.14","extensionRequest");k("1.2.840.113549.1.9.20","friendlyName");k("1.2.840.113549.1.9.21","localKeyId");k("1.2.840.113549.1.9.22.1","x509Certificate");k("1.2.840.113549.1.12.10.1.1","keyBag");k("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");k("1.2.840.113549.1.12.10.1.3","certBag");k("1.2.840.113549.1.12.10.1.4","crlBag");k("1.2.840.113549.1.12.10.1.5","secretBag");k("1.2.840.113549.1.12.10.1.6","safeContentsBag");k("1.2.840.113549.1.5.13","pkcs5PBES2");k("1.2.840.113549.1.5.12","pkcs5PBKDF2");k("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");k("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");k("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");k("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");k("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");k("1.2.840.113549.2.7","hmacWithSHA1");k("1.2.840.113549.2.8","hmacWithSHA224");k("1.2.840.113549.2.9","hmacWithSHA256");k("1.2.840.113549.2.10","hmacWithSHA384");k("1.2.840.113549.2.11","hmacWithSHA512");k("1.2.840.113549.3.7","des-EDE3-CBC");k("2.16.840.1.101.3.4.1.2","aes128-CBC");k("2.16.840.1.101.3.4.1.22","aes192-CBC");k("2.16.840.1.101.3.4.1.42","aes256-CBC");k("2.5.4.3","commonName");k("2.5.4.4","surname");k("2.5.4.5","serialNumber");k("2.5.4.6","countryName");k("2.5.4.7","localityName");k("2.5.4.8","stateOrProvinceName");k("2.5.4.9","streetAddress");k("2.5.4.10","organizationName");k("2.5.4.11","organizationalUnitName");k("2.5.4.12","title");k("2.5.4.13","description");k("2.5.4.15","businessCategory");k("2.5.4.17","postalCode");k("2.5.4.42","givenName");k("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");k("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");k("2.16.840.1.113730.1.1","nsCertType");k("2.16.840.1.113730.1.13","nsComment");ft("2.5.29.1","authorityKeyIdentifier");ft("2.5.29.2","keyAttributes");ft("2.5.29.3","certificatePolicies");ft("2.5.29.4","keyUsageRestriction");ft("2.5.29.5","policyMapping");ft("2.5.29.6","subtreesConstraint");ft("2.5.29.7","subjectAltName");ft("2.5.29.8","issuerAltName");ft("2.5.29.9","subjectDirectoryAttributes");ft("2.5.29.10","basicConstraints");ft("2.5.29.11","nameConstraints");ft("2.5.29.12","policyConstraints");ft("2.5.29.13","basicConstraints");k("2.5.29.14","subjectKeyIdentifier");k("2.5.29.15","keyUsage");ft("2.5.29.16","privateKeyUsagePeriod");k("2.5.29.17","subjectAltName");k("2.5.29.18","issuerAltName");k("2.5.29.19","basicConstraints");ft("2.5.29.20","cRLNumber");ft("2.5.29.21","cRLReason");ft("2.5.29.22","expirationDate");ft("2.5.29.23","instructionCode");ft("2.5.29.24","invalidityDate");ft("2.5.29.25","cRLDistributionPoints");ft("2.5.29.26","issuingDistributionPoint");ft("2.5.29.27","deltaCRLIndicator");ft("2.5.29.28","issuingDistributionPoint");ft("2.5.29.29","certificateIssuer");ft("2.5.29.30","nameConstraints");k("2.5.29.31","cRLDistributionPoints");k("2.5.29.32","certificatePolicies");ft("2.5.29.33","policyMappings");ft("2.5.29.34","policyConstraints");k("2.5.29.35","authorityKeyIdentifier");ft("2.5.29.36","policyConstraints");k("2.5.29.37","extKeyUsage");ft("2.5.29.46","freshestCRL");ft("2.5.29.54","inhibitAnyPolicy");k("1.3.6.1.4.1.11129.2.4.2","timestampList");k("1.3.6.1.5.5.7.1.1","authorityInfoAccess");k("1.3.6.1.5.5.7.3.1","serverAuth");k("1.3.6.1.5.5.7.3.2","clientAuth");k("1.3.6.1.5.5.7.3.3","codeSigning");k("1.3.6.1.5.5.7.3.4","emailProtection");k("1.3.6.1.5.5.7.3.8","timeStamping")});var bn=ht((y2,T0)=>{var xt=lt();At();yi();var F=T0.exports=xt.asn1=xt.asn1||{};F.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};F.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};F.create=function(t,e,r,n,i){if(xt.util.isArray(n)){for(var s=[],o=0;oe){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var hl=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var s=r&127;mn(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};F.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.length(),n=gi(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function gi(t,e,r,n){var i;mn(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;i=t.length();var c=hl(t,e);if(e-=i-t.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=c,f}c=e}var u,h,l=(s&32)===32;if(l)if(u=[],c===void 0)for(;;){if(mn(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),u.push(gi(t,e,r+1,n)),e-=i-t.length()}else for(;c>0;)i=t.length(),u.push(gi(t,c,r+1,n)),e-=i-t.length(),c-=i-t.length();if(u===void 0&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&(h=t.bytes(c)),u===void 0&&n.decodeBitStrings&&o===F.Class.UNIVERSAL&&a===F.Type.BITSTRING&&c>1){var g=t.read,d=e,p=0;if(a===F.Type.BITSTRING&&(mn(t,e,1),p=t.getByte(),e--),p===0)try{i=t.length();var y={strict:!0,decodeBitStrings:!0},x=gi(t,e,r+1,y),v=i-t.length();e-=v,a==F.Type.BITSTRING&&v++;var m=x.tagClass;v===c&&(m===F.Class.UNIVERSAL||m===F.Class.CONTEXT_SPECIFIC)&&(u=[x])}catch{}u===void 0&&(t.read=g,e=d)}if(u===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===F.Type.BMPSTRING)for(u="";c>0;c-=2)mn(t,e,2),u+=String.fromCharCode(t.getInt16()),e-=2;else u=t.getBytes(c),e-=c}var A=h===void 0?null:{bitStringContents:h};return F.create(o,a,l,u,A)}F.toDer=function(t){var e=xt.util.createBuffer(),r=t.tagClass|t.type,n=xt.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=F.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(n),e};F.oidToDer=function(t){var e=t.split("."),r=xt.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,s,o,a=2;a>>7,n||(o|=128),i.push(o),n=!1;while(s>0);for(var c=i.length-1;c>=0;--c)r.putByte(i[c])}return r};F.derToOid=function(t){var e;typeof t=="string"&&(t=xt.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};F.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),f=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,0),f&&(c=t.charAt(f),c==="+"||c==="-")){var u=parseInt(t.substr(f+1,2),10),h=parseInt(t.substr(f+4,2),10),l=u*60+h;l*=6e4,c==="+"?e.setTime(+e-l):e.setTime(+e+l)}return e};F.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,f=0,u=!1;t.charAt(t.length-1)==="Z"&&(u=!0);var h=t.length-5,l=t.charAt(h);if(l==="+"||l==="-"){var g=parseInt(t.substr(h+1,2),10),d=parseInt(t.substr(h+4,2),10);f=g*60+d,f*=6e4,l==="+"&&(f*=-1),u=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(s,o,a,c),e.setTime(+e+f)):(e.setFullYear(r,n,i),e.setHours(s,o,a,c)),e};F.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};F.derToInteger=function(t){typeof t=="string"&&(t=xt.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};F.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&xt.util.isArray(e.value))for(var s=0,o=0;i&&o0&&(n+=` `);for(var i="",s=0;s1?n+="0x"+xt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===F.Type.OCTETSTRING)I0.test(t.value)||(n+="("+t.value+") "),n+="0x"+xt.util.bytesToHex(t.value);else if(t.type===F.Type.UTF8)try{n+=xt.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+xt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===F.Type.PRINTABLESTRING||t.type===F.Type.IA5String?n+=t.value:I0.test(t.value)?n+="0x"+xt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Fs=ht((g2,_0)=>{var Nt=lt();Bt();_0.exports=Nt.cipher=Nt.cipher||{};Nt.cipher.algorithms=Nt.cipher.algorithms||{};Nt.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Nt.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Nt.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Nt.cipher.algorithms[t]=e};Nt.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Nt.cipher.algorithms?Nt.cipher.algorithms[t]:null};var Ms=Nt.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Ms.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Nt.util.createBuffer(),this.output=t.output||Nt.util.createBuffer(),this.mode.start(e)};Ms.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ms.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Hs=ht((x2,L0)=>{var Dt=lt();Bt();Dt.cipher=Dt.cipher||{};var nt=L0.exports=Dt.cipher.modes=Dt.cipher.modes||{};nt.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.ecb.prototype.start=function(t){};nt.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=xi(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};nt.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb.prototype.decrypt=nt.ofb.prototype.encrypt;nt.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}mi(this._inBlock)};nt.ctr.prototype.decrypt=nt.ctr.prototype.encrypt;nt.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0,this._R=3774873600};nt.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Dt.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Dt.util.createBuffer(t.additionalData):r=Dt.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Dt.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Vs(n*8)))}this._inBlock=this._j0.slice(0),mi(this._inBlock),this._partialBytes=0,r=Dt.util.createBuffer(r),this._aDataLength=Vs(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};nt.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),mi(this._inBlock)};nt.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),mi(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};nt.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};nt.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};nt.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Dt.util.createBuffer();for(var n=0;n{var pt=lt();Fs();Hs();Bt();k0.exports=pt.aes=pt.aes||{};pt.aes.startEncrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};pt.aes.createEncryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!1,mode:e})};pt.aes.startDecrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};pt.aes.createDecryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!0,mode:e})};pt.aes.Algorithm=function(t,e){Gs||N0();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return zs(r._w,n,i,!1)},decrypt:function(n,i){return zs(r._w,n,i,!0)}}}),r._init=!1};pt.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pt.util.createBuffer(e);else if(pt.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pt.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,$t[r]=a,qs[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],f=c<<24^a<<16^a<<8^(a^c),u=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var h=0;h<4;++h)ar[h][r]=f,ue[h][a]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function D0(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=kr*o,c=s;c>>16&255]<<24^$t[n>>>8&255]<<16^$t[n&255]<<8^$t[n>>>24]^R0[i]<<24,i++):s>6&&c%s===4&&(n=$t[n>>>24]<<24^$t[n>>>16&255]<<16^$t[n>>>8&255]<<8^$t[n&255]),r[c]=r[c-s]^n;if(e){var f,u=ue[0],h=ue[1],l=ue[2],g=ue[3],d=r.slice(0);a=r.length;for(var c=0,p=a-kr;c>>24]]^h[$t[f>>>16&255]]^l[$t[f>>>8&255]]^g[$t[f&255]];r=d}return r}function zs(t,e,r,n){var i=t.length/4-1,s,o,a,c,f;n?(s=ue[0],o=ue[1],a=ue[2],c=ue[3],f=qs):(s=ar[0],o=ar[1],a=ar[2],c=ar[3],f=$t);var u,h,l,g,d,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],l=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,v=1;v>>24]^o[h>>>16&255]^a[l>>>8&255]^c[g&255]^t[++x],p=s[h>>>24]^o[l>>>16&255]^a[g>>>8&255]^c[u&255]^t[++x],y=s[l>>>24]^o[g>>>16&255]^a[u>>>8&255]^c[h&255]^t[++x],g=s[g>>>24]^o[u>>>16&255]^a[h>>>8&255]^c[l&255]^t[++x],u=d,h=p,l=y;r[0]=f[u>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[g&255]^t[++x],r[n?3:1]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[g>>>8&255]<<8^f[u&255]^t[++x],r[2]=f[l>>>24]<<24^f[g>>>16&255]<<16^f[u>>>8&255]<<8^f[h&255]^t[++x],r[n?1:3]=f[g>>>24]<<24^f[u>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++x]}function bi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=pt.cipher.createDecipher(r,t.key):n=pt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof pt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var K0=ht((b2,U0)=>{var vt=lt();Fs();Hs();Bt();U0.exports=vt.des=vt.des||{};vt.des.startEncrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createEncryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!1,mode:e})};vt.des.startDecrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createDecryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!0,mode:e})};vt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return P0(r._keys,n,i,!1)},decrypt:function(n,i){return P0(r._keys,n,i,!0)}}}),r._init=!1};vt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=vt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vl(e),this._init=!0}};pe("DES-ECB",vt.cipher.modes.ecb);pe("DES-CBC",vt.cipher.modes.cbc);pe("DES-CFB",vt.cipher.modes.cfb);pe("DES-OFB",vt.cipher.modes.ofb);pe("DES-CTR",vt.cipher.modes.ctr);pe("3DES-ECB",vt.cipher.modes.ecb);pe("3DES-CBC",vt.cipher.modes.cbc);pe("3DES-CFB",vt.cipher.modes.cfb);pe("3DES-OFB",vt.cipher.modes.ofb);pe("3DES-CTR",vt.cipher.modes.ctr);function pe(t,e){var r=function(){return new vt.des.Algorithm(t,e)};vt.cipher.registerAlgorithm(t,r)}var ll=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],dl=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],pl=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yl=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],gl=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],xl=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ml=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],bl=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vl(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],x=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,m,A=0;A>>4^B)&252645135,B^=m,S^=m<<4,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>2^B)&858993459,B^=m,S^=m<<2,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=(B>>>8^S)&16711935,S^=m,B^=m<<8,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=S<<8|B>>>20&240,S=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=m;for(var R=0;R>>26,B=B<<2|B>>>26):(S=S<<1|S>>>27,B=B<<1|B>>>27),S&=-15,B&=-15;var _=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|a[S>>>4&15],O=c[B>>>28]|f[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|l[B>>>12&15]|g[B>>>8&15]|d[B>>>4&15];m=(O>>>16^_)&65535,y[v++]=_^m,y[v++]=O^m<<16}}return y}function P0(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var f=0;f>>4|c<<28)^t[l+1];o=a,a=c,c=o^(dl[g>>>24&63]|yl[g>>>16&63]|xl[g>>>8&63]|bl[g&63]|ll[d>>>24&63]|pl[d>>>16&63]|gl[d>>>8&63]|ml[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function vi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=vt.cipher.createDecipher(r,t.key):n=vt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof vt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var cr=ht((v2,O0)=>{var wi=lt();O0.exports=wi.md=wi.md||{};wi.md.algorithms=wi.md.algorithms||{}});var F0=ht((w2,M0)=>{var Re=lt();cr();Bt();var wl=M0.exports=Re.hmac=Re.hmac||{};wl.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Re.md.algorithms)e=Re.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Re.util.createBuffer(o);else if(Re.util.isArray(o)){var a=o;o=Re.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Re.util.createBuffer(),n=Re.util.createBuffer(),f=o.length();for(var c=0;c{});var H0=ht((B2,V0)=>{var Wt=lt();F0();cr();Bt();var El=Wt.pkcs5=Wt.pkcs5||{},Ne;Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&(Ne=Ei());V0.exports=Wt.pbkdf2=El.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&Ne.pbkdf2&&(i===null||typeof i!="object")&&(Ne.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?Ne.pbkdf2Sync.length===4?Ne.pbkdf2(t,e,r,n,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2(t,e,r,n,i,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):Ne.pbkdf2Sync.length===4?Ne.pbkdf2Sync(t,e,r,n).toString("binary"):Ne.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Wt.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Wt.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),f=n-(c-1)*o,u=Wt.hmac.create();u.start(i,t);var h="",l,g,d;if(!s){for(var p=1;p<=c;++p){u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g;h+=pc)return s(null,h);u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes(),y=2,v()}function v(){if(y<=r)return u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g,++y,Wt.util.setImmediate(v);h+=p{var Bi=lt();Bt();var q0=z0.exports=Bi.pem=Bi.pem||{};q0.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r +`,t.composed){for(var o=0,a="",s=0;s1?n+="0x"+xt.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(t.type===F.Type.OCTETSTRING)I0.test(t.value)||(n+="("+t.value+") "),n+="0x"+xt.util.bytesToHex(t.value);else if(t.type===F.Type.UTF8)try{n+=xt.util.decodeUtf8(t.value)}catch(u){if(u.message==="URI malformed")n+="0x"+xt.util.bytesToHex(t.value)+" (malformed UTF8)";else throw u}else t.type===F.Type.PRINTABLESTRING||t.type===F.Type.IA5String?n+=t.value:I0.test(t.value)?n+="0x"+xt.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var Fs=ht((g2,_0)=>{var Nt=lt();At();_0.exports=Nt.cipher=Nt.cipher||{};Nt.cipher.algorithms=Nt.cipher.algorithms||{};Nt.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Nt.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Nt.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Nt.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Nt.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Nt.cipher.algorithms[t]=e};Nt.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Nt.cipher.algorithms?Nt.cipher.algorithms[t]:null};var Ms=Nt.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Ms.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Nt.util.createBuffer(),this.output=t.output||Nt.util.createBuffer(),this.mode.start(e)};Ms.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Ms.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Hs=ht((x2,L0)=>{var Dt=lt();At();Dt.cipher=Dt.cipher||{};var nt=L0.exports=Dt.cipher.modes=Dt.cipher.modes||{};nt.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.ecb.prototype.start=function(t){};nt.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};nt.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=xi(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};nt.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};nt.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0)t.read-=this.blockSize;else for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};nt.ofb.prototype.decrypt=nt.ofb.prototype.encrypt;nt.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0};nt.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=xi(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};nt.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}mi(this._inBlock)};nt.ctr.prototype.decrypt=nt.ctr.prototype.encrypt;nt.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Dt.util.createBuffer(),this._partialBytes=0,this._R=3774873600};nt.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Dt.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Dt.util.createBuffer(t.additionalData):r=Dt.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Dt.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Vs(n*8)))}this._inBlock=this._j0.slice(0),mi(this._inBlock),this._partialBytes=0,r=Dt.util.createBuffer(r),this._aDataLength=Vs(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};nt.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i0&&(s=this.blockSize-s),this._partialOutput.clear();for(var i=0;i0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),mi(this._inBlock)};nt.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),mi(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};nt.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,s=this._m[r][i];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};nt.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};nt.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,s=new Array(i),o=0;o>>1,i=new Array(r);i[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Dt.util.createBuffer();for(var n=0;n{var pt=lt();Fs();Hs();At();k0.exports=pt.aes=pt.aes||{};pt.aes.startEncrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};pt.aes.createEncryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!1,mode:e})};pt.aes.startDecrypting=function(t,e,r,n){var i=bi({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};pt.aes.createDecryptionCipher=function(t,e){return bi({key:t,output:null,decrypt:!0,mode:e})};pt.aes.Algorithm=function(t,e){Gs||N0();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return zs(r._w,n,i,!1)},decrypt:function(n,i){return zs(r._w,n,i,!0)}}}),r._init=!1};pt.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pt.util.createBuffer(e);else if(pt.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pt.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^a&255^99,$t[r]=a,qs[a]=r,c=t[a],i=t[r],s=t[i],o=t[s],f=c<<24^a<<16^a<<8^(a^c),u=(i^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^i^o);for(var h=0;h<4;++h)ar[h][r]=f,ue[h][a]=u,f=f<<24|f>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function D0(t,e){for(var r=t.slice(0),n,i=1,s=r.length,o=s+6+1,a=Pr*o,c=s;c>>16&255]<<24^$t[n>>>8&255]<<16^$t[n&255]<<8^$t[n>>>24]^R0[i]<<24,i++):s>6&&c%s===4&&(n=$t[n>>>24]<<24^$t[n>>>16&255]<<16^$t[n>>>8&255]<<8^$t[n&255]),r[c]=r[c-s]^n;if(e){var f,u=ue[0],h=ue[1],l=ue[2],g=ue[3],d=r.slice(0);a=r.length;for(var c=0,p=a-Pr;c>>24]]^h[$t[f>>>16&255]]^l[$t[f>>>8&255]]^g[$t[f&255]];r=d}return r}function zs(t,e,r,n){var i=t.length/4-1,s,o,a,c,f;n?(s=ue[0],o=ue[1],a=ue[2],c=ue[3],f=qs):(s=ar[0],o=ar[1],a=ar[2],c=ar[3],f=$t);var u,h,l,g,d,p,y;u=e[0]^t[0],h=e[n?3:1]^t[1],l=e[2]^t[2],g=e[n?1:3]^t[3];for(var x=3,v=1;v>>24]^o[h>>>16&255]^a[l>>>8&255]^c[g&255]^t[++x],p=s[h>>>24]^o[l>>>16&255]^a[g>>>8&255]^c[u&255]^t[++x],y=s[l>>>24]^o[g>>>16&255]^a[u>>>8&255]^c[h&255]^t[++x],g=s[g>>>24]^o[u>>>16&255]^a[h>>>8&255]^c[l&255]^t[++x],u=d,h=p,l=y;r[0]=f[u>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[g&255]^t[++x],r[n?3:1]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[g>>>8&255]<<8^f[u&255]^t[++x],r[2]=f[l>>>24]<<24^f[g>>>16&255]<<16^f[u>>>8&255]<<8^f[h&255]^t[++x],r[n?1:3]=f[g>>>24]<<24^f[u>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++x]}function bi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=pt.cipher.createDecipher(r,t.key):n=pt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof pt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var K0=ht((b2,U0)=>{var vt=lt();Fs();Hs();At();U0.exports=vt.des=vt.des||{};vt.des.startEncrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createEncryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!1,mode:e})};vt.des.startDecrypting=function(t,e,r,n){var i=vi({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};vt.des.createDecryptionCipher=function(t,e){return vi({key:t,output:null,decrypt:!0,mode:e})};vt.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return P0(r._keys,n,i,!1)},decrypt:function(n,i){return P0(r._keys,n,i,!0)}}}),r._init=!1};vt.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=vt.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=vl(e),this._init=!0}};pe("DES-ECB",vt.cipher.modes.ecb);pe("DES-CBC",vt.cipher.modes.cbc);pe("DES-CFB",vt.cipher.modes.cfb);pe("DES-OFB",vt.cipher.modes.ofb);pe("DES-CTR",vt.cipher.modes.ctr);pe("3DES-ECB",vt.cipher.modes.ecb);pe("3DES-CBC",vt.cipher.modes.cbc);pe("3DES-CFB",vt.cipher.modes.cfb);pe("3DES-OFB",vt.cipher.modes.ofb);pe("3DES-CTR",vt.cipher.modes.ctr);function pe(t,e){var r=function(){return new vt.des.Algorithm(t,e)};vt.cipher.registerAlgorithm(t,r)}var ll=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],dl=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],pl=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],yl=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],gl=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],xl=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ml=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],bl=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function vl(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=t.length()>8?3:1,y=[],x=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,m,A=0;A>>4^B)&252645135,B^=m,S^=m<<4,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>2^B)&858993459,B^=m,S^=m<<2,m=(B>>>-16^S)&65535,S^=m,B^=m<<-16,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=(B>>>8^S)&16711935,S^=m,B^=m<<8,m=(S>>>1^B)&1431655765,B^=m,S^=m<<1,m=S<<8|B>>>20&240,S=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=m;for(var R=0;R>>26,B=B<<2|B>>>26):(S=S<<1|S>>>27,B=B<<1|B>>>27),S&=-15,B&=-15;var _=e[S>>>28]|r[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|a[S>>>4&15],O=c[B>>>28]|f[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|l[B>>>12&15]|g[B>>>8&15]|d[B>>>4&15];m=(O>>>16^_)&65535,y[v++]=_^m,y[v++]=O^m<<16}}return y}function P0(t,e,r,n){var i=t.length===32?3:9,s;i===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var f=0;f>>4|c<<28)^t[l+1];o=a,a=c,c=o^(dl[g>>>24&63]|yl[g>>>16&63]|xl[g>>>8&63]|bl[g&63]|ll[d>>>24&63]|pl[d>>>16&63]|gl[d>>>8&63]|ml[d&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function vi(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=vt.cipher.createDecipher(r,t.key):n=vt.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(s,o){var a=null;o instanceof vt.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,i.call(n,o)},n}});var cr=ht((v2,O0)=>{var wi=lt();O0.exports=wi.md=wi.md||{};wi.md.algorithms=wi.md.algorithms||{}});var F0=ht((w2,M0)=>{var Ne=lt();cr();At();var wl=M0.exports=Ne.hmac=Ne.hmac||{};wl.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Ne.md.algorithms)e=Ne.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Ne.util.createBuffer(o);else if(Ne.util.isArray(o)){var a=o;o=Ne.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Ne.util.createBuffer(),n=Ne.util.createBuffer(),f=o.length();for(var c=0;c{});var H0=ht((B2,V0)=>{var Wt=lt();F0();cr();At();var El=Wt.pkcs5=Wt.pkcs5||{},De;Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&(De=Ei());V0.exports=Wt.pbkdf2=El.pbkdf2=function(t,e,r,n,i,s){if(typeof i=="function"&&(s=i,i=null),Wt.util.isNodejs&&!Wt.options.usePureJavaScript&&De.pbkdf2&&(i===null||typeof i!="object")&&(De.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?De.pbkdf2Sync.length===4?De.pbkdf2(t,e,r,n,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):De.pbkdf2(t,e,r,n,i,function(m,A){if(m)return s(m);s(null,A.toString("binary"))}):De.pbkdf2Sync.length===4?De.pbkdf2Sync(t,e,r,n).toString("binary"):De.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in Wt.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Wt.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(n/o),f=n-(c-1)*o,u=Wt.hmac.create();u.start(i,t);var h="",l,g,d;if(!s){for(var p=1;p<=c;++p){u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes();for(var y=2;y<=r;++y)u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g;h+=pc)return s(null,h);u.start(null,null),u.update(e),u.update(Wt.util.int32ToBytes(p)),l=d=u.digest().getBytes(),y=2,v()}function v(){if(y<=r)return u.start(null,null),u.update(d),g=u.digest().getBytes(),l=Wt.util.xorBytes(l,g,o),d=g,++y,Wt.util.setImmediate(v);h+=p{var Bi=lt();At();var q0=z0.exports=Bi.pem=Bi.pem||{};q0.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r `,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Si(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Si(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Si(n)),t.headers)for(var i=0;i65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r `+e.substr(o)):e=e.substr(0,o)+`\r -`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();Bt();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();Bt();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var bn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();Bt();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();Bt();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var De,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,De=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,De=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,De=26):(D.prototype.am=sc,De=28);D.prototype.DB=De;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function vn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}vn.prototype.convert=uc;vn.prototype.revert=uc;vn.prototype.mulTo=Xd;vn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new vn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Kr.prototype.convert=ep;Kr.prototype.revert=rp;Kr.prototype.reduce=np;Kr.prototype.mulTo=sp;Kr.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Kr(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();Bt();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();Bt();bn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();Bt();Ti();bn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();mn();Ti();yi();bc();vc();bn();Bt();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ne=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ne.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ne.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ne.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ne.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.crypto=="object"&&typeof ne.globalScope.crypto.subtle=="object"&&typeof ne.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ne.globalScope<"u"&&typeof ne.globalScope.msCrypto=="object"&&typeof ne.globalScope.msCrypto.subtle=="object"&&typeof ne.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();mn();K0();cr();yi();H0();G0();bn();nc();Ri();Bt();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();Bt();var _n=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=_n;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return _n.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return _n.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return _n.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;_n.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Cw,jf)=>{var jr=1e3,tn=jr*60,en=tn*60,Sr=en*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*en;case"minutes":case"minute":case"mins":case"min":case"m":return r*tn;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=en?Math.round(t/en)+"h":e>=tn?Math.round(t/tn)+"m":e>=jr?Math.round(t/jr)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=en?Vi(t,e,en,"hour"):e>=tn?Vi(t,e,tn,"minute"):e>=jr?Vi(t,e,jr,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Iw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{jt.formatArgs=R1;jt.save=N1;jt.load=D1;jt.useColors=L1;jt.storage=k1();jt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();jt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}jt.log=console.debug||console.log||(()=>{});function N1(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=jt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(jt);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};_t(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Me(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Me(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function It(t=0){return globalThis.Buffer?.allocUnsafe!=null?Me(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,Ht=127;function Be(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&Ht,ri+s.length,0));let r=It(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Me(r)}function Lt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Fn(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Fn(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Gt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Gt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=n,s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:[...this.bufs],length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Fn(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=It(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Be(t),r=It(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function nn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}nn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Rt(r(t.byteLength),t)};var Br=zt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Mn(t);return ts.bytes=Be(e),e};ts.bytes=0;function sn(t,e){let r=new Rt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Br.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Br.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Br.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Br.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}sn.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return sn(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Rt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Rt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Mn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Be(e.maxDataLength)),{read:async i=>{let s=-1,o=new Rt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(nn.single(i,e),s)},writeV:async(i,s)=>{let o=new Rt(...i.map(a=>nn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ar=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Ar,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Ar,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Ar,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ae=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Cr(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Cr(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,P=w+O*a+M*(5*y)+U*(5*p)+q*(5*d)+z*(5*g);w=P>>>13,P&=8191,P+=Z*(5*l)+C*(5*h)+N*(5*u)+T*(5*f)+L*(5*c),w+=P>>>13,P&=8191;let K=w+O*c+M*a+U*(5*y)+q*(5*p)+z*(5*d);w=K>>>13,K&=8191,K+=Z*(5*g)+C*(5*l)+N*(5*h)+T*(5*u)+L*(5*f),w+=K>>>13,K&=8191;let V=w+O*f+M*c+U*a+q*(5*y)+z*(5*p);w=V>>>13,V&=8191,V+=Z*(5*d)+C*(5*g)+N*(5*l)+T*(5*h)+L*(5*u),w+=V>>>13,V&=8191;let W=w+O*u+M*f+U*c+q*a+z*(5*y);w=W>>>13,W&=8191,W+=Z*(5*p)+C*(5*d)+N*(5*g)+T*(5*l)+L*(5*h),w+=W>>>13,W&=8191;let Y=w+O*h+M*u+U*f+q*c+z*a;w=Y>>>13,Y&=8191,Y+=Z*(5*y)+C*(5*p)+N*(5*d)+T*(5*g)+L*(5*l),w+=Y>>>13,Y&=8191;let et=w+O*l+M*h+U*u+q*f+z*c;w=et>>>13,et&=8191,et+=Z*a+C*(5*y)+N*(5*p)+T*(5*d)+L*(5*g),w+=et>>>13,et&=8191;let X=w+O*g+M*l+U*h+q*u+z*f;w=X>>>13,X&=8191,X+=Z*c+C*a+N*(5*y)+T*(5*p)+L*(5*d),w+=X>>>13,X&=8191;let J=w+O*d+M*g+U*l+q*h+z*u;w=J>>>13,J&=8191,J+=Z*f+C*c+N*a+T*(5*y)+L*(5*p),w+=J>>>13,J&=8191;let dt=w+O*p+M*d+U*g+q*l+z*h;w=dt>>>13,dt&=8191,dt+=Z*u+C*f+N*c+T*a+L*(5*y),w+=dt>>>13,dt&=8191;let ut=w+O*y+M*p+U*d+q*g+z*l;w=ut>>>13,ut&=8191,ut+=Z*h+C*u+N*f+T*c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ae(qu),$u=Ae(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ae(f),h=ls(i)&&ls(s),l=h?Ae(i):Da,g=h?Ae(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Cr(a),Cr(c),Cr(f);let l=f.length;if(u||(u=new Uint8Array(l)),Cr(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function on(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Ir(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var Tr=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var _r=class extends Tr{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Ir(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends _r{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};_t(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>an,bitSet:()=>Dh,bytesToHex:()=>Ce,bytesToNumberBE:()=>Ie,bytesToNumberLE:()=>ce,concatBytes:()=>_e,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>Te,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>ee});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ce(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ee(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var Tt=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=Tt?r:e+r}function Bs(t,e,r){if(r<=Tt||e 0");if(r===bt)return Tt;let n=bt;for(;e>Tt;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >Tt;)n*=n,n%=r;return n}function ai(t,e){if(t===Tt||e<=Tt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=Tt,s=bt,o=bt,a=Tt;for(;r!==Tt;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===Tt;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return ee(t,r)}function Vh(t,e,r){if(r 0");if(r===Tt)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>Tt;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=Tt)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:an(i),ZERO:Tt,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Tt<=c&&cc===Tt,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?Te(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Ie(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Ie(t):ce(t),a=at(o,e-bt)+bt;return r?Te(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function cn(t){return As(t.Fp),ee(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Qt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=cn(t);return ee(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Qt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let Ct=u(K*V),Vt=u(W*Y);if(Ct!==Vt)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,Ct=u(dt*Ut),Vt=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(Ct,Vt,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),Ct=u(et*K*ut),Vt=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Vt-Ct,rn=Vt+Ct,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(rn*na),hu=u(Se*na),lu=u(tr*rn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Qt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Qt};if(X!==Qt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Qt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Qt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let Ct=(Kt&Qt)===Qt,Vt=(et&128)!==0;if(!P&&Kt===fe&&Vt)throw new Error("Point.fromHex: x=0 and x_0=1");return Vt!==Ct&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=Te(P,r.BYTES);return K[K.length-1]|=w&Qt?128:0,K}toHex(){return Ce(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Qt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Qt,Qt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=_e(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=_e(et,Te(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var fn=BigInt(0),_s=BigInt(1);function Yh(t){return ee(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&fn<=m&&m=fn;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return Te(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===fn)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var un=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=un,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=un,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Le=ci(un,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Le,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Lr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),hn=Qa({P:un,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=un,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Le.ORDER+BigInt(3))/BigInt(8),_x=Le.pow(Ls,tl),Lx=Le.sqrt(Le.neg(Le.ONE)),Rx=(Le.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Le,Le.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends Tr{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,on(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Rr.create=(t,e)=>new li(t,e);function s0(t,e,r){return on(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Rr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(on(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Rr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends _r{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Nr=ri(()=>new Ds);var di={hashSHA256(t){return Nr(t)},getHKDF(t,e){let r=s0(Nr,e,t),i=o0(Nr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=hn.utils.randomPrivateKey();return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:hn.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return hn.getSharedSecret(t,e)},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t)},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t,i)}};var a0=di;var Dr=t=>{let e=It(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};Dr.bytes=2;var ln=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};ln.bytes=2;function c0(t){return new Rt(t.ne,t.ciphertext)}function f0(t){return new Rt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Rt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o;i===0&&s===n.byteLength&&n instanceof Uint8Array?o=t.encrypt(n,t.session):o=t.encrypt(n.subarray(i,s),t.session),e?.encryptedPackets.increment(),yield new Rt(Dr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Or=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Or({prefix:t,name:e,encode:n,decode:s=>ke(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Or({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};_t(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};_t(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};_t(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Or({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};_t(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};_t(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};_t(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};_t(po,{base64:()=>Mr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Mr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};_t(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};_t(go,{identity:()=>ny});var ny=Or({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};_t(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[wn.decode(t,e),wn.decode.bytes],Fr=(t,e,r=0)=>(wn.encode(t,e,r),e),Vr=t=>wn.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Vr(t),i=n+Vr(r),s=new Uint8Array(i+r);return Fr(t,s,0),Fr(r,s,n),s.set(e,i),new Hr(t,r,e,s)},Sn=t=>{let e=ke(t),[r,n]=En(e),[i,s]=En(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Hr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},Hr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=ke,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};_t(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Sn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Bn,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=ke(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Hr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=En(e.subarray(r));return r+=l,h},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},Bn=112,Ly=18,Qc=(t,e,r)=>{let n=Vr(t),i=n+Vr(e),s=new Uint8Array(i+r.byteLength);return Fr(t,s,0),Fr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var zr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=It(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>Tn,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var Gr=32,Pe=64,ki=32;async function tf(){let t=Lr.utils.randomPrivateKey(),e=Lr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Lr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Lr.sign(e,r)}async function nf(t,e,r){return Lr.verify(e,r,t)}function sf(t,e){let r=new Uint8Array(Pe);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return It(o);i+o>e&&(n=It(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?It(t):Uy(t)}var In=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(An,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(An,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(An,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(An,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(An,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(Cn,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,4,r.lo)._push(Cn,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function An(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function Cn(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(In.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},In.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(At(t),r)}function Uo(){return new In}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Wr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Wr||(Wr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Wr.VARINT,r,n)}function xr(t,e){return Ui("message",Wr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var Tn=class{_key;constructor(e){this._key=Yr(e,Gr)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Yr(e,Pe),this._publicKey=Yr(r,Gr)}async sign(e){return rf(this._key,e)}get public(){return new Tn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Pe){t=Yr(t,Pe+Gr);let n=t.subarray(0,Pe),i=t.subarray(Pe,t.length);return new mr(n,i)}t=Yr(t,Pe);let e=t.subarray(0,Pe),r=t.subarray(Gr);return new mr(e,r)}function qy(t){return t=Yr(t,Gr),new Tn(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Yr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=zt(Bt(),1),yb=zt(Ti(),1),gf=zt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function Jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=At(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Gt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};_t(zo,{MAX_KEY_SIZE:()=>Nn,RsaPrivateKey:()=>Zr,RsaPublicKey:()=>Rn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Ln=zt(lt(),1);var uv=zt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=zt(Ri(),1),Ho=zt(lt(),1);function Sf(t,e){return e.map(r=>Jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};_t(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=zt(mn(),1),Xb=zt(Ri(),1);var Ue=zt(lt(),1);function Zy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.privateKeyToAsn1({n:Jt(t.n),e:Jt(t.e),d:Jt(t.d),p:Jt(t.p),q:Jt(t.q),dP:Jt(t.dp),dQ:Jt(t.dq),qInv:Jt(t.qi)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ue.default.asn1.fromDer(Et(t,"ascii")),r=Ue.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ue.default.pki.publicKeyToAsn1({n:Jt(t.n),e:Jt(t.e)});return At(Ue.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(Uint8Array.from(r),"ascii"),o=n(s,i);return At(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return At(t.n,"base64url").length*8}var Nn=8192,Rn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Zr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Rn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Ln.default.util.ByteBuffer(this.marshal()),i=Ln.default.asn1.fromDer(n),s=Ln.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Ln.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Zr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Rn(e)}async function n1(t){if(Mi(t)>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Zr(e.privateKey,e.publicKey)}async function i1(t){if(t>Nn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Zr(e.privateKey,e.publicKey)}var Yo={};_t(Yo,{Secp256k1PrivateKey:()=>kn,Secp256k1PublicKey:()=>Dn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=cn(t);ee(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Ke=BigInt(0),ie=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return _e(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Ker.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Ke)return y;if(a(p),p===ie)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Ke||S>Ke;)m&ie&&(B=B.add(_)),S&ie&&(R=R.add(_)),_=_.double(),m>>=ie,S>>=ie;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Ke||B===ie||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===ie)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===ie?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ce(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=cn(t);return ee(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return KeCe(qe(C,e.nByteLength));function d(C){let N=n>>ie;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Ie(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Ie(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=an(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Ke<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=_e(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),Ct=f.BASE.multiply(Ut).toAffine(),Vt=a(Ct.x);if(Vt===Ke)return;let Se=a(Kt*a(J+Vt*Y));if(Se===Ke)return;let tr=(Ct.x===Vt?0:2)|Number(Ct.y&ie),rn=Se;return P&&d(Se)&&(rn=p(Se),tr^=1),new x(Vt,rn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(Ct){if(!(Ct instanceof wr.Err))throw Ct;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:Ct,s:Vt}=w;V=new x(Ct,Vt)}else throw new Error("PARSE");W=f.fromHex(T)}catch(Ct){if(Ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Rr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Oe=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Nr),Cv=BigInt(0);var Iv=Oe.ProjectivePoint;function Mf(){return Oe.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e);try{return Oe.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r);return Oe.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Oe.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Oe.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Oe.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var Dn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},kn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new Dn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Lt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return $r(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new kn(t)}function y1(t){return new Dn(t)}async function g1(){let t=Mf();return new kn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(zr).map(t=>t.decoder).reduce((t,e)=>t.or(e),zr.identity.decoder),Xf=114,Zo=36,Xo=37,Pn=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Lt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Lt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Xr=class extends Pn{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Qr=class extends Pn{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},Jr=class extends Pn{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Sn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Qr({multihash:r}):t.startsWith("16U")?new Jr({multihash:r}):new Xr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Sn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:e});if(e.digest.length===Xo)return new Jr({multihash:e})}if(e.code===Ft.code)return new Xr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Xr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Qr({multihash:t.multihash});if(e.digest.length===Xo)return new Jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Qr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new Jr({multihash:ve(Je.code,t),privateKey:e}):new Xr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Un;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Un||(Un={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Un.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Un.decode(t)}function Jf(t){let e=At("noise-libp2p-static-key:");return Gt([e,t],e.length+t.length)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function Kn(t){return!(!(t instanceof Uint8Array)||t.length!==32)}var te=zt(nu(),1);te.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);te.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);te.default.formatters.m=t=>t==null?"undefined":Mr.baseEncode(t);te.default.formatters.p=t=>t==null?"undefined":t.toString();te.default.formatters.c=t=>t==null?"undefined":t.toString();te.default.formatters.k=t=>t==null?"undefined":t.toString();te.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return te.default.enabled(`${t}:trace`)&&te.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,te.default)(`${t}:trace`)),Object.assign((0,te.default)(t),{error:(0,te.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var se;Ia?se=Pt:se=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){se(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`)}function ea(t){t?(se(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),se(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):se("Missing local ephemeral keys.")}function ou(t){se(`REMOTE_STATIC_PUBLIC_KEY ${Et(t,"hex")}`)}function ra(t){se(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t,"hex")}`)}function au(t){t.cs1&&t.cs2?(se(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),se(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):se("Missing cipher state.")}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Lt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(Gt([e,r],e.length+r.length))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=At(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(Kn(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&Kn(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&Kn(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new pn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:Dr,lengthDecoder:ln,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>sn(o,{lengthDecoder:ln}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); +`+a+e.substr(o+1),s=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Sl(t){return t.replace(/^\s+/,"")}});var Q0=ht((C2,X0)=>{var ye=lt();cr();At();var W0=X0.exports=ye.sha256=ye.sha256||{};ye.md.sha256=ye.md.algorithms.sha256=W0;W0.create=function(){Y0||Bl();var t=null,e=ye.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),$0(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=ye.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(Ws.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};$0(h,r,i);var l=ye.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l.putInt32(h.h5),l.putInt32(h.h6),l.putInt32(h.h7),l},n};var Ws=null,Y0=!1,Z0=null;function Bl(){Ws="\x80",Ws+=ye.util.fillString("\0",64),Z0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Y0=!0}function $0(t,e,r){for(var n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v=r.length();v>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[f-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(u=t.h0,h=t.h1,l=t.h2,g=t.h3,d=t.h4,p=t.h5,y=t.h6,x=t.h7,f=0;f<64;++f)o=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),a=y^d&(p^y),s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),c=u&h|l&(u^h),n=x+o+a+Z0[f]+e[f],i=s+c,x=y,y=p,p=d,d=g+n>>>0,g=l,l=h,h=u,u=n+i>>>0;t.h0=t.h0+u|0,t.h1=t.h1+h|0,t.h2=t.h2+l|0,t.h3=t.h3+g|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+x|0,v-=64}}});var j0=ht((I2,J0)=>{var ge=lt();At();var Ai=null;ge.util.isNodejs&&!ge.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ai=Ei());var Al=J0.exports=ge.prng=ge.prng||{};Al.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(f,u){if(!u)return e.generateSync(f);var h=e.plugin.cipher,l=e.plugin.increment,g=e.plugin.formatKey,d=e.plugin.formatSeed,p=ge.util.createBuffer();e.key=null,y();function y(x){if(x)return u(x);if(p.length()>=f)return u(null,p.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return ge.util.nextTick(function(){s(y)});var v=h(e.key,e.seed);e.generated+=v.length,p.putBytes(v),e.key=g(h(e.key,l(e.seed))),e.seed=d(h(e.key,e.seed)),ge.util.setImmediate(y)}},e.generateSync=function(f){var u=e.plugin.cipher,h=e.plugin.increment,l=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var d=ge.util.createBuffer();d.length()1048575&&(e.key=null),e.key===null&&o();var p=u(e.key,e.seed);e.generated+=p.length,d.putBytes(p),e.key=l(u(e.key,h(e.seed))),e.seed=g(u(e.key,e.seed))}return d.getBytes(f)};function s(f){if(e.pools[0].messageLength>=32)return a(),f();var u=32-e.pools[0].messageLength<<5;e.seedFile(u,function(h,l){if(h)return f(h);e.collect(l),a(),f()})}function o(){if(e.pools[0].messageLength>=32)return a();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var u=1,h=0;h<32;++h)e.reseeds%u===0&&(f.update(e.pools[h].digest().getBytes()),e.pools[h].start()),u=u<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var l=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(l),e.generated=0}function c(f){var u=null,h=ge.util.globalScope,l=h.crypto||h.msCrypto;l&&l.getRandomValues&&(u=function(S){return l.getRandomValues(S)});var g=ge.util.createBuffer();if(u)for(;g.length()>16),v+=(x&32767)<<16,v+=x>>15,v=(v&2147483647)+(v>>31),A=v&4294967295;for(var y=0;y<3;++y)m=A>>>(y<<3),m^=Math.floor(Math.random()*256),g.putByte(m&255)}return g.getBytes(f)}return Ai?(e.seedFile=function(f,u){Ai.randomBytes(f,function(h,l){if(h)return u(h);u(null,l.toString())})},e.seedFileSync=function(f){return Ai.randomBytes(f).toString()}):(e.seedFile=function(f,u){try{u(null,c(f))}catch(h){u(h)}},e.seedFileSync=c),e.collect=function(f){for(var u=f.length,h=0;h>l&255);e.collect(h)},e.registerWorker=function(f){if(f===self)e.seedFile=function(h,l){function g(d){var p=d.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",g),l(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var l=h.data;l.forge&&l.forge.prng&&e.seedFile(l.forge.prng.needed,function(g,d){f.postMessage({forge:{prng:{err:g,bytes:d}}})})};f.addEventListener("message",u)}},e}});var vn=ht((T2,Ys)=>{var kt=lt();$s();Q0();j0();At();(function(){if(kt.random&&kt.random.getBytes){Ys.exports=kt.random;return}(function(t){var e={},r=new Array(4),n=kt.util.createBuffer();e.formatKey=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),kt.aes._expandKey(h,!1)},e.formatSeed=function(h){var l=kt.util.createBuffer(h);return h=new Array(4),h[0]=l.getInt32(),h[1]=l.getInt32(),h[2]=l.getInt32(),h[3]=l.getInt32(),h},e.cipher=function(h,l){return kt.aes._updateBlock(h,l,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=kt.md.sha256;function i(){var h=kt.prng.create(e);return h.getBytes=function(l,g){return h.generate(l,g)},h.getBytesSync=function(l){return h.generate(l)},h}var s=i(),o=null,a=kt.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(h){return c.getRandomValues(h)}),kt.options.usePureJavaScript||!kt.util.isNodejs&&!o){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var u in navigator)try{typeof navigator[u]=="string"&&(f+=navigator[u])}catch{}s.collect(f),f=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!kt.random)kt.random=s;else for(var u in s)kt.random[u]=s[u];kt.random.createInstance=i,Ys.exports=kt.random})(typeof jQuery<"u"?jQuery:null)})()});var nc=ht((_2,rc)=>{var Yt=lt();At();var Zs=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],tc=[1,2,3,5],Cl=function(t,e){return t<>16-e},Il=function(t,e){return(t&65535)>>e|t<<16-e&65535};rc.exports=Yt.rc2=Yt.rc2||{};Yt.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Yt.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,s=Math.ceil(i/8),o=255>>(i&7),a;for(a=n;a<128;a++)r.putByte(Zs[r.at(a-1)+r.at(a-n)&255]);for(r.setAt(128-s,Zs[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,Zs[r.at(a+1)^r.at(a+s)]);return r};var ec=function(t,e,r){var n=!1,i=null,s=null,o=null,a,c,f,u,h=[];for(t=Yt.rc2.expandKey(t,e),f=0;f<64;f++)h.push(t.getInt16Le());r?(a=function(d){for(f=0;f<4;f++)d[f]+=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),d[f]=Cl(d[f],tc[f]),u++},c=function(d){for(f=0;f<4;f++)d[f]+=h[d[(f+3)%4]&63]}):(a=function(d){for(f=3;f>=0;f--)d[f]=Il(d[f],tc[f]),d[f]-=h[u]+(d[(f+3)%4]&d[(f+2)%4])+(~d[(f+3)%4]&d[(f+1)%4]),u--},c=function(d){for(f=3;f>=0;f--)d[f]-=h[d[(f+3)%4]&63]});var l=function(d){var p=[];for(f=0;f<4;f++){var y=i.getInt16Le();o!==null&&(r?y^=o.getInt16Le():o.putInt16Le(y)),p.push(y&65535)}u=r?0:63;for(var x=0;x=8;)l([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(d){var p=!0;if(r)if(d)p=d(8,i,!r);else{var y=i.length()===8?8:8-i.length();i.fillWithByte(y,y)}if(p&&(n=!0,g.update()),!r&&(p=i.length()===0,p))if(d)p=d(8,s,!r);else{var x=s.length(),v=s.at(x-1);v>x?p=!1:s.truncate(v)}return p}},g};Yt.rc2.startEncrypting=function(t,e,r){var n=Yt.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createEncryptionCipher=function(t,e){return ec(t,e,!0)};Yt.rc2.startDecrypting=function(t,e,r){var n=Yt.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Yt.rc2.createDecryptionCipher=function(t,e){return ec(t,e,!1)}});var Ti=ht((L2,hc)=>{var Xs=lt();hc.exports=Xs.jsbn=Xs.jsbn||{};var ke,Tl=0xdeadbeefcafe,ic=(Tl&16777215)==15715070;function D(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}Xs.jsbn.BigInteger=D;function ot(){return new D(null)}function _l(t,e,r,n,i,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Ll(t,e,r,n,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,f=this.data[t++]>>15,u=a*c+f*o;c=o*c+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(c>>>30)+(u>>>15)+a*f+(i>>>30),r.data[n++]=c&1073741823}return i}function sc(t,e,r,n,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,f=this.data[t++]>>14,u=a*c+f*o;c=o*c+((u&16383)<<14)+r.data[n]+i,i=(c>>28)+(u>>14)+a*f,r.data[n++]=c&268435455}return i}typeof navigator>"u"?(D.prototype.am=sc,ke=28):ic&&navigator.appName=="Microsoft Internet Explorer"?(D.prototype.am=Ll,ke=30):ic&&navigator.appName!="Netscape"?(D.prototype.am=_l,ke=26):(D.prototype.am=sc,ke=28);D.prototype.DB=ke;D.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Dl(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function Ye(t){var e=ot();return e.fromInt(t),e}function kl(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=r==8?t[n]&255:ac(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&t[0]&128&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function Ul(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(i=!0,s=oc(n));o>=0;)a>(a+=this.DB-e)):(n=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=oc(n));return i?s:"0"}function Kl(){var t=ot();return D.ZERO.subTo(this,t),t}function Ol(){return this.s<0?this.negate():this}function Ml(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Ii(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Fl(){return this.t<=0?0:this.DB*(this.t-1)+Ii(this.data[this.t-1]^this.s&this.DM)}function Vl(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Hl(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>n|o,o=(this.data[a]&i)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function zl(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,s=(1<>n;for(var o=r+1;o>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function $l(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function Yl(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,u=s.data[f-1];if(u!=0){var h=u*(1<1?s.data[f-2]>>this.F2:0),l=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),D.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var v=r.data[--p]==u?this.DM:Math.floor(r.data[p]*l+(r.data[p-1]+d)*g);if((r.data[p]+=s.am(0,v,r,y,0,f))0&&r.rShiftTo(c,r),o<0&&D.ZERO.subTo(r,r)}}}function Zl(t){var e=ot();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(D.ZERO)>0&&t.subTo(e,e),e}function fr(t){this.m=t}function Xl(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Ql(t){return t}function Jl(t){t.divRemTo(this.m,null,t)}function jl(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function td(t,e){t.squareTo(e),this.reduce(e)}fr.prototype.convert=Xl;fr.prototype.revert=Ql;fr.prototype.reduce=Jl;fr.prototype.mulTo=jl;fr.prototype.sqrTo=td;function ed(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ur(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function nd(t){var e=ot();return t.copyTo(e),this.reduce(e),e}function id(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sd(t,e){t.squareTo(e),this.reduce(e)}function od(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ur.prototype.convert=rd;ur.prototype.revert=nd;ur.prototype.reduce=id;ur.prototype.mulTo=od;ur.prototype.sqrTo=sd;function ad(){return(this.t>0?this.data[0]&1:this.s)==0}function cd(t,e){if(t>4294967295||t<1)return D.ONE;var r=ot(),n=ot(),i=e.convert(this),s=Ii(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function fd(t,e){var r;return t<256||e.isEven()?r=new fr(e):r=new ur(e),this.exp(t,r)}D.prototype.copyTo=Nl;D.prototype.fromInt=Dl;D.prototype.fromString=kl;D.prototype.clamp=Pl;D.prototype.dlShiftTo=Vl;D.prototype.drShiftTo=Hl;D.prototype.lShiftTo=ql;D.prototype.rShiftTo=zl;D.prototype.subTo=Gl;D.prototype.multiplyTo=$l;D.prototype.squareTo=Wl;D.prototype.divRemTo=Yl;D.prototype.invDigit=ed;D.prototype.isEven=ad;D.prototype.exp=cd;D.prototype.toString=Ul;D.prototype.negate=Kl;D.prototype.abs=Ol;D.prototype.compareTo=Ml;D.prototype.bitLength=Fl;D.prototype.mod=Zl;D.prototype.modPowInt=fd;D.ZERO=Ye(0);D.ONE=Ye(1);function ud(){var t=ot();return this.copyTo(t),t}function hd(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function dd(){return this.t==0?this.s:this.data[0]<<16>>16}function pd(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function yd(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function gd(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Ye(r),i=ot(),s=ot(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(t)+o}function xd(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&D.ZERO.subTo(this,this)}function md(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(D.ONE.shiftLeft(t-1),Js,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(D.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function vd(t){return this.compareTo(t)==0}function wd(t){return this.compareTo(t)<0?this:t}function Ed(t){return this.compareTo(t)>0?this:t}function Sd(t,e,r){var n,i,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Dd(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hd(t){var e=ot();return this.addTo(t,e),e}function qd(t){var e=ot();return this.subTo(t,e),e}function zd(t){var e=ot();return this.multiplyTo(t,e),e}function Gd(t){var e=ot();return this.divRemTo(t,e,null),e}function $d(t){var e=ot();return this.divRemTo(t,null,e),e}function Wd(t){var e=ot(),r=ot();return this.divRemTo(t,e,r),new Array(e,r)}function Yd(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Zd(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function wn(){}function uc(t){return t}function Xd(t,e,r){t.multiplyTo(e,r)}function Qd(t,e){t.squareTo(e)}wn.prototype.convert=uc;wn.prototype.revert=uc;wn.prototype.mulTo=Xd;wn.prototype.sqrTo=Qd;function Jd(t){return this.exp(t,new wn)}function jd(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=ot();return t.copyTo(e),this.reduce(e),e}function rp(t){return t}function np(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ip(t,e){t.squareTo(e),this.reduce(e)}function sp(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Or.prototype.convert=ep;Or.prototype.revert=rp;Or.prototype.reduce=np;Or.prototype.mulTo=sp;Or.prototype.sqrTo=ip;function op(t,e){var r=t.bitLength(),n,i=Ye(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new fr(e):e.isEven()?s=new Or(e):s=new ur(e);var o=new Array,a=3,c=n-1,f=(1<1){var u=ot();for(s.sqrTo(o[1],u);a<=f;)o[a]=ot(),s.mulTo(u,o[a-2],o[a]),a+=2}var h=t.t-1,l,g=!0,d=ot(),p;for(r=Ii(t.data[h])-1;h>=0;){for(r>=c?l=t.data[h]>>r-c&f:(l=(t.data[h]&(1<0&&(l|=t.data[h-1]>>this.DB+r-c)),a=n;!(l&1);)l>>=1,--a;if((r-=a)<0&&(r+=this.DB,--h),g)o[l].copyTo(i),g=!1;else{for(;a>1;)s.sqrTo(i,d),s.sqrTo(d,i),a-=2;a>0?s.sqrTo(i,d):(p=i,i=d,d=p),s.mulTo(d,o[l],i)}for(;h>=0&&!(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function cp(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function fp(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return D.ZERO;for(var r=t.clone(),n=this.clone(),i=Ye(1),s=Ye(0),o=Ye(0),a=Ye(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(a,s)):(n.subTo(r,n),e&&o.subTo(i,o),a.subTo(s,a))}if(n.compareTo(D.ONE)!=0)return D.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],up=(1<<26)/he[he.length-1];function hp(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=he[he.length-1]){for(e=0;e=0);var a=s.modPow(n,this);if(a.compareTo(D.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{var xe=lt();cr();At();var dc=yc.exports=xe.sha1=xe.sha1||{};xe.md.sha1=xe.md.algorithms.sha1=dc;dc.create=function(){pc||pp();var t=null,e=xe.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=n.fullMessageLength.length-1;a>=0;--a)n.fullMessageLength[a]+=o[1],o[1]=o[0]+(n.fullMessageLength[a]/4294967296>>>0),n.fullMessageLength[a]=n.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),lc(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=xe.util.createBuffer();i.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=s&n.blockLength-1;i.putBytes(js.substr(0,n.blockLength-o));for(var a,c,f=n.fullMessageLength[0]*8,u=0;u>>0,f+=c,i.putInt32(f>>>0),f=a>>>0;i.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};lc(h,r,i);var l=xe.util.createBuffer();return l.putInt32(h.h0),l.putInt32(h.h1),l.putInt32(h.h2),l.putInt32(h.h3),l.putInt32(h.h4),l},n};var js=null,pc=!1;function pp(){js="\x80",js+=xe.util.fillString("\0",64),pc=!0}function lc(t,e,r){for(var n,i,s,o,a,c,f,u,h=r.length();h>=64;){for(i=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,u=0;u<16;++u)n=r.getInt32(),e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=a^s&(o^a),n=(i<<5|i>>>27)+f+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=e[u-3]^e[u-8]^e[u-14]^e[u-16],n=n<<1|n>>>31,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s&o|a&(s^o),n=(i<<5|i>>>27)+f+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=e[u-6]^e[u-16]^e[u-28]^e[u-32],n=n<<2|n>>>30,e[u]=n,f=s^o^a,n=(i<<5|i>>>27)+f+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,h-=64}}});var bc=ht((N2,mc)=>{var me=lt();At();vn();gc();var xc=mc.exports=me.pkcs1=me.pkcs1||{};xc.encode_rsa_oaep=function(t,e,r){var n,i,s,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=me.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=c,f}n||(n=""),s.update(n,"raw");for(var u=s.digest(),h="",l=c-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var vc=ht((D2,to)=>{var Ze=lt();At();Ti();vn();(function(){if(Ze.prime){to.exports=Ze.prime;return}var t=to.exports=Ze.prime=Ze.prime||{},e=Ze.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,l){return h|l};t.generateProbablePrime=function(h,l,g){typeof l=="function"&&(g=l,l={}),l=l||{};var d=l.algorithm||"PRIMEINC";typeof d=="string"&&(d={name:d}),d.options=d.options||{};var p=l.prng||Ze.random,y={nextBytes:function(x){for(var v=p.getBytesSync(x.length),m=0;ml&&(h=f(l,g)),h.isProbablePrime(p))return x(null,h);h.dAddOffset(r[d++%8],0)}while(y<0||+new Date-v"u")return o(h,l,g,d);var p=f(h,l),y=g.workers,x=g.workLoad||100,v=x*30/8,m=g.workerScript||"forge/prime.worker.js";if(y===-1)return Ze.util.estimateCores(function(S,B){S&&(B=2),y=B-1,A()});A();function A(){y=Math.max(1,y);for(var S=[],B=0;Bh&&(p=f(h,l));var z=p.toString(16);M.target.postMessage({hex:z,workLoad:x}),p.dAddOffset(v,0)}}}}function f(h,l){var g=new e(h,l),d=h-1;return g.testBit(d)||g.bitwiseTo(e.ONE.shiftLeft(d),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Ri=ht((k2,Ic)=>{var $=lt();bn();Ti();yi();bc();vc();vn();At();typeof st>"u"&&(st=$.jsbn.BigInteger);var st,eo=$.util.isNodejs?Ei():null,E=$.asn1,ie=$.util;$.pki=$.pki||{};Ic.exports=$.pki.rsa=$.rsa=$.rsa||{};var Q=$.pki,yp=[6,4,2,4,2,4,6,2],gp={name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},xp={name:"RSAPrivateKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},mp={name:"RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:E.Class.UNIVERSAL,type:E.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},bp=$.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},vp={name:"DigestInfo",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:E.Class.UNIVERSAL,type:E.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:E.Class.UNIVERSAL,type:E.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:E.Class.UNIVERSAL,type:E.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:E.Class.UNIVERSAL,type:E.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wp=function(t){var e;if(t.algorithm in Q.oids)e=Q.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=E.oidToDer(e).getBytes(),i=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]),s=E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[]);s.value.push(E.create(E.Class.UNIVERSAL,E.Type.OID,!1,n)),s.value.push(E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,""));var o=E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(o),E.toDer(i).getBytes()},Ac=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(st.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(st.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new st($.util.bytesToHex($.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(st.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(s)<0;)i=i.add(e.p);var o=i.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};Q.rsa.encrypt=function(t,e,r){var n=r,i,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=Cc(t,e,r)):(i=$.util.createBuffer(),i.putBytes(t));for(var o=new st(i.toHex(),16),a=Ac(o,e,n),c=a.toString(16),f=$.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),f.getBytes()};Q.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=i,s}var o=new st($.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=Ac(o,e,r),c=a.toString(16),f=$.util.createBuffer(),u=i-Math.ceil(c.length/2);u>0;)f.putByte(0),--u;return f.putBytes($.util.hexToBytes(c)),n!==!1?Li(f.getBytes(),e,r):f.getBytes()};Q.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||$.random,i={nextBytes:function(a){for(var c=n.getBytesSync(a.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};Q.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new st(null);r.fromInt(30);for(var n=0,i=function(h,l){return h|l},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime(Sp(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(yp[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(st.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};Q.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!$.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(wc("generateKeyPair"))return eo.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,f){if(a)return n(a);n(null,{privateKey:Q.privateKeyFromPem(f),publicKey:Q.publicKeyFromPem(c)})});if(Ec("generateKey")&&Ec("exportKey"))return ie.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return ie.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){n(a)}).then(function(a){if(a){var c=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(a)));n(null,{privateKey:c,publicKey:Q.setRsaPublicKey(c.n,c.e)})}});if(Sc("generateKey")&&Sc("exportKey")){var i=ie.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:Bc(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(a){var c=a.target.result,f=ie.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);f.oncomplete=function(u){var h=u.target.result,l=Q.privateKeyFromAsn1(E.fromDer($.util.createBuffer(h)));n(null,{privateKey:l,publicKey:Q.setRsaPublicKey(l.n,l.e)})},f.onerror=function(u){n(u)}},i.onerror=function(a){n(a)};return}}else if(wc("generateKeyPairSync")){var s=eo.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Q.privateKeyFromPem(s.privateKey),publicKey:Q.publicKeyFromPem(s.publicKey)}}}var o=Q.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Q.rsa.stepKeyPairGenerationState(o,0),o.keys;Ep(o,r,n)};Q.setRsaPublicKey=Q.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,s){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(a,c,f){return Cc(a,c,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(a,c){return $.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(a){return a}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return Q.rsa.encrypt(o,r,!0)},r.verify=function(n,i,s,o){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),s==="RSASSA-PKCS1-V1_5"?s={verify:function(c,f){f=Li(f,r,!0);var u=E.fromDer(f,{parseAllBytes:o._parseAllDigestBytes}),h={},l=[];if(!E.validate(u,vp,h,l)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=l,g}var d=E.derToOid(h.algorithmIdentifier);if(!(d===$.oids.md2||d===$.oids.md5||d===$.oids.sha1||d===$.oids.sha224||d===$.oids.sha256||d===$.oids.sha384||d===$.oids.sha512||d===$.oids["sha512-224"]||d===$.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=d,g}if((d===$.oids.md2||d===$.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return c===h.digest}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(c,f){return f=Li(f,r,!0),c===f}});var a=Q.rsa.decrypt(i,r,!0,!1);return s.verify(n,a,r.n.bitLength())},r};Q.setRsaPrivateKey=Q.rsa.setPrivateKey=function(t,e,r,n,i,s,o,a){var c={n:t,e,d:r,p:n,q:i,dP:s,dQ:o,qInv:a};return c.decrypt=function(f,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var l=Q.rsa.decrypt(f,c,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Li};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(g,d){return $.pkcs1.decode_rsa_oaep(d,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(l,c,!1)},c.sign=function(f,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:wp},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return f}},h=1);var l=u.encode(f,c.n.bitLength());return Q.rsa.encrypt(l,c,h)},c};Q.wrapRsaPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.OCTETSTRING,!1,E.toDer(t).getBytes())])};Q.privateKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,gp,e,r)&&(t=E.fromDer($.util.createBuffer(e.privateKey))),e={},r=[],!E.validate(t,xp,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,s,o,a,c,f,u,h;return i=$.util.createBuffer(e.privateKeyModulus).toHex(),s=$.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=$.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=$.util.createBuffer(e.privateKeyPrime1).toHex(),c=$.util.createBuffer(e.privateKeyPrime2).toHex(),f=$.util.createBuffer(e.privateKeyExponent1).toHex(),u=$.util.createBuffer(e.privateKeyExponent2).toHex(),h=$.util.createBuffer(e.privateKeyCoefficient).toHex(),Q.setRsaPrivateKey(new st(i,16),new st(s,16),new st(o,16),new st(a,16),new st(c,16),new st(f,16),new st(u,16),new st(h,16))};Q.privateKeyToAsn1=Q.privateKeyToRSAPrivateKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,E.integerToDer(0).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.d)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.p)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.q)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dP)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.dQ)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.qInv))])};Q.publicKeyFromAsn1=function(t){var e={},r=[];if(E.validate(t,bp,e,r)){var n=E.derToOid(e.publicKeyOid);if(n!==Q.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!E.validate(t,mp,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var s=$.util.createBuffer(e.publicKeyModulus).toHex(),o=$.util.createBuffer(e.publicKeyExponent).toHex();return Q.setRsaPublicKey(new st(s,16),new st(o,16))};Q.publicKeyToAsn1=Q.publicKeyToSubjectPublicKeyInfo=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(Q.oids.rsaEncryption).getBytes()),E.create(E.Class.UNIVERSAL,E.Type.NULL,!1,"")]),E.create(E.Class.UNIVERSAL,E.Type.BITSTRING,!1,[Q.publicKeyToRSAPublicKey(t)])])};Q.publicKeyToRSAPublicKey=function(t){return E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.n)),E.create(E.Class.UNIVERSAL,E.Type.INTEGER,!1,be(t.e))])};function Cc(t,e,r){var n=$.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o=i-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var f=0,u=$.random.getBytes(o),c=0;c"u")throw new Error("Encryption block is invalid.");var c=0;if(a===0){c=i-3-n;for(var f=0;f1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var u=s.getByte();if(u!==0||c!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function Ep(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){$.prime.generateProbablePrime(a,n,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.p=null,i();return}if(t.q.subtract(st.ONE).gcd(t.e).compareTo(st.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(st.ONE),t.q1=t.q.subtract(st.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(st.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var u=t.e.modInverse(t.phi);t.keys={privateKey:Q.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Q.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function be(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=$.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Sp(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function wc(t){return $.util.isNodejs&&typeof eo[t]=="function"}function Ec(t){return typeof ie.globalScope<"u"&&typeof ie.globalScope.crypto=="object"&&typeof ie.globalScope.crypto.subtle=="object"&&typeof ie.globalScope.crypto.subtle[t]=="function"}function Sc(t){return typeof ie.globalScope<"u"&&typeof ie.globalScope.msCrypto=="object"&&typeof ie.globalScope.msCrypto.subtle=="object"&&typeof ie.globalScope.msCrypto.subtle[t]=="function"}function Bc(t){for(var e=$.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{var H=lt();$s();bn();K0();cr();yi();H0();G0();vn();nc();Ri();At();typeof Tc>"u"&&(Tc=H.jsbn.BigInteger);var Tc,I=H.asn1,tt=H.pki=H.pki||{};Nc.exports=tt.pbe=H.pbe=H.pbe||{};var hr=tt.oids,Bp={name:"EncryptedPrivateKeyInfo",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ap={name:"PBES2Algorithms",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:I.Class.UNIVERSAL,type:I.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Cp={name:"pkcs-12PbeParams",tagClass:I.Class.UNIVERSAL,type:I.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:I.Class.UNIVERSAL,type:I.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:I.Class.UNIVERSAL,type:I.Type.INTEGER,constructed:!1,capture:"iterations"}]};tt.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=H.random.getBytesSync(r.saltSize),i=r.count,s=I.integerToDer(i),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var f,u,h;switch(r.algorithm){case"aes128":o=16,f=16,u=hr["aes128-CBC"],h=H.aes.createEncryptionCipher;break;case"aes192":o=24,f=16,u=hr["aes192-CBC"],h=H.aes.createEncryptionCipher;break;case"aes256":o=32,f=16,u=hr["aes256-CBC"],h=H.aes.createEncryptionCipher;break;case"des":o=8,f=8,u=hr.desCBC,h=H.des.createEncryptionCipher;break;default:var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Rc(g),p=H.pkcs5.pbkdf2(e,n,i,o,d),y=H.random.getBytesSync(f),x=h(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes();var v=Ip(n,s,o,g);a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBES2).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr.pkcs5PBKDF2).getBytes()),v]),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(u).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,y)])])])}else if(r.algorithm==="3des"){o=24;var m=new H.util.ByteBuffer(n),p=tt.pbe.generatePkcs12Key(e,m,1,i,o),y=tt.pbe.generatePkcs12Key(e,m,2,i,o),x=H.des.createEncryptionCipher(p);x.start(y),x.update(I.toDer(t)),x.finish(),c=x.output.getBytes(),a=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OID,!1,I.oidToDer(hr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,n),I.create(I.Class.UNIVERSAL,I.Type.INTEGER,!1,s.getBytes())])])}else{var l=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw l.algorithm=r.algorithm,l}var A=I.create(I.Class.UNIVERSAL,I.Type.SEQUENCE,!0,[a,I.create(I.Class.UNIVERSAL,I.Type.OCTETSTRING,!1,c)]);return A};tt.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!I.validate(t,Bp,n,i)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=I.derToOid(n.encryptionOid),a=tt.pbe.getCipher(o,n.encryptionParams,e),c=H.util.createBuffer(n.encryptedData);return a.update(c),a.finish()&&(r=I.fromDer(a.output)),r};tt.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:I.toDer(t).getBytes()};return H.pem.encode(r,{maxline:e})};tt.encryptedPrivateKeyFromPem=function(t){var e=H.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return I.fromDer(e.body)};tt.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=tt.wrapRsaPrivateKey(tt.privateKeyToAsn1(t));return n=tt.encryptPrivateKeyInfo(n,e,r),tt.encryptedPrivateKeyToPem(n)}var i,s,o,a;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,s=H.random.getBytesSync(16),a=H.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,s=H.random.getBytesSync(8),a=H.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var f=H.pbe.opensslDeriveBytes(e,s.substr(0,8),o),u=a(f);u.start(s),u.update(I.toDer(tt.privateKeyToAsn1(t))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:H.util.bytesToHex(s).toUpperCase()},body:u.output.getBytes()};return H.pem.encode(h)};tt.decryptRsaPrivateKey=function(t,e){var r=null,n=H.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,o;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,o=H.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=H.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=H.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=H.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=H.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(h){return H.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":s=8,o=function(h){return H.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":s=16,o=function(h){return H.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var a=H.util.hexToBytes(n.dekInfo.parameters),c=H.pbe.opensslDeriveBytes(e,a.substr(0,8),s),f=o(c);if(f.start(a),f.update(H.util.createBuffer(n.body)),f.finish())r=f.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=tt.decryptPrivateKeyInfo(I.fromDer(r),e):r=I.fromDer(r),r!==null&&(r=tt.privateKeyFromAsn1(r)),r};tt.pbe.generatePkcs12Key=function(t,e,r,n,i,s){var o,a;if(typeof s>"u"||s===null){if(!("sha1"in H.md))throw new Error('"sha1" hash algorithm unavailable.');s=H.md.sha1.create()}var c=s.digestLength,f=s.blockLength,u=new H.util.ByteBuffer,h=new H.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)q=q>>8,q+=_.at(a)+U.at(a),U.setAt(a,q&255);M.putBuffer(U)}m=M,u.putBuffer(B)}return u.truncate(u.length()-i),u};tt.pbe.getCipher=function(t,e,r){switch(t){case tt.oids.pkcs5PBES2:return tt.pbe.getCipherForPBES2(t,e,r);case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:return tt.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};tt.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!I.validate(e,Ap,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}if(t=I.derToOid(n.kdfOid),t!==tt.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=I.derToOid(n.encOid),t!==tt.oids["aes128-CBC"]&&t!==tt.oids["aes192-CBC"]&&t!==tt.oids["aes256-CBC"]&&t!==tt.oids["des-EDE3-CBC"]&&t!==tt.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=n.kdfSalt,a=H.util.createBuffer(n.kdfIterationCount);a=a.getInt(a.length()<<3);var c,f;switch(tt.oids[t]){case"aes128-CBC":c=16,f=H.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=H.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=H.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=H.des.createDecryptionCipher;break;case"desCBC":c=8,f=H.des.createDecryptionCipher;break}var u=Lc(n.prfOid),h=H.pkcs5.pbkdf2(r,o,a,c,u),l=n.encIv,g=f(h);return g.start(l),g};tt.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!I.validate(e,Cp,n,i)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=i,s}var o=H.util.createBuffer(n.salt),a=H.util.createBuffer(n.iterations);a=a.getInt(a.length()<<3);var c,f,u;switch(t){case tt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,f=8,u=H.des.startDecrypting;break;case tt.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,f=8,u=function(p,y){var x=H.rc2.createDecryptionCipher(p,40);return x.start(y,null),x};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=Lc(n.prfOid),l=tt.pbe.generatePkcs12Key(r,o,1,a,c,h);h.start();var g=tt.pbe.generatePkcs12Key(r,o,2,a,f,h);return u(l,g)};tt.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in H.md))throw new Error('"md5" hash algorithm unavailable.');n=H.md.md5.create()}e===null&&(e="");for(var i=[_c(n,t+e)],s=16,o=1;s{var mt=lt();cr();At();var Ln=wf.exports=mt.sha512=mt.sha512||{};mt.md.sha512=mt.md.algorithms.sha512=Ln;var bf=mt.sha384=mt.sha512.sha384=mt.sha512.sha384||{};bf.create=function(){return Ln.create("SHA-384")};mt.md.sha384=mt.md.algorithms.sha384=bf;mt.sha512.sha256=mt.sha512.sha256||{create:function(){return Ln.create("SHA-512/256")}};mt.md["sha512/256"]=mt.md.algorithms["sha512/256"]=mt.sha512.sha256;mt.sha512.sha224=mt.sha512.sha224||{create:function(){return Ln.create("SHA-512/224")}};mt.md["sha512/224"]=mt.md.algorithms["sha512/224"]=mt.sha512.sha224;Ln.create=function(t){if(vf||Yy(),typeof t>"u"&&(t="SHA-512"),!(t in br))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=br[t],r=null,n=mt.util.createBuffer(),i=new Array(80),s=0;s<80;++s)i[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,f=0;f>>0,u>>>0];for(var h=a.fullMessageLength.length-1;h>=0;--h)a.fullMessageLength[h]+=u[1],u[1]=u[0]+(a.fullMessageLength[h]/4294967296>>>0),a.fullMessageLength[h]=a.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(c),mf(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),a},a.digest=function(){var c=mt.util.createBuffer();c.putBytes(n.bytes());var f=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,u=f&a.blockLength-1;c.putBytes(Fo.substr(0,a.blockLength-u));for(var h,l,g=a.fullMessageLength[0]*8,d=0;d>>0,g+=l,c.putInt32(g>>>0),g=h>>>0;c.putInt32(g);for(var p=new Array(r.length),d=0;d=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)L=e[C-2],N=L[0],T=L[1],n=((N>>>19|T<<13)^(T>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|T>>>19)^(T<<3|N>>>29)^(N<<26|T>>>6))>>>0,P=e[C-15],N=P[0],T=P[1],s=((N>>>1|T<<31)^(N>>>8|T<<24)^N>>>7)>>>0,o=((N<<31|T>>>1)^(N<<24|T>>>8)^(N<<25|T>>>7))>>>0,w=e[C-7],K=e[C-16],T=i+w[1]+o+K[1],e[C][0]=n+w[0]+s+K[0]+(T/4294967296>>>0)>>>0,e[C][1]=T>>>0;for(p=t[0][0],y=t[0][1],x=t[1][0],v=t[1][1],m=t[2][0],A=t[2][1],S=t[3][0],B=t[3][1],R=t[4][0],_=t[4][1],O=t[5][0],M=t[5][1],U=t[6][0],q=t[6][1],z=t[7][0],Z=t[7][1],C=0;C<80;++C)f=((R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23))>>>0,u=((R<<18|_>>>14)^(R<<14|_>>>18)^(_<<23|R>>>9))>>>0,h=(U^R&(O^U))>>>0,l=(q^_&(M^q))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,g=(p&x|m&(p^x))>>>0,d=(y&v|A&(y^v))>>>0,T=Z+u+l+Vo[C][1]+e[C][1],n=z+f+h+Vo[C][0]+e[C][0]+(T/4294967296>>>0)>>>0,i=T>>>0,T=c+d,s=a+g+(T/4294967296>>>0)>>>0,o=T>>>0,z=U,Z=q,U=O,q=M,O=R,M=_,T=B+i,R=S+n+(T/4294967296>>>0)>>>0,_=T>>>0,S=m,B=A,m=x,A=v,x=p,v=y,T=i+o,p=n+s+(T/4294967296>>>0)>>>0,y=T>>>0;T=t[0][1]+y,t[0][0]=t[0][0]+p+(T/4294967296>>>0)>>>0,t[0][1]=T>>>0,T=t[1][1]+v,t[1][0]=t[1][0]+x+(T/4294967296>>>0)>>>0,t[1][1]=T>>>0,T=t[2][1]+A,t[2][0]=t[2][0]+m+(T/4294967296>>>0)>>>0,t[2][1]=T>>>0,T=t[3][1]+B,t[3][0]=t[3][0]+S+(T/4294967296>>>0)>>>0,t[3][1]=T>>>0,T=t[4][1]+_,t[4][0]=t[4][0]+R+(T/4294967296>>>0)>>>0,t[4][1]=T>>>0,T=t[5][1]+M,t[5][0]=t[5][0]+O+(T/4294967296>>>0)>>>0,t[5][1]=T>>>0,T=t[6][1]+q,t[6][0]=t[6][0]+U+(T/4294967296>>>0)>>>0,t[6][1]=T>>>0,T=t[7][1]+Z,t[7][0]=t[7][0]+z+(T/4294967296>>>0)>>>0,t[7][1]=T>>>0,V-=128}}});var tu=ht((Iw,jf)=>{var tn=1e3,en=tn*60,rn=en*60,Sr=rn*24,B1=Sr*7,A1=Sr*365.25;jf.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return C1(t);if(r==="number"&&isFinite(t))return e.long?T1(t):I1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function C1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*A1;case"weeks":case"week":case"w":return r*B1;case"days":case"day":case"d":return r*Sr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*rn;case"minutes":case"minute":case"mins":case"min":case"m":return r*en;case"seconds":case"second":case"secs":case"sec":case"s":return r*tn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function I1(t){var e=Math.abs(t);return e>=Sr?Math.round(t/Sr)+"d":e>=rn?Math.round(t/rn)+"h":e>=en?Math.round(t/en)+"m":e>=tn?Math.round(t/tn)+"s":t+"ms"}function T1(t){var e=Math.abs(t);return e>=Sr?Vi(t,e,Sr,"day"):e>=rn?Vi(t,e,rn,"hour"):e>=en?Vi(t,e,en,"minute"):e>=tn?Vi(t,e,tn,"second"):t+" ms"}function Vi(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ru=ht((Tw,eu)=>{function _1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=tu(),r.destroy=f,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let h=0;for(let l=0;l{if(B==="%%")return"%";A++;let _=r.formatters[R];if(typeof _=="function"){let O=y[A];B=_.call(x,O),y.splice(A,1),A--}return B}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==r.namespaces&&(g=r.namespaces,d=r.enabled(u)),d),set:y=>{l=y}}),typeof r.init=="function"&&r.init(p),p}function n(u,h){let l=r(this.namespace+(typeof h>"u"?":":h)+u);return l.log=this.log,l}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let h,l=(typeof u=="string"?u:"").split(/[\s,]+/),g=l.length;for(h=0;h"-"+h)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let h,l;for(h=0,l=r.skips.length;h{te.formatArgs=R1;te.save=N1;te.load=D1;te.useColors=L1;te.storage=k1();te.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();te.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function L1(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function R1(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Hi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}te.log=console.debug||console.log||(()=>{});function N1(t){try{t?te.storage.setItem("debug",t):te.storage.removeItem("debug")}catch{}}function D1(){let t;try{t=te.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function k1(){try{return localStorage}catch{}}Hi.exports=ru()(te);var{formatters:P1}=Hi.exports;P1.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V1={};Lt(V1,{noise:()=>F1,pureJsCrypto:()=>di});function Be(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function rt(t=0){return globalThis.Buffer?.alloc!=null?Be(globalThis.Buffer.alloc(t)):new Uint8Array(t)}function Tt(t=0){return globalThis.Buffer?.allocUnsafe!=null?Be(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var Su=Math.pow(2,7),Bu=Math.pow(2,14),Au=Math.pow(2,21),Zi=Math.pow(2,28),Xi=Math.pow(2,35),Qi=Math.pow(2,42),Ji=Math.pow(2,49),ct=128,qt=127;function Ae(t){if(tNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Cu(t,e,r=0){switch(Ae(t)){case 8:e[r++]=t&255|ct,t/=128;case 7:e[r++]=t&255|ct,t/=128;case 6:e[r++]=t&255|ct,t/=128;case 5:e[r++]=t&255|ct,t/=128;case 4:e[r++]=t&255|ct,t>>>=7;case 3:e[r++]=t&255|ct,t>>>=7;case 2:e[r++]=t&255|ct,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Iu(t,e,r=0){switch(Ae(t)){case 8:e.set(r++,t&255|ct),t/=128;case 7:e.set(r++,t&255|ct),t/=128;case 6:e.set(r++,t&255|ct),t/=128;case 5:e.set(r++,t&255|ct),t/=128;case 4:e.set(r++,t&255|ct),t>>>=7;case 3:e.set(r++,t&255|ct),t>>>=7;case 2:e.set(r++,t&255|ct),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function Tu(t,e){let r=t[e],n=0;if(n+=r&qt,ri+s.length,0));let r=Tt(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Be(r)}function Rt(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let r=0;for(let n of e)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Br(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...e){this.prependAll(e)}prependAll(e){let r=0;for(let n of e.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Br(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(e){let r=da(this.bufs,e);return r.buf[r.index]}set(e,r){let n=da(this.bufs,e);n.buf[n.index]=r}write(e,r=0){if(e instanceof Uint8Array)for(let n=0;n0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,r){let{bufs:n,length:i}=this._subList(e,r);return Qt(n,i)}subarray(e,r){let{bufs:n,length:i}=this._subList(e,r);return n.length===1?n[0]:Qt(n,i)}sublist(e,r){let{bufs:n,length:i}=this._subList(e,r),s=new t;return s.length=i,s.bufs=[...n],s}_subList(e,r){if(e=e??0,r=r??this.length,e<0&&(e=this.length+e),r<0&&(r=this.length+r),e<0||r>this.length)throw new RangeError("index is out of bounds");if(e===r)return{bufs:[],length:0};if(e===0&&r===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let s=0;s=c)continue;let f=e>=a&&ea&&r<=c;if(f&&u){if(e===a&&r===c){n.push(o);break}let h=e-a;n.push(o.subarray(h,h+(r-e)));break}if(f){if(e===0){n.push(o);continue}n.push(o.subarray(e-a));continue}if(u){if(r===c){n.push(o);break}n.push(o.subarray(0,r-a));break}n.push(o)}return{bufs:n,length:r-e}}indexOf(e,r=0){if(!Br(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),e.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let s=256,o=new Int32Array(s);for(let h=0;h=0;l--){let g=this.get(h+l);if(n[l]!==g){u=Math.max(1,l-a[g]);break}}if(u===0)return h}return-1}getInt8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(e,r){let n=Tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,e)}getInt16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,e)}getInt32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,e)}getBigInt64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,e)}getUint8(e){let r=this.subarray(e,e+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(e,r){let n=Tt(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,e)}getUint16(e,r){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(e,r,n){let i=rt(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,e)}getUint32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,e)}getBigUint64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,e)}getFloat32(e,r){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(e,r,n){let i=rt(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,e)}getFloat64(e,r){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(e,r,n){let i=rt(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,e)}equals(e){if(e==null||!(e instanceof t)||e.bufs.length!==this.bufs.length)return!1;for(let r=0;ri+s.byteLength,0)),n.length=r,n}};function Vn(t){return t[Symbol.asyncIterator]!=null}var Hn=t=>{let e=Ae(t),r=Tt(e);return la(t,r),Hn.bytes=e,r};Hn.bytes=0;function sn(t,e){e=e??{};let r=e.lengthEncoder??Hn;function*n(i){let s=r(i.byteLength);s instanceof Uint8Array?yield s:yield*s,i instanceof Uint8Array?yield i:yield*i}return Vn(t)?async function*(){for await(let i of t)yield*n(i)}():function*(){for(let i of t)yield*n(i)}()}sn.single=(t,e)=>{e=e??{};let r=e.lengthEncoder??Hn;return new Bt(r(t.byteLength),t)};var Ar=Gt(xa(),1);var Ru=8,Nu=1024*1024*4,er;(function(t){t[t.LENGTH=0]="LENGTH",t[t.DATA=1]="DATA"})(er||(er={}));var ts=t=>{let e=Fn(t);return ts.bytes=Ae(e),e};ts.bytes=0;function on(t,e){let r=new Bt,n=er.LENGTH,i=-1,s=e?.lengthDecoder??ts,o=e?.maxLengthLength??Ru,a=e?.maxDataLength??Nu;function*c(){for(;r.byteLength>0;){if(n===er.LENGTH)try{if(i=s(r),i<0)throw(0,Ar.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>a)throw(0,Ar.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let f=s.bytes;r.consume(f),e?.onLength!=null&&e.onLength(i),n=er.DATA}catch(f){if(f instanceof RangeError){if(r.byteLength>o)throw(0,Ar.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw f}if(n===er.DATA){if(r.byteLength0)throw(0,Ar.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}():function*(){for(let f of t)r.append(f),yield*c();if(r.byteLength>0)throw(0,Ar.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}()}on.fromReader=(t,e)=>{let r=1,n=async function*(){for(;;)try{let{done:s,value:o}=await t.next(r);if(s===!0)return;o!=null&&(yield o)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}();return on(n,{...e??{},onLength:s=>{r=s}})};function oe(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var qn=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function ma(t,e,r){if(e==null)return t;if(e.aborted)return Promise.reject(new qn(r?.errorMessage,r?.errorCode));let n,i=new qn(r?.errorMessage,r?.errorCode);try{return await Promise.race([t,new Promise((s,o)=>{n=()=>{o(i)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var es=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=oe(),this.needNext.resolve(),this.haveNext=oe()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let e=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=oe(),e}async throw(e){return this.ended=!0,e!=null&&this.haveNext.reject(e),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,r){await this._push(e,r)}async end(e,r){e!=null?await this.throw(e):await this._push(void 0,r)}async _push(e,r){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=oe(),await ma(this.needNext.promise,r?.signal,r)}};function ba(){return new es}var zn=class extends Error{code;constructor(e,r){super(e),this.code=r}},rs=class extends zn{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function va(t,e){let r=ba();t.sink(r).catch(async o=>{await r.end(o)}),t.sink=async o=>{for await(let a of o)await r.push(a);await r.end()};let n=t.source;t.source[Symbol.iterator]!=null?n=t.source[Symbol.iterator]():t.source[Symbol.asyncIterator]!=null&&(n=t.source[Symbol.asyncIterator]());let i=new Bt;return{read:async(o,a)=>{a?.signal?.throwIfAborted();let c,f=new Promise((u,h)=>{c=()=>{h(new rs("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(o==null){let{done:h,value:l}=await Promise.race([n.next(),f]);return h===!0?new Bt:l}for(;i.byteLength{a?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,a):await r.push(o.subarray(),a)},unwrap:()=>{if(i.byteLength>0){let o=t.source;t.source=async function*(){e?.yieldBytes===!1?yield i:yield*i,yield*o}()}return t}}}var Gn=class extends Error{code;constructor(e,r){super(e),this.code=r}},wa=t=>Fn(t);wa.bytes=0;function ns(t,e={}){let r=va(t,e);return e.maxDataLength!=null&&e.maxLengthLength==null&&(e.maxLengthLength=Ae(e.maxDataLength)),{read:async i=>{let s=-1,o=new Bt,a=e?.lengthDecoder??wa;for(;;){o.append(await r.read(1,i));try{s=a(o)}catch(c){if(c instanceof RangeError)continue;throw c}if(e?.maxLengthLength!=null&&o.byteLength>e.maxLengthLength)throw new Gn("message length length too long","ERR_MSG_LENGTH_TOO_LONG");if(s>-1)break}if(e?.maxDataLength!=null&&s>e.maxDataLength)throw new Gn("message length too long","ERR_MSG_DATA_TOO_LONG");return r.read(s,i)},write:async(i,s)=>{await r.write(sn.single(i,e),s)},writeV:async(i,s)=>{let o=new Bt(...i.map(a=>sn.single(a,e)));await r.write(o,s)},unwrap:()=>r.unwrap()}}function is(){let t=oe(),e=!1;return{sink:async r=>{if(e)throw new Error("already piped");e=!0,t.resolve(r)},source:async function*(){yield*await t.promise}()}}function Ea(){let t=is(),e=is();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}var $n=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Cr=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new $n(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new $n(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var ss=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wn(t={}){return ku(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function ku(t,e){e=e??{};let r=e.onEnd,n=new Cr,i,s,o,a=oe(),c=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((y,x)=>{s=v=>{s=null,n.push(v);try{y(t(n))}catch(m){x(m)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=oe()})}},f=y=>s!=null?s(y):(n.push(y),i),u=y=>(n=new Cr,s!=null?s({error:y}):(n.push({error:y}),i)),h=y=>{if(o)return i;if(e?.objectMode!==!0&&y?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return f({done:!1,value:y})},l=y=>o?i:(o=!0,y!=null?u(y):f({done:!0})),g=()=>(n=new Cr,l(),{done:!0}),d=y=>(l(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:c,return:g,throw:d,push:h,end:l,get readableLength(){return n.size},onEmpty:async y=>{let x=y?.signal;if(x?.throwIfAborted(),n.isEmpty())return;let v,m;x!=null&&(v=new Promise((A,S)=>{m=()=>{S(new ss)},x.addEventListener("abort",m)}));try{await Promise.race([a.promise,v])}finally{m!=null&&x!=null&&x?.removeEventListener("abort",m)}}},r==null)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),r!=null&&(r(y),r=void 0),{done:!0}},return(){return p.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(y){return p.end(y),r!=null&&(r(y),r=void 0),i},get readableLength(){return p.readableLength},onEmpty:y=>p.onEmpty(y)},i}function Pu(t){return t[Symbol.asyncIterator]!=null}function Uu(...t){let e=[];for(let r of t)Pu(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=Wn({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Sa=Uu;function Ba(t,...e){if(t==null)throw new Error("Empty pipeline");if(os(t)){let n=t;t=()=>n.source}else if(Ca(t)||Aa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&os(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n{let e;for(;t.length>0;)e=t.shift()(e);return e},Aa=t=>t?.[Symbol.asyncIterator]!=null,Ca=t=>t?.[Symbol.iterator]!=null,os=t=>t==null?!1:t.sink!=null&&t.source!=null,Ou=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=Wn({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,s=t.source;if(Aa(s))i=async function*(){yield*s,n.end()};else if(Ca(s))i=function*(){yield*s,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Sa(n,i())}return t.source};var Ia=!!globalThis.process?.env?.DUMP_SESSION_KEYS;var Mu=t=>t instanceof Uint8Array;var Ce=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ta=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Fu)throw new Error("Non little-endian hardware is not supported");function Yn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Zn(t){if(typeof t=="string")t=Yn(t);else if(Mu(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Vu=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function _a(t,e){if(e!==void 0&&(typeof e!="object"||!Vu(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function rr(t,e){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function La(t,e){if(t.length!==e.length)throw new Error("equalBytes: Different size of Uint8Arrays");let r=!0;for(let n=0;n(Object.assign(e,t),e);function cs(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}function Xn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function fs(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function Ir(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function us(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ra(t,e){Ir(t);let r=e.outputLen;if(t.lengtht[e++]&255|(t[e++]&255)<<8,hs=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Zn(e),rr(e,32);let r=Ot(e,0),n=Ot(e,2),i=Ot(e,4),s=Ot(e,6),o=Ot(e,8),a=Ot(e,10),c=Ot(e,12),f=Ot(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|f<<8)&8191,this.r[9]=f>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ot(e,16+2*u)}process(e,r,n=!1){let i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],f=o[2],u=o[3],h=o[4],l=o[5],g=o[6],d=o[7],p=o[8],y=o[9],x=Ot(e,r+0),v=Ot(e,r+2),m=Ot(e,r+4),A=Ot(e,r+6),S=Ot(e,r+8),B=Ot(e,r+10),R=Ot(e,r+12),_=Ot(e,r+14),O=s[0]+(x&8191),M=s[1]+((x>>>13|v<<3)&8191),U=s[2]+((v>>>10|m<<6)&8191),q=s[3]+((m>>>7|A<<9)&8191),z=s[4]+((A>>>4|S<<12)&8191),Z=s[5]+(S>>>1&8191),C=s[6]+((S>>>14|B<<2)&8191),N=s[7]+((B>>>11|R<<5)&8191),T=s[8]+((R>>>8|_<<8)&8191),L=s[9]+(_>>>5|i),w=0,P=w+O*a+M*(5*y)+U*(5*p)+q*(5*d)+z*(5*g);w=P>>>13,P&=8191,P+=Z*(5*l)+C*(5*h)+N*(5*u)+T*(5*f)+L*(5*c),w+=P>>>13,P&=8191;let K=w+O*c+M*a+U*(5*y)+q*(5*p)+z*(5*d);w=K>>>13,K&=8191,K+=Z*(5*g)+C*(5*l)+N*(5*h)+T*(5*u)+L*(5*f),w+=K>>>13,K&=8191;let V=w+O*f+M*c+U*a+q*(5*y)+z*(5*p);w=V>>>13,V&=8191,V+=Z*(5*d)+C*(5*g)+N*(5*l)+T*(5*h)+L*(5*u),w+=V>>>13,V&=8191;let W=w+O*u+M*f+U*c+q*a+z*(5*y);w=W>>>13,W&=8191,W+=Z*(5*p)+C*(5*d)+N*(5*g)+T*(5*l)+L*(5*h),w+=W>>>13,W&=8191;let Y=w+O*h+M*u+U*f+q*c+z*a;w=Y>>>13,Y&=8191,Y+=Z*(5*y)+C*(5*p)+N*(5*d)+T*(5*g)+L*(5*l),w+=Y>>>13,Y&=8191;let et=w+O*l+M*h+U*u+q*f+z*c;w=et>>>13,et&=8191,et+=Z*a+C*(5*y)+N*(5*p)+T*(5*d)+L*(5*g),w+=et>>>13,et&=8191;let X=w+O*g+M*l+U*h+q*u+z*f;w=X>>>13,X&=8191,X+=Z*c+C*a+N*(5*y)+T*(5*p)+L*(5*d),w+=X>>>13,X&=8191;let J=w+O*d+M*g+U*l+q*h+z*u;w=J>>>13,J&=8191,J+=Z*f+C*c+N*a+T*(5*y)+L*(5*p),w+=J>>>13,J&=8191;let dt=w+O*p+M*d+U*g+q*l+z*h;w=dt>>>13,dt&=8191,dt+=Z*u+C*f+N*c+T*a+L*(5*y),w+=dt>>>13,dt&=8191;let ut=w+O*y+M*p+U*d+q*g+z*l;w=ut>>>13,ut&=8191,ut+=Z*h+C*u+N*f+T*c+L*a,w+=ut>>>13,ut&=8191,w=(w<<2)+w|0,w=w+P|0,P=w&8191,w=w>>>13,K+=w,s[0]=P,s[1]=K,s[2]=V,s[3]=W,s[4]=Y,s[5]=et,s[6]=X,s[7]=J,s[8]=dt,s[9]=ut}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535}update(e){us(this);let{buffer:r,blockLen:n}=this;e=Zn(e);let i=e.length;for(let s=0;s>>0,e[s++]=n[o]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function Hu(t){let e=(n,i)=>t(i).update(Zn(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var Na=Hu(t=>new hs(t));var qu=Yn("expand 16-byte k"),zu=Yn("expand 32-byte k"),Gu=Ce(qu),$u=Ce(zu);function G(t,e){return t<>>32-e}function ls(t){return t.byteOffset%4===0}var Qn=64,Wu=16,ka=2**32-1,Da=new Uint32Array;function Yu(t,e,r,n,i,s,o,a){let c=i.length,f=new Uint8Array(Qn),u=Ce(f),h=ls(i)&&ls(s),l=h?Ce(i):Da,g=h?Ce(s):Da;for(let d=0;d=ka)throw new Error("arx: counter overflow");let p=Math.min(Qn,c-d);if(h&&p===Qn){let y=d/4;if(d%4!==0)throw new Error("arx: invalid block position");for(let x=0,v;x{Ir(a),Ir(c),Ir(f);let l=f.length;if(u||(u=new Uint8Array(l)),Ir(u),Xn(h),h<0||h>=ka)throw new Error("arx: counter overflow");if(u.length0;)g.pop().fill(0);return u}}function Ka(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],f=t[3],u=e[0],h=e[1],l=e[2],g=e[3],d=e[4],p=e[5],y=e[6],x=e[7],v=i,m=r[0],A=r[1],S=r[2],B=o,R=a,_=c,O=f,M=u,U=h,q=l,z=g,Z=d,C=p,N=y,T=x,L=v,w=m,P=A,K=S;for(let W=0;W{t.update(e);let r=e.length%16;r&&t.update(Ju.subarray(r))},ju=new Uint8Array(32);function Ua(t,e,r,n,i){let s=t(e,r,ju),o=Na.create(s);i&&Pa(o,i),Pa(o,n);let a=new Uint8Array(16),c=Ta(a);cs(c,0,BigInt(i?i.length:0),!0),cs(c,8,BigInt(n.length),!0),o.update(a);let f=o.digest();return s.fill(0),f}var Oa=t=>(e,r,n)=>(rr(e,32),rr(r),{encrypt:(s,o)=>{let a=s.length,c=a+16;o?rr(o,c):o=new Uint8Array(c),t(e,r,s,o,1);let f=Ua(t,e,r,o.subarray(0,-16),n);return o.set(f,a),o},decrypt:(s,o)=>{let a=s.length,c=a-16;if(a<16)throw new Error("encrypted data must be at least 16 bytes");o?rr(o,c):o=new Uint8Array(c);let f=s.subarray(0,-16),u=s.subarray(-16),h=Ua(t,e,r,f,n);if(!La(u,h))throw new Error("invalid tag");return t(e,r,f,o,1),o}}),ps=as({blockSize:64,nonceLength:12,tagLength:16},Oa(Xu)),Zg=as({blockSize:64,nonceLength:24,tagLength:16},Oa(Qu));function Jn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ys(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function an(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Jn(t.outputLen),Jn(t.blockLen)}function Tr(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ma(t,e){ys(t);let r=e.outputLen;if(t.lengtht instanceof Uint8Array;var ti=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ae=(t,e)=>t<<32-e|t>>>e,th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");function gs(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fe(t){if(typeof t=="string"&&(t=gs(t)),!Fa(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function ei(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Fa(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}var _r=class{clone(){return this._cloneInto()}},tx={}.toString;function ri(t){let e=n=>t().update(Fe(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nr(t=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function eh(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,f=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+f,a,n)}var Lr=class extends _r{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ti(this.buffer)}update(e){Tr(this);let{view:r,buffer:n,blockLen:i}=this;e=Fe(e);let s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hu.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>xs&ni)}:{h:Number(t>>xs&ni)|0,l:Number(t&ni)|0}}function rh(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),ih=(t,e,r)=>t>>>r,sh=(t,e,r)=>t<<32-r|e>>>r,oh=(t,e,r)=>t>>>r|e<<32-r,ah=(t,e,r)=>t<<32-r|e>>>r,ch=(t,e,r)=>t<<64-r|e>>>r-32,fh=(t,e,r)=>t>>>r-32|e<<64-r,uh=(t,e)=>e,hh=(t,e)=>t,lh=(t,e,r)=>t<>>32-r,dh=(t,e,r)=>e<>>32-r,ph=(t,e,r)=>e<>>64-r,yh=(t,e,r)=>t<>>64-r;function gh(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var xh=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),mh=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,bh=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vh=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,wh=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Eh=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;var Sh={fromBig:Va,split:rh,toBig:nh,shrSH:ih,shrSL:sh,rotrSH:oh,rotrSL:ah,rotrBH:ch,rotrBL:fh,rotr32H:uh,rotr32L:hh,rotlSH:lh,rotlSL:dh,rotlBH:ph,rotlBL:yh,add:gh,add3L:xh,add3H:mh,add4L:bh,add4H:vh,add5H:Eh,add5L:wh},j=Sh;var[Bh,Ah]=j.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ve=new Uint32Array(80),He=new Uint32Array(80),ms=class extends Lr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:f,El:u,Fh:h,Fl:l,Gh:g,Gl:d,Hh:p,Hl:y}=this;return[e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y]}set(e,r,n,i,s,o,a,c,f,u,h,l,g,d,p,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=h|0,this.Fl=l|0,this.Gh=g|0,this.Gl=d|0,this.Hh=p|0,this.Hl=y|0}process(e,r){for(let m=0;m<16;m++,r+=4)Ve[m]=e.getUint32(r),He[m]=e.getUint32(r+=4);for(let m=16;m<80;m++){let A=Ve[m-15]|0,S=He[m-15]|0,B=j.rotrSH(A,S,1)^j.rotrSH(A,S,8)^j.shrSH(A,S,7),R=j.rotrSL(A,S,1)^j.rotrSL(A,S,8)^j.shrSL(A,S,7),_=Ve[m-2]|0,O=He[m-2]|0,M=j.rotrSH(_,O,19)^j.rotrBH(_,O,61)^j.shrSH(_,O,6),U=j.rotrSL(_,O,19)^j.rotrBL(_,O,61)^j.shrSL(_,O,6),q=j.add4L(R,U,He[m-7],He[m-16]),z=j.add4H(q,B,M,Ve[m-7],Ve[m-16]);Ve[m]=z|0,He[m]=q|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:f,Dl:u,Eh:h,El:l,Fh:g,Fl:d,Gh:p,Gl:y,Hh:x,Hl:v}=this;for(let m=0;m<80;m++){let A=j.rotrSH(h,l,14)^j.rotrSH(h,l,18)^j.rotrBH(h,l,41),S=j.rotrSL(h,l,14)^j.rotrSL(h,l,18)^j.rotrBL(h,l,41),B=h&g^~h&p,R=l&d^~l&y,_=j.add5L(v,S,R,Ah[m],He[m]),O=j.add5H(_,x,A,B,Bh[m],Ve[m]),M=_|0,U=j.rotrSH(n,i,28)^j.rotrBH(n,i,34)^j.rotrBH(n,i,39),q=j.rotrSL(n,i,28)^j.rotrBL(n,i,34)^j.rotrBL(n,i,39),z=n&s^n&a^s&a,Z=i&o^i&c^o&c;x=p|0,v=y|0,p=g|0,y=d|0,g=h|0,d=l|0,{h,l}=j.add(f|0,u|0,O|0,M|0),f=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;let C=j.add3L(M,q,Z);n=j.add3H(C,O,U,z),i=C|0}({h:n,l:i}=j.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=j.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=j.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:f,l:u}=j.add(this.Dh|0,this.Dl|0,f|0,u|0),{h,l}=j.add(this.Eh|0,this.El|0,h|0,l|0),{h:g,l:d}=j.add(this.Fh|0,this.Fl|0,g|0,d|0),{h:p,l:y}=j.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:x,l:v}=j.add(this.Hh|0,this.Hl|0,x|0,v|0),this.set(n,i,s,o,a,c,f,u,h,l,g,d,p,y,x,v)}roundClean(){Ve.fill(0),He.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var bs=ri(()=>new ms);var oi={};Lt(oi,{bitGet:()=>Nh,bitLen:()=>Rh,bitMask:()=>cn,bitSet:()=>Dh,bytesToHex:()=>Ie,bytesToNumberBE:()=>Te,bytesToNumberLE:()=>ce,concatBytes:()=>Le,createHmacDrbg:()=>Es,ensureBytes:()=>yt,equalBytes:()=>_h,hexToBytes:()=>ir,hexToNumber:()=>ws,numberToBytesBE:()=>qe,numberToBytesLE:()=>_e,numberToHexUnpadded:()=>za,numberToVarBytesBE:()=>Th,utf8ToBytes:()=>Lh,validateObject:()=>re});var qa=BigInt(0),ii=BigInt(1),Ch=BigInt(2),si=t=>t instanceof Uint8Array,Ih=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ie(t){if(!si(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rn+i.length,0)),r=0;return t.forEach(n=>{if(!si(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function _h(t,e){if(t.length!==e.length)return!1;for(let r=0;rqa;t>>=ii,e+=1);return e}function Nh(t,e){return t>>BigInt(e)&ii}var Dh=(t,e,r)=>t|(r?ii:qa)<(Ch<new Uint8Array(t),Ha=t=>Uint8Array.from(t);function Es(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vs(t),i=vs(t),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...h)=>r(i,n,...h),c=(h=vs())=>{i=a(Ha([0]),h),n=a(),h.length!==0&&(i=a(Ha([1]),h),n=a())},f=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0,l=[];for(;h{o(),c(h);let g;for(;!(g=l(f()));)c();return o(),g}}var kh={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function re(t,e,r={}){let n=(i,s,o)=>{let a=kh[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}var _t=BigInt(0),bt=BigInt(1),sr=BigInt(2),Ph=BigInt(3),Ss=BigInt(4),Ga=BigInt(5),$a=BigInt(8),Uh=BigInt(9),Kh=BigInt(16);function at(t,e){let r=t%e;return r>=_t?r:e+r}function Bs(t,e,r){if(r<=_t||e<_t)throw new Error("Expected power/modulo > 0");if(r===bt)return _t;let n=bt;for(;e>_t;)e&bt&&(n=n*t%r),t=t*t%r,e>>=bt;return n}function gt(t,e,r){let n=t;for(;e-- >_t;)n*=n,n%=r;return n}function ai(t,e){if(t===_t||e<=_t)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=at(t,e),n=e,i=_t,s=bt,o=bt,a=_t;for(;r!==_t;){let f=n/r,u=n%r,h=i-o*f,l=s-a*f;n=r,r=u,i=o,s=a,o=h,a=l}if(n!==bt)throw new Error("invert: does not exist");return at(i,e)}function Oh(t){let e=(t-bt)/sr,r,n,i;for(r=t-bt,n=0;r%sr===_t;r/=sr,n++);for(i=sr;i(at(t,e)&bt)===bt,Fh=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function As(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Fh.reduce((n,i)=>(n[i]="function",n),e);return re(t,r)}function Vh(t,e,r){if(r<_t)throw new Error("Expected power > 0");if(r===_t)return t.ONE;if(r===bt)return e;let n=t.ONE,i=e;for(;r>_t;)r&bt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bt;return n}function Hh(t,e){let r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function Cs(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ci(t,e,r=!1,n={}){if(t<=_t)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Cs(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=Mh(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:cn(i),ZERO:_t,ONE:bt,create:c=>at(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return _t<=c&&cc===_t,isOdd:c=>(c&bt)===bt,neg:c=>at(-c,t),eql:(c,f)=>c===f,sqr:c=>at(c*c,t),add:(c,f)=>at(c+f,t),sub:(c,f)=>at(c-f,t),mul:(c,f)=>at(c*f,t),pow:(c,f)=>Vh(a,c,f),div:(c,f)=>at(c*ai(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>ai(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Hh(a,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?_e(c,s):qe(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ce(c):Te(c)}});return Object.freeze(a)}function Ya(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function Za(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function Is(t){let e=Za(t);return e+Math.ceil(e/2)}function Xa(t,e,r=!1){let n=t.length,i=Za(e),s=Is(e);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=r?Te(t):ce(t),a=at(o,e-bt)+bt;return r?_e(a,i):qe(a,i)}var zh=BigInt(0),Ts=BigInt(1);function fi(t,e){let r=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>zh;)s&Ts&&(o=o.add(a)),a=a.double(),s>>=Ts;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],f=i,u=f;for(let h=0;h>=g,y>c&&(y-=l,o+=Ts);let x=p,v=p+Math.abs(y)-1,m=d%2!==0,A=y<0;y===0?u=u.add(r(m,s[x])):f=f.add(r(A,s[v]))}return{p:f,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,f=s.get(i);return f||(f=this.precomputeWindow(i,c),c!==1&&s.set(i,a(f))),this.wNAF(c,f,o)}}}function fn(t){return As(t.Fp),re(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cs(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var fe=BigInt(0),Jt=BigInt(1),ui=BigInt(2),Gh=BigInt(8),$h={zip215:!0};function Wh(t){let e=fn(t);return re(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function hi(t){let e=Wh(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,f=ui<{try{return{isValid:!0,value:r.sqrt(L*r.inv(w))}}catch{return{isValid:!1,value:fe}}}),l=e.adjustScalarBytes||(L=>L),g=e.domain||((L,w,P)=>{if(w.length||P)throw new Error("Contexts/pre-hash are not supported");return L}),d=L=>typeof L=="bigint"&&fed(L)&&d(w)&&LL===fe||p(L,f);function x(L,w){if(p(L,w))return L;throw new Error(`Expected valid scalar < ${w}, got ${typeof L} ${L}`)}function v(L){return L===fe?L:x(L,n)}let m=new Map;function A(L){if(!(L instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(w,P,K,V){if(this.ex=w,this.ey=P,this.ez=K,this.et=V,!y(w))throw new Error("x required");if(!y(P))throw new Error("y required");if(!y(K))throw new Error("z required");if(!y(V))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof S)throw new Error("extended point not allowed");let{x:P,y:K}=w||{};if(!y(P)||!y(K))throw new Error("invalid affine point");return new S(P,K,Jt,u(P*K))}static normalizeZ(w){let P=r.invertBatch(w.map(K=>K.ez));return w.map((K,V)=>K.toAffine(P[V])).map(S.fromAffine)}_setWindowSize(w){this._WINDOW_SIZE=w,m.delete(this)}assertValidity(){let{a:w,d:P}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:K,ey:V,ez:W,et:Y}=this,et=u(K*K),X=u(V*V),J=u(W*W),dt=u(J*J),ut=u(et*w),Ut=u(J*u(ut+X)),Kt=u(dt+u(P*u(et*X)));if(Ut!==Kt)throw new Error("bad point: equation left != right (1)");let It=u(K*V),Ht=u(W*Y);if(It!==Ht)throw new Error("bad point: equation left != right (2)")}equals(w){A(w);let{ex:P,ey:K,ez:V}=this,{ex:W,ey:Y,ez:et}=w,X=u(P*et),J=u(W*V),dt=u(K*et),ut=u(Y*V);return X===J&&dt===ut}is0(){return this.equals(S.ZERO)}negate(){return new S(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:w}=e,{ex:P,ey:K,ez:V}=this,W=u(P*P),Y=u(K*K),et=u(ui*u(V*V)),X=u(w*W),J=P+K,dt=u(u(J*J)-W-Y),ut=X+Y,Ut=ut-et,Kt=X-Y,It=u(dt*Ut),Ht=u(ut*Kt),Se=u(dt*Kt),tr=u(Ut*ut);return new S(It,Ht,tr,Se)}add(w){A(w);let{a:P,d:K}=e,{ex:V,ey:W,ez:Y,et}=this,{ex:X,ey:J,ez:dt,et:ut}=w;if(P===BigInt(-1)){let ia=u((W-V)*(J+X)),sa=u((W+V)*(J-X)),Yi=u(sa-ia);if(Yi===fe)return this.double();let oa=u(Y*ui*ut),aa=u(et*ui*dt),ca=aa+oa,fa=sa+ia,ua=aa-oa,du=u(ca*Yi),pu=u(fa*ua),yu=u(ca*ua),gu=u(Yi*fa);return new S(du,pu,gu,yu)}let Ut=u(V*X),Kt=u(W*J),It=u(et*K*ut),Ht=u(Y*dt),Se=u((V+W)*(X+J)-Ut-Kt),tr=Ht-It,nn=Ht+It,na=u(Kt-P*Ut),fu=u(Se*tr),uu=u(nn*na),hu=u(Se*na),lu=u(tr*nn);return new S(fu,uu,lu,hu)}subtract(w){return this.add(w.negate())}wNAF(w){return _.wNAFCached(this,m,w,S.normalizeZ)}multiply(w){let{p:P,f:K}=this.wNAF(x(w,n));return S.normalizeZ([P,K])[0]}multiplyUnsafe(w){let P=v(w);return P===fe?R:this.equals(R)||P===Jt?this:this.equals(B)?this.wNAF(P).p:_.unsafeLadder(this,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(w){let{ex:P,ey:K,ez:V}=this,W=this.is0();w==null&&(w=W?Gh:r.inv(V));let Y=u(P*w),et=u(K*w),X=u(V*w);if(W)return{x:fe,y:Jt};if(X!==Jt)throw new Error("invZ was invalid");return{x:Y,y:et}}clearCofactor(){let{h:w}=e;return w===Jt?this:this.multiplyUnsafe(w)}static fromHex(w,P=!1){let{d:K,a:V}=e,W=r.BYTES;w=yt("pointHex",w,W);let Y=w.slice(),et=w[W-1];Y[W-1]=et&-129;let X=ce(Y);X===fe||(P?x(X,f):x(X,r.ORDER));let J=u(X*X),dt=u(J-Jt),ut=u(K*J-V),{isValid:Ut,value:Kt}=h(dt,ut);if(!Ut)throw new Error("Point.fromHex: invalid y coordinate");let It=(Kt&Jt)===Jt,Ht=(et&128)!==0;if(!P&&Kt===fe&&Ht)throw new Error("Point.fromHex: x=0 and x_0=1");return Ht!==It&&(Kt=u(-Kt)),S.fromAffine({x:Kt,y:X})}static fromPrivateKey(w){return U(w).point}toRawBytes(){let{x:w,y:P}=this.toAffine(),K=_e(P,r.BYTES);return K[K.length-1]|=w&Jt?128:0,K}toHex(){return Ie(this.toRawBytes())}}S.BASE=new S(e.Gx,e.Gy,Jt,u(e.Gx*e.Gy)),S.ZERO=new S(fe,Jt,Jt,fe);let{BASE:B,ZERO:R}=S,_=fi(S,a*8);function O(L){return at(L,n)}function M(L){return O(ce(L))}function U(L){let w=a;L=yt("private key",L,w);let P=yt("hashed private key",s(L),2*w),K=l(P.slice(0,w)),V=P.slice(w,2*w),W=M(K),Y=B.multiply(W),et=Y.toRawBytes();return{head:K,prefix:V,scalar:W,point:Y,pointBytes:et}}function q(L){return U(L).pointBytes}function z(L=new Uint8Array,...w){let P=Le(...w);return M(s(g(P,yt("context",L),!!i)))}function Z(L,w,P={}){L=yt("message",L),i&&(L=i(L));let{prefix:K,scalar:V,pointBytes:W}=U(w),Y=z(P.context,K,L),et=B.multiply(Y).toRawBytes(),X=z(P.context,et,W,L),J=O(Y+X*V);v(J);let dt=Le(et,_e(J,r.BYTES));return yt("result",dt,a*2)}let C=$h;function N(L,w,P,K=C){let{context:V,zip215:W}=K,Y=r.BYTES;L=yt("signature",L,2*Y),w=yt("message",w),i&&(w=i(w));let et=ce(L.slice(Y,2*Y)),X,J,dt;try{X=S.fromHex(P,W),J=S.fromHex(L.slice(0,Y),W),dt=B.multiplyUnsafe(et)}catch{return!1}if(!W&&X.isSmallOrder())return!1;let ut=z(V,J.toRawBytes(),X.toRawBytes(),w);return J.add(X.multiplyUnsafe(ut)).subtract(dt).clearCofactor().equals(S.ZERO)}return B._setWindowSize(8),{CURVE:e,getPublicKey:q,sign:Z,verify:N,ExtendedPoint:S,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(L=8,w=S.BASE){return w._setWindowSize(L),w.multiply(BigInt(3)),w}}}}var un=BigInt(0),_s=BigInt(1);function Yh(t){return re(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Qa(t){let e=Yh(t),{P:r}=e,n=m=>at(m,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(m=>m),c=e.powPminus2||(m=>Bs(m,r-BigInt(2),r));function f(m,A,S){let B=n(m*(A-S));return A=n(A-B),S=n(S+B),[A,S]}function u(m){if(typeof m=="bigint"&&un<=m&&m=un;C--){let N=B>>C&_s;q^=N,z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1],q=N;let T=_+O,L=n(T*T),w=_-O,P=n(w*w),K=L-P,V=M+U,W=M-U,Y=n(W*T),et=n(V*w),X=Y+et,J=Y-et;M=n(X*X),U=n(R*n(J*J)),_=n(L*P),O=n(K*(L+n(h*K)))}z=f(q,_,M),_=z[0],M=z[1],z=f(q,O,U),O=z[0],U=z[1];let Z=c(O);return n(_*Z)}function g(m){return _e(n(m),s)}function d(m){let A=yt("u coordinate",m,s);return o===s&&(A[o-1]&=127),ce(A)}function p(m){let A=yt("scalar",m);if(A.length!==s&&A.length!==o)throw new Error(`Expected ${s} or ${o} bytes, got ${A.length}`);return ce(a(A))}function y(m,A){let S=d(A),B=p(m),R=l(S,B);if(R===un)throw new Error("Invalid private or public key received");return g(R)}let x=g(e.Gu);function v(m){return y(m,x)}return{scalarMult:y,scalarMultBase:v,getSharedSecret:(m,A)=>y(m,A),getPublicKey:m=>v(m),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:x}}var hn=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ja=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Cx=BigInt(0),Zh=BigInt(1),Ls=BigInt(2),Xh=BigInt(5),ja=BigInt(10),Qh=BigInt(20),Jh=BigInt(40),t0=BigInt(80);function e0(t){let e=hn,n=t*t%e*t%e,i=gt(n,Ls,e)*n%e,s=gt(i,Zh,e)*t%e,o=gt(s,Xh,e)*s%e,a=gt(o,ja,e)*o%e,c=gt(a,Qh,e)*a%e,f=gt(c,Jh,e)*c%e,u=gt(f,t0,e)*f%e,h=gt(u,t0,e)*f%e,l=gt(h,ja,e)*o%e;return{pow_p_5_8:gt(l,Ls,e)*t%e,b2:n}}function r0(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jh(t,e){let r=hn,n=at(e*e*e,r),i=at(n*n*e,r),s=e0(t*i).pow_p_5_8,o=at(t*n*s,r),a=at(e*o*o,r),c=o,f=at(o*Ja,r),u=a===t,h=a===at(-t,r),l=a===at(-t*Ja,r);return u&&(o=c),(h||l)&&(o=f),Wa(o,r)&&(o=at(-o,r)),{isValid:u||h,value:o}}var Re=ci(hn,void 0,!0),Rs={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Re,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:bs,randomBytes:nr,adjustScalarBytes:r0,uvRatio:jh},Rr=hi(Rs);function n0(t,e,r){if(e.length>255)throw new Error("Context is too big");return ei(gs("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,e.length]),e,t)}var Ix=hi({...Rs,domain:n0}),Tx=hi({...Rs,domain:n0,prehash:bs}),ln=Qa({P:hn,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{let e=hn,{pow_p_5_8:r,b2:n}=e0(t);return at(gt(r,BigInt(3),e)*n,e)},adjustScalarBytes:r0,randomBytes:nr});var tl=(Re.ORDER+BigInt(3))/BigInt(8),_x=Re.pow(Ls,tl),Lx=Re.sqrt(Re.neg(Re.ONE)),Rx=(Re.ORDER-BigInt(5))/BigInt(8),Nx=BigInt(486662);var Dx=Ya(Re,Re.neg(BigInt(486664)));var kx=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Ux=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Kx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");var Ox=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var li=class extends _r{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,an(e);let n=Fe(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew li(t,e).update(r).digest();Nr.create=(t,e)=>new li(t,e);function s0(t,e,r){return an(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Nr(t,Fe(r),Fe(e))}var Ns=new Uint8Array([0]),i0=new Uint8Array;function o0(t,e,r,n=32){if(an(t),Jn(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");let i=Math.ceil(n/t.outputLen);r===void 0&&(r=i0);let s=new Uint8Array(i*t.outputLen),o=Nr.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let f=0;ft&e^~t&r,rl=(t,e,r)=>t&e^t&r^e&r,nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ze=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ge=new Uint32Array(64),Ds=class extends Lr{constructor(){super(64,32,8,!1),this.A=ze[0]|0,this.B=ze[1]|0,this.C=ze[2]|0,this.D=ze[3]|0,this.E=ze[4]|0,this.F=ze[5]|0,this.G=ze[6]|0,this.H=ze[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Ge[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let l=Ge[h-15],g=Ge[h-2],d=ae(l,7)^ae(l,18)^l>>>3,p=ae(g,17)^ae(g,19)^g>>>10;Ge[h]=p+Ge[h-7]+d+Ge[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:f,H:u}=this;for(let h=0;h<64;h++){let l=ae(a,6)^ae(a,11)^ae(a,25),g=u+l+el(a,c,f)+nl[h]+Ge[h]|0,p=(ae(n,2)^ae(n,13)^ae(n,22))+rl(n,i,s)|0;u=f,f=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,f,u)}roundClean(){Ge.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Dr=ri(()=>new Ds);var di={hashSHA256(t){return Dr(t.subarray())},getHKDF(t,e){let r=s0(Dr,e,t),i=o0(Dr,r,void 0,96),s=i.subarray(0,32),o=i.subarray(32,64),a=i.subarray(64,96);return[s,o,a]},generateX25519KeyPair(){let t=ln.utils.randomPrivateKey();return{publicKey:ln.getPublicKey(t),privateKey:t}},generateX25519KeyPairFromSeed(t){return{publicKey:ln.getPublicKey(t),privateKey:t}},generateX25519SharedKey(t,e){return ln.getSharedSecret(t.subarray(),e.subarray())},chaCha20Poly1305Encrypt(t,e,r,n){return ps(n,e,r).encrypt(t.subarray())},chaCha20Poly1305Decrypt(t,e,r,n,i){return ps(n,e,r).decrypt(t.subarray(),i)}};var a0=di;var kr=t=>{let e=Tt(2);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(0,t,!1),e};kr.bytes=2;var dn=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof Uint8Array?new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1):t.getUint16(0)};dn.bytes=2;function c0(t){return new Bt(t.ne,t.ciphertext)}function f0(t){return new Bt(t.ne,t.ns,t.ciphertext)}function u0(t){return new Bt(t.ns,t.ciphertext)}function h0(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.subarray(0,32),ciphertext:t.subarray(32,t.length),ns:rt(0)}}function l0(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.subarray(0,32),ns:t.subarray(32,80),ciphertext:t.subarray(80,t.length)}}function d0(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:rt(0),ns:t.subarray(0,48),ciphertext:t.subarray(48,t.length)}}var y0=16;function g0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length);let o;n instanceof Uint8Array?o=t.encrypt(n.subarray(i,s),t.session):o=t.encrypt(n.sublist(i,s),t.session),e?.encryptedPackets.increment(),yield new Bt(kr(o.byteLength),o)}}}function x0(t,e){return async function*(r){for await(let n of r)for(let i=0;in.length&&(s=n.length),s-y0Dp});function Tp(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(m);x!==v;){for(var S=d[x],B=0,R=m-1;(S!==0||B>>0,A[R]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=B,x++}for(var _=m-y;_!==m&&A[_]===0;)_++;for(var O=c.repeat(p);_>>0,m=new Uint8Array(v);d[p];){var A=r[d.charCodeAt(p)];if(A===255)return;for(var S=0,B=v-1;(A!==0||S>>0,m[B]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");x=S,p++}if(d[p]!==" "){for(var R=v-x;R!==v&&m[R]===0;)R++;for(var _=new Uint8Array(y+(v-R)),O=y;R!==v;)_[O++]=m[R++];return _}}}function g(d){var p=l(d);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:l,decode:g}}var _p=Tp,Lp=_p,kc=Lp;var K2=new Uint8Array(0);var Pc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Uc=t=>new TextEncoder().encode(t),Kc=t=>new TextDecoder().decode(t);var ro=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},no=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Mc(this,e)}},io=class{constructor(e){this.decoders=e}or(e){return Mc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Mc=(t,e)=>new io({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),so=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ro(e,r,n),this.decoder=new no(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Mr=({name:t,prefix:e,encode:r,decode:n})=>new so(t,e,r,n),Xe=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=kc(r,e);return Mr({prefix:t,name:e,encode:n,decode:s=>Pe(i(s))})},Rp=(t,e,r,n)=>{let i={};for(let u=0;u=8&&(a-=8,o[f++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Np=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Mr({prefix:e,name:t,encode(i){return Np(i,n,r)},decode(i){return Rp(i,n,r,t)}});var Dp=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var ao={};Lt(ao,{base16:()=>kp,base16upper:()=>Pp});var kp=St({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pp=St({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var co={};Lt(co,{base2:()=>Up});var Up=St({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fo={};Lt(fo,{base256emoji:()=>Vp});var Fc=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Kp=Fc.reduce((t,e,r)=>(t[r]=e,t),[]),Op=Fc.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Mp(t){return t.reduce((e,r)=>(e+=Kp[r],e),"")}function Fp(t){let e=[];for(let r of t){let n=Op[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Vp=Mr({prefix:"\u{1F680}",name:"base256emoji",encode:Mp,decode:Fp});var uo={};Lt(uo,{base32:()=>Qe,base32hex:()=>Gp,base32hexpad:()=>Wp,base32hexpadupper:()=>Yp,base32hexupper:()=>$p,base32pad:()=>qp,base32padupper:()=>zp,base32upper:()=>Hp,base32z:()=>Zp});var Qe=St({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hp=St({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qp=St({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zp=St({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gp=St({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$p=St({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wp=St({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yp=St({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zp=St({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ho={};Lt(ho,{base36:()=>Xp,base36upper:()=>Qp});var Xp=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qp=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lo={};Lt(lo,{base58btc:()=>Mt,base58flickr:()=>Jp});var Mt=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Jp=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var po={};Lt(po,{base64:()=>Fr,base64pad:()=>jp,base64url:()=>ty,base64urlpad:()=>ey});var Fr=St({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jp=St({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ty=St({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ey=St({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var yo={};Lt(yo,{base8:()=>ry});var ry=St({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var go={};Lt(go,{identity:()=>ny});var ny=Mr({prefix:"\0",name:"identity",encode:t=>Kc(t),decode:t=>Uc(t)});var J2=new TextEncoder,j2=new TextDecoder;var mo={};Lt(mo,{identity:()=>Je});var oy=qc,Vc=128,ay=127,cy=~ay,fy=Math.pow(2,31);function qc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=fy;)e[r++]=t&255|Vc,t/=128;for(;t&cy;)e[r++]=t&255|Vc,t>>>=7;return e[r]=t|0,qc.bytes=r-n+1,e}var uy=xo,hy=128,Hc=127;function xo(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw xo.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Hc)<=hy);return xo.bytes=s-n,r}var ly=Math.pow(2,7),dy=Math.pow(2,14),py=Math.pow(2,21),yy=Math.pow(2,28),gy=Math.pow(2,35),xy=Math.pow(2,42),my=Math.pow(2,49),by=Math.pow(2,56),vy=Math.pow(2,63),wy=function(t){return t[En.decode(t,e),En.decode.bytes],Vr=(t,e,r=0)=>(En.encode(t,e,r),e),Hr=t=>En.encodingLength(t);var ve=(t,e)=>{let r=e.byteLength,n=Hr(t),i=n+Hr(r),s=new Uint8Array(i+r);return Vr(t,s,0),Vr(r,s,n),s.set(e,i),new qr(t,r,e,s)},Bn=t=>{let e=Pe(t),[r,n]=Sn(e),[i,s]=Sn(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new qr(r,i,o,e)},zc=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Pc(t.bytes,r.bytes)}},qr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Gc=0,By="identity",$c=Pe,Ay=t=>ve(Gc,$c(t)),Je={code:Gc,name:By,encode:$c,digest:Ay};var wo={};Lt(wo,{sha256:()=>Ft,sha512:()=>Cy});var vo=({name:t,code:e,encode:r})=>new bo(t,e,r),bo=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ve(this.code,r):r.then(n=>ve(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Yc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ft=vo({name:"sha2-256",code:18,encode:Yc("SHA-256")}),Cy=vo({name:"sha2-512",code:19,encode:Yc("SHA-512")});var Zc=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Ty(r,Eo(t),e||Mt.encoder);default:return _y(r,Eo(t),e||Qe.encoder)}};var Xc=new WeakMap,Eo=t=>{let e=Xc.get(t);if(e==null){let r=new Map;return Xc.set(t,r),r}return e},lr=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==An)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ly)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=ve(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&zc(e.multihash,n.multihash)}toString(e){return Zc(this,e)}toJSON(){return{"/":Zc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new t(n,i,s,o||Qc(n,i,s.bytes))}else if(r[Ry]===!0){let{version:n,multihash:i,code:s}=r,o=Bn(i);return t.create(n,s,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==An)throw new Error(`Version 0 CID must use dag-pb (code: ${An}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Qc(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,An,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=Pe(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new qr(r.multihashCode,r.digestSize,s,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,l]=Sn(e.subarray(r));return r+=l,h},i=n(),s=An;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),c=n(),f=r+c,u=f-o;return{version:i,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:f}}static parse(e,r){let[n,i]=Iy(e,r),s=t.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Eo(s).set(n,e),s}},Iy=(t,e)=>{switch(t[0]){case"Q":{let r=e||Mt;return[Mt.prefix,r.decode(`${Mt.prefix}${t}`)]}case Mt.prefix:{let r=e||Mt;return[Mt.prefix,r.decode(t)]}case Qe.prefix:{let r=e||Qe;return[Qe.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Ty=(t,e,r)=>{let{prefix:n}=r;if(n!==Mt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return i},_y=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let s=r.encode(t);return e.set(n,s),s}else return i},An=112,Ly=18,Qc=(t,e,r)=>{let n=Hr(t),i=n+Hr(e),s=new Uint8Array(i+r.byteLength);return Vr(t,s,0),Vr(e,s,n),s.set(r,i),s},Ry=Symbol.for("@ipld/js-cid/CID");var Gr={...go,...co,...yo,...oo,...ao,...uo,...ho,...lo,...po,...fo},ym={...wo,...mo};function jc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Jc=jc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),So=jc("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=Tt(t.length);for(let r=0;rmr,Ed25519PublicKey:()=>_n,generateKeyPair:()=>zy,generateKeyPairFromSeed:()=>yf,unmarshalEd25519PrivateKey:()=>Hy,unmarshalEd25519PublicKey:()=>qy});var $r=32,Ue=64,ki=32;async function tf(){let t=Rr.utils.randomPrivateKey(),e=Rr.getPublicKey(t);return{privateKey:sf(t,e),publicKey:e}}async function ef(t){if(t.length!==ki)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');let e=t,r=Rr.getPublicKey(e);return{privateKey:sf(e,r),publicKey:r}}async function rf(t,e){let r=t.subarray(0,ki);return Rr.sign(e instanceof Uint8Array?e:e.subarray(),r)}async function nf(t,e,r){return Rr.verify(e,r instanceof Uint8Array?r:r.subarray(),t)}function sf(t,e){let r=new Uint8Array(Ue);for(let n=0;n>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return dr;if(ePy)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>hf&&(i=0n,++n>hf&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return dr;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):dr}},dr=new Xt(0,0);dr.toBigInt=function(){return 0n};dr.zzEncode=dr.zzDecode=function(){return this};dr.length=function(){return 1};var hf=4294967296n;function lf(t){let e=0,r=0;for(let n=0;n191&&a<224?s[o++]=(a&31)<<6|t[e++]&63:a>239&&a<365?(a=((a&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[o++]=55296+(a>>10),s[o++]=56320+(a&1023)):s[o++]=(a&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))}function To(t,e,r){let n=r,i,s;for(let o=0;o>6|192,e[r++]=i&63|128):(i&64512)===55296&&((s=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function le(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Pi(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var _o=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,le(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw le(this,4);return Pi(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw le(this,4);let e=cf(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw le(this,4);let e=uf(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw le(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return df(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw le(this,e);this.pos+=e}else do if(this.pos>=this.len)throw le(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Xt(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw le(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw le(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw le(this,8);let e=Pi(this.buf,this.pos+=4),r=Pi(this.buf,this.pos+=4);return new Xt(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Lo(t){return new _o(t instanceof Uint8Array?t:t.subarray())}function pr(t,e){let r=Lo(t);return e.decode(r)}function Ro(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return Tt(o);i+o>e&&(n=Tt(e),i=0);let a=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),a}}var yr=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function No(){}var ko=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uy=Ro();function Ky(t){return globalThis.Buffer!=null?Tt(t):Uy(t)}var Tn=class{len;head;tail;states;constructor(){this.len=0,this.head=new yr(No,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new yr(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new Po((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(Cn,10,Xt.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Xt.fromBigInt(e);return this._push(Cn,r.length(),r)}uint64Number(e){let r=Xt.fromNumber(e);return this._push(Cn,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Xt.fromBigInt(e).zzEncode();return this._push(Cn,r.length(),r)}sint64Number(e){let r=Xt.fromNumber(e).zzEncode();return this._push(Cn,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(Do,1,e?1:0)}fixed32(e){return this._push(In,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Xt.fromBigInt(e);return this._push(In,4,r.lo)._push(In,4,r.hi)}fixed64Number(e){let r=Xt.fromNumber(e);return this._push(In,4,r.lo)._push(In,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(af,4,e)}double(e){return this._push(ff,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(Do,1,0):this.uint32(r)._push(My,r,e)}string(e){let r=lf(e);return r!==0?this.uint32(r)._push(To,r,e):this._push(Do,1,0)}fork(){return this.states=new ko(this),this.head=this.tail=new yr(No,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new yr(No,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ky(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function Do(t,e,r){e[r]=t&255}function Oy(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var Po=class extends yr{next;constructor(e,r){super(Oy,e,r),this.next=void 0}};function Cn(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function In(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function My(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Tn.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Fy,e,t),this},Tn.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Vy,e,t),this});function Fy(t,e,r){e.set(t,r)}function Vy(t,e,r){t.length<40?To(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Ct(t),r)}function Uo(){return new Tn}function gr(t,e){let r=Uo();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var Yr;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(Yr||(Yr={}));function Ui(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function Ko(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(s,o){let a=e(s);o.int32(a)},n=function(s){let o=s.int32();return e(o)};return Ui("enum",Yr.VARINT,r,n)}function xr(t,e){return Ui("message",Yr.LENGTH_DELIMITED,t,e)}var wt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(wt||(wt={}));var Oo;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(Oo||(Oo={}));(function(t){t.codec=()=>Ko(Oo)})(wt||(wt={}));var we;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(we||(we={}));var Ee;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),wt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:i.Type=wt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Ee||(Ee={}));var _n=class{_key;constructor(e){this._key=Zr(e,$r)}async verify(e,r){return nf(this._key,r,e)}marshal(){return this._key}get bytes(){return we.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},mr=class{_key;_publicKey;constructor(e,r){this._key=Zr(e,Ue),this._publicKey=Zr(r,$r)}async sign(e){return rf(this._key,e)}get public(){return new _n(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Ed25519,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=Je.digest(this.public.bytes);return Mt.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Wr(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function Hy(t){if(t.length>Ue){t=Zr(t,Ue+$r);let n=t.subarray(0,Ue),i=t.subarray(Ue,t.length);return new mr(n,i)}t=Zr(t,Ue);let e=t.subarray(0,Ue),r=t.subarray($r);return new mr(e,r)}function qy(t){return t=Zr(t,$r),new _n(t)}async function zy(){let{privateKey:t,publicKey:e}=await tf();return new mr(t,e)}async function yf(t){let{privateKey:e,publicKey:r}=await ef(t);return new mr(e,r)}function Zr(t,e){if(t=Uint8Array.from(t??[]),t.length!==e)throw new it(`Key must be a Uint8Array of length ${e}, got ${t.length}`,"ERR_INVALID_KEY_TYPE");return t}function Et(t,e="utf8"){let r=Di[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var pb=Gt(At(),1),yb=Gt(Ti(),1),gf=Gt(lt(),1);function de(t,e){let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.subarray(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Qt([new Uint8Array(e-r.length),r])}return Et(r,"base64url")}function jt(t){let e=xf(t);return new gf.default.jsbn.BigInteger(Et(e,"base16"),16)}function xf(t,e){let r=Ct(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Qt([new Uint8Array(e-r.length),r])}return r}var Gy={"P-256":256,"P-384":384,"P-521":521},$y=Object.keys(Gy),Cb=$y.join(" / ");var zo={};Lt(zo,{MAX_KEY_SIZE:()=>Dn,RsaPrivateKey:()=>Xr,RsaPublicKey:()=>Nn,fromJwk:()=>n1,generateKeyPair:()=>i1,unmarshalRsaPrivateKey:()=>e1,unmarshalRsaPublicKey:()=>r1});var Rn=Gt(lt(),1);var uv=Gt(Ef(),1);function Oi(t){if(isNaN(t)||t<=0)throw new it("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return nr(t)}var $b=Gt(Ri(),1),Ho=Gt(lt(),1);function Sf(t,e){return e.map(r=>jt(t[r]))}function Bf(t){return Ho.default.pki.setRsaPrivateKey(...Sf(t,["n","e","d","p","q","dp","dq","qi"]))}function Af(t){return Ho.default.pki.setRsaPublicKey(...Sf(t,["n","e"]))}var vr={};Lt(vr,{jwkToPkcs1:()=>Xy,jwkToPkix:()=>Jy,pkcs1ToJwk:()=>Zy,pkixToJwk:()=>Qy});var Zb=Gt(bn(),1),Xb=Gt(Ri(),1);var Ke=Gt(lt(),1);function Zy(t){let e=Ke.default.asn1.fromDer(Et(t,"ascii")),r=Ke.default.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e),d:de(r.d),p:de(r.p),q:de(r.q),dp:de(r.dP),dq:de(r.dQ),qi:de(r.qInv),alg:"RS256"}}function Xy(t){if(t.n==null||t.e==null||t.d==null||t.p==null||t.q==null||t.dp==null||t.dq==null||t.qi==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ke.default.pki.privateKeyToAsn1({n:jt(t.n),e:jt(t.e),d:jt(t.d),p:jt(t.p),q:jt(t.q),dP:jt(t.dp),dQ:jt(t.dq),qInv:jt(t.qi)});return Ct(Ke.default.asn1.toDer(e).getBytes(),"ascii")}function Qy(t){let e=Ke.default.asn1.fromDer(Et(t,"ascii")),r=Ke.default.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:de(r.n),e:de(r.e)}}function Jy(t){if(t.n==null||t.e==null)throw new it("JWK was missing components","ERR_INVALID_PARAMETERS");let e=Ke.default.pki.publicKeyToAsn1({n:jt(t.n),e:jt(t.e)});return Ct(Ke.default.asn1.toDer(e).getBytes(),"ascii")}async function Cf(t){let e=await Zt.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await _f(e);return{privateKey:r[0],publicKey:r[1]}}async function qo(t){let r=[await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await jy(t)],n=await _f({privateKey:r[0],publicKey:r[1]});return{privateKey:n[0],publicKey:n[1]}}async function If(t,e){let r=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),n=await Zt.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,e instanceof Uint8Array?e:e.subarray());return new Uint8Array(n,0,n.byteLength)}async function Tf(t,e,r){let n=await Zt.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return Zt.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r instanceof Uint8Array?r:r.subarray())}async function _f(t){if(t.privateKey==null||t.publicKey==null)throw new it("Private and public key are required","ERR_INVALID_PARAMETERS");return Promise.all([Zt.get().subtle.exportKey("jwk",t.privateKey),Zt.get().subtle.exportKey("jwk",t.publicKey)])}async function jy(t){return Zt.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}function Lf(t,e,r,n){let i=e?Af(t):Bf(t),s=Et(r instanceof Uint8Array?r:r.subarray(),"ascii"),o=n(s,i);return Ct(o,"ascii")}function Rf(t,e){return Lf(t,!0,e,(r,n)=>n.encrypt(r))}function Nf(t,e){return Lf(t,!1,e,(r,n)=>n.decrypt(r))}function Mi(t){if(t.kty!=="RSA")throw new it("invalid key type","ERR_INVALID_KEY_TYPE");if(t.n==null)throw new it("invalid key modulus","ERR_INVALID_KEY_MODULUS");return Ct(t.n,"base64url").length*8}var Dn=8192,Nn=class{_key;constructor(e){this._key=e}async verify(e,r){return Tf(this._key,r,e)}marshal(){return vr.jwkToPkix(this._key)}get bytes(){return we.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}encrypt(e){return Rf(this._key,e)}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Xr=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Oi(16)}async sign(e){return If(this._key,e)}get public(){if(this._publicKey==null)throw new it("public key not provided","ERR_PUBKEY_NOT_PROVIDED");return new Nn(this._publicKey)}decrypt(e){return Nf(this._key,e)}marshal(){return vr.jwkToPkcs1(this._key)}get bytes(){return Ee.encode({Type:wt.RSA,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let n=new Rn.default.util.ByteBuffer(this.marshal()),i=Rn.default.asn1.fromDer(n),s=Rn.default.pki.privateKeyFromAsn1(i),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return Rn.default.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return Wr(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}}};async function e1(t){let e=vr.pkcs1ToJwk(t);if(Mi(e)>Dn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let r=await qo(e);return new Xr(r.privateKey,r.publicKey)}function r1(t){let e=vr.pkixToJwk(t);if(Mi(e)>Dn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");return new Nn(e)}async function n1(t){if(Mi(t)>Dn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await qo(t);return new Xr(e.privateKey,e.publicKey)}async function i1(t){if(t>Dn)throw new it("key size is too large","ERR_KEY_SIZE_TOO_LARGE");let e=await Cf(t);return new Xr(e.privateKey,e.publicKey)}var Yo={};Lt(Yo,{Secp256k1PrivateKey:()=>Pn,Secp256k1PublicKey:()=>kn,generateKeyPair:()=>g1,unmarshalSecp256k1PrivateKey:()=>p1,unmarshalSecp256k1PublicKey:()=>y1});function s1(t){let e=fn(t);re(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:o1,hexToBytes:a1}=oi,wr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=wr;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:o1(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=wr,r=typeof t=="string"?a1(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=wr._parseInt(r.subarray(2)),{d:o,l:a}=wr._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){let e=f=>Number.parseInt(f[0],16)&8?"00"+f:f,r=f=>{let u=f.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Oe=BigInt(0),se=BigInt(1),gv=BigInt(2),Df=BigInt(3),xv=BigInt(4);function c1(t){let e=s1(t),{Fp:r}=e,n=e.toBytes||((d,p,y)=>{let x=p.toAffine();return Le(Uint8Array.from([4]),r.toBytes(x.x),r.toBytes(x.y))}),i=e.fromBytes||(d=>{let p=d.subarray(1),y=r.fromBytes(p.subarray(0,r.BYTES)),x=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:y,y:x}});function s(d){let{a:p,b:y}=e,x=r.sqr(d),v=r.mul(x,d);return r.add(r.add(v,r.mul(d,p)),y)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(d){return typeof d=="bigint"&&Oer.eql(m,r.ZERO);return v(y)&&v(x)?h.ZERO:new h(y,x,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=r.invertBatch(p.map(x=>x.pz));return p.map((x,v)=>x.toAffine(y[v])).map(h.fromAffine)}static fromHex(p){let y=h.fromAffine(i(yt("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return h.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,f.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!r.isValid(p)||!r.isValid(y))throw new Error("bad point: x or y not FE");let x=r.sqr(y),v=s(p);if(!r.eql(x,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.eql(r.mul(y,S),r.mul(m,v)),R=r.eql(r.mul(x,S),r.mul(A,v));return B&&R}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,x=r.mul(y,Df),{px:v,py:m,pz:A}=this,S=r.ZERO,B=r.ZERO,R=r.ZERO,_=r.mul(v,v),O=r.mul(m,m),M=r.mul(A,A),U=r.mul(v,m);return U=r.add(U,U),R=r.mul(v,A),R=r.add(R,R),S=r.mul(p,R),B=r.mul(x,M),B=r.add(S,B),S=r.sub(O,B),B=r.add(O,B),B=r.mul(S,B),S=r.mul(U,S),R=r.mul(x,R),M=r.mul(p,M),U=r.sub(_,M),U=r.mul(p,U),U=r.add(U,R),R=r.add(_,_),_=r.add(R,_),_=r.add(_,M),_=r.mul(_,U),B=r.add(B,_),M=r.mul(m,A),M=r.add(M,M),_=r.mul(M,U),S=r.sub(S,_),R=r.mul(M,O),R=r.add(R,R),R=r.add(R,R),new h(S,B,R)}add(p){u(p);let{px:y,py:x,pz:v}=this,{px:m,py:A,pz:S}=p,B=r.ZERO,R=r.ZERO,_=r.ZERO,O=e.a,M=r.mul(e.b,Df),U=r.mul(y,m),q=r.mul(x,A),z=r.mul(v,S),Z=r.add(y,x),C=r.add(m,A);Z=r.mul(Z,C),C=r.add(U,q),Z=r.sub(Z,C),C=r.add(y,v);let N=r.add(m,S);return C=r.mul(C,N),N=r.add(U,z),C=r.sub(C,N),N=r.add(x,v),B=r.add(A,S),N=r.mul(N,B),B=r.add(q,z),N=r.sub(N,B),_=r.mul(O,C),B=r.mul(M,z),_=r.add(B,_),B=r.sub(q,_),_=r.add(q,_),R=r.mul(B,_),q=r.add(U,U),q=r.add(q,U),z=r.mul(O,z),C=r.mul(M,C),q=r.add(q,z),z=r.sub(U,z),z=r.mul(O,z),C=r.add(C,z),U=r.mul(q,C),R=r.add(R,U),U=r.mul(N,C),B=r.mul(Z,B),B=r.sub(B,U),U=r.mul(Z,q),_=r.mul(N,_),_=r.add(_,U),new h(B,R,_)}subtract(p){return this.add(p.negate())}is0(){return this.equals(h.ZERO)}wNAF(p){return g.wNAFCached(this,f,p,y=>{let x=r.invertBatch(y.map(v=>v.pz));return y.map((v,m)=>v.toAffine(x[m])).map(h.fromAffine)})}multiplyUnsafe(p){let y=h.ZERO;if(p===Oe)return y;if(a(p),p===se)return this;let{endo:x}=e;if(!x)return g.unsafeLadder(this,p);let{k1neg:v,k1:m,k2neg:A,k2:S}=x.splitScalar(p),B=y,R=y,_=this;for(;m>Oe||S>Oe;)m&se&&(B=B.add(_)),S&se&&(R=R.add(_)),_=_.double(),m>>=se,S>>=se;return v&&(B=B.negate()),A&&(R=R.negate()),R=new h(r.mul(R.px,x.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,x,v,{endo:m}=e;if(m){let{k1neg:A,k1:S,k2neg:B,k2:R}=m.splitScalar(y),{p:_,f:O}=this.wNAF(S),{p:M,f:U}=this.wNAF(R);_=g.constTimeNegate(A,_),M=g.constTimeNegate(B,M),M=new h(r.mul(M.px,m.beta),M.py,M.pz),x=_.add(M),v=O.add(U)}else{let{p:A,f:S}=this.wNAF(y);x=A,v=S}return h.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(p,y,x){let v=h.BASE,m=(S,B)=>B===Oe||B===se||!S.equals(v)?S.multiplyUnsafe(B):S.multiply(B),A=m(this,y).add(m(p,x));return A.is0()?void 0:A}toAffine(p){let{px:y,py:x,pz:v}=this,m=this.is0();p==null&&(p=m?r.ONE:r.inv(v));let A=r.mul(y,p),S=r.mul(x,p),B=r.mul(v,p);if(m)return{x:r.ZERO,y:r.ZERO};if(!r.eql(B,r.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===se)return!0;if(y)return y(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===se?this:y?y(h,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(h,this,p)}toHex(p=!0){return Ie(this.toRawBytes(p))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,g=fi(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f1(t){let e=fn(t);return re(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function kf(t){let e=f1(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(C){return OeIe(qe(C,e.nByteLength));function d(C){let N=n>>se;return C>N}function p(C){return d(C)?a(-C):C}let y=(C,N,T)=>Te(C.slice(N,T));class x{constructor(N,T,L){this.r=N,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(N){let T=e.nByteLength;return N=yt("compactSignature",N,T*2),new x(y(N,0,T),y(N,T,2*T))}static fromDER(N){let{r:T,s:L}=wr.toSig(yt("DER",N));return new x(T,L)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new x(this.r,this.s,N)}recoverPublicKey(N){let{r:T,s:L,recovery:w}=this,P=R(yt("msgHash",N));if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");let K=w===2||w===3?T+e.n:T;if(K>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let V=w&1?"03":"02",W=f.fromHex(V+g(K)),Y=c(K),et=a(-P*Y),X=a(L*Y),J=f.BASE.multiplyAndAddUnsafe(W,et,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ir(this.toDERHex())}toDERHex(){return wr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ir(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let v={isValidPrivateKey(C){try{return u(C),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let C=Is(e.n);return Xa(e.randomBytes(C),e.n)},precompute(C=8,N=f.BASE){return N._setWindowSize(C),N.multiply(BigInt(3)),N}};function m(C,N=!0){return f.fromPrivateKey(C).toRawBytes(N)}function A(C){let N=C instanceof Uint8Array,T=typeof C=="string",L=(N||T)&&C.length;return N?L===i||L===s:T?L===2*i||L===2*s:C instanceof f}function S(C,N,T=!0){if(A(C))throw new Error("first arg must be private key");if(!A(N))throw new Error("second arg must be public key");return f.fromHex(N).multiply(u(C)).toRawBytes(T)}let B=e.bits2int||function(C){let N=Te(C),T=C.length*8-e.nBitLength;return T>0?N>>BigInt(T):N},R=e.bits2int_modN||function(C){return a(B(C))},_=cn(e.nBitLength);function O(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(Oe<=C&&C<_))throw new Error(`bigint expected < 2^${e.nBitLength}`);return qe(C,e.nByteLength)}function M(C,N,T=U){if(["recovered","canonical"].some(ut=>ut in T))throw new Error("sign() legacy options not supported");let{hash:L,randomBytes:w}=e,{lowS:P,prehash:K,extraEntropy:V}=T;P==null&&(P=!0),C=yt("msgHash",C),K&&(C=yt("prehashed msgHash",L(C)));let W=R(C),Y=u(N),et=[O(Y),O(W)];if(V!=null){let ut=V===!0?w(r.BYTES):V;et.push(yt("extraEntropy",ut))}let X=Le(...et),J=W;function dt(ut){let Ut=B(ut);if(!l(Ut))return;let Kt=c(Ut),It=f.BASE.multiply(Ut).toAffine(),Ht=a(It.x);if(Ht===Oe)return;let Se=a(Kt*a(J+Ht*Y));if(Se===Oe)return;let tr=(It.x===Ht?0:2)|Number(It.y&se),nn=Se;return P&&d(Se)&&(nn=p(Se),tr^=1),new x(Ht,nn,tr)}return{seed:X,k2sig:dt}}let U={lowS:e.lowS,prehash:!1},q={lowS:e.lowS,prehash:!1};function z(C,N,T=U){let{seed:L,k2sig:w}=M(C,N,T),P=e;return Es(P.hash.outputLen,P.nByteLength,P.hmac)(L,w)}f.BASE._setWindowSize(8);function Z(C,N,T,L=q){let w=C;if(N=yt("msgHash",N),T=yt("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");let{lowS:P,prehash:K}=L,V,W;try{if(typeof w=="string"||w instanceof Uint8Array)try{V=x.fromDER(w)}catch(It){if(!(It instanceof wr.Err))throw It;V=x.fromCompact(w)}else if(typeof w=="object"&&typeof w.r=="bigint"&&typeof w.s=="bigint"){let{r:It,s:Ht}=w;V=new x(It,Ht)}else throw new Error("PARSE");W=f.fromHex(T)}catch(It){if(It.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(P&&V.hasHighS())return!1;K&&(N=e.hash(N));let{r:Y,s:et}=V,X=R(N),J=c(et),dt=a(X*J),ut=a(Y*J),Ut=f.BASE.multiplyAndAddUnsafe(W,dt,ut)?.toAffine();return Ut?a(Ut.x)===Y:!1}return{CURVE:e,getPublicKey:m,getSharedSecret:S,sign:z,verify:Z,ProjectivePoint:f,Signature:x,utils:v}}function u1(t){return{hash:t,hmac:(e,...r)=>Nr(t,e,ei(...r)),randomBytes:nr}}function Pf(t,e){let r=n=>kf({...t,...u1(n)});return Object.freeze({...r(e),create:r})}var Of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Uf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h1=BigInt(1),Go=BigInt(2),Kf=(t,e)=>(t+e/Go)/e;function l1(t){let e=Of,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,h=gt(u,r,e)*u%e,l=gt(h,r,e)*u%e,g=gt(l,Go,e)*f%e,d=gt(g,i,e)*g%e,p=gt(d,s,e)*d%e,y=gt(p,a,e)*p%e,x=gt(y,c,e)*y%e,v=gt(x,a,e)*p%e,m=gt(v,r,e)*u%e,A=gt(m,o,e)*d%e,S=gt(A,n,e)*f%e,B=gt(S,Go,e);if(!$o.eql($o.sqr(B),t))throw new Error("Cannot find square root");return B}var $o=ci(Of,void 0,void 0,{sqrt:l1}),Me=Pf({a:BigInt(0),b:BigInt(7),Fp:$o,n:Uf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=Uf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Kf(s*t,e),c=Kf(-n*t,e),f=at(t-a*r-c*i,e),u=at(-a*n-c*s,e),h=f>o,l=u>o;if(h&&(f=e-f),l&&(u=e-u),f>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:f,k2neg:l,k2:u}}}},Dr),Cv=BigInt(0);var Iv=Me.ProjectivePoint;function Mf(){return Me.utils.randomPrivateKey()}async function Ff(t,e){let{digest:r}=await Ft.digest(e instanceof Uint8Array?e:e.subarray());try{return Me.sign(r,t).toDERRawBytes()}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}async function Vf(t,e,r){try{let{digest:n}=await Ft.digest(r instanceof Uint8Array?r:r.subarray());return Me.verify(e,n,t)}catch(n){throw new it(String(n),"ERR_INVALID_INPUT")}}function Hf(t){return Me.ProjectivePoint.fromHex(t).toRawBytes(!0)}function qf(t){try{Me.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}function Wo(t){try{Me.ProjectivePoint.fromHex(t)}catch(e){throw new it(String(e),"ERR_INVALID_PUBLIC_KEY")}}function zf(t){try{return Me.getPublicKey(t,!0)}catch(e){throw new it(String(e),"ERR_INVALID_PRIVATE_KEY")}}var kn=class{_key;constructor(e){Wo(e),this._key=e}async verify(e,r){return Vf(this._key,r,e)}marshal(){return Hf(this._key)}get bytes(){return we.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}},Pn=class{_key;_publicKey;constructor(e,r){this._key=e,this._publicKey=r??zf(e),qf(this._key),Wo(this._publicKey)}async sign(e){return Ff(this._key,e)}get public(){return new kn(this._publicKey)}marshal(){return this._key}get bytes(){return Ee.encode({Type:wt.Secp256k1,Data:this.marshal()}).subarray()}equals(e){return Rt(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Ft.digest(this.bytes);return e}async id(){let e=await this.public.hash();return Et(e,"base58btc")}async export(e,r="libp2p-key"){if(r==="libp2p-key")return Wr(this.bytes,e);throw new it(`export format '${r}' is not supported`,"ERR_INVALID_EXPORT_FORMAT")}};function p1(t){return new Pn(t)}function y1(t){return new kn(t)}async function g1(){let t=Mf();return new Pn(t)}var Er={rsa:zo,ed25519:Mo,secp256k1:Yo};function Gf(t){let e=Object.keys(Er).join(" / ");return new it(`invalid or unsupported key type ${t}. Must be ${e}`,"ERR_UNSUPPORTED_KEY_TYPE")}function $f(t){let e=we.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPublicKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PublicKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Gf(e.Type??"unknown")}}async function Wf(t){let e=Ee.decode(t),r=e.Data??new Uint8Array;switch(e.Type){case wt.RSA:return Er.rsa.unmarshalRsaPrivateKey(r);case wt.Ed25519:return Er.ed25519.unmarshalEd25519PrivateKey(r);case wt.Secp256k1:return Er.secp256k1.unmarshalSecp256k1PrivateKey(r);default:throw Gf(e.Type??"RSA")}}var Yf=Symbol.for("@libp2p/peer-id");var m1=Symbol.for("nodejs.util.inspect.custom"),Zf=Object.values(Gr).map(t=>t.decoder).reduce((t,e)=>t.or(e),Gr.identity.decoder),Xf=114,Zo=36,Xo=37,Un=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[Yf]=!0;toString(){return this.string==null&&(this.string=Mt.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return lr.createV1(Xf,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return Rt(this.multihash.bytes,e);if(typeof e=="string")return b1(e).equals(this);if(e?.multihash?.bytes!=null)return Rt(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[m1](){return`PeerId(${this.toString()})`}},Qr=class extends Un{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Jr=class extends Un{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},jr=class extends Un{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function b1(t,e){if(e=e??Zf,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=Bn(Mt.decode(`z${t}`));return t.startsWith("12D")?new Jr({multihash:r}):t.startsWith("16U")?new jr({multihash:r}):new Qr({multihash:r})}return v1(Zf.decode(t))}function v1(t){try{let e=Bn(t);if(e.code===Je.code){if(e.digest.length===Zo)return new Jr({multihash:e});if(e.digest.length===Xo)return new jr({multihash:e})}if(e.code===Ft.code)return new Qr({multihash:e})}catch{return w1(lr.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function w1(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Xf)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Ft.code)return new Qr({multihash:t.multihash});if(e.code===Je.code){if(e.digest.length===Zo)return new Jr({multihash:t.multihash});if(e.digest.length===Xo)return new jr({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}async function Qo(t,e){return t.length===Zo?new Jr({multihash:ve(Je.code,t),privateKey:e}):t.length===Xo?new jr({multihash:ve(Je.code,t),privateKey:e}):new Qr({multihash:await Ft.digest(t),publicKey:t,privateKey:e})}var Fi;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{if(i.lengthDelimited!==!1&&n.fork(),r.webtransportCerthashes!=null)for(let s of r.webtransportCerthashes)n.uint32(10),n.bytes(s);i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={webtransportCerthashes:[]},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.webtransportCerthashes.push(r.bytes());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Fi||(Fi={}));var Kn;(function(t){let e;t.codec=()=>(e==null&&(e=xr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.identityKey!=null&&r.identityKey.byteLength>0&&(n.uint32(10),n.bytes(r.identityKey)),r.identitySig!=null&&r.identitySig.byteLength>0&&(n.uint32(18),n.bytes(r.identitySig)),r.extensions!=null&&(n.uint32(34),Fi.codec().encode(r.extensions,n)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={identityKey:rt(0),identitySig:rt(0)},s=n==null?r.len:r.pos+n;for(;r.pos>>3){case 1:{i.identityKey=r.bytes();break}case 2:{i.identitySig=r.bytes();break}case 4:{i.extensions=Fi.codec().decode(r,r.uint32());break}default:{r.skipType(o&7);break}}}return i})),e),t.encode=r=>gr(r,t.codec()),t.decode=r=>pr(r,t.codec())})(Kn||(Kn={}));async function Qf(t,e,r){let n=await S1(t,Jf(e));if(t.publicKey==null)throw new Error("PublicKey was missing from local PeerId");return E1(t.publicKey,n,r)}function E1(t,e,r){return Kn.encode({identityKey:t,identitySig:e,extensions:r??{webtransportCerthashes:[]}}).subarray()}async function S1(t,e){if(t.privateKey==null)throw new Error("PrivateKey was missing from PeerId");return(await Wf(t.privateKey)).sign(e)}async function Jo(t){return Qo(t.identityKey)}function jo(t){return Kn.decode(t)}function Jf(t){let e=Ct("noise-libp2p-static-key:");return t instanceof Uint8Array?Qt([e,t],e.length+t.length):(t.prepend(e),t)}async function ta(t,e,r){let n=await Qo(e.identityKey);if(!n.equals(r))throw new Error(`Payload identity key ${n.toString()} does not match expected remote peer ${r.toString()}`);let i=Jf(t);if(n.publicKey==null)throw new Error("PublicKey was missing from PeerId");if(e.identitySig==null)throw new Error("Signature was missing from message");if(!await $f(n.publicKey).verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return n}function On(t){return!(!(t instanceof Uint8Array)&&!Br(t)||t.byteLength!==32)}var ee=Gt(nu(),1);ee.default.formatters.b=t=>t==null?"undefined":Mt.baseEncode(t);ee.default.formatters.t=t=>t==null?"undefined":Qe.baseEncode(t);ee.default.formatters.m=t=>t==null?"undefined":Fr.baseEncode(t);ee.default.formatters.p=t=>t==null?"undefined":t.toString();ee.default.formatters.c=t=>t==null?"undefined":t.toString();ee.default.formatters.k=t=>t==null?"undefined":t.toString();ee.default.formatters.a=t=>t==null?"undefined":t.toString();function U1(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function iu(t){let e=U1(`${t}:trace`);return ee.default.enabled(`${t}:trace`)&&ee.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,ee.default)(`${t}:trace`)),Object.assign((0,ee.default)(t),{error:(0,ee.default)(`${t}:error`),trace:e})}var Pt=iu("libp2p:noise");var Vt;Ia?Vt=Pt:Vt=Object.assign(()=>{},{enabled:!1,trace:()=>{},error:()=>{}});function su(t){Vt.enabled&&(Vt(`LOCAL_STATIC_PUBLIC_KEY ${Et(t.publicKey,"hex")}`),Vt(`LOCAL_STATIC_PRIVATE_KEY ${Et(t.privateKey,"hex")}`))}function ea(t){Vt.enabled&&(t?(Vt(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Et(t.publicKey,"hex")}`),Vt(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Et(t.privateKey,"hex")}`)):Vt("Missing local ephemeral keys."))}function ou(t){Vt.enabled&&Vt(`REMOTE_STATIC_PUBLIC_KEY ${Et(t.subarray(),"hex")}`)}function ra(t){Vt.enabled&&Vt(`REMOTE_EPHEMERAL_PUBLIC_KEY ${Et(t.subarray(),"hex")}`)}function au(t){Vt.enabled&&(t.cs1&&t.cs2?(Vt(`CIPHER_STATE_1 ${t.cs1.n.getUint64()} ${Et(t.cs1.k,"hex")}`),Vt(`CIPHER_STATE_2 ${t.cs2.n.getUint64()} ${Et(t.cs2.k,"hex")}`)):Vt("Missing cipher state."))}var K1=0,O1=4294967295,M1="Cipherstate has reached maximum n, a new handshake must be performed",qi=class{n;bytes;view;constructor(e=K1){this.n=e,this.bytes=rt(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,e,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>O1)throw new Error(M1)}};var zi=class{crypto;constructor(e){this.crypto=e}encryptWithAd(e,r,n){let i=this.encrypt(e.k,e.n,r,n);return e.n.increment(),i}decryptWithAd(e,r,n,i){let{plaintext:s,valid:o}=this.decrypt(e.k,e.n,r,n,i);return o&&e.n.increment(),{plaintext:s,valid:o}}hasKey(e){return!this.isEmptyKey(e.k)}createEmptyKey(){return rt(32)}isEmptyKey(e){let r=this.createEmptyKey();return Rt(r,e)}encrypt(e,r,n,i){return r.assertValue(),this.crypto.chaCha20Poly1305Encrypt(i,r.getBytes(),n,e)}encryptAndHash(e,r){let n;return this.hasKey(e.cs)?n=this.encryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,n),n}decrypt(e,r,n,i,s){r.assertValue();let o=this.crypto.chaCha20Poly1305Decrypt(i,r.getBytes(),n,e,s);return o?{plaintext:o,valid:!0}:{plaintext:rt(0),valid:!1}}decryptAndHash(e,r){let n,i=!0;return this.hasKey(e.cs)?{plaintext:n,valid:i}=this.decryptWithAd(e.cs,e.h,r):n=r,this.mixHash(e,r),{plaintext:n,valid:i}}dh(e,r){try{let n=this.crypto.generateX25519SharedKey(e,r);return n.length===32?n:n.subarray(0,32)}catch(n){let i=n;return Pt.error(i),rt(32)}}mixHash(e,r){e.h=this.getHash(e.h,r)}getHash(e,r){return this.crypto.hashSHA256(new Bt(e,r))}mixKey(e,r){let[n,i]=this.crypto.getHKDF(e.ck,r);e.cs=this.initializeKey(i),e.ck=n}initializeKey(e){return{k:e,n:new qi}}initializeSymmetric(e){let r=Ct(e,"utf-8"),n=this.hashProtocolName(r),i=n,s=this.createEmptyKey();return{cs:this.initializeKey(s),ck:i,h:n}}hashProtocolName(e){if(e.length<=32){let r=rt(32);return r.set(e),r}else return this.getHash(e,rt(0))}split(e){let[r,n]=this.crypto.getHKDF(e.ck,rt(0)),i=this.initializeKey(r),s=this.initializeKey(n);return{cs1:i,cs2:s}}writeMessageRegular(e,r){let n=this.encryptWithAd(e,rt(0),r),i=this.createEmptyKey(),s=rt(0);return{ne:i,ns:s,ciphertext:n}}readMessageRegular(e,r){return this.decryptWithAd(e,rt(0),r.ciphertext)}};var Gi=class extends zi{initializeInitiator(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}initializeResponder(e,r,n,i){let s="Noise_XX_25519_ChaChaPoly_SHA256",o=this.initializeSymmetric(s);this.mixHash(o,e);let a=rt(32);return{ss:o,s:r,rs:n,psk:i,re:a}}writeMessageA(e,r,n){let i=rt(0);n!==void 0?e.e=n:e.e=this.crypto.generateX25519KeyPair();let s=e.e.publicKey;this.mixHash(e.ss,s);let o=this.encryptAndHash(e.ss,r);return{ne:s,ns:i,ciphertext:o}}writeMessageB(e,r){e.e=this.crypto.generateX25519KeyPair();let n=e.e.publicKey;this.mixHash(e.ss,n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let i=e.s.publicKey,s=this.encryptAndHash(e.ss,i);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let o=this.encryptAndHash(e.ss,r);return{ne:n,ns:s,ciphertext:o}}writeMessageC(e,r){let n=e.s.publicKey,i=this.encryptAndHash(e.ss,n);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));let s=this.encryptAndHash(e.ss,r),a={ne:this.createEmptyKey(),ns:i,ciphertext:s},{cs1:c,cs2:f}=this.split(e.ss);return{h:e.ss.h,messageBuffer:a,cs1:c,cs2:f}}readMessageA(e,r){return On(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,r.ciphertext)}readMessageB(e,r){if(On(r.ne)&&(e.re=r.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);i&&On(n)&&(e.rs=n),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext);return{plaintext:s,valid:i&&o}}readMessageC(e,r){let{plaintext:n,valid:i}=this.decryptAndHash(e.ss,r.ns);if(i&&On(n)&&(e.rs=n),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));let{plaintext:s,valid:o}=this.decryptAndHash(e.ss,r.ciphertext),{cs1:a,cs2:c}=this.split(e.ss);return{h:e.ss.h,plaintext:s,valid:i&&o,cs1:a,cs2:c}}initSession(e,r,n){let i=this.createEmptyKey(),s=rt(32),o;return e?o=this.initializeInitiator(r,n,s,i):o=this.initializeResponder(r,n,s,i),{hs:o,i:e,mc:0}}sendMessage(e,r,n){let i;if(e.mc===0)i=this.writeMessageA(e.hs,r,n);else if(e.mc===1)i=this.writeMessageB(e.hs,r);else if(e.mc===2){let{h:s,messageBuffer:o,cs1:a,cs2:c}=this.writeMessageC(e.hs,r);i=o,e.h=s,e.cs1=a,e.cs2=c}else if(e.mc>2)if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");i=this.writeMessageRegular(e.cs1,r)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");i=this.writeMessageRegular(e.cs2,r)}else throw new Error("Session invalid.");return e.mc++,i}recvMessage(e,r){let n=rt(0),i=!1;if(e.mc===0)({plaintext:n,valid:i}=this.readMessageA(e.hs,r));else if(e.mc===1)({plaintext:n,valid:i}=this.readMessageB(e.hs,r));else if(e.mc===2){let{h:s,plaintext:o,valid:a,cs1:c,cs2:f}=this.readMessageC(e.hs,r);n=o,i=a,e.h=s,e.cs1=c,e.cs2=f}return e.mc++,{plaintext:n,valid:i}}};var $i=class{isInitiator;session;remotePeer;remoteExtensions={webtransportCerthashes:[]};payload;connection;xx;staticKeypair;prologue;constructor(e,r,n,i,s,o,a,c){this.isInitiator=e,this.payload=r,this.prologue=n,this.staticKeypair=s,this.connection=o,a&&(this.remotePeer=a),this.xx=c??new Gi(i),this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair)}async propose(){if(su(this.session.hs.s),this.isInitiator){Pt.trace("Stage 0 - Initiator starting to send first message.");let e=this.xx.sendMessage(this.session,rt(0));await this.connection.write(c0(e)),Pt.trace("Stage 0 - Initiator finished sending first message."),ea(this.session.hs.e)}else{Pt.trace("Stage 0 - Responder waiting to receive first message...");let e=h0((await this.connection.read()).subarray()),{valid:r}=this.xx.recvMessage(this.session,e);if(!r)throw new or("xx handshake stage 0 validation fail");Pt.trace("Stage 0 - Responder received first message."),ra(this.session.hs.re)}}async exchange(){if(this.isInitiator){Pt.trace("Stage 1 - Initiator waiting to receive first message from responder...");let e=l0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 1 validation fail");Pt.trace("Stage 1 - Initiator received the message."),ra(this.session.hs.re),ou(this.session.hs.rs),Pt.trace("Initiator going to check remote's signature...");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new yn(`Error occurred while verifying signed payload: ${s.message}`)}Pt.trace("All good with the signature!")}else{Pt.trace("Stage 1 - Responder sending out first message with signed payload and static key.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(f0(e)),Pt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),ea(this.session.hs.e)}}async finish(){if(this.isInitiator){Pt.trace("Stage 2 - Initiator sending third handshake message.");let e=this.xx.sendMessage(this.session,this.payload);await this.connection.write(u0(e)),Pt.trace("Stage 2 - Initiator sent message with signed payload.")}else{Pt.trace("Stage 2 - Responder waiting for third handshake message...");let e=d0((await this.connection.read()).subarray()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new or("xx handshake stage 2 validation fail");Pt.trace("Stage 2 - Responder received the message, finished handshake.");try{let i=jo(r);this.remotePeer=this.remotePeer||await Jo(i),await ta(this.session.hs.rs,i,this.remotePeer),this.setRemoteNoiseExtension(i.extensions)}catch(i){let s=i;throw new yn(`Error occurred while verifying signed payload: ${s.message}`)}}au(this.session)}encrypt(e,r){let n=this.getCS(r);return this.xx.encryptWithAd(n,rt(0),e)}decrypt(e,r,n){let i=this.getCS(r,!1);return this.xx.decryptWithAd(i,rt(0),e,n)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e,r=!0){if(!e.cs1||!e.cs2)throw new or("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?r?e.cs1:e.cs2:r?e.cs2:e.cs1}setRemoteNoiseExtension(e){e&&(this.remoteExtensions=e)}};function cu(t){return{xxHandshakeSuccesses:t.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:t.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:t.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:t.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:t.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}var Wi=class{protocol="/noise";crypto;prologue;staticKeys;extensions;metrics;constructor(e={}){let{staticNoiseKey:r,extensions:n,crypto:i,prologueBytes:s,metrics:o}=e;this.crypto=i??a0,this.extensions=n,this.metrics=o?cu(o):void 0,r?this.staticKeys=this.crypto.generateX25519KeyPairFromSeed(r):this.staticKeys=this.crypto.generateX25519KeyPair(),this.prologue=s??rt(0)}async secureOutbound(e,r,n){let i=ns(r,{lengthEncoder:kr,lengthDecoder:dn,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!0,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remoteExtensions:s.remoteExtensions,remotePeer:s.remotePeer}}async secureInbound(e,r,n){let i=ns(r,{lengthEncoder:kr,lengthDecoder:dn,maxDataLength:65535}),s=await this.performHandshake({connection:i,isInitiator:!1,localPeer:e,remotePeer:n}),o=await this.createSecureConnection(i,s);return r.source=o.source,r.sink=o.sink,{conn:r,remotePeer:s.remotePeer,remoteExtensions:s.remoteExtensions}}async performHandshake(e){let r=await Qf(e.localPeer,this.staticKeys.publicKey,this.extensions);return this.performXXHandshake(e,r)}async performXXHandshake(e,r){let{isInitiator:n,remotePeer:i,connection:s}=e,o=new $i(n,r,this.prologue,this.crypto,this.staticKeys,s,i);try{await o.propose(),await o.exchange(),await o.finish(),this.metrics?.xxHandshakeSuccesses.increment()}catch(a){if(this.metrics?.xxHandshakeErrors.increment(),a instanceof Error)throw a.message=`Error occurred during XX handshake: ${a.message}`,a}return o}async createSecureConnection(e,r){let[n,i]=Ea(),s=e.unwrap();return await Ba(n,g0(r,this.metrics),s,o=>on(o,{lengthDecoder:dn}),x0(r,this.metrics),n),i}};function F1(t={}){return()=>new Wi(t)}return Eu(V1);})(); /*! Bundled license information: @noble/ciphers/esm/utils.js: diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts index 40a820d88..cfaebefd2 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts @@ -1,14 +1,14 @@ -import type { bytes } from './basic.js'; import type { NoiseSession } from './handshake.js'; import type { NoiseExtensions } from '../proto/payload.js'; import type { PeerId } from '@libp2p/interface/peer-id'; +import type { Uint8ArrayList } from 'uint8arraylist'; export interface IHandshake { session: NoiseSession; remotePeer: PeerId; remoteExtensions: NoiseExtensions; - encrypt: (plaintext: bytes, session: NoiseSession) => bytes; - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { - plaintext: bytes; + encrypt: (plaintext: Uint8Array | Uint8ArrayList, session: NoiseSession) => Uint8Array | Uint8ArrayList; + decrypt: (ciphertext: Uint8Array | Uint8ArrayList, session: NoiseSession, dst?: Uint8Array) => { + plaintext: Uint8Array | Uint8ArrayList; valid: boolean; }; } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts.map index 2b64678a8..86506e31b 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake-interface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"handshake-interface.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,eAAe,CAAA;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,CAAA;IAC3D,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9G"} \ No newline at end of file +{"version":3,"file":"handshake-interface.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,eAAe,CAAA;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,GAAG,cAAc,EAAE,OAAO,EAAE,YAAY,KAAK,UAAU,GAAG,cAAc,CAAA;IACvG,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,UAAU,GAAG,cAAc,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CAC1J"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts index 558a55238..e200280b4 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts @@ -1,11 +1,12 @@ import type { bytes, bytes32, uint64 } from './basic.js'; import type { KeyPair } from './libp2p.js'; import type { Nonce } from '../nonce.js'; +import type { Uint8ArrayList } from 'uint8arraylist'; export type Hkdf = [bytes, bytes, bytes]; export interface MessageBuffer { ne: bytes32; - ns: bytes; - ciphertext: bytes; + ns: Uint8Array | Uint8ArrayList; + ciphertext: Uint8Array | Uint8ArrayList; } export interface CipherState { k: bytes32; @@ -20,7 +21,7 @@ export interface HandshakeState { ss: SymmetricState; s: KeyPair; e?: KeyPair; - rs: bytes32; + rs: Uint8Array | Uint8ArrayList; re: bytes32; psk: bytes32; } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts.map index e4a428b8e..dba1124b9 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/@types/handshake.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAExC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,OAAO,CAAA;IAGV,CAAC,EAAE,KAAK,CAAA;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,WAAW,CAAA;IACf,EAAE,EAAE,OAAO,CAAA;IACX,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,IAAI,EAAE,KAAK,CAAA;CACZ"} \ No newline at end of file +{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../../src/@types/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAExC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,UAAU,GAAG,cAAc,CAAA;IAC/B,UAAU,EAAE,UAAU,GAAG,cAAc,CAAA;CACxC;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,OAAO,CAAA;IAGV,CAAC,EAAE,KAAK,CAAA;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,WAAW,CAAA;IACf,EAAE,EAAE,OAAO,CAAA;IACX,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,EAAE,OAAO,CAAA;IACV,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,EAAE,EAAE,UAAU,GAAG,cAAc,CAAA;IAC/B,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,cAAc,CAAA;IAClB,CAAC,CAAC,EAAE,OAAO,CAAA;IACX,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAA;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,KAAK,CAAA;IAClB,WAAW,EAAE,KAAK,CAAA;IAClB,IAAI,EAAE,KAAK,CAAA;CACZ"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts index c98b18b9a..0d95740f7 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts @@ -1,13 +1,14 @@ -import type { bytes32, bytes } from './@types/basic.js'; +import { type Uint8ArrayList } from 'uint8arraylist'; +import type { bytes32 } from './@types/basic.js'; import type { Hkdf } from './@types/handshake.js'; import type { KeyPair } from './@types/libp2p.js'; export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array; + hashSHA256: (data: Uint8Array | Uint8ArrayList) => Uint8Array; getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf; generateX25519KeyPair: () => KeyPair; generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair; - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array; - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes; - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null; + generateX25519SharedKey: (privateKey: Uint8Array | Uint8ArrayList, publicKey: Uint8Array | Uint8ArrayList) => Uint8Array; + chaCha20Poly1305Encrypt: (plaintext: Uint8Array | Uint8ArrayList, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => Uint8ArrayList | Uint8Array; + chaCha20Poly1305Decrypt: (ciphertext: Uint8Array | Uint8ArrayList, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => Uint8ArrayList | Uint8Array | null; } //# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts.map index 21fb764ad..3933e9103 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CA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AA;IAE/C,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,6BAA6B,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAA;IAC5D,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,EAAE,SAAS,EAAE,UAAU,GAAG,cAAc,KAAK,UAAU,CAAA;IAExH,uBAAuB,EAAE,CAAC,SAAS,EAAE,UAAU,GAAG,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,KAAK,cAAc,GAAG,UAAU,CAAA;IAC/I,uBAAuB,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,cAAc,GAAG,UAAU,GAAG,IAAI,CAAA;CAC1K"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js index d4b4414d0..bb3bbc1aa 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js @@ -1,2 +1,2 @@ -export {}; +import {} from 'uint8arraylist'; //# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js.map index e85268dce..d093197d9 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,gBAAgB,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.d.ts.map index 5f7efefc8..819dbc96f 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA2DpD,eAAO,MAAM,aAAa,EAAE,gBA+E3B,CAAA"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAkHpD,eAAO,MAAM,aAAa,EAAE,gBAyF3B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js index bde9ae3dd..ceba87da4 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js @@ -1,6 +1,7 @@ import crypto from 'node:crypto'; import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305'; import { digest } from '@chainsafe/as-sha256'; +import { Uint8ArrayList } from 'uint8arraylist'; import { isElectronMain } from 'wherearewe'; import { pureJsCrypto } from './js.js'; const ctx = newInstance(); @@ -10,46 +11,81 @@ const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06 const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]); const nodeCrypto = { hashSHA256(data) { - return crypto.createHash('sha256').update(data).digest(); + const hash = crypto.createHash('sha256'); + if (data instanceof Uint8Array) { + return hash.update(data).digest(); + } + for (const buf of data) { + hash.update(buf); + } + return hash.digest(); }, chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { const cipher = crypto.createCipheriv(CHACHA_POLY1305, k, nonce, { authTagLength: 16 }); cipher.setAAD(ad, { plaintextLength: plaintext.byteLength }); - const updated = cipher.update(plaintext); + if (plaintext instanceof Uint8Array) { + const updated = cipher.update(plaintext); + const final = cipher.final(); + const tag = cipher.getAuthTag(); + return Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength); + } + const output = new Uint8ArrayList(); + for (const buf of plaintext) { + output.append(cipher.update(buf)); + } const final = cipher.final(); - const tag = cipher.getAuthTag(); - const encrypted = Buffer.concat([updated, tag, final], updated.byteLength + tag.byteLength + final.byteLength); - return encrypted; + if (final.byteLength > 0) { + output.append(final); + } + output.append(cipher.getAuthTag()); + return output; }, chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, _dst) { const authTag = ciphertext.subarray(ciphertext.length - 16); - const text = ciphertext.subarray(0, ciphertext.length - 16); const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { authTagLength: 16 }); + let text; + if (ciphertext instanceof Uint8Array) { + text = ciphertext.subarray(0, ciphertext.length - 16); + } + else { + text = ciphertext.sublist(0, ciphertext.length - 16); + } decipher.setAAD(ad, { plaintextLength: text.byteLength }); decipher.setAuthTag(authTag); - const updated = decipher.update(text); + if (text instanceof Uint8Array) { + const output = decipher.update(text); + const final = decipher.final(); + if (final.byteLength > 0) { + return Buffer.concat([output, final], output.byteLength + final.byteLength); + } + return output; + } + const output = new Uint8ArrayList(); + for (const buf of text) { + output.append(decipher.update(buf)); + } const final = decipher.final(); if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength); + output.append(final); } - return updated; + return output; } }; const asCrypto = { hashSHA256(data) { - return digest(data); + return digest(data.subarray()); }, chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad); + return asImpl.seal(k, nonce, plaintext.subarray(), ad); }, chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst); + return asImpl.open(k, nonce, ciphertext.subarray(), ad, dst); } }; // benchmarks show that for chacha20poly1305 @@ -61,13 +97,13 @@ export const defaultCrypto = { return nodeCrypto.hashSHA256(data); }, chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { + if (plaintext.byteLength < 1200) { return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); } return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k); }, chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { + if (ciphertext.byteLength < 1200) { return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); } return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst); @@ -108,14 +144,26 @@ export const defaultCrypto = { }; }, generateX25519SharedKey(privateKey, publicKey) { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength); - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength); + if (publicKey instanceof Uint8Array) { + publicKey = Buffer.concat([ + X25519_PREFIX, + publicKey + ], X25519_PREFIX.byteLength + publicKey.byteLength); + } + else { + publicKey.prepend(X25519_PREFIX); + publicKey = publicKey.subarray(); + } + if (privateKey instanceof Uint8Array) { + privateKey = Buffer.concat([ + PKCS8_PREFIX, + privateKey + ], PKCS8_PREFIX.byteLength + privateKey.byteLength); + } + else { + privateKey.prepend(PKCS8_PREFIX); + privateKey = privateKey.subarray(); + } return crypto.diffieHellman({ publicKey: crypto.createPublicKey({ key: Buffer.from(publicKey, publicKey.byteOffset, publicKey.byteLength), diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js.map index 8e5524ac5..3e764dfa7 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAItC,MAAM,GAAG,GAAG,WAAW,EAAE,CAAA;AACzB,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAA;AACxC,MAAM,eAAe,GAAG,mBAAmB,CAAA;AAC3C,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI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AG,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC;gBACvE,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,KAAK;aACd,CAAC;YACF,UAAU,EAAE,MAAM,CAAC,gBAAgB,CAAC;gBAClC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;gBAC1E,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,KAAK;aACd,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,qFAAqF;AACrF,IAAI,cAAc,EAAE;IAClB,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;IACxE,aAAa,CAAC,uBAAuB,GAAG,QAAQ,CAAC,uBAAuB,CAAA;CACzE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.d.ts.map index d9693c950..8a7973b5b 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,eAAO,MAAM,YAAY,EAAE,gBA+C1B,CAAA"} \ No newline at end of file +{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../src/crypto/js.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAGpD,eAAO,MAAM,YAAY,EAAE,gBA+C1B,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js index b2aa8b079..2dba4a27f 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js @@ -4,7 +4,7 @@ import { extract, expand } from '@noble/hashes/hkdf'; import { sha256 } from '@noble/hashes/sha256'; export const pureJsCrypto = { hashSHA256(data) { - return sha256(data); + return sha256(data.subarray()); }, getHKDF(ck, ikm) { const prk = extract(sha256, ikm, ck); @@ -31,13 +31,13 @@ export const pureJsCrypto = { }; }, generateX25519SharedKey(privateKey, publicKey) { - return x25519.getSharedSecret(privateKey, publicKey); + return x25519.getSharedSecret(privateKey.subarray(), publicKey.subarray()); }, chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext); + return chacha20poly1305(k, nonce, ad).encrypt(plaintext.subarray()); }, chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst); + return chacha20poly1305(k, nonce, ad).decrypt(ciphertext.subarray(), dst); } }; //# sourceMappingURL=js.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js.map index a58e0e68d..274864d01 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/js.js.map @@ -1 +1 @@ -{"version":3,"file":"js.js","sourceRoot":"","sources":["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AU,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAA;IAC3E,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts index a897b30ad..a6fffb234 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts @@ -3,5 +3,5 @@ import type { IHandshake } from '../@types/handshake-interface.js'; import type { MetricsRegistry } from '../metrics.js'; import type { Transform } from 'it-stream-types'; export declare function encryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform>; -export declare function decryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator>; +export declare function decryptStream(handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator>; //# sourceMappingURL=streaming.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map index 2796c50d5..db86cb680 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAuBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CA6BtJ"} \ No newline at end of file +{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKhD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAuBvI;AAGD,wBAAgB,aAAa,CAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CA6BvK"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js index d01611c66..cc5163716 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js @@ -12,11 +12,11 @@ export function encryptStream(handshake, metrics) { end = chunk.length; } let data; - if (i === 0 && end === chunk.byteLength && chunk instanceof Uint8Array) { - data = handshake.encrypt(chunk, handshake.session); + if (chunk instanceof Uint8Array) { + data = handshake.encrypt(chunk.subarray(i, end), handshake.session); } else { - data = handshake.encrypt(chunk.subarray(i, end), handshake.session); + data = handshake.encrypt(chunk.sublist(i, end), handshake.session); } metrics?.encryptedPackets.increment(); yield new Uint8ArrayList(uint16BEEncode(data.byteLength), data); @@ -36,7 +36,7 @@ export function decryptStream(handshake, metrics) { if (end - CHACHA_TAG_LENGTH < i) { throw new Error('Invalid chunk'); } - const encrypted = chunk.subarray(i, end); + const encrypted = chunk.sublist(i, end); // memory allocation is not cheap so reuse the encrypted Uint8Array // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 // this is ok because chacha20 reads bytes one by one and don't reread after that diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map index 1bfa7aa17..f548aaeaa 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/crypto/streaming.js.map @@ -1 +1 @@ -{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK9C,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,wDAAwD;AACx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G,CAAC,GAAG,0BAA0B,CAAA;gBACxC,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;oBACtB,GAAG,GAAG,KAAK,CAAC,MAAM,CAAA;iBACnB;gBAED,IAAI,GAAG,GAAG,iBAAiB,GAAG,CAAC,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;iBACjC;gBAED,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;gBACxC,mEAAmE;gBACnE,6EAA6E;gBAC7E,iFAAiF;gBACjF,6JAA6J;gBAC7J,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,CAAA;gBACtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;gBAC5F,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../../src/crypto/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAK9C,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAE,SAAqB,EAAE,OAAyB;IAC7E,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EAAE;oBACtB,GAAG,GAAG,KAAK,CAAC,MAAM,CAAA;iBACnB;gBAED,IAAI,GAAG,GAAG,iBAAiB,GAAG,CAAC,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;iBACjC;gBAED,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;gBACvC,mEAAmE;gBACnE,6EAA6E;gBAC7E,iFAAiF;gBACjF,6JAA6J;gBAC7J,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,CAAA;gBACtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;gBAC5F,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,CAAA;oBAClC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;iBACtD;gBACD,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;gBACrC,MAAM,SAAS,CAAA;aAChB;SACF;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts index 8bde3f774..e3b2374f2 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts @@ -7,6 +7,7 @@ import type { ICryptoInterface } from './crypto.js'; import type { NoiseExtensions } from './proto/payload.js'; import type { PeerId } from '@libp2p/interface/peer-id'; import type { LengthPrefixedStream } from 'it-length-prefixed-stream'; +import type { Uint8ArrayList } from 'uint8arraylist'; export declare class XXHandshake implements IHandshake { isInitiator: boolean; session: NoiseSession; @@ -21,12 +22,12 @@ export declare class XXHandshake implements IHandshake { propose(): Promise; exchange(): Promise; finish(): Promise; - encrypt(plaintext: Uint8Array, session: NoiseSession): bytes; - decrypt(ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { - plaintext: bytes; + encrypt(plaintext: Uint8Array | Uint8ArrayList, session: NoiseSession): Uint8Array | Uint8ArrayList; + decrypt(ciphertext: Uint8Array | Uint8ArrayList, session: NoiseSession, dst?: Uint8Array): { + plaintext: Uint8Array | Uint8ArrayList; valid: boolean; }; - getRemoteStaticKey(): bytes; + getRemoteStaticKey(): Uint8Array | Uint8ArrayList; private getCS; protected setRemoteNoiseExtension(e: NoiseExtensions | null | undefined): void; } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts.map index cb8bec51a..0810c584b 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"handshake-xx.d.ts","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAcvC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,E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AE,OAAO,EACtB,UAAU,EAAE,oBAAoB,EAChC,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,EAAE;IAeH,OAAO,IAAK,OAAO,CAAC,IAAI,CAAC;IAqBzB,QAAQ,IAAK,OAAO,CAAC,IAAI,CAAC;IAiC1B,MAAM,IAAK,OAAO,CAAC,IAAI,CAAC;IA4B9B,OAAO,CAAE,SAAS,EAAE,UAAU,GAAG,cAAc,EAAE,OAAO,EAAE,YAAY,GAAG,UAAU,GAAG,cAAc;IAMpG,OAAO,CAAE,UAAU,EAAE,UAAU,GAAG,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG;QAAE,SAAS,EAAE,UAAU,GAAG,cAAc,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE;IAMtJ,kBAAkB,IAAK,UAAU,GAAG,cAAc;IAIzD,OAAO,CAAC,KAAK;IAYb,SAAS,CAAC,uBAAuB,CAAE,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAKhF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.js.map index 1b47203b9..b727b89ad 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshake-xx.js.map @@ -1 +1 @@ -{"version":3,"file":"handshake-xx.js","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,OAA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,CAAC,GAAG,CAAA;SAC9C;aAAM;YACL,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;IACH,CAAC;IAES,uBAAuB,CAAE,CAAqC;QACtE,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"handshake-xx.js","sourceRoot":"","sources":["../../src/handshake-xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AAWnB,MAAM,OAAO,WAAW;IACf,WAAW,CAAS;IACpB,OAAO,CAAc;IACrB,UAAU,CAAS;IACnB,gBAAgB,GAAoB,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAA;IAE/D,OAAO,CAAO;IACd,UAAU,CAAsB;IAChC,EAAE,CAAI;IACN,aAAa,CAAS;IAEf,QAAQ,CAAS;IAElC,YACE,WAAoB,EACpB,OAAc,EACd,QAAiB,EACjB,MAAwB,EACxB,aAAsB,EACtB,UAAgC,EAChC,UAAmB,EACnB,SAAc;QAEd,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,OAAO,GA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AErC,OAAO,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;IACvE,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAA;IAC3B,CAAC;IAEO,KAAK,CAAE,OAAqB,EAAE,UAAU,GAAG,IAAI;QACrD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChC,MAAM,IAAI,0BAA0B,CAAC,gEAAgE,CAAC,CAAA;SACvG;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;aAAM;YACL,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA;SAC9C;IACH,CAAC;IAES,uBAAuB,CAAE,CAAqC;QACtE,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts index eb1e51754..51b7f7da5 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts @@ -1,9 +1,10 @@ +import { Uint8ArrayList } from 'uint8arraylist'; import { Nonce } from '../nonce.js'; import type { bytes, bytes32 } from '../@types/basic.js'; import type { CipherState, MessageBuffer, SymmetricState } from '../@types/handshake.js'; import type { ICryptoInterface } from '../crypto.js'; export interface DecryptedResult { - plaintext: bytes; + plaintext: Uint8ArrayList | Uint8Array; valid: boolean; } export interface SplitState { @@ -13,18 +14,18 @@ export interface SplitState { export declare abstract class AbstractHandshake { crypto: ICryptoInterface; constructor(crypto: ICryptoInterface); - encryptWithAd(cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes; - decryptWithAd(cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult; + encryptWithAd(cs: CipherState, ad: Uint8Array, plaintext: Uint8Array | Uint8ArrayList): Uint8Array | Uint8ArrayList; + decryptWithAd(cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array | Uint8ArrayList, dst?: Uint8Array): DecryptedResult; protected hasKey(cs: CipherState): boolean; protected createEmptyKey(): bytes32; protected isEmptyKey(k: bytes32): boolean; - protected encrypt(k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes; - protected encryptAndHash(ss: SymmetricState, plaintext: bytes): bytes; - protected decrypt(k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult; - protected decryptAndHash(ss: SymmetricState, ciphertext: bytes): DecryptedResult; - protected dh(privateKey: bytes32, publicKey: bytes32): bytes32; - protected mixHash(ss: SymmetricState, data: bytes): void; - protected getHash(a: Uint8Array, b: Uint8Array): bytes32; + protected encrypt(k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array | Uint8ArrayList): Uint8Array | Uint8ArrayList; + protected encryptAndHash(ss: SymmetricState, plaintext: bytes): Uint8Array | Uint8ArrayList; + protected decrypt(k: bytes32, n: Nonce, ad: bytes, ciphertext: Uint8Array | Uint8ArrayList, dst?: Uint8Array): DecryptedResult; + protected decryptAndHash(ss: SymmetricState, ciphertext: Uint8Array | Uint8ArrayList): DecryptedResult; + protected dh(privateKey: bytes32, publicKey: Uint8Array | Uint8ArrayList): bytes32; + protected mixHash(ss: SymmetricState, data: Uint8Array | Uint8ArrayList): void; + protected getHash(a: Uint8Array, b: Uint8Array | Uint8ArrayList): Uint8Array; protected mixKey(ss: SymmetricState, ikm: bytes32): void; protected initializeKey(k: bytes32): CipherState; protected initializeSymmetric(protocolName: string): SymmetricState; diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts.map index 0ffc88414..09f5980ff 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-handshake.d.ts","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,KAAK,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,WAAW,CAAA;IAChB,GAAG,EAAE,WAAW,CAAA;CACjB;AAED,8BAAsB,iBAAiB;IAC9B,MAAM,EAAE,gBAAgB,CAAA;gBAElB,MAAM,EAAE,gBAAgB;IAI9B,aAAa,CAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,KAAK;IAO7E,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AAC,gBAAgB,CAAE,YAAY,EAAE,UAAU,GAAG,OAAO;IAU9D,SAAS,CAAC,KAAK,CAAE,EAAE,EAAE,cAAc,GAAG,UAAU;IAQhD,SAAS,CAAC,mBAAmB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,aAAa;IAQ9E,SAAS,CAAC,kBAAkB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAGxF"} \ No newline at end of file +{"version":3,"file":"abstract-handshake.d.ts","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAK/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,cAAc,GAAG,UAAU,CAAA;IACtC,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,WAAW,CAAA;IAChB,GAAG,EAAE,WAAW,CAAA;CACjB;AAED,8BAAsB,iBAAiB;IAC9B,MAAM,EAAE,gBAAgB,CAAA;gBAElB,MAAM,EAAE,gBAAgB;IAI9B,aAAa,CAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc;IAOpH,aAAa,CAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,cAAc,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,eAAe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,EAAE,UAAU,GAAG,OAAO;IAU9D,SAAS,CAAC,KAAK,CAAE,EAAE,EAAE,cAAc,GAAG,UAAU;IAQhD,SAAS,CAAC,mBAAmB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,aAAa;IAQ9E,SAAS,CAAC,kBAAkB,CAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAGxF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js index f1d205fe1..e878ab55f 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js @@ -1,6 +1,6 @@ +import { Uint8ArrayList } from 'uint8arraylist'; import { fromString as uint8ArrayFromString } from 'uint8arrays'; import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'; -import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; import { equals as uint8ArrayEquals } from 'uint8arrays/equals'; import { logger } from '../logger.js'; import { Nonce } from '../nonce.js'; @@ -92,7 +92,7 @@ export class AbstractHandshake { ss.h = this.getHash(ss.h, data); } getHash(a, b) { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)); + const u = this.crypto.hashSHA256(new Uint8ArrayList(a, b)); return u; } mixKey(ss, ikm) { diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js.map index 757420896..5641cbc6f 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/abstract-handshake.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-handshake.js","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAenC,MAAM,OAAgB,iBAAiB;IAC9B,MAAM,CAAkB;IAE/B,YAAa,MAAwB;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEM,aAAa,CAAE,EAAe,EAAE,EAAc,EAAE,SAAqB;QAC1E,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;QACjD,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;QAEhB,OAAO,CAAC,CAAA;IACV,CAAC;IAEM,aAAa,CAAE,EAAe,EAAE,EAAc,EAAE,UAAsB,EAAE,GAAgB;QAC7F,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;QAC1E,IAAI,KAAK;YAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;QAE3B,OAAO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AE;YAC7B,MAAM,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAA;YAC7B,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;YACnB,OAAO,CAAC,CAAA;SACT;aAAM;YACL,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;SACtD;IACH,CAAC;IAES,KAAK,CAAE,EAAkB;QACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;QACvE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEtC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrB,CAAC;IAES,mBAAmB,CAAE,EAAe,EAAE,OAAc;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACtE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;QAE7B,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAA;IAC/B,CAAC;IAES,kBAAkB,CAAE,EAAe,EAAE,OAAsB;QACnE,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"abstract-handshake.js","sourceRoot":"","sources":["../../../src/handshakes/abstract-handshake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAA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,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;QACvE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEtC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;IACrB,CAAC;IAES,mBAAmB,CAAE,EAAe,EAAE,OAAc;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACtE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAChC,MAAM,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;QAE7B,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAA;IAC/B,CAAC;IAES,kBAAkB,CAAE,EAAe,EAAE,OAAsB;QACnE,OAAO,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACvE,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.d.ts.map index 76c3cbdac..7a6ec499c 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"xx.d.ts","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAEA,OAAO,EAA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AAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,YAAY;IAgBb,WAAW,CAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,YAAY;IAkB7E,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa;IAkCvF,WAAW,CAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,eAAe;CAkBpF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.js.map index e4e4a1586..16a116910 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/handshakes/xx.js.map @@ -1 +1 @@ -{"version":3,"file":"xx.js","sourceRoot":"","sources":["../../../src/handshakes/xx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAwB,MAAM,yBAAyB,CAAA;AAKjF,MAAM,OAAO,EAAG,SAAQ,iBAAiB;IAC/B,mBAAmB,CAAE,QAAiB,EAAE,CAAU,EAAE,EAAW,EAAE,GAAY;QACnF,MAAM,IAAI,GAAG,kCAAkC,CAAA;QAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,OAAO,CAAC,EAA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AC,EAAE;YAC3B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;SAChE;aAAM,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE;YAC3B,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;YACpH,SAAS,GAAG,kBAAkB,CAAA;YAC9B,KAAK,GAAG,cAAc,CAAA;YACtB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAA;YACb,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;YACjB,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;SAClB;QACD,OAAO,CAAC,EAAE,EAAE,CAAA;QACZ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;IAC7B,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts index 55e6ab35d..18ab10920 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts @@ -1,11 +1,12 @@ import { type Logger } from '@libp2p/logger'; import type { NoiseSession } from './@types/handshake.js'; import type { KeyPair } from './@types/libp2p.js'; +import type { Uint8ArrayList } from 'uint8arraylist'; declare const log: Logger; export { log as logger }; export declare function logLocalStaticKeys(s: KeyPair): void; export declare function logLocalEphemeralKeys(e: KeyPair | undefined): void; -export declare function logRemoteStaticKey(rs: Uint8Array): void; -export declare function logRemoteEphemeralKey(re: Uint8Array): void; +export declare function logRemoteStaticKey(rs: Uint8Array | Uint8ArrayList): void; +export declare function logRemoteEphemeralKey(re: Uint8Array | Uint8ArrayList): void; export declare function logCipherState(session: NoiseSession): void; //# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts.map index 8873892ba..f1674c84e 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,QAAA,MAAM,GAAG,QAAyB,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAaxB,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,GAAG,IAAI,CAGpD;AAED,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAOnE;AAED,wBAAgB,kBAAkB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAExD;AAED,wBAAgB,qBAAqB,CAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAE3D;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAO3D"} \ No newline at end of file +{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,QAAA,MAAM,GAAG,QAAyB,CAAA;AAElC,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,CAAA;AAaxB,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,GAAG,IAAI,CAOpD;AAED,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAWnE;AAED,wBAAgB,kBAAkB,CAAE,EAAE,EAAE,UAAU,GAAG,cAAc,GAAG,IAAI,CAMzE;AAED,wBAAgB,qBAAqB,CAAE,EAAE,EAAE,UAAU,GAAG,cAAc,GAAG,IAAI,CAM5E;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAW3D"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js index daf1e24aa..58fb658e5 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js @@ -15,10 +15,16 @@ else { }); } export function logLocalStaticKeys(s) { + if (!keyLogger.enabled) { + return; + } keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`); keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`); } export function logLocalEphemeralKeys(e) { + if (!keyLogger.enabled) { + return; + } if (e) { keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`); keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`); @@ -28,12 +34,21 @@ export function logLocalEphemeralKeys(e) { } } export function logRemoteStaticKey(rs) { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`); + if (!keyLogger.enabled) { + return; + } + keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs.subarray(), 'hex')}`); } export function logRemoteEphemeralKey(re) { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`); + if (!keyLogger.enabled) { + return; + } + keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re.subarray(), 'hex')}`); } export function logCipherState(session) { + if (!keyLogger.enabled) { + return; + } if (session.cs1 && session.cs2) { keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`); keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js.map index e408da6b8..97391b53b 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/logger.js.map @@ -1 +1 @@ -{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIlD,MAAM,GAAG,GAAG,M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AC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpG,SAAS,CAAC,kBAAkB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;KACrG;SAAM;QACL,SAAS,CAAC,uBAAuB,CAAC,CAAA;KACnC;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts index 84d925c27..61e81274c 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts @@ -1,12 +1,13 @@ +import { type Uint8ArrayList } from 'uint8arraylist'; import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js'; import type { bytes } from './@types/basic.js'; import type { PeerId } from '@libp2p/interface/peer-id'; export declare function getPayload(localPeer: PeerId, staticPublicKey: bytes, extensions?: NoiseExtensions): Promise; export declare function createHandshakePayload(libp2pPublicKey: Uint8Array, signedPayload: Uint8Array, extensions?: NoiseExtensions): bytes; -export declare function signPayload(peerId: PeerId, payload: bytes): Promise; +export declare function signPayload(peerId: PeerId, payload: Uint8Array | Uint8ArrayList): Promise; export declare function getPeerIdFromPayload(payload: NoiseHandshakePayload): Promise; -export declare function decodePayload(payload: bytes | Uint8Array): NoiseHandshakePayload; -export declare function getHandshakePayload(publicKey: bytes): bytes; +export declare function decodePayload(payload: Uint8Array | Uint8ArrayList): NoiseHandshakePayload; +export declare function getHandshakePayload(publicKey: Uint8Array | Uint8ArrayList): Uint8Array | Uint8ArrayList; /** * Verifies signed payload, throws on any irregularities. * @@ -15,6 +16,6 @@ export declare function getHandshakePayload(publicKey: bytes): bytes; * @param {PeerId} remotePeer - owner's libp2p peer ID * @returns {Promise} - peer ID of payload owner */ -export declare function verifySignedPayload(noiseStaticKey: bytes, payload: NoiseHandshakePayload, remotePeer: PeerId): Promise; -export declare function isValidPublicKey(pk: bytes): boolean; +export declare function verifySignedPayload(noiseStaticKey: Uint8Array | Uint8ArrayList, payload: NoiseHandshakePayload, remotePeer: PeerId): Promise; +export declare function isValidPublicKey(pk: Uint8Array | Uint8ArrayList): boolean; //# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts.map index 50f0d9642..f111ad12e 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,KAAK,EACtB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC,KAAK,CAAC,CAYhB;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,UAAU,EACzB,UAAU,CAAC,EAAE,eAAe,GAC3B,KAAK,CAMP;AAED,wBAAsB,WAAW,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,C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C,CAE3F;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,UAAU,GAAG,cAAc,GAAG,qBAAqB,CAE1F;AAED,wBAAgB,mBAAmB,CAAE,SAAS,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,CAUxG;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,UAAU,GAAG,cAAc,EAC3C,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,wBAAgB,gBAAgB,CAAE,EAAE,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,CAU1E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js index b88ea5ef4..2fe0ef182 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js @@ -1,5 +1,6 @@ -import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; +import { unmarshalPublicKey, unmarshalPrivateKey } from '../../../crypto/dist/src/keys/index.js'; import { peerIdFromKeys } from '@libp2p/peer-id'; +import { isUint8ArrayList } from 'uint8arraylist'; import { concat as uint8ArrayConcat } from 'uint8arrays/concat'; import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; import { NoiseHandshakePayload } from './proto/payload.js'; @@ -32,7 +33,11 @@ export function decodePayload(payload) { } export function getHandshakePayload(publicKey) { const prefix = uint8ArrayFromString('noise-libp2p-static-key:'); - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length); + if (publicKey instanceof Uint8Array) { + return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length); + } + publicKey.prepend(prefix); + return publicKey; } /** * Verifies signed payload, throws on any irregularities. @@ -63,10 +68,10 @@ export async function verifySignedPayload(noiseStaticKey, payload, remotePeer) { return payloadPeerId; } export function isValidPublicKey(pk) { - if (!(pk instanceof Uint8Array)) { + if (!(pk instanceof Uint8Array) && !(isUint8ArrayList(pk))) { return false; } - if (pk.length !== 32) { + if (pk.byteLength !== 32) { return false; } return true; diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js.map index 7e09ad531..a92e613fb 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/src/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAIhF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,eAAsB,EACtB,UAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAA;IAExF,IAAI,SAAS,CAAC,SAAS,IAAI,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;KAC3D;IAED,OAAO,sBAAsB,CAC3B,SAAS,CAAC,SAAS,EACnB,aAAa,EACb,UAAU,CACX,CAAA;AACH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A;IAE3E,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IAED,OAAO,aAAa,CAAA;AACtB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAE,EAA+B;IAC/D,IAAI,CAAC,CAAC,EAAE,YAAY,UAAU,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE;QAC1D,OAAO,KAAK,CAAA;KACb;IAED,IAAI,EAAE,CAAC,UAAU,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js index 1fb4f4029..3ecdc9eaf 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js @@ -96,9 +96,9 @@ describe('XX Handshake', () => { throw new Error('CipherState missing'); } const ciphertext = xx.encryptWithAd(nsInit.cs1, ad, message); - assert(!uint8ArrayEquals(Buffer.from('HelloCrypto'), ciphertext), 'Encrypted message should not be same as plaintext.'); + assert(!uint8ArrayEquals(Buffer.from('HelloCrypto'), ciphertext.subarray()), 'Encrypted message should not be same as plaintext.'); const { plaintext: decrypted, valid } = xx.decryptWithAd(nsResp.cs1, ad, ciphertext); - assert(uint8ArrayEquals(Buffer.from('HelloCrypto'), decrypted), 'Decrypted text not equal to original message.'); + assert(uint8ArrayEquals(Buffer.from('HelloCrypto'), decrypted.subarray()), 'Decrypted text not equal to original message.'); assert(valid); } catch (e) { @@ -116,11 +116,11 @@ describe('XX Handshake', () => { } const encrypted = xx.encryptWithAd(nsInit.cs1, ad, message); const { plaintext: decrypted } = xx.decryptWithAd(nsResp.cs1, ad, encrypted); - assert.equal('ethereum1', uint8ArrayToString(decrypted, 'utf8'), 'Decrypted text not equal to original message.'); + assert.equal('ethereum1', uint8ArrayToString(decrypted.subarray(), 'utf8'), 'Decrypted text not equal to original message.'); const message2 = Buffer.from('ethereum2'); const encrypted2 = xx.encryptWithAd(nsInit.cs1, ad, message2); const { plaintext: decrypted2 } = xx.decryptWithAd(nsResp.cs1, ad, encrypted2); - assert.equal('ethereum2', uint8ArrayToString(decrypted2, 'utf-8'), 'Decrypted text not equal to original message.'); + assert.equal('ethereum2', uint8ArrayToString(decrypted2.subarray(), 'utf-8'), 'Decrypted text not equal to original message.'); }); }); //# sourceMappingURL=xx.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js.map index c1bd0610e..e8c578c0d 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/handshakes/xx.spec.js.map @@ -1 +1 @@ -{"version":3,"file":"xx.spec.js","sourceRoot":"","sources":["../../../test/handshakes/xx.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAA;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AAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js index b8a3acafb..8093b8037 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js @@ -68,7 +68,7 @@ describe('Noise', () => { xx.recvMessage(handshake.session, receivedMessageBuffer); // Stage 1 const { publicKey: libp2pPubKey } = getKeyPairFromPeerId(remotePeer); - const signedPayload = await signPayload(remotePeer, getHandshakePayload(staticKeys.publicKey)); + const signedPayload = await signPayload(remotePeer, getHandshakePayload(staticKeys.publicKey).subarray()); const handshakePayload = createHandshakePayload(libp2pPubKey, signedPayload); const messageBuffer = xx.sendMessage(handshake.session, handshakePayload); await wrapped.write(encode1(messageBuffer)); @@ -84,7 +84,7 @@ describe('Noise', () => { const data = (await wrapped.read()).slice(); const { plaintext: decrypted, valid } = handshake.decrypt(data, handshake.session); // Decrypted data should match - expect(uint8ArrayEquals(decrypted, uint8ArrayFromString('test'))).to.be.true(); + expect(uint8ArrayEquals(decrypted.subarray(), uint8ArrayFromString('test'))).to.be.true(); expect(valid).to.be.true(); }); it('should test large payloads', async function () { diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js.map index 0f925ef77..bed085bbd 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/noise.spec.js.map @@ -1 +1 @@ -{"version":3,"file":"noise.spec.js","sourceRoot":"","sources":["../../test/no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AAE,UAAU,CAAC;gBACnE,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,CAAC;aAClE,CAAC,CAAA;YACF,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC7C,MAAM,eAAe,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;YAE/C,MAAM,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;YAChD,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,CAAA;YAC5C,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;SAC3D;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;SAC3B;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js index a89a68b08..9a5d033a5 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js @@ -49,7 +49,7 @@ describe('XX Handshake', () => { // Test encryption and decryption const encrypted = handshakeInitiator.encrypt(Buffer.from('encryptthis'), handshakeInitiator.session); const { plaintext: decrypted, valid } = handshakeResponder.decrypt(encrypted, handshakeResponder.session); - assert(uint8ArrayEquals(decrypted, Buffer.from('encryptthis'))); + assert(uint8ArrayEquals(decrypted.subarray(), Buffer.from('encryptthis'))); assert(valid); } catch (e) { diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js.map index 6b3161d8a..66f02afcd 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js.map +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/test/xx-handshake.spec.js.map @@ -1 +1 @@ -{"version":3,"file":"xx-handshake.spec.js","sourceRoot":"","sources":["../../test/xx-handshake.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAG9D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,KAAa,EAAE,KAAa,EAAE,QAAgB,CAAA;IAElD,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,MAAM,yBAAyB,CAAC,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,IAAI;YACF,MAAM,MAAM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CAAC,GAAG,CAAC;gBAChB,kBAAkB,CAAC,MAAM,EAAE;gBAC3B,kBAAkB,CAAC,MAAM,EAAE;aAC5B,CAAC,CAAA;YAEF,MAAM,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAU,CAAA;YACtB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,uEAAuE,KAAK,CAAC,QAAQ,EAAE,wCAAwC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SACjL;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo index 0fb65f133..06b0c025f 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/dist/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"ad1764b2c66d631e98be0b8255b410a319857ece25c6e8ae9627a535a0241c6b","signature":"1f66808998faa0d77e425d4c5ae8f481c3234d4b8c1deff001e1af71b4b041f3"},{"version":"c99a598040f64ddf29965a42c440a61492300923e58015c9dbad51a95f245b53","signature":"2f37bd92ed3c6cbac299dbfd79abe367c5e5d72e098abdb8d3e3900badd53e88"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","b9998d79c6cb4e43e9d812fec5ccafbedee623c589904e3e3f0439ef861e25dd","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","5dcd218cfe8eb7fd6a1e5668c1a98734ddefe888d17129f8844552dddda2a74d","0564c90e8c2577950a446d6197a3ab7ec433ad5ac98435378e8855427f4cbf24","e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","6af9cf238459fe6d7e2d61cd50a157a6f540905c9793718e0e6e5993ab0cd650","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"9b48eef82666050e509dece807d29b825fde4909ac48c7f1cab67390973a03ec","signature":"220216e61adba5829f622fe331a5a99d4aeedcda11c983149ceff8a063d2585f"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","23b0b3d88c166dad8d63750b716b921c51053ad54b14a4e7e32fd526033566db","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"177dfa229223890f5e22db17d46280f2d4a16ca4c9ab73e4bbff4a1fd12300b4","signature":"e8f2522c8a4cf550c9fcc6154869253bd9ece549be7b5aeaaa7b20f73fb5cd83"},{"version":"e82bddfda890f3c83d1ece8c1df0ce57769a2a82b0ff81aff1409b329a460fc2","signature":"3f39c6ba0e49842fc434134519c30a89d3ec16da9701cf4d1113abf2f2ccfa17"},{"version":"a9ed6ff8aa6f2ea797e06d0f8bb03a4f43ab73a8adf133166140ca1ea208b520","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"b55e067a9546ac1c237571f938f04ae6593e138a2c1a645ed9171dbc36ee764e","signature":"f30884bec83e02740b8a410ecba62ba558f571a554e1b377ac4b83dff125b57e"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"36be103794251feb6152dd2c8ec5d0e5f841a189c920881bccfe27f7459f54ed","signature":"0cae8a9a58a4d4836626ea63c8e3e699e7bcdab24c31ef39009abaf97c704b1c"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"d898e165d52d3df19f98e46a53df138c8e28b1ec7224e75140d419f7bc60c7f0","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"f2f278cd3ffe7eb472b5daaec63622a32623cdf0d71395dfe60895363af42dc7","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"0708b60644e1bccec13c7ddbcceca6749b587ffea525ac42c9395af5c90146bd","signature":"7115ea7b230353fe5e5d9436fe7f5b8863dea85c1b7c030c58a75bdb9e844b91"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"1bcee41416ce15644b7e0eb66c2bb9df82007068fc83675d48927495cde7bd57","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"28ff2e0cd9350ef52ad5d6a77ddf2650d0505bd3d8cb1db66e1e5abf798d0c92","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"86b69f4f564965d8fd203354ebfcc235e37958a8195b600161deb5b9982a4dde","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,62,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[64,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[64,164,179,180,182,282,283,284,286],[64,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[164,201],[164,204],[164,202,205,206,207,208,209,210],[64,71,164],[64,78,79,82,83,164,179,289,290],[64,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[64,79,164,179,183],[79,82,164,183],[64,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[64,79,164,172,183,282],[64,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[64,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[64,164,179,192,231],[64,164,179,190,192],[64,164,179,192],[64,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[63,164],[63,71,164],[63,64,164],[63,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,164,185,186],[62,73,164,184],[62,164,185,187],[164,260],[127,164,185,188,241,245,246,260],[62,164,185,187,188,248,255,257,259],[61,64,164,179,193,230,262],[62,64,72,164,187,192],[62,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,72,164,186,187,188,213,222,225,227],[62,72,164,185,187,220,228],[73,164,184,188,260,264],[61,164,185,187,223,226],[164,173],[61,62,64,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[62,72,164],[64,71,72,164],[62,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[64,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,64,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,185,186],[62,73,184],[62,185,187],[265],[188],[64,179,230,262],[62,64,187,192],[62,73,79,185,187,188,229,230,232],[62,186,187,188],[62,185,187,228],[73,184,188,260,264],[185,187,226],[173],[62,64,73,79,173,179,183,184,185,188],[62],[64,71],[62,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[62,5],[230,220],[187,221],[185,222],[61,5],[188,223],[266,224],[261,225],[260,226],[263,227],[193,228],[233,229],[228,230],[229,231],[265,232],[227,233],[262,234],[264,235],[186,236],[73,237],[220,238],[269,239],[280,240],[374,241],[281,242],[364,243],[372,244],[371,245],[373,246]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,5],[173,49],[353,50],[79,51],[83,52],[174,53],[175,52],[292,54],[176,5],[177,49],[180,55],[285,5],[178,56],[181,57],[329,58],[330,58],[334,59],[331,58],[332,58],[333,58],[327,60],[322,61],[326,62],[325,30],[354,63],[226,64],[315,65],[314,64],[312,64],[313,64],[279,66],[212,67],[355,68],[336,69],[335,70],[81,35],[82,71],[80,35],[248,72],[247,5],[251,73],[252,74],[253,74],[250,5],[254,5],[249,5],[255,75],[258,76],[257,76],[259,77],[256,5],[378,78],[271,79],[275,79],[273,79],[270,5],[380,80],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,81],[391,82],[397,83],[395,5],[394,84],[396,85],[405,86],[400,87],[402,88],[403,89],[404,90],[398,5],[399,90],[401,90],[393,90],[392,5],[408,91],[387,5],[386,5],[389,82],[390,92],[388,82],[409,5],[410,5],[411,5],[379,5],[85,93],[86,93],[121,94],[122,95],[123,96],[124,97],[125,98],[126,99],[127,100],[128,101],[129,102],[130,103],[131,103],[133,104],[132,105],[134,106],[135,107],[136,108],[120,109],[170,5],[137,110],[138,111],[139,112],[171,113],[140,114],[141,115],[142,116],[143,117],[144,118],[145,119],[146,120],[147,121],[148,122],[149,123],[150,123],[151,124],[152,125],[154,126],[153,127],[155,128],[156,129],[157,130],[158,131],[159,132],[160,133],[161,134],[162,135],[163,136],[164,137],[165,138],[166,139],[167,140],[168,141],[169,142],[412,5],[413,5],[377,143],[414,5],[439,144],[440,145],[415,146],[418,146],[437,144],[438,144],[428,144],[427,147],[425,144],[420,144],[433,144],[431,144],[435,144],[419,144],[432,144],[436,144],[421,144],[422,144],[434,144],[416,144],[423,144],[424,144],[426,144],[430,144],[441,148],[429,144],[417,144],[454,149],[453,5],[448,148],[450,150],[449,148],[442,148],[443,148],[445,148],[447,148],[451,150],[452,150],[444,150],[446,150],[278,151],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,152],[460,153],[276,154],[87,5],[274,79],[272,155],[305,5],[345,5],[337,156],[338,5],[321,157],[319,158],[320,5],[365,5],[231,32],[232,159],[191,160],[189,161],[192,162],[234,163],[235,163],[282,5],[190,32],[179,5],[375,104],[340,164],[342,165],[343,166],[344,167],[350,168],[351,169],[356,170],[352,171],[216,172],[74,5],[217,173],[75,174],[200,5],[78,175],[195,176],[215,177],[214,177],[197,178],[198,179],[76,5],[201,180],[196,181],[77,182],[199,5],[357,5],[349,183],[347,184],[348,185],[346,5],[324,5],[293,5],[294,11],[63,186],[67,187],[68,188],[65,189],[66,187],[71,190],[69,30],[70,186],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[64,5],[72,5],[221,5],[213,5],[222,5],[219,191],[225,192],[223,191],[218,193],[224,5],[103,194],[110,195],[102,194],[117,196],[94,197],[93,198],[116,199],[111,200],[114,201],[96,202],[95,203],[91,204],[90,205],[113,206],[92,207],[97,208],[98,5],[101,208],[88,5],[119,209],[118,208],[105,210],[106,211],[108,212],[104,213],[107,214],[112,199],[99,215],[100,216],[109,217],[89,218],[115,219],[246,5],[230,247],[187,248],[185,249],[188,250],[266,251],[261,252],[260,252],[263,253],[193,254],[233,255],[228,256],[229,257],[265,258],[227,259],[262,260],[264,261],[186,262],[73,263],[220,264],[280,265],[371,266]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,63,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,64,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,62,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./test/handshakes/xx.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file +{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../src/@types/basic.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/utils/reader.d.ts","../node_modules/protons-runtime/dist/src/utils/writer.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/alloc.d.ts","../src/proto/payload.ts","../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface/dist/src/peer-id/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-info/index.d.ts","../node_modules/@libp2p/interface/dist/src/content-routing/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/buffer/index.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@libp2p/interface/dist/src/events.d.ts","../node_modules/@libp2p/interface/dist/src/metrics/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-routing/index.d.ts","../node_modules/@libp2p/interface/dist/src/peer-store/index.d.ts","../node_modules/@libp2p/interface/dist/src/startable.d.ts","../node_modules/@libp2p/interface/dist/src/stream-handler/index.d.ts","../node_modules/@libp2p/interface/dist/src/topology/index.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/index.d.ts","../node_modules/@libp2p/interface/dist/src/transport/index.d.ts","../node_modules/@libp2p/interface/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-encrypter/index.d.ts","../src/@types/libp2p.ts","../src/nonce.ts","../src/@types/handshake.ts","../src/crypto.ts","../node_modules/it-length-prefixed/dist/src/encode.d.ts","../node_modules/it-reader/dist/src/index.d.ts","../node_modules/it-length-prefixed/dist/src/decode.d.ts","../node_modules/it-length-prefixed/dist/src/index.d.ts","../src/encoder.ts","../node_modules/@libp2p/interface/dist/src/errors.d.ts","../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/interface.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ecdh.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/keys.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/rsa-class.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.d.ts","../node_modules/@libp2p/interface/dist/src/keys/index.d.ts","../node_modules/@libp2p/crypto/dist/src/keys/index.d.ts","../node_modules/@libp2p/peer-id/dist/src/index.d.ts","../node_modules/uint8arrays/dist/src/concat.d.ts","../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../node_modules/multiformats/dist/types/src/bases/base.d.ts","../node_modules/multiformats/dist/types/src/basics.d.ts","../node_modules/uint8arrays/dist/src/util/bases.d.ts","../node_modules/uint8arrays/dist/src/from-string.d.ts","../src/utils.ts","../node_modules/uint8arrays/dist/src/compare.d.ts","../node_modules/uint8arrays/dist/src/equals.d.ts","../node_modules/uint8arrays/dist/src/to-string.d.ts","../node_modules/uint8arrays/dist/src/xor.d.ts","../node_modules/uint8arrays/dist/src/index.d.ts","../node_modules/@libp2p/logger/dist/src/index.d.ts","../src/logger.ts","../src/handshakes/abstract-handshake.ts","../src/handshakes/xx.ts","../src/@types/handshake-interface.ts","../node_modules/it-byte-stream/dist/src/index.d.ts","../node_modules/it-length-prefixed-stream/dist/src/index.d.ts","../src/handshake-xx.ts","../node_modules/it-pair/dist/src/duplex.d.ts","../node_modules/it-pipe/dist/src/index.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/types.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/wasm.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/poly1305.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/chacha20.d.ts","../node_modules/@chainsafe/as-chacha20poly1305/lib/src/index.d.ts","../node_modules/@chainsafe/as-sha256/lib/hashobject.d.ts","../node_modules/@chainsafe/as-sha256/lib/wasm.d.ts","../node_modules/@chainsafe/as-sha256/lib/sha256.d.ts","../node_modules/@chainsafe/as-sha256/lib/index.d.ts","../node_modules/wherearewe/dist/src/index.d.ts","../node_modules/@noble/ciphers/utils.d.ts","../node_modules/@noble/ciphers/chacha.d.ts","../node_modules/@noble/curves/abstract/utils.d.ts","../node_modules/@noble/curves/abstract/modular.d.ts","../node_modules/@noble/curves/abstract/curve.d.ts","../node_modules/@noble/curves/abstract/edwards.d.ts","../node_modules/@noble/curves/abstract/hash-to-curve.d.ts","../node_modules/@noble/curves/abstract/montgomery.d.ts","../node_modules/@noble/curves/ed25519.d.ts","../node_modules/@noble/hashes/utils.d.ts","../node_modules/@noble/hashes/hkdf.d.ts","../node_modules/@noble/hashes/_sha2.d.ts","../node_modules/@noble/hashes/sha256.d.ts","../src/crypto/js.ts","../src/crypto/index.ts","../src/metrics.ts","../src/crypto/streaming.ts","../src/noise.ts","../src/index.ts","../src/crypto/index.browser.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/index.d.ts","../node_modules/@libp2p/interface-compliance-tests/dist/src/connection-encryption/index.d.ts","../test/compliance.spec.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@types/chai-as-promised/index.d.ts","../node_modules/chai-parentheses/index.d.ts","../node_modules/@types/chai-subset/index.d.ts","../node_modules/chai-bites/index.d.ts","../node_modules/@types/chai-string/index.d.ts","../node_modules/aegir/dist/utils/chai.d.ts","../node_modules/@types/sinonjs__fake-timers/index.d.ts","../node_modules/@types/sinon/index.d.ts","../node_modules/@libp2p/peer-id-factory/dist/src/index.d.ts","../test/fixtures/peer.ts","../test/index.spec.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/frame.d.ts","../node_modules/@libp2p/interface/dist/src/stream-muxer/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/muxer.d.ts","../node_modules/@chainsafe/libp2p-yamux/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/index.d.ts","../node_modules/@libp2p/daemon-protocol/dist/src/stream-handler.d.ts","../node_modules/@libp2p/daemon-client/dist/src/index.d.ts","../node_modules/@libp2p/interface/dist/src/pubsub/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decoderpc.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@libp2p/peer-collections/dist/src/map.d.ts","../node_modules/@libp2p/peer-collections/dist/src/set.d.ts","../node_modules/@libp2p/peer-collections/dist/src/list.d.ts","../node_modules/@libp2p/peer-collections/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/connection-manager/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/registrar/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/providers.d.ts","../node_modules/@libp2p/interface-internal/dist/src/address-manager/index.d.ts","../node_modules/progress-events/dist/src/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/record.d.ts","../node_modules/@libp2p/kad-dht/dist/src/record/index.d.ts","../node_modules/@libp2p/kad-dht/dist/src/index.d.ts","../node_modules/@libp2p/daemon-server/dist/src/index.d.ts","../node_modules/@libp2p/interop/dist/src/connect.d.ts","../node_modules/@libp2p/interop/dist/src/dht/index.d.ts","../node_modules/@libp2p/interop/dist/src/pubsub/index.d.ts","../node_modules/@libp2p/interop/dist/src/relay/index.d.ts","../node_modules/@libp2p/interop/dist/src/streams/index.d.ts","../node_modules/@libp2p/interop/dist/src/index.d.ts","../node_modules/@libp2p/tcp/dist/src/listener.d.ts","../node_modules/@libp2p/tcp/dist/src/index.d.ts","../node_modules/execa/index.d.ts","../node_modules/go-libp2p/dist/src/index.d.ts","../node_modules/@libp2p/interface-internal/dist/src/transport-manager/index.d.ts","../node_modules/libp2p/dist/src/address-manager/index.d.ts","../node_modules/@libp2p/interface/dist/src/connection-gater/index.d.ts","../node_modules/libp2p/dist/src/components.d.ts","../node_modules/libp2p/dist/src/connection-manager/auto-dial.d.ts","../node_modules/libp2p/dist/src/connection-manager/connection-pruner.d.ts","../node_modules/eventemitter3/index.d.ts","../node_modules/p-queue/dist/queue.d.ts","../node_modules/p-queue/dist/options.d.ts","../node_modules/p-queue/dist/priority-queue.d.ts","../node_modules/p-queue/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dial-queue.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/@libp2p/interface/dist/src/peer-discovery/index.d.ts","../node_modules/@libp2p/keychain/dist/src/index.d.ts","../node_modules/@libp2p/peer-store/dist/src/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/p-defer/index.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/@libp2p/interface-peer-id/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../test/interop.ts","../node_modules/iso-random-stream/dist/src/index.d.ts","../node_modules/@libp2p/crypto/dist/src/aes/index.d.ts","../node_modules/@libp2p/crypto/dist/src/hmac/index.d.ts","../node_modules/@libp2p/crypto/dist/src/pbkdf2.d.ts","../node_modules/@libp2p/crypto/dist/src/random-bytes.d.ts","../node_modules/@libp2p/crypto/dist/src/index.d.ts","../test/utils.ts","../test/noise.spec.ts","../test/xx-handshake.spec.ts","../test/handshakes/xx.spec.ts","../node_modules/keyv/src/index.d.ts","../node_modules/@types/http-cache-semantics/index.d.ts","../node_modules/@types/responselike/index.d.ts","../node_modules/@types/cacheable-request/index.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/keyv/index.d.ts","../node_modules/@types/linkify-it/index.d.ts","../node_modules/@types/mdurl/encode.d.ts","../node_modules/@types/mdurl/decode.d.ts","../node_modules/@types/mdurl/parse.d.ts","../node_modules/@types/mdurl/format.d.ts","../node_modules/@types/mdurl/index.d.ts","../node_modules/@types/markdown-it/lib/common/utils.d.ts","../node_modules/@types/markdown-it/lib/token.d.ts","../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../node_modules/@types/markdown-it/lib/ruler.d.ts","../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../node_modules/@types/markdown-it/lib/parser_block.d.ts","../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../node_modules/@types/markdown-it/lib/parser_core.d.ts","../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../node_modules/@types/markdown-it/lib/renderer.d.ts","../node_modules/@types/markdown-it/lib/index.d.ts","../node_modules/@types/markdown-it/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/strip-bom/index.d.ts","../node_modules/@types/strip-json-comments/index.d.ts","../node_modules/@types/ungap__structured-clone/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts","../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"1bc2fdadc59c4529e51cd693e1bb45c0f9d6c4cf079b008fa3a17da4cd08af44","signature":"a5b2968580425f209992ad1d8a62ab079d84643e00e0f0b11f65fe6423a643f5"},"d35b5db21a04a45ae6323c4d4b25acc983dfe2870fc670fd05249eb19d839a5e",{"version":"a00b40912153391370bfc844161907779723e82cd2d671b3bebea763212f048e","signature":"35095a100857bdbca3c31ddd6e1eb18259140dee0092d97e631889daf084eaec"},"fd617cc8eec6f43227ab572160bac9d23c723073e83a9b100bd15c758eff34c2","ec3786b43d68955ecdb12ce679d3bc61b6b25c4d0ac5bcdaf50fa4a746189b98","3155e98b0df0c1523715e8a1c75c8a67c401aeb58d6eccf8bd89d5d775b8c1cf","fa82b7b22d9df87323e31e9e2ad75911028f3e544647fd212424b3c4452fee3f","90aa0b916eef195a17c3dbd621746f82ac7969ecc3dbf27c81ee4c68c5af7f25","9ceec2a882368c0160a8a3879aa0efce0fb985751fc23ff6191006030969cfa4","cad5d6451789234434c28dd2d6a8267b0d64c479b1ad267321faa31ba90d570b","e0e8254f7a1a21b5768beb4dbc9d4574ce67aefa59d88251d16b17c658f2a69e","c33b700f5d0797c331e08b29f8440204e19cf035555ea9111321f881f1b4702a",{"version":"b2d663f1f5da5b395c5dc6ba6dbc633d61580235f82faaca06bf420fcdae46cf","signature":"6744c64cda78d6af7280d69c20ead828fa4296efe0b582548cb10ab66914993d"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","f5337c3ea7b8702ffe2718f56a24325a67d517c0d552ef71b8d578d9f33a99d3",{"version":"1cd9488f96f8d5657d4109a6ae188f65846e905c5b236fdf379c16362e7a60a7","signature":"612bf9cb0b0a7ce6eab9fa9c09da1b1e4e5ec8f6b94f282035bfc89f68d4f3c6"},{"version":"2dec630463aaa98bfbc039a798f1757b9d53fd8ebd1722817b05b4534133d8cb","signature":"1cc2659564153cef042b6a377a36a04d861398d678e7032ec42698d8c80ec77f"},{"version":"04c0845e6238ad637b36f880c649580adb0c243f3fa45f4c3807430c8e862933","signature":"da7f4b98c4488238be67d8ddcd4216a17d3d18d96e1d768a8e4fececb1e50c1c"},{"version":"bc71694976d33375e52860a689a8e0cb6377cbadb47616a6ef0bcdb79dd85ca2","signature":"a70eee113e9abf464f7402761e384ba3895fcb1cae7794c5d2e8df465670ba76"},"f30cfcfff28ee8f87563225b47239bb07b9b11edd09dda0ea6499b18cca1a30e","0edb8a97ead1fefd337458449050857e80740e31a3f76cffa656262f4e651a50","db8e4b47dd8c22634e3a326e5a5f60aa71a8ad4a0458fc0aadb6951f1c7cdc54","5b7a6d3f5c1b1d94d6cbc6c1e113588e20ae61d583d0d0cb5ec3fd92926d3749",{"version":"57b66a49fde8cfb80495147e1e115f4d09e7d089a97bca210d7b737a9a3dfd40","signature":"7c86832b33e8881089597745da92dc33a29681874849008a13069039bd613ea6"},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","7b16a7c7a940bd42cf6120082f6b35c5dec35e483a51cb1af342ef0192743577","7a6f74294b8fb90f5e3832be21e25898dd81b2a1adc36dda6929813ba4135311","d25e693302c8e284b417884b40dbadffe693b0daff8999a000995114dbf74c49","a1d4ac1b15cd62c7346d976e3a01e6cbcd4f166ea6b7866907d25c5acc832d77","5d40e6a7071d0d1e6e558e17214ff786ecb3ea73e31b25a88c2cbe2435fa1252","c45242078469b9680653d6a0667b23b1b767ec908825a14bfa8bb1dde2e30dae","b1b6235704afa69cf1cc3dad74e423ffef52a7c95d349909287ecb2b4e61b732","e0a7a6eb257be445fadd46381e7a6d7f46b79595fdb5471e8646247013c3ad2f","b8f44b2f7459b20574c73911097dbed93e55e455cd53e9b3a2a7ff5b8c456cd8","df21f5c49d638cbd6bd322eeb5b16d8352ba14ccb88cc9b23a7d8d5c2eaaf659","f6d13788d90394a540d136fb8ba9a0a647d8baa2e51d2ae155d039b031f4717f","61aecaffa270848d50da8222593fc396b31ba3b608608f44816b1d30ff105585","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"2b388a5b2cc42c8441389c61dd6c1325879a083bd58659977dcce6dcf6dd28ff","signature":"895aa3573a4f328c65492ac306486fd0180174668e2a0676eb48adcc1bff6df3"},"0eff9792dd66a9aef708b34dd51d2e46158ae518db6ab14f54c5a99e8551abe7","66336b5a5d5e897e932cbf1e306ff8ac8a9929971409a8049c8c8a249cd8b57c","a878d4c7237a7af50e96534295fcf723134d70cbb1e9bfd8365266b912aee6ec","1185e162cb22a9bc3e94b2ae2ba35ed943ee69beae5364b38680f7d8587e7d35","b0e45bb147d111025fccf490ec1a7f58d84c3ae9f58a61313b1010df95e4eeac","fbacab2238e299ccf6596c3bd404c7dcad2c5a88ecd254a8a38cf2d184a67c75",{"version":"46ce1f90a803756157dd1c91c00b48376f5c9411b9b774115e5bc788b2d4122a","signature":"ddfcbb86bf297f1a1ca712d99a6f8acff7a1fc525485a49724110ccfc46fbf3b"},{"version":"f372b6e2a5faf96e2e0ff358d6f108d3179f09591647a69a6c1b1f1b9a22dcb2","signature":"2e01a9e79826c2d0355a22f2e6dc664a36683417e324a9c0d4b1fc5725635a32"},{"version":"40eb173f4f47d739fc1100db964bcc4c679e896caa83ed5d9ace4ec9528e8c78","signature":"b73dc3c92a3cdfe4144eafad3b73c13787c5cffe4ec5b35cd0467e9a3ede9ec1"},{"version":"971ff4a8a87e894f1d6792854ab02ecf69677e9428edd0f819584ca60ba3f893","signature":"034a4c643c1b79860657fec38bc4761c893fd3a3d635e0704ba7a6f46ef739dc"},"4de66b5983d6286bfe3606cf155a5b21043111389d0b4c7b23d3f4282099f7d4","3968eed4d327e075c2386fad0b39b5ad2fe1892f6409a3bb46660c46f58300a6",{"version":"549b9cca9b7c3aa4869a70c36884a966ed60fe96fdf7082846b79d1f333b86ed","signature":"6cf6ed626d4e29031f40cb4e7683a640bf6bd7d78d35e99d6b503899f049a3b4"},"b1129d7c114eba7c7b155dc809d6371ef86a0738f7ca93b3efef9b796d6168d9","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","ffff3307a2c3797cdc04d7493e94245c13a646194c87f5bf5d2432995b834cc3","a87bc62d9a6be405f53f883a422efd557775224cd2b6688440cd333aaac27169","3d08777d7a3f5c1899a21dc2bd9f0ca80cfe0badba576cae22f5b47b7f81b3eb","bbbfe3163d9421b837e4e203c24243344be38e4359b6fc15426943454d8949b6","8cf4dc652e929c4de69ce5079b98a0683757b2dde66a7cee93edcb5aa08d5c48","f74d877f1fc949fb61197bf32a41829a83ee6aea528787dc2788378baaaa0ecf","a62a02c433e6fee26404825310ad462433320ef2e9f80fa7b9156135fd975f8f","22f15ae5c80b3e795da92636aa03d8f981811d067d82bff01ca54093c0535ec0","b56d4bc83ec01834829979ad57de59b4947cd62f71b102ab0040b6960d5bdc81","a10213415bf98670b026b77a90c7933594f0b5c34bde5b74e80134fdf0331bba","00cd454fa42dca69cdea08d4cb9698e679ba9a31762c23d905e45ba92269ac3a","58765e8e715155b2940e868ab1534b1bfac7087f6b42f7810ef94cc077d62981","f1c4e4db3e1dd83c3749f174e662de845e1217017ead0c15074e3ba00db67b6e","5aaea3d4b3af0c8339006c30af04eafdeb21b0a1bba2f1d32540ade412ee80a7","eb72bbe04857681ebd08a48d3b0869969c335445c31de53a85f76b4a42b97c92","c8cc38cbba80bfd5719c1b9d7efcd76fc90d4497e8a9aa715db426993274f0ae","49b6ff487f2d72569e361f077397214fea20839712527f5fb9ed8bb877dd7db8","d3043c37eeeb10d8a5c0c2a3b9d72e23a5fed2e9a367c5b4154bc8d9283601f3","58ff317d61b47e8fc6688bd50e6770311691202553f119d1e1d79b64d864e200","cde49e6e1ab8a2b4202958e3267e898489b737198a0599c7d251f94d9dea658b","3c3ca314a2b01902ef19b499be6e052925a849f14e2d9185afb323df3d3a72b6","b4b4af7820e7888cf67beeb95d0d6144b3d854370a7b78a598e80dc268e74249","1e7146a407bf85762b80681cd4aa3b544000e30c9b24d04685dfa69f82a48fd9","a3c42863fed9b49c35144d60aa0b2865b5fede65ea0050a28f45381af6dae035",{"version":"0d3eab3df87bf09cba3e05626802e7ca3a41f7d3f7eb6511c638bafd5c52565c","signature":"8db42cde9161c917ae86f075cb21c16d1fab5965db0c4f4b372b4e7a0276f82e"},{"version":"917b6a0feb5eca283fe3a2026c882c836671108d7bc7cdb301b758a9cd761214","signature":"a03bc49af672574771ede656f9c35be60c2ba44f45655aed449e7f9e5efae6aa"},{"version":"19e0cd3c787b3570a7e8c20aa0718062bfb65e97391bd700bf37612569f3fc68","signature":"39c164f8cfdeb33577063044cf89c43c19bb4f79fae41960e0a17c6de26272c5"},{"version":"a7eada863fe6d6a9ff2dc80f15b09747040b31f5ba2c4eda874c0bb682741142","signature":"0abfab39cca2b786d14a621a308538c88dbdba07093283eec1bc6daafc462b3f"},{"version":"699246380aaa11f56f67ba8a5583f035e79f3de9d5837fe1979c579bafc32156","signature":"4110b29391d0835f9b88a4c69cb7e1cdddbac43ca9ee86393ebc15567c271b4d"},{"version":"aaa8702650fe4efdb8e82d41231add24a0b809b17f55d52009dc469c8ee0b011","signature":"f2dc190b33c1e842552ab4117c29cc960edd8ce2327a22254ec47cbcbdbb91f7"},{"version":"96db0fd5e766faa06d7b4f3ccc7e3b7df29a4c1aa4f116eaec55e5936e321325","signature":"0017550b13ae859f43d4b435fdab5e5035b0d6f7b7959458f30f67e859882d4d"},"5bca2169d85cde638dc45542bb3674c42e5a0eea70ac2737cb48848a0c9e10b4","e9fd0c57db08c441b0f044449b651e5d9910fa6c7871dbcb4d266b9cd357e2ed",{"version":"bf471b46fd0e07028f318e408bc578f4a3e125333bb545445175e6ba50791ffe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"13acb84a8fa8264d596433ae541c83b13d226a9592e6a26b165002c38132b97a","signature":"e307a4efa11c7f907b4e98ebb9496837e1901f13a19d8b0ed8c51205b09d528f"},{"version":"303ae53a3993e592fa9602ec5c83bac6d5c074f6e73fca8b2007f6db3ecf25f8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","c8031a5db82b240f801a5684ab693e95e1e06dc76958894fe42d35acbd446f28","1633b84fd3346ad6500a88e7a119ac778bb6f6b2746a3b7b8164c5ef2721822f","37fa00014a0f86b91526c4fde9b31af33d3e3bd5892c0519aa0d96d7935de484","5c9d5e0cd18c905ee6f6bc6f85b02c4d5b6f64ad08e1181f63785fae04823db3","5abd603c11eeb815a1746ff003233ae03c8f4f34fcf7835742c30fff038d4100","df54eaa5ea53c6bb3a9548bc5d2f6fb22583ea3e8b936a4e8ec5acfd90422ff3","be8d072f400254824429edab10acbe595299b702c97b99cc47f8e8018b7102ff","1a319786bea64c944ba8dd33331090034468efbab9c2fb96552850033d62d8d8","33174450482b921bbf093e3d52f501f7f93b5fd612311aa86e7339f2800162aa","03e385ae2125c9aa9dead008b42a0ab20d0812c26c19ee210d84c2666113f867","688c9dfd2b7114f5f01022abb5b179659f990d5af5924f185c2644ca99fe7b77","932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","38fc2c990835686053591402bd73803ef28e117fa49427763e62636fd16c76ad","85489033e86eba49bfef2ad7330f8bb57cf7ef6aeb341c00ae1a3e5b19a02f4f","d4936633d5453e441ad5ab182efad46a0e1285fe5f9f5c2948cad3e71b7c2c23","a1b60bd2328318dcbec30bdf529dad31a13315ff2df60c8bd71630c58a575b06","e7ad5aa8eb177708949df3abbfe5ccbe7b75c920fb3bdd89426c38c61f239da6","8cc6a35806cd10d448b0f2ab01fe0b6194ca57fdaced2d71781b68e83c55bd88","8f364fec0ef20506aa9cf00b5cd8b620c1c0389687b11a3a32b0b5d4716ad894","5d11703e2c5d4dbe00bbe79f3bc864d178cf8d6ebccc2d1448ea29e93654f029","f4e82c91aac3b61f3ad04f11a44c5b79f724ff8a09281d0afa24a6624633ff25","ed849d616865076f44a41c87f27698f7cdf230290c44bafc71d7c2bc6919b202","7b8b9017156ef8bf3bbe42785fac8956e5c9869f4a494536d7f548a7c1c7d98a","eb2f08ae9c540a5fb60a5edddc0860ca3dad54ec842301ca73441d9e54534af0","763bb8df872cbb8783e29e19bd7a1dea0f88f7fd7398343af38be8509a65df82","687ce021a76c91c0e0b08fa5b828de2916e1b1aa9a23394e8ebc4dd96b8ee776","c286b410193495d067668bcdbd13ea3f3a39001edff02edee248babf2652e563","ba1405da509cc84896a588978efc45400d4f9844ee738d750b59868b1ad1618a","83a1426ac1a9cf144141dfe10d71a68629623a7c28245c9ca0e0352bead501fd","2726c0a6a4a87fad11e6846e6b0b40b8924fbe66340adc512093c4273bc53e4e","c888daaa99fdf6c5712d98605fdcf21cbbaab756a629661a44cac44ede464d37","e044f60686dc70015a3b7e7c64ad0ac5ec5ec101a0aede0782ec077e136b6a65","a232f867897bbecfebf68df575a417af1afd9b5dd3d83fb4d59e0a133a0de93d","228dbc8825b7a45af7d416dee95c0a2162d7cf73ffddfd52357b7e548882bdaa","602baeb62ccf84672ba7afacb5a21b675171282397513cac8f06d3a8634f840c","8970ab047d89c71edf9973609dd62f61bb366abeabbff36a1200103b6c1c605b","36d756189d9295e3a964e5cd45cb8ac965d5d2ada53ed848e08608426c146d69","8bdb5c16e8b9ba625ec08d8189879a6fb47b2c3c458a5d43ebd53a8763b5712e","93597e08900c3ac5ec730c16c4fbe425f7342e1f0420967b2afd90d67a2abee1","af89ab13b40dd28cd91818fc6329914d2b9663591831f032ff0f0cb4a028d4a5","6e6733927ade923e34b243d6fbec1465cfc8ed6edf62c6e09ed00c529f0d93de","83b3a9e85f7967509436fcdfa9be9bd543fb54003a9233c5c0af087e4a2c11c8","dc92d6eccf12395aa1d47afb765d5e4a1cd2639a385db0e3e88e9937ad2b63a3","ffb6e0556a4b5323c8bdf12727d000e8a3633f0552fffc4b779ae88546be2770","1242141c87ba3396bead6f379f6d6778bd38d02017f243aa448d1454a5fdc90e","17a4105ddae0308e19ee8532bdeb76278efa9dc644366060ca644541d3fd831c","913ffa031f7455c53e99c75ae130a046612d2ee0e716ed92707e996cbd3952ea","44e897d02326bf4d8169ea9638fe0a4c53b8f85cc48ae2fcbbb67b2f72c1d805","288fb1b9df77067c3c2675bde87d23d4a3f01bb6f929f854f11bdb68662968ff","b43b5156bc2831b46f6226777e292ff1646b3651ce190708b6228a078d42da4a","c3e77c4aa1097a38dcf4a20a093ce65033a16f3a48dab0ae3c5f6661bc39b11c","93acb99d30b8a22b443bfefb333d15d6310af7bd76a832f9559f7af9535ed2ae","3053e413471eef0274bc90318db14072e6164fbcc77765ab9557a769370382b2","32cbe201bfe8ed7f4c323fb8a3fcfdfb451f22e84d3c49da33ceda2fbf9230be","50d536e2e8bdbb4234b6ade05992aa4227fbf0401aba24922734c3ddb4a3ff11","4e152867a5b1bea2dc6a2921c0196f877630fc144369f8c7b9a69905caa62741","445c1751941d390dedf7667ab0fef01d468089576c07eba15810bf69485e4589","7f2cc72a16a663ab9f8d99bd5658e583251ce0c003bf80a948973e15a7ef9596","6af42c3c33c7123e7b056a6fd272d470914f382fad5e99689fa4991ff610e757","60f7cf25a65631bcfc27276a9b7b584ad13c2a37f871376d5d02e2133bc5fef9","e1c0439c8c796ddfdd08206dfd2cf7a7defec9d83f7b1e873d908489bda18af4","27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370","8c15566043b036c0720caf51ca343754e84e34fbaaf4a58d8080cf4ab2d93734","d8c8d41b25ef1827daaff9d84db43593995ce075551e7f4d8f10e316261e86f0","22fcf82dcbb4743dc846e838434ad1c2843cd18476e534dd3b37f85ece99ac73","40924f439552f559ffa4e41d300a411646ac9f3b53e578a012f7c439d36c6a30","7a34c06f5ed61c8108b2b82b7834655f1933d6ead3c9f6ff9d12efee4cb4bcaf","ee24d63f039e5745a279243916c7bb2c3d405bc0158912c0f37471381b467087","459c0ca522af7a412ef771447fe2c558c9a4640cffa4f53bacac05d0378a3ae7","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","f196d5ed4194259ffb797a34001a5edb7a165cd110dc3e4d8f03f11e3531fe9b","683889752b7c95fffd073b82ea76d36b3fe548ef3bb9887eb903676eabd676ff","a439ff9443c77478bb024ea2d96fbc088bccc915adf6bb8aeb9ab21fd737a071","b40afc6ff175241970202125bc1b5996cf5783b2f755977691f8c6522ace9f14","8bfc11f55ca063b10f0335922693ca70885d8f59b20607dd501250d1b1e960db","a884051a029dc34c400dc1dbad39a878935d37ebbea62d357d17b25f0076b578",{"version":"1b1ca1d97df4268847d5c387b1a89c01ec2fdc2062def1216442c8f040dcb660","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6e0011406961ab3d469f2a7c3fddc41a5c9fb6d9452c47b5389124da846ab07a","df1bbd333631040027035b56cb31093015e59ce977a590500ed09feab109939b","a4f27ea63e3ff26a94b6681967a5276a2df9ddb80ae990df1ad03c0fffb34eca","18418f70457cee30da01c21bc26869ceb1ae65564784136f7fe2f7f2ff8f740f","3d2ec84143e6462a786b5d9ecf06f4f6f67a59a1f16c5a3a5e41721ba8478b7f","892f412f701d356f85cd3cb7d48b87ffecc0d4f85a2005c1d53e5e08414df8b1",{"version":"14261c0d2da587df791a696c8272003a3c5c1d7dd3a91f459092a8ab99759ca3","signature":"23d9dffba690dd7b1cc3986e0d592011a8660f0cb7632037b83b157b659c1510"},{"version":"b53d81e22a3aaea474090ae4dc430b4cdab6d4eaff1f3c8fd644faa6a3eb18d6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"b45003f0fe5b752aa604f105e926c07fb55c4c87c0dcd70a2d042d0eab0d970c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"21baa482f35686cb3f9fc04daf84c76b7d64aa5aacc9f08e3a38ed908f736ae3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a","4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","852bcf5d92d819abdf34ba0759c311b61d5dac7b9963a6c3cc4f23b025dee8f3","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[61,63,73,[185,188],193,220,[227,230],233,[260,266],269,280,281,364,[371,374]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[164,236],[164,236,237],[164,237,238,239,240],[164,237],[164],[164,242,244],[164,243],[79,164,172,175,226,292,295,296,297,298,300,308,309,310,311,316,317],[164,295,297],[164,294,295],[164,293],[164,292,295,297,299],[164,301,303],[164,299,301,307],[164,305],[164,297,300,301,302,303,304,306],[164,297],[62,164,183],[164,297,300],[79,82,164,210,292,295],[164,226],[164,180,284,287],[62,164,179,180,182,282,283,284,286],[62,164,182,283,284,285],[164,211,366,367,368,369],[164,203],[62,164,201],[164,204],[164,202,205,206,207,208,209,210],[62,71,164],[62,78,79,82,83,164,179,289,290],[62,164,179],[82,164,182,183,289,318,327],[164,184,267],[82,164],[79,82,164,182,183,315],[164,178,183],[82,164,181,183],[164,358,362],[164,361,362],[164,361],[164,358,359,360],[62,79,164,179,183],[79,82,164,183],[62,79,82,164,179,182],[78,83,164,182],[134,164,171],[79,82,83,84,164,172,173,174,175,176,177,178,181,183],[62,164],[164,183],[83,164,172],[76,78,164],[79,82,164],[79,83,164,182],[62,79,164,172,183,282],[62,164,179,182,183],[79,164,183],[82,164,172,180,182,183],[164,334],[164,291,329,330,331,332,333],[78,79,83,164,172,173,175,182,316,317,321,322,323,324,326],[79,164,176,201,321],[62,164,325],[79,164,210,321],[79,164],[164,312,313,314],[79,164,210],[74,76,78,79,164],[79,82,164,172,175,182,321],[82,164,173,181,335],[82,164,172,173,181,183,336],[80,81,164],[164,247],[164,250],[164,249,250,251],[164,249,251,252,253,254],[164,256],[164,256,258],[134,137,163,164,171,375,376,377],[164,270],[164,379],[164,405],[164,390],[164,394,395,396],[164,393],[164,395],[164,385,391,392,397,400,402,403,404],[164,392,398,399,405],[164,398,401],[164,392,393,398,405],[164,392,405],[164,407],[164,386,387,388,389],[85,164],[121,164],[122,127,155,164],[123,134,135,142,152,163,164],[123,124,134,142,164],[125,164],[126,127,135,143,164],[127,152,160,164],[128,130,134,142,164],[129,164],[130,131,164],[134,164],[132,134,164],[121,134,164],[134,135,136,152,163,164],[134,135,136,149,152,155,164],[119,164,168],[130,134,137,142,152,163,164],[134,135,137,138,142,152,160,163,164],[137,139,152,160,163,164],[85,86,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],[134,140,164],[141,163,164,168],[130,134,142,152,164],[143,164],[144,164],[121,145,164],[146,162,164,168],[147,164],[148,164],[134,149,150,164],[149,151,164,166],[122,134,152,153,154,155,164],[122,152,154,164],[152,153,164],[155,164],[156,164],[121,152,164],[134,158,159,164],[158,159,164],[127,142,152,160,164],[161,164],[142,162,164],[122,137,148,163,164],[127,164],[152,164,165],[141,164,166],[164,167],[122,127,134,136,145,152,163,164,166,168],[152,164,169],[137,152,164,171],[164,415,454],[164,415,439,454],[164,454],[164,415],[164,415,440,454],[164,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453],[164,440,454],[164,277],[164,458],[134,152,164,171],[164,270,271,272,273,274,275],[164,270,271],[122,123,152,164],[164,319,320],[164,223],[62,164,179,192,231],[62,164,179,190,192],[62,164,179,192],[62,164,189,191],[164,179],[79,82,164,172,175,182,339],[79,84,164,172,173,174,175,176,181,182,183,316,317,321,323,339,341],[164,172,175,176,182,316],[82,164,172,175,182,316],[79,82,164,173,175,182,183,315,339,341,349],[79,82,164,172,173,175,176,182,183,315,316,339,341,343,344,350],[79,84,164,173,174,180,181,182,183,184,321,340,341,342,351,352,353,354,355],[82,164,172,173,176,181,182,183,323,339],[74,164],[164,201,214,215,216],[77,78,164],[77,164],[75,164],[164,195],[76,164],[76,164,197],[78,164,196,197,198,199,200],[74,75,76,77,164,195],[74,75,76,164],[164,345,346,347,348],[164,346],[164,346,347],[71,164],[64,164],[64,71,164],[62,64,164],[64,65,66,67,68,69,70,164],[164,218],[164,213,218,219,221,222,223,224],[164,201,217],[96,100,163,164],[96,152,163,164],[91,164],[93,96,160,163,164],[142,160,164],[164,171],[91,164,171],[93,96,142,163,164],[88,89,92,95,122,134,152,163,164],[88,94,164],[92,96,122,155,163,164,171],[122,164,171],[112,122,164,171],[90,91,164,171],[96,164],[90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,113,114,115,116,117,118,164],[96,103,104,164],[94,96,104,105,164],[95,164],[88,91,96,164],[96,100,104,105,164],[100,164],[94,96,99,163,164],[88,93,94,96,100,103,164],[122,152,164],[91,96,112,122,164,168,171],[62,73,79,164,187],[62,63,164,185,186],[63,73,164,184],[62,63,164,185,187],[164,260],[62,127,164,185,188,241,245,246,260],[62,63,164,185,187,188,248,255,257,259],[61,62,164,179,193,230,262],[62,63,72,164,187,192],[62,63,72,73,79,164,185,187,188,193,194,220,227,229,230,232],[62,63,72,164,186,187,188,222,225,227],[62,63,72,164,185,187,220,228],[73,164,184,188,260,264],[61,62,164,185,187,223,226],[164,173],[61,62,63,72,73,79,164,173,179,183,184,185,188,192,193,220,230,232,233,234,235,261,262,263],[63,72,164],[62,71,72,164],[62,63,73,79,164,211,212,213,219],[164,264,268],[79,164,279],[122,164,185,187,220,222,223,229,260,276,371],[62,164,173,219,232,234,264,265,276,278,280],[82,135,164,211,212,226,265,288,291,328,334,336,337,338,356,357,363],[61,62,79,122,164,193,219,220,222,223,229,231,232,233,234,260,264,276,278,280,365,371],[79,164,185,210,370],[79,122,164,220,222,232,233,234,261,276,280],[62,73,79,187],[62,63,185,186],[63,73,184],[62,63,185,187],[265],[188],[62,179,230,262],[62,63,187,192],[62,63,73,79,185,187,188,229,230,232],[62,63,186,187,188],[63,185,187,228],[73,184,188,260,264],[62,185,187,226],[173],[62,63,73,79,173,179,183,184,185,188],[63],[62,71],[62,63,73,79],[79],[79,185,210]],"referencedMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,49],[173,50],[353,51],[79,52],[83,53],[174,54],[175,53],[292,55],[176,5],[177,50],[180,56],[285,5],[178,57],[181,58],[329,59],[330,59],[334,60],[331,59],[332,59],[333,59],[327,61],[322,62],[326,63],[325,30],[354,64],[226,65],[315,66],[314,65],[312,65],[313,65],[279,67],[212,68],[355,69],[336,70],[335,71],[81,35],[82,72],[80,35],[248,73],[247,5],[251,74],[252,75],[253,75],[250,5],[254,5],[249,5],[255,76],[258,77],[257,77],[259,78],[256,5],[378,79],[271,80],[275,80],[273,80],[270,5],[380,81],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,82],[391,83],[397,84],[395,5],[394,85],[396,86],[405,87],[400,88],[402,89],[403,90],[404,91],[398,5],[399,91],[401,91],[393,91],[392,5],[408,92],[387,5],[386,5],[389,83],[390,93],[388,83],[409,5],[410,5],[411,5],[379,5],[85,94],[86,94],[121,95],[122,96],[123,97],[124,98],[125,99],[126,100],[127,101],[128,102],[129,103],[130,104],[131,104],[133,105],[132,106],[134,107],[135,108],[136,109],[120,110],[170,5],[137,111],[138,112],[139,113],[171,114],[140,115],[141,116],[142,117],[143,118],[144,119],[145,120],[146,121],[147,122],[148,123],[149,124],[150,124],[151,125],[152,126],[154,127],[153,128],[155,129],[156,130],[157,131],[158,132],[159,133],[160,134],[161,135],[162,136],[163,137],[164,138],[165,139],[166,140],[167,141],[168,142],[169,143],[412,5],[413,5],[377,144],[414,5],[439,145],[440,146],[415,147],[418,147],[437,145],[438,145],[428,145],[427,148],[425,145],[420,145],[433,145],[431,145],[435,145],[419,145],[432,145],[436,145],[421,145],[422,145],[434,145],[416,145],[423,145],[424,145],[426,145],[430,145],[441,149],[429,145],[417,145],[454,150],[453,5],[448,149],[450,151],[449,149],[442,149],[443,149],[445,149],[447,149],[451,151],[452,151],[444,151],[446,151],[278,152],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,153],[460,154],[276,155],[87,5],[274,80],[272,156],[305,5],[345,5],[337,157],[338,5],[321,158],[319,159],[320,5],[365,5],[231,32],[232,160],[191,161],[189,162],[192,163],[234,164],[235,164],[282,5],[190,32],[179,5],[375,105],[340,165],[342,166],[343,167],[344,168],[350,169],[351,170],[356,171],[352,172],[216,173],[74,5],[217,174],[75,175],[200,5],[78,176],[195,177],[215,178],[214,178],[197,179],[198,180],[76,5],[201,181],[196,182],[77,183],[199,5],[357,5],[349,184],[347,185],[348,186],[346,5],[324,5],[293,5],[294,11],[64,187],[67,188],[68,189],[65,190],[66,188],[71,191],[69,30],[70,187],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[62,5],[72,5],[221,5],[213,5],[222,5],[219,192],[225,193],[223,192],[218,194],[224,5],[103,195],[110,196],[102,195],[117,197],[94,198],[93,199],[116,200],[111,201],[114,202],[96,203],[95,204],[91,205],[90,206],[113,207],[92,208],[97,209],[98,5],[101,209],[88,5],[119,210],[118,209],[105,211],[106,212],[108,213],[104,214],[107,215],[112,200],[99,216],[100,217],[109,218],[89,219],[115,220],[246,5],[63,5],[230,221],[187,222],[185,223],[61,5],[188,224],[266,225],[261,226],[260,227],[263,228],[193,229],[233,230],[228,231],[229,232],[265,233],[227,234],[262,235],[264,236],[186,237],[73,238],[220,239],[269,240],[280,241],[374,242],[281,243],[364,244],[372,245],[371,246],[373,247]],"exportedModulesMap":[[240,1],[238,2],[241,3],[239,4],[236,5],[237,5],[242,5],[245,6],[244,7],[243,5],[311,5],[318,8],[298,9],[296,10],[295,11],[300,12],[304,13],[308,14],[306,15],[301,5],[299,5],[307,16],[303,17],[309,18],[310,19],[297,20],[302,5],[283,21],[284,5],[288,22],[287,23],[286,24],[366,5],[367,5],[370,25],[204,26],[202,27],[205,28],[211,29],[203,5],[206,26],[207,30],[208,27],[209,27],[368,5],[369,5],[291,31],[289,30],[290,32],[328,33],[268,34],[267,5],[323,35],[316,36],[317,37],[339,38],[363,39],[359,5],[360,40],[362,41],[358,5],[361,42],[184,43],[341,44],[183,45],[84,46],[194,5],[172,47],[182,48],[210,49],[173,50],[353,51],[79,52],[83,53],[174,54],[175,53],[292,55],[176,5],[177,50],[180,56],[285,5],[178,57],[181,58],[329,59],[330,59],[334,60],[331,59],[332,59],[333,59],[327,61],[322,62],[326,63],[325,30],[354,64],[226,65],[315,66],[314,65],[312,65],[313,65],[279,67],[212,68],[355,69],[336,70],[335,71],[81,35],[82,72],[80,35],[248,73],[247,5],[251,74],[252,75],[253,75],[250,5],[254,5],[249,5],[255,76],[258,77],[257,77],[259,78],[256,5],[378,79],[271,80],[275,80],[273,80],[270,5],[380,81],[376,5],[381,5],[382,5],[383,5],[384,47],[385,5],[406,82],[391,83],[397,84],[395,5],[394,85],[396,86],[405,87],[400,88],[402,89],[403,90],[404,91],[398,5],[399,91],[401,91],[393,91],[392,5],[408,92],[387,5],[386,5],[389,83],[390,93],[388,83],[409,5],[410,5],[411,5],[379,5],[85,94],[86,94],[121,95],[122,96],[123,97],[124,98],[125,99],[126,100],[127,101],[128,102],[129,103],[130,104],[131,104],[133,105],[132,106],[134,107],[135,108],[136,109],[120,110],[170,5],[137,111],[138,112],[139,113],[171,114],[140,115],[141,116],[142,117],[143,118],[144,119],[145,120],[146,121],[147,122],[148,123],[149,124],[150,124],[151,125],[152,126],[154,127],[153,128],[155,129],[156,130],[157,131],[158,132],[159,133],[160,134],[161,135],[162,136],[163,137],[164,138],[165,139],[166,140],[167,141],[168,142],[169,143],[412,5],[413,5],[377,144],[414,5],[439,145],[440,146],[415,147],[418,147],[437,145],[438,145],[428,145],[427,148],[425,145],[420,145],[433,145],[431,145],[435,145],[419,145],[432,145],[436,145],[421,145],[422,145],[434,145],[416,145],[423,145],[424,145],[426,145],[430,145],[441,149],[429,145],[417,145],[454,150],[453,5],[448,149],[450,151],[449,149],[442,149],[443,149],[445,149],[447,149],[451,151],[452,151],[444,151],[446,151],[278,152],[277,5],[455,5],[456,5],[457,5],[407,5],[458,5],[459,153],[460,154],[276,155],[87,5],[274,80],[272,156],[305,5],[345,5],[337,157],[338,5],[321,158],[319,159],[320,5],[365,5],[231,32],[232,160],[191,161],[189,162],[192,163],[234,164],[235,164],[282,5],[190,32],[179,5],[375,105],[340,165],[342,166],[343,167],[344,168],[350,169],[351,170],[356,171],[352,172],[216,173],[74,5],[217,174],[75,175],[200,5],[78,176],[195,177],[215,178],[214,178],[197,179],[198,180],[76,5],[201,181],[196,182],[77,183],[199,5],[357,5],[349,184],[347,185],[348,186],[346,5],[324,5],[293,5],[294,11],[64,187],[67,188],[68,189],[65,190],[66,188],[71,191],[69,30],[70,187],[59,5],[60,5],[10,5],[11,5],[14,5],[13,5],[2,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[22,5],[3,5],[4,5],[23,5],[27,5],[24,5],[25,5],[26,5],[28,5],[29,5],[30,5],[5,5],[31,5],[32,5],[33,5],[34,5],[6,5],[38,5],[35,5],[36,5],[37,5],[39,5],[7,5],[40,5],[45,5],[46,5],[41,5],[42,5],[43,5],[44,5],[8,5],[50,5],[47,5],[48,5],[49,5],[51,5],[9,5],[52,5],[53,5],[54,5],[57,5],[55,5],[56,5],[1,5],[58,5],[12,5],[62,5],[72,5],[221,5],[213,5],[222,5],[219,192],[225,193],[223,192],[218,194],[224,5],[103,195],[110,196],[102,195],[117,197],[94,198],[93,199],[116,200],[111,201],[114,202],[96,203],[95,204],[91,205],[90,206],[113,207],[92,208],[97,209],[98,5],[101,209],[88,5],[119,210],[118,209],[105,211],[106,212],[108,213],[104,214],[107,215],[112,200],[99,216],[100,217],[109,218],[89,219],[115,220],[246,5],[230,248],[187,249],[185,250],[188,251],[266,252],[261,253],[260,253],[263,254],[193,255],[233,256],[228,257],[229,258],[265,259],[227,260],[262,261],[264,262],[186,263],[73,264],[220,265],[280,266],[371,267]],"semanticDiagnosticsPerFile":[240,238,241,239,236,237,242,245,244,243,311,318,298,296,295,300,304,308,306,301,299,307,303,309,310,297,302,283,284,288,287,286,366,367,370,204,202,205,211,203,206,207,208,209,368,369,291,289,290,328,268,267,323,316,317,339,363,359,360,362,358,361,184,341,183,84,194,172,182,210,173,353,79,83,174,175,292,176,177,180,285,178,181,329,330,334,331,332,333,327,322,326,325,354,226,315,314,312,313,279,212,355,336,335,81,82,80,248,247,251,252,253,250,254,249,255,258,257,259,256,378,271,275,273,270,380,376,381,382,383,384,385,406,391,397,395,394,396,405,400,402,403,404,398,399,401,393,392,408,387,386,389,390,388,409,410,411,379,85,86,121,122,123,124,125,126,127,128,129,130,131,133,132,134,135,136,120,170,137,138,139,171,140,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,412,413,377,414,439,440,415,418,437,438,428,427,425,420,433,431,435,419,432,436,421,422,434,416,423,424,426,430,441,429,417,454,453,448,450,449,442,443,445,447,451,452,444,446,278,277,455,456,457,407,458,459,460,276,87,274,272,305,345,337,338,321,319,320,365,231,232,191,189,192,234,235,282,190,179,375,340,342,343,344,350,351,356,352,216,74,217,75,200,78,195,215,214,197,198,76,201,196,77,199,357,349,347,348,346,324,293,294,64,67,68,65,66,71,69,70,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,62,72,221,213,222,219,225,223,218,224,103,110,102,117,94,93,116,111,114,96,95,91,90,113,92,97,98,101,88,119,118,105,106,108,104,107,112,99,100,109,89,115,246,63,230,187,185,61,188,266,261,260,263,193,233,228,229,265,227,262,264,186,73,220,269,280,374,281,364,372,371,373],"latestChangedDtsFile":"./src/utils.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/package.json index f57d80eba..d39d47add 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/package.json +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/package.json @@ -69,10 +69,10 @@ "dependencies": { "@chainsafe/as-chacha20poly1305": "^0.1.0", "@chainsafe/as-sha256": "^0.4.1", - "@libp2p/crypto": "^2.0.0", - "@libp2p/interface": "^0.1.0", - "@libp2p/logger": "^3.0.0", - "@libp2p/peer-id": "^3.0.0", + "@libp2p/crypto": "file:../crypto", + "@libp2p/interface": "file:../interface", + "@libp2p/logger": "next", + "@libp2p/peer-id": "next", "@noble/ciphers": "^0.4.0", "@noble/curves": "^1.1.0", "@noble/hashes": "^1.3.1", @@ -87,28 +87,6 @@ "uint8arrays": "^4.0.4", "wherearewe": "^2.0.1" }, - "devDependencies": { - "@chainsafe/libp2p-yamux": "^5.0.0", - "@libp2p/daemon-client": "^7.0.0", - "@libp2p/daemon-server": "^6.0.0", - "@libp2p/interface-compliance-tests": "^4.0.0", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interop": "^9.0.0", - "@libp2p/peer-id-factory": "^3.0.0", - "@libp2p/tcp": "^8.0.0", - "@multiformats/multiaddr": "^12.1.0", - "@types/sinon": "^17.0.1", - "aegir": "^40.0.8", - "benchmark": "^2.1.4", - "execa": "^8.0.1", - "go-libp2p": "^1.0.3", - "iso-random-stream": "^2.0.2", - "libp2p": "^0.46.0", - "mkdirp": "^3.0.0", - "p-defer": "^4.0.0", - "protons": "^7.0.0", - "sinon": "^17.0.1" - }, "browser": { "./dist/src/crypto/index.js": "./dist/src/crypto/index.browser.js", "util": false diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake-interface.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake-interface.ts index 9b402b1fd..a67b44d13 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake-interface.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake-interface.ts @@ -1,12 +1,12 @@ -import type { bytes } from './basic.js' import type { NoiseSession } from './handshake.js' import type { NoiseExtensions } from '../proto/payload.js' import type { PeerId } from '@libp2p/interface/peer-id' +import type { Uint8ArrayList } from 'uint8arraylist' export interface IHandshake { session: NoiseSession remotePeer: PeerId remoteExtensions: NoiseExtensions - encrypt: (plaintext: bytes, session: NoiseSession) => bytes - decrypt: (ciphertext: bytes, session: NoiseSession, dst?: Uint8Array) => { plaintext: bytes, valid: boolean } + encrypt: (plaintext: Uint8Array | Uint8ArrayList, session: NoiseSession) => Uint8Array | Uint8ArrayList + decrypt: (ciphertext: Uint8Array | Uint8ArrayList, session: NoiseSession, dst?: Uint8Array) => { plaintext: Uint8Array | Uint8ArrayList, valid: boolean } } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake.ts index ec333b703..46754ea61 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/@types/handshake.ts @@ -1,13 +1,14 @@ import type { bytes, bytes32, uint64 } from './basic.js' import type { KeyPair } from './libp2p.js' import type { Nonce } from '../nonce.js' +import type { Uint8ArrayList } from 'uint8arraylist' export type Hkdf = [bytes, bytes, bytes] export interface MessageBuffer { ne: bytes32 - ns: bytes - ciphertext: bytes + ns: Uint8Array | Uint8ArrayList + ciphertext: Uint8Array | Uint8ArrayList } export interface CipherState { @@ -27,7 +28,7 @@ export interface HandshakeState { ss: SymmetricState s: KeyPair e?: KeyPair - rs: bytes32 + rs: Uint8Array | Uint8ArrayList re: bytes32 psk: bytes32 } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto.ts index 108dfee1c..b7d1bd44c 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto.ts @@ -1,16 +1,17 @@ -import type { bytes32, bytes } from './@types/basic.js' +import { type Uint8ArrayList } from 'uint8arraylist' +import type { bytes32 } from './@types/basic.js' import type { Hkdf } from './@types/handshake.js' import type { KeyPair } from './@types/libp2p.js' export interface ICryptoInterface { - hashSHA256: (data: Uint8Array) => Uint8Array + hashSHA256: (data: Uint8Array | Uint8ArrayList) => Uint8Array getHKDF: (ck: bytes32, ikm: Uint8Array) => Hkdf generateX25519KeyPair: () => KeyPair generateX25519KeyPairFromSeed: (seed: Uint8Array) => KeyPair - generateX25519SharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Uint8Array + generateX25519SharedKey: (privateKey: Uint8Array | Uint8ArrayList, publicKey: Uint8Array | Uint8ArrayList) => Uint8Array - chaCha20Poly1305Encrypt: (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => bytes - chaCha20Poly1305Decrypt: (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => bytes | null + chaCha20Poly1305Encrypt: (plaintext: Uint8Array | Uint8ArrayList, nonce: Uint8Array, ad: Uint8Array, k: bytes32) => Uint8ArrayList | Uint8Array + chaCha20Poly1305Decrypt: (ciphertext: Uint8Array | Uint8ArrayList, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array) => Uint8ArrayList | Uint8Array | null } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/index.ts index 946799c9b..3b57d9830 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/index.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/index.ts @@ -1,6 +1,7 @@ import crypto from 'node:crypto' import { newInstance, ChaCha20Poly1305 } from '@chainsafe/as-chacha20poly1305' import { digest } from '@chainsafe/as-sha256' +import { Uint8ArrayList } from 'uint8arraylist' import { isElectronMain } from 'wherearewe' import { pureJsCrypto } from './js.js' import type { KeyPair } from '../@types/libp2p.js' @@ -13,7 +14,17 @@ const PKCS8_PREFIX = Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06 const X25519_PREFIX = Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]) const nodeCrypto: Pick = { hashSHA256 (data) { - return crypto.createHash('sha256').update(data).digest() + const hash = crypto.createHash('sha256') + + if (data instanceof Uint8Array) { + return hash.update(data).digest() + } + + for (const buf of data) { + hash.update(buf) + } + + return hash.digest() }, chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { @@ -21,42 +32,87 @@ const nodeCrypto: Pick 0) { + output.append(final) + } + + output.append(cipher.getAuthTag()) + + return output }, chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, _dst) { const authTag = ciphertext.subarray(ciphertext.length - 16) - const text = ciphertext.subarray(0, ciphertext.length - 16) const decipher = crypto.createDecipheriv(CHACHA_POLY1305, k, nonce, { authTagLength: 16 }) + + let text: Uint8Array | Uint8ArrayList + + if (ciphertext instanceof Uint8Array) { + text = ciphertext.subarray(0, ciphertext.length - 16) + } else { + text = ciphertext.sublist(0, ciphertext.length - 16) + } + decipher.setAAD(ad, { plaintextLength: text.byteLength }) decipher.setAuthTag(authTag) - const updated = decipher.update(text) + + if (text instanceof Uint8Array) { + const output = decipher.update(text) + const final = decipher.final() + + if (final.byteLength > 0) { + return Buffer.concat([output, final], output.byteLength + final.byteLength) + } + + return output + } + + const output = new Uint8ArrayList() + + for (const buf of text) { + output.append(decipher.update(buf)) + } + const final = decipher.final() + if (final.byteLength > 0) { - return Buffer.concat([updated, final], updated.byteLength + final.byteLength) + output.append(final) } - return updated + + return output } } const asCrypto: Pick = { hashSHA256 (data) { - return digest(data) + return digest(data.subarray()) }, chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - return asImpl.seal(k, nonce, plaintext, ad) + return asImpl.seal(k, nonce, plaintext.subarray(), ad) }, chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - return asImpl.open(k, nonce, ciphertext, ad, dst) + return asImpl.open(k, nonce, ciphertext.subarray(), ad, dst) } } @@ -69,13 +125,13 @@ export const defaultCrypto: ICryptoInterface = { return nodeCrypto.hashSHA256(data) }, chaCha20Poly1305Encrypt (plaintext, nonce, ad, k) { - if (plaintext.length < 1200) { + if (plaintext.byteLength < 1200) { return asCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) } return nodeCrypto.chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) }, chaCha20Poly1305Decrypt (ciphertext, nonce, ad, k, dst) { - if (ciphertext.length < 1200) { + if (ciphertext.byteLength < 1200) { return asCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) } return nodeCrypto.chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) @@ -118,16 +174,26 @@ export const defaultCrypto: ICryptoInterface = { privateKey: seed } }, - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - publicKey = Buffer.concat([ - X25519_PREFIX, - publicKey - ], X25519_PREFIX.byteLength + publicKey.byteLength) - - privateKey = Buffer.concat([ - PKCS8_PREFIX, - privateKey - ], PKCS8_PREFIX.byteLength + privateKey.byteLength) + generateX25519SharedKey (privateKey: Uint8Array | Uint8ArrayList, publicKey: Uint8Array | Uint8ArrayList): Uint8Array { + if (publicKey instanceof Uint8Array) { + publicKey = Buffer.concat([ + X25519_PREFIX, + publicKey + ], X25519_PREFIX.byteLength + publicKey.byteLength) + } else { + publicKey.prepend(X25519_PREFIX) + publicKey = publicKey.subarray() + } + + if (privateKey instanceof Uint8Array) { + privateKey = Buffer.concat([ + PKCS8_PREFIX, + privateKey + ], PKCS8_PREFIX.byteLength + privateKey.byteLength) + } else { + privateKey.prepend(PKCS8_PREFIX) + privateKey = privateKey.subarray() + } return crypto.diffieHellman({ publicKey: crypto.createPublicKey({ diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/js.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/js.ts index e47d4761b..034a0a3dd 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/js.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/js.ts @@ -2,14 +2,15 @@ import { chacha20poly1305 } from '@noble/ciphers/chacha' import { x25519 } from '@noble/curves/ed25519' import { extract, expand } from '@noble/hashes/hkdf' import { sha256 } from '@noble/hashes/sha256' -import type { bytes, bytes32 } from '../@types/basic.js' +import type { bytes32 } from '../@types/basic.js' import type { Hkdf } from '../@types/handshake.js' import type { KeyPair } from '../@types/libp2p.js' import type { ICryptoInterface } from '../crypto.js' +import type { Uint8ArrayList } from 'uint8arraylist' export const pureJsCrypto: ICryptoInterface = { - hashSHA256 (data: Uint8Array): Uint8Array { - return sha256(data) + hashSHA256 (data: Uint8Array | Uint8ArrayList): Uint8Array { + return sha256(data.subarray()) }, getHKDF (ck: bytes32, ikm: Uint8Array): Hkdf { @@ -43,15 +44,15 @@ export const pureJsCrypto: ICryptoInterface = { } }, - generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array { - return x25519.getSharedSecret(privateKey, publicKey) + generateX25519SharedKey (privateKey: Uint8Array | Uint8ArrayList, publicKey: Uint8Array | Uint8ArrayList): Uint8Array { + return x25519.getSharedSecret(privateKey.subarray(), publicKey.subarray()) }, - chaCha20Poly1305Encrypt (plaintext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32): bytes { - return chacha20poly1305(k, nonce, ad).encrypt(plaintext) + chaCha20Poly1305Encrypt (plaintext: Uint8Array | Uint8ArrayList, nonce: Uint8Array, ad: Uint8Array, k: bytes32): Uint8Array { + return chacha20poly1305(k, nonce, ad).encrypt(plaintext.subarray()) }, - chaCha20Poly1305Decrypt (ciphertext: Uint8Array, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array): bytes | null { - return chacha20poly1305(k, nonce, ad).decrypt(ciphertext, dst) + chaCha20Poly1305Decrypt (ciphertext: Uint8Array | Uint8ArrayList, nonce: Uint8Array, ad: Uint8Array, k: bytes32, dst?: Uint8Array): Uint8Array | null { + return chacha20poly1305(k, nonce, ad).decrypt(ciphertext.subarray(), dst) } } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts index b4ae0cc75..a9d56fbf4 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/crypto/streaming.ts @@ -17,12 +17,12 @@ export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry) end = chunk.length } - let data: Uint8Array + let data: Uint8Array | Uint8ArrayList - if (i === 0 && end === chunk.byteLength && chunk instanceof Uint8Array) { - data = handshake.encrypt(chunk, handshake.session) - } else { + if (chunk instanceof Uint8Array) { data = handshake.encrypt(chunk.subarray(i, end), handshake.session) + } else { + data = handshake.encrypt(chunk.sublist(i, end), handshake.session) } metrics?.encryptedPackets.increment() @@ -34,7 +34,7 @@ export function encryptStream (handshake: IHandshake, metrics?: MetricsRegistry) } // Decrypt received payload to the user -export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator> { +export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry): Transform, AsyncGenerator> { return async function * (source) { for await (const chunk of source) { for (let i = 0; i < chunk.length; i += NOISE_MSG_MAX_LENGTH_BYTES) { @@ -47,7 +47,7 @@ export function decryptStream (handshake: IHandshake, metrics?: MetricsRegistry) throw new Error('Invalid chunk') } - const encrypted = chunk.subarray(i, end) + const encrypted = chunk.sublist(i, end) // memory allocation is not cheap so reuse the encrypted Uint8Array // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164 // this is ok because chacha20 reads bytes one by one and don't reread after that diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshake-xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshake-xx.ts index 3b547dc03..d438a4178 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshake-xx.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshake-xx.ts @@ -23,6 +23,7 @@ import type { ICryptoInterface } from './crypto.js' import type { NoiseExtensions } from './proto/payload.js' import type { PeerId } from '@libp2p/interface/peer-id' import type { LengthPrefixedStream } from 'it-length-prefixed-stream' +import type { Uint8ArrayList } from 'uint8arraylist' export class XXHandshake implements IHandshake { public isInitiator: boolean @@ -142,19 +143,19 @@ export class XXHandshake implements IHandshake { logCipherState(this.session) } - public encrypt (plaintext: Uint8Array, session: NoiseSession): bytes { + public encrypt (plaintext: Uint8Array | Uint8ArrayList, session: NoiseSession): Uint8Array | Uint8ArrayList { const cs = this.getCS(session) return this.xx.encryptWithAd(cs, uint8ArrayAlloc(0), plaintext) } - public decrypt (ciphertext: Uint8Array, session: NoiseSession, dst?: Uint8Array): { plaintext: bytes, valid: boolean } { + public decrypt (ciphertext: Uint8Array | Uint8ArrayList, session: NoiseSession, dst?: Uint8Array): { plaintext: Uint8Array | Uint8ArrayList, valid: boolean } { const cs = this.getCS(session, false) return this.xx.decryptWithAd(cs, uint8ArrayAlloc(0), ciphertext, dst) } - public getRemoteStaticKey (): bytes { + public getRemoteStaticKey (): Uint8Array | Uint8ArrayList { return this.session.hs.rs } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/abstract-handshake.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/abstract-handshake.ts index 308d298c5..cbe3a55ed 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/abstract-handshake.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/abstract-handshake.ts @@ -1,6 +1,6 @@ +import { Uint8ArrayList } from 'uint8arraylist' import { fromString as uint8ArrayFromString } from 'uint8arrays' import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc' -import { concat as uint8ArrayConcat } from 'uint8arrays/concat' import { equals as uint8ArrayEquals } from 'uint8arrays/equals' import { logger } from '../logger.js' import { Nonce } from '../nonce.js' @@ -9,7 +9,7 @@ import type { CipherState, MessageBuffer, SymmetricState } from '../@types/hands import type { ICryptoInterface } from '../crypto.js' export interface DecryptedResult { - plaintext: bytes + plaintext: Uint8ArrayList | Uint8Array valid: boolean } @@ -25,14 +25,14 @@ export abstract class AbstractHandshake { this.crypto = crypto } - public encryptWithAd (cs: CipherState, ad: Uint8Array, plaintext: Uint8Array): bytes { + public encryptWithAd (cs: CipherState, ad: Uint8Array, plaintext: Uint8Array | Uint8ArrayList): Uint8Array | Uint8ArrayList { const e = this.encrypt(cs.k, cs.n, ad, plaintext) cs.n.increment() return e } - public decryptWithAd (cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array, dst?: Uint8Array): DecryptedResult { + public decryptWithAd (cs: CipherState, ad: Uint8Array, ciphertext: Uint8Array | Uint8ArrayList, dst?: Uint8Array): DecryptedResult { const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst) if (valid) cs.n.increment() @@ -53,13 +53,13 @@ export abstract class AbstractHandshake { return uint8ArrayEquals(emptyKey, k) } - protected encrypt (k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array): bytes { + protected encrypt (k: bytes32, n: Nonce, ad: Uint8Array, plaintext: Uint8Array | Uint8ArrayList): Uint8Array | Uint8ArrayList { n.assertValue() return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k) } - protected encryptAndHash (ss: SymmetricState, plaintext: bytes): bytes { + protected encryptAndHash (ss: SymmetricState, plaintext: bytes): Uint8Array | Uint8ArrayList { let ciphertext if (this.hasKey(ss.cs)) { ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext) @@ -71,7 +71,7 @@ export abstract class AbstractHandshake { return ciphertext } - protected decrypt (k: bytes32, n: Nonce, ad: bytes, ciphertext: bytes, dst?: Uint8Array): DecryptedResult { + protected decrypt (k: bytes32, n: Nonce, ad: bytes, ciphertext: Uint8Array | Uint8ArrayList, dst?: Uint8Array): DecryptedResult { n.assertValue() const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst) @@ -89,8 +89,9 @@ export abstract class AbstractHandshake { } } - protected decryptAndHash (ss: SymmetricState, ciphertext: bytes): DecryptedResult { - let plaintext: bytes; let valid = true + protected decryptAndHash (ss: SymmetricState, ciphertext: Uint8Array | Uint8ArrayList): DecryptedResult { + let plaintext: Uint8Array | Uint8ArrayList + let valid = true if (this.hasKey(ss.cs)) { ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext)) } else { @@ -101,7 +102,7 @@ export abstract class AbstractHandshake { return { plaintext, valid } } - protected dh (privateKey: bytes32, publicKey: bytes32): bytes32 { + protected dh (privateKey: bytes32, publicKey: Uint8Array | Uint8ArrayList): bytes32 { try { const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey) @@ -117,12 +118,12 @@ export abstract class AbstractHandshake { } } - protected mixHash (ss: SymmetricState, data: bytes): void { + protected mixHash (ss: SymmetricState, data: Uint8Array | Uint8ArrayList): void { ss.h = this.getHash(ss.h, data) } - protected getHash (a: Uint8Array, b: Uint8Array): bytes32 { - const u = this.crypto.hashSHA256(uint8ArrayConcat([a, b], a.length + b.length)) + protected getHash (a: Uint8Array, b: Uint8Array | Uint8ArrayList): Uint8Array { + const u = this.crypto.hashSHA256(new Uint8ArrayList(a, b)) return u } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/xx.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/xx.ts index 61077388f..5a41e3bb5 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/xx.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/handshakes/xx.ts @@ -4,6 +4,7 @@ import { AbstractHandshake, type DecryptedResult } from './abstract-handshake.js import type { bytes32, bytes } from '../@types/basic.js' import type { CipherState, HandshakeState, MessageBuffer, NoiseSession } from '../@types/handshake.js' import type { KeyPair } from '../@types/libp2p.js' +import type { Uint8ArrayList } from 'uint8arraylist' export class XX extends AbstractHandshake { private initializeInitiator (prologue: bytes32, s: KeyPair, rs: bytes32, psk: bytes32): HandshakeState { @@ -96,7 +97,7 @@ export class XX extends AbstractHandshake { return { plaintext, valid: (valid1 && valid2) } } - private readMessageC (hs: HandshakeState, message: MessageBuffer): { h: bytes, plaintext: bytes, valid: boolean, cs1: CipherState, cs2: CipherState } { + private readMessageC (hs: HandshakeState, message: MessageBuffer): { h: bytes, plaintext: Uint8Array | Uint8ArrayList, valid: boolean, cs1: CipherState, cs2: CipherState } { const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns) if (valid1 && isValidPublicKey(ns)) { hs.rs = ns @@ -165,7 +166,7 @@ export class XX extends AbstractHandshake { } public recvMessage (session: NoiseSession, message: MessageBuffer): DecryptedResult { - let plaintext: bytes = uint8ArrayAlloc(0) + let plaintext: Uint8Array | Uint8ArrayList = uint8ArrayAlloc(0) let valid = false if (session.mc === 0) { ({ plaintext, valid } = this.readMessageA(session.hs, message)) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/logger.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/logger.ts index b44ca7b42..1a70d1472 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/logger.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/logger.ts @@ -3,6 +3,7 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string' import { DUMP_SESSION_KEYS } from './constants.js' import type { NoiseSession } from './@types/handshake.js' import type { KeyPair } from './@types/libp2p.js' +import type { Uint8ArrayList } from 'uint8arraylist' const log = logger('libp2p:noise') @@ -20,11 +21,19 @@ if (DUMP_SESSION_KEYS) { } export function logLocalStaticKeys (s: KeyPair): void { + if (!keyLogger.enabled) { + return + } + keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${uint8ArrayToString(s.publicKey, 'hex')}`) keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${uint8ArrayToString(s.privateKey, 'hex')}`) } export function logLocalEphemeralKeys (e: KeyPair | undefined): void { + if (!keyLogger.enabled) { + return + } + if (e) { keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${uint8ArrayToString(e.publicKey, 'hex')}`) keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${uint8ArrayToString(e.privateKey, 'hex')}`) @@ -33,15 +42,27 @@ export function logLocalEphemeralKeys (e: KeyPair | undefined): void { } } -export function logRemoteStaticKey (rs: Uint8Array): void { - keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs, 'hex')}`) +export function logRemoteStaticKey (rs: Uint8Array | Uint8ArrayList): void { + if (!keyLogger.enabled) { + return + } + + keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${uint8ArrayToString(rs.subarray(), 'hex')}`) } -export function logRemoteEphemeralKey (re: Uint8Array): void { - keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re, 'hex')}`) +export function logRemoteEphemeralKey (re: Uint8Array | Uint8ArrayList): void { + if (!keyLogger.enabled) { + return + } + + keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${uint8ArrayToString(re.subarray(), 'hex')}`) } export function logCipherState (session: NoiseSession): void { + if (!keyLogger.enabled) { + return + } + if (session.cs1 && session.cs2) { keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${uint8ArrayToString(session.cs1.k, 'hex')}`) keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${uint8ArrayToString(session.cs2.k, 'hex')}`) diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/utils.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/utils.ts index 993c9628c..4c6557779 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/utils.ts +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/noise/src/utils.ts @@ -1,5 +1,6 @@ import { unmarshalPublicKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' import { peerIdFromKeys } from '@libp2p/peer-id' +import { type Uint8ArrayList, isUint8ArrayList } from 'uint8arraylist' import { concat as uint8ArrayConcat } from 'uint8arrays/concat' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { type NoiseExtensions, NoiseHandshakePayload } from './proto/payload.js' @@ -36,7 +37,7 @@ export function createHandshakePayload ( }).subarray() } -export async function signPayload (peerId: PeerId, payload: bytes): Promise { +export async function signPayload (peerId: PeerId, payload: Uint8Array | Uint8ArrayList): Promise { if (peerId.privateKey == null) { throw new Error('PrivateKey was missing from PeerId') } @@ -50,13 +51,20 @@ export async function getPeerIdFromPayload (payload: NoiseHandshakePayload): Pro return peerIdFromKeys(payload.identityKey) } -export function decodePayload (payload: bytes | Uint8Array): NoiseHandshakePayload { +export function decodePayload (payload: Uint8Array | Uint8ArrayList): NoiseHandshakePayload { return NoiseHandshakePayload.decode(payload) } -export function getHandshakePayload (publicKey: bytes): bytes { +export function getHandshakePayload (publicKey: Uint8Array | Uint8ArrayList): Uint8Array | Uint8ArrayList { const prefix = uint8ArrayFromString('noise-libp2p-static-key:') - return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length) + + if (publicKey instanceof Uint8Array) { + return uint8ArrayConcat([prefix, publicKey], prefix.length + publicKey.length) + } + + publicKey.prepend(prefix) + + return publicKey } /** @@ -68,7 +76,7 @@ export function getHandshakePayload (publicKey: bytes): bytes { * @returns {Promise} - peer ID of payload owner */ export async function verifySignedPayload ( - noiseStaticKey: bytes, + noiseStaticKey: Uint8Array | Uint8ArrayList, payload: NoiseHandshakePayload, remotePeer: PeerId ): Promise { @@ -98,12 +106,12 @@ export async function verifySignedPayload ( return payloadPeerId } -export function isValidPublicKey (pk: bytes): boolean { - if (!(pk instanceof Uint8Array)) { +export function isValidPublicKey (pk: Uint8Array | Uint8ArrayList): boolean { + if (!(pk instanceof Uint8Array) && !(isUint8ArrayList(pk))) { return false } - if (pk.length !== 32) { + if (pk.byteLength !== 32) { return false } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package-lock.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package-lock.json index 3313e70d9..ccb07b955 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package-lock.json +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package-lock.json @@ -10,7 +10,71 @@ "@chainsafe/libp2p-yamux": "^5.0.3", "@libp2p/perf": "next", "@libp2p/tcp": "next", - "libp2p": "next" + "libp2p": "file://./libp2p" + } + }, + "crypto": { + "version": "2.0.8", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "file:../interface", + "@noble/curves": "^1.1.0", + "@noble/hashes": "^1.3.1", + "multiformats": "^12.1.3", + "node-forge": "^1.1.0", + "protons-runtime": "^5.0.0", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^4.0.6" + } + }, + "interface": { + "version": "0.1.6", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.1.10", + "it-pushable": "^3.2.1", + "it-stream-types": "^2.0.1", + "multiformats": "^12.1.3", + "uint8arraylist": "^2.4.3" + } + }, + "libp2p": { + "version": "0.46.21", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "file:../crypto", + "@libp2p/interface": "file:../interface", + "@libp2p/interface-internal": "next", + "@libp2p/logger": "next", + "@libp2p/multistream-select": "next", + "@libp2p/peer-collections": "next", + "@libp2p/peer-id": "next", + "@libp2p/peer-id-factory": "next", + "@libp2p/peer-store": "next", + "@libp2p/utils": "file:../utils", + "@multiformats/mafmt": "^12.1.6", + "@multiformats/multiaddr": "^12.1.10", + "@multiformats/multiaddr-matcher": "^1.1.0", + "any-signal": "^4.1.1", + "datastore-core": "^9.0.1", + "delay": "^6.0.0", + "interface-datastore": "^8.2.0", + "it-all": "^3.0.2", + "it-drain": "^3.0.2", + "it-filter": "^3.0.1", + "it-first": "^3.0.3", + "it-map": "^3.0.4", + "it-merge": "^3.0.0", + "it-pipe": "^3.0.1", + "it-stream-types": "^2.0.1", + "merge-options": "^3.0.4", + "multiformats": "^12.1.3", + "p-defer": "^4.0.0", + "p-queue": "^7.4.1", + "private-ip": "^3.0.1", + "rate-limiter-flexible": "^3.0.0", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^4.0.6" } }, "node_modules/@chainsafe/as-chacha20poly1305": { @@ -29,9 +93,9 @@ "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" }, "node_modules/@chainsafe/libp2p-noise": { - "version": "13.0.3", - "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", - "integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", + "version": "13.0.4", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.4.tgz", + "integrity": "sha512-buE6CG/+7f4DP9emEETh3h8diEfCZep7K63w+fZErQ0idusNhfuypPo7gL1c75p172hzPHhBjcJibScnOw6dJA==", "dependencies": { "@chainsafe/as-chacha20poly1305": "^0.1.0", "@chainsafe/as-sha256": "^0.4.1", @@ -85,34 +149,12 @@ } }, "node_modules/@libp2p/crypto": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8.tgz", - "integrity": "sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA==", - "dependencies": { - "@libp2p/interface": "^0.1.6", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.0.1", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } + "resolved": "crypto", + "link": true }, "node_modules/@libp2p/interface": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", - "integrity": "sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.5", - "abortable-iterator": "^5.0.1", - "it-pushable": "^3.2.0", - "it-stream-types": "^2.0.1", - "multiformats": "^12.0.1", - "p-defer": "^4.0.0", - "race-signal": "^1.0.0", - "uint8arraylist": "^2.4.3" - } + "resolved": "interface", + "link": true }, "node_modules/@libp2p/interface-internal": { "version": "0.1.9-0b4a2ee79", @@ -322,6 +364,25 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/peer-record/node_modules/@libp2p/utils": { + "version": "4.0.7-0b4a2ee79", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-0b4a2ee79.tgz", + "integrity": "sha512-ZHjjlDvG5j+SDtcYNJUhONflbcHNbwdHZsHZlpjwaYyHb74ZvKzd9O5YJTXoAZyJgN2v0cJ814Pc2ObrjrqpTw==", + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/interface": "0.1.6-0b4a2ee79", + "@multiformats/multiaddr": "^12.1.10", + "@multiformats/multiaddr-matcher": "^1.1.0", + "get-iterator": "^2.0.1", + "is-loopback-addr": "^2.0.1", + "it-pushable": "^3.2.2", + "it-stream-types": "^2.0.1", + "p-queue": "^7.4.1", + "private-ip": "^3.0.1", + "race-signal": "^1.0.1", + "uint8arraylist": "^2.4.3" + } + }, "node_modules/@libp2p/peer-store": { "version": "9.0.9-0b4a2ee79", "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9-0b4a2ee79.tgz", @@ -412,7 +473,7 @@ "uint8arraylist": "^2.4.3" } }, - "node_modules/@libp2p/utils": { + "node_modules/@libp2p/tcp/node_modules/@libp2p/utils": { "version": "4.0.7-0b4a2ee79", "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-0b4a2ee79.tgz", "integrity": "sha512-ZHjjlDvG5j+SDtcYNJUhONflbcHNbwdHZsHZlpjwaYyHb74ZvKzd9O5YJTXoAZyJgN2v0cJ814Pc2ObrjrqpTw==", @@ -431,17 +492,9 @@ "uint8arraylist": "^2.4.3" } }, - "node_modules/@libp2p/utils/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } + "node_modules/@libp2p/utils": { + "resolved": "utils", + "link": true }, "node_modules/@multiformats/mafmt": { "version": "12.1.6", @@ -518,19 +571,6 @@ "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==" }, - "node_modules/abortable-iterator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz", - "integrity": "sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg==", - "dependencies": { - "get-iterator": "^2.0.0", - "it-stream-types": "^2.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/any-signal": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", @@ -826,93 +866,8 @@ "integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA==" }, "node_modules/libp2p": { - "version": "0.46.21-0b4a2ee79", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.46.21-0b4a2ee79.tgz", - "integrity": "sha512-WLThU38PZfc2nYzKCZdVgsuWALtkWavwSXQy4pNhSf8fAzbRTjRdY1EqR/O3G2tI6CybdHVj1dCxMnvvM/YXuA==", - "dependencies": { - "@libp2p/crypto": "2.0.8-0b4a2ee79", - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@libp2p/interface-internal": "0.1.9-0b4a2ee79", - "@libp2p/logger": "3.1.0-0b4a2ee79", - "@libp2p/multistream-select": "4.0.6-0b4a2ee79", - "@libp2p/peer-collections": "4.0.8-0b4a2ee79", - "@libp2p/peer-id": "3.0.6-0b4a2ee79", - "@libp2p/peer-id-factory": "3.0.8-0b4a2ee79", - "@libp2p/peer-store": "9.0.9-0b4a2ee79", - "@libp2p/utils": "4.0.7-0b4a2ee79", - "@multiformats/mafmt": "^12.1.6", - "@multiformats/multiaddr": "^12.1.10", - "@multiformats/multiaddr-matcher": "^1.1.0", - "any-signal": "^4.1.1", - "datastore-core": "^9.0.1", - "delay": "^6.0.0", - "interface-datastore": "^8.2.0", - "it-all": "^3.0.2", - "it-drain": "^3.0.2", - "it-filter": "^3.0.1", - "it-first": "^3.0.3", - "it-map": "^3.0.4", - "it-merge": "^3.0.0", - "it-pipe": "^3.0.1", - "it-stream-types": "^2.0.1", - "merge-options": "^3.0.4", - "multiformats": "^12.1.3", - "p-defer": "^4.0.0", - "p-queue": "^7.4.1", - "private-ip": "^3.0.1", - "rate-limiter-flexible": "^3.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/crypto": { - "version": "2.0.8-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-0b4a2ee79.tgz", - "integrity": "sha512-k6elAUnxMquhQYpCnlLmuU8NpfVU12XU0hFELsgC4TqKkC1PO7EuagngbjHilzyo1wpSAfaYGjAIjlQfjB50iw==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "multiformats": "^12.1.3", - "node-forge": "^1.1.0", - "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" - } - }, - "node_modules/libp2p/node_modules/@libp2p/interface": { - "version": "0.1.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-0b4a2ee79.tgz", - "integrity": "sha512-MdxUr/x2pLsh6/VD+N05TbpfICF6IMaW0cYX2EogcybuDc1UneGvmY2QJBkqBYvougrF34TMezwgVmm82Ezjyg==", - "dependencies": { - "@multiformats/multiaddr": "^12.1.10", - "it-pushable": "^3.2.1", - "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", - "uint8arraylist": "^2.4.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/logger": { - "version": "3.1.0-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0-0b4a2ee79.tgz", - "integrity": "sha512-haeXJplYP29dYTkwLlGI/dc7nQuRTbRte7GeMcNwrmCeODM3uo3D0O7+qS6RulmRDbvWqs3muCxZyRFSU4oB+A==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "@multiformats/multiaddr": "^12.1.10", - "debug": "^4.3.4", - "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" - } - }, - "node_modules/libp2p/node_modules/@libp2p/peer-id": { - "version": "3.0.6-0b4a2ee79", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-0b4a2ee79.tgz", - "integrity": "sha512-4IHuFCa+iP+yjsD/575wle50GgyH/76jxrYVFNvJwDBGODb/iSZ1VbhK0OKJk/Q12SF3cSbPQH8m5gOmc/ETcQ==", - "dependencies": { - "@libp2p/interface": "0.1.6-0b4a2ee79", - "multiformats": "^12.1.3", - "uint8arrays": "^4.0.6" - } + "resolved": "libp2p", + "link": true }, "node_modules/merge-options": { "version": "3.0.4", @@ -1134,6 +1089,24 @@ "node": ">=16.0.0", "npm": ">=7.0.0" } + }, + "utils": { + "version": "4.0.7", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/interface": "file:../interface", + "@multiformats/multiaddr": "^12.1.10", + "@multiformats/multiaddr-matcher": "^1.1.0", + "get-iterator": "^2.0.1", + "is-loopback-addr": "^2.0.1", + "it-pushable": "^3.2.2", + "it-stream-types": "^2.0.1", + "p-queue": "^7.4.1", + "private-ip": "^3.0.1", + "race-signal": "^1.0.1", + "uint8arraylist": "^2.4.3" + } } } } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package.json index dc78f0d62..901d25ddb 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package.json +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/package.json @@ -8,6 +8,6 @@ "@chainsafe/libp2p-yamux": "^5.0.3", "@libp2p/perf": "next", "@libp2p/tcp": "next", - "libp2p": "next" + "libp2p": "file://./libp2p" } } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/package.json index b39367234..3d5a6d748 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/package.json +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/tcp/package.json @@ -51,21 +51,11 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^0.1.6", - "@libp2p/utils": "^4.0.7", + "@libp2p/interface": "file:../interface", + "@libp2p/utils": "file:../utils", "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.1.10", "@types/sinon": "^17.0.0", "stream-to-it": "^0.2.2" - }, - "devDependencies": { - "@libp2p/interface-compliance-tests": "^4.1.5", - "@libp2p/logger": "^3.1.0", - "aegir": "^41.0.2", - "it-all": "^3.0.3", - "it-pipe": "^3.0.1", - "p-defer": "^4.0.0", - "sinon": "^17.0.0", - "uint8arrays": "^4.0.6" } } diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/index.min.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/index.min.js new file mode 100644 index 000000000..a5615866a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/index.min.js @@ -0,0 +1,3 @@ +(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PUtils = factory()}(typeof self !== 'undefined' ? self : this, function () { +"use strict";var Libp2PUtils=(()=>{var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(o,e,x,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of b(e))!c.call(o,p)&&p!==x&&t(o,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return o};var f=o=>d(t({},"__esModule",{value:!0}),o);var g={};return f(g);})(); +return Libp2PUtils})); diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts new file mode 100644 index 000000000..43a39bb79 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts @@ -0,0 +1,145 @@ +import { Uint8ArrayList } from 'uint8arraylist'; +import type { AbortOptions } from '@libp2p/interface'; +import type { Direction, ReadStatus, Stream, StreamStatus, StreamTimeline, WriteStatus } from '@libp2p/interface/connection'; +import type { Logger } from '@libp2p/logger'; +import type { Source } from 'it-stream-types'; +export interface AbstractStreamInit { + /** + * A unique identifier for this stream + */ + id: string; + /** + * The stream direction + */ + direction: Direction; + /** + * A Logger implementation used to log stream-specific information + */ + log: Logger; + /** + * User specific stream metadata + */ + metadata?: Record; + /** + * Invoked when the stream ends + */ + onEnd?(err?: Error | undefined): void; + /** + * Invoked when the readable end of the stream is closed + */ + onCloseRead?(): void; + /** + * Invoked when the writable end of the stream is closed + */ + onCloseWrite?(): void; + /** + * Invoked when the the stream has been reset by the remote + */ + onReset?(): void; + /** + * Invoked when the the stream has errored + */ + onAbort?(err: Error): void; + /** + * How long to wait in ms for stream data to be written to the underlying + * connection when closing the writable end of the stream. (default: 500) + */ + closeTimeout?: number; + /** + * After the stream sink has closed, a limit on how long it takes to send + * a close-write message to the remote peer. + */ + sendCloseWriteTimeout?: number; +} +export declare abstract class AbstractStream implements Stream { + id: string; + direction: Direction; + timeline: StreamTimeline; + protocol?: string; + metadata: Record; + source: AsyncGenerator; + status: StreamStatus; + readStatus: ReadStatus; + writeStatus: WriteStatus; + readonly log: Logger; + private readonly sinkController; + private readonly sinkEnd; + private readonly closed; + private endErr; + private readonly streamSource; + private readonly onEnd?; + private readonly onCloseRead?; + private readonly onCloseWrite?; + private readonly onReset?; + private readonly onAbort?; + private readonly sendCloseWriteTimeout; + constructor(init: AbstractStreamInit); + sink(source: Source): Promise; + protected onSourceEnd(err?: Error): void; + protected onSinkEnd(err?: Error): void; + close(options?: AbortOptions): Promise; + closeRead(options?: AbortOptions): Promise; + closeWrite(options?: AbortOptions): Promise; + /** + * Close immediately for reading and writing and send a reset message (local + * error) + */ + abort(err: Error): void; + /** + * Receive a reset message - close immediately for reading and writing (remote + * error) + */ + reset(): void; + _closeSinkAndSource(err?: Error): void; + _closeSink(err?: Error): void; + _closeSource(err?: Error): void; + /** + * The remote closed for writing so we should expect to receive no more + * messages + */ + remoteCloseWrite(): void; + /** + * The remote closed for reading so we should not send any more + * messages + */ + remoteCloseRead(): void; + /** + * The underlying muxer has closed, no more messages can be sent or will + * be received, close immediately to free up resources + */ + destroy(): void; + /** + * When an extending class reads data from it's implementation-specific source, + * call this method to allow the stream consumer to read the data. + */ + sourcePush(data: Uint8ArrayList): void; + /** + * Returns the amount of unread data - can be used to prevent large amounts of + * data building up when the stream consumer is too slow. + */ + sourceReadableLength(): number; + /** + * Send a message to the remote muxer informing them a new stream is being + * opened + */ + abstract sendNewStream(options?: AbortOptions): void | Promise; + /** + * Send a data message to the remote muxer + */ + abstract sendData(buf: Uint8ArrayList, options?: AbortOptions): void | Promise; + /** + * Send a reset message to the remote muxer + */ + abstract sendReset(options?: AbortOptions): void | Promise; + /** + * Send a message to the remote muxer, informing them no more data messages + * will be sent by this end of the stream + */ + abstract sendCloseWrite(options?: AbortOptions): void | Promise; + /** + * Send a message to the remote muxer, informing them no more data messages + * will be read by this end of the stream + */ + abstract sendCloseRead(options?: AbortOptions): void | Promise; +} +//# sourceMappingURL=abstract-stream.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts.map new file mode 100644 index 000000000..4b6335fb9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"abstract-stream.d.ts","sourceRoot":"","sources":["../../src/abstract-stream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC5H,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAM7C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IAEpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAElC;;O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,CAAE,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAErF;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAEjE;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAEtE;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CACtE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js new file mode 100644 index 000000000..7c793c9c5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js @@ -0,0 +1,340 @@ +import { CodeError } from '@libp2p/interface/errors'; +import { pushable } from 'it-pushable'; +import defer, {} from 'p-defer'; +import { raceSignal } from 'race-signal'; +import { Uint8ArrayList } from 'uint8arraylist'; +import { closeSource } from './close-source.js'; +const ERR_STREAM_RESET = 'ERR_STREAM_RESET'; +const ERR_SINK_INVALID_STATE = 'ERR_SINK_INVALID_STATE'; +const DEFAULT_SEND_CLOSE_WRITE_TIMEOUT = 5000; +function isPromise(thing) { + if (thing == null) { + return false; + } + return typeof thing.then === 'function' && + typeof thing.catch === 'function' && + typeof thing.finally === 'function'; +} +export class AbstractStream { + id; + direction; + timeline; + protocol; + metadata; + source; + status; + readStatus; + writeStatus; + log; + sinkController; + sinkEnd; + closed; + endErr; + streamSource; + onEnd; + onCloseRead; + onCloseWrite; + onReset; + onAbort; + sendCloseWriteTimeout; + constructor(init) { + this.sinkController = new AbortController(); + this.sinkEnd = defer(); + this.closed = defer(); + this.log = init.log; + // stream status + this.status = 'open'; + this.readStatus = 'ready'; + this.writeStatus = 'ready'; + this.id = init.id; + this.metadata = init.metadata ?? {}; + this.direction = init.direction; + this.timeline = { + open: Date.now() + }; + this.sendCloseWriteTimeout = init.sendCloseWriteTimeout ?? DEFAULT_SEND_CLOSE_WRITE_TIMEOUT; + this.onEnd = init.onEnd; + this.onCloseRead = init?.onCloseRead; + this.onCloseWrite = init?.onCloseWrite; + this.onReset = init?.onReset; + this.onAbort = init?.onAbort; + this.source = this.streamSource = pushable({ + onEnd: (err) => { + if (err != null) { + this.log.trace('source ended with error', err); + } + else { + this.log.trace('source ended'); + } + this.onSourceEnd(err); + } + }); + // necessary because the libp2p upgrader wraps the sink function + this.sink = this.sink.bind(this); + } + async sink(source) { + if (this.writeStatus !== 'ready') { + throw new CodeError(`writable end state is "${this.writeStatus}" not "ready"`, ERR_SINK_INVALID_STATE); + } + try { + this.writeStatus = 'writing'; + const options = { + signal: this.sinkController.signal + }; + if (this.direction === 'outbound') { // If initiator, open a new stream + const res = this.sendNewStream(options); + if (isPromise(res)) { + await res; + } + } + const abortListener = () => { + closeSource(source, this.log); + }; + try { + this.sinkController.signal.addEventListener('abort', abortListener); + this.log.trace('sink reading from source'); + for await (let data of source) { + data = data instanceof Uint8Array ? new Uint8ArrayList(data) : data; + const res = this.sendData(data, options); + if (isPromise(res)) { // eslint-disable-line max-depth + await res; + } + } + } + finally { + this.sinkController.signal.removeEventListener('abort', abortListener); + } + this.log.trace('sink finished reading from source, write status is "%s"', this.writeStatus); + if (this.writeStatus === 'writing') { + this.writeStatus = 'closing'; + this.log.trace('send close write to remote'); + await this.sendCloseWrite({ + signal: AbortSignal.timeout(this.sendCloseWriteTimeout) + }); + this.writeStatus = 'closed'; + } + this.onSinkEnd(); + } + catch (err) { + this.log.trace('sink ended with error, calling abort with error', err); + this.abort(err); + throw err; + } + finally { + this.log.trace('resolve sink end'); + this.sinkEnd.resolve(); + } + } + onSourceEnd(err) { + if (this.timeline.closeRead != null) { + return; + } + this.timeline.closeRead = Date.now(); + this.readStatus = 'closed'; + if (err != null && this.endErr == null) { + this.endErr = err; + } + this.onCloseRead?.(); + if (this.timeline.closeWrite != null) { + this.log.trace('source and sink ended'); + this.timeline.close = Date.now(); + if (this.status !== 'aborted' && this.status !== 'reset') { + this.status = 'closed'; + } + if (this.onEnd != null) { + this.onEnd(this.endErr); + } + this.closed.resolve(); + } + else { + this.log.trace('source ended, waiting for sink to end'); + } + } + onSinkEnd(err) { + if (this.timeline.closeWrite != null) { + return; + } + this.timeline.closeWrite = Date.now(); + this.writeStatus = 'closed'; + if (err != null && this.endErr == null) { + this.endErr = err; + } + this.onCloseWrite?.(); + if (this.timeline.closeRead != null) { + this.log.trace('sink and source ended'); + this.timeline.close = Date.now(); + if (this.status !== 'aborted' && this.status !== 'reset') { + this.status = 'closed'; + } + if (this.onEnd != null) { + this.onEnd(this.endErr); + } + this.closed.resolve(); + } + else { + this.log.trace('sink ended, waiting for source to end'); + } + } + // Close for both Reading and Writing + async close(options) { + this.log.trace('closing gracefully'); + this.status = 'closing'; + await Promise.all([ + this.closeRead(options), + this.closeWrite(options) + ]); + // wait for read and write ends to close + await raceSignal(this.closed.promise, options?.signal); + this.status = 'closed'; + this.log.trace('closed gracefully'); + } + async closeRead(options = {}) { + if (this.readStatus === 'closing' || this.readStatus === 'closed') { + return; + } + this.log.trace('closing readable end of stream with starting read status "%s"', this.readStatus); + const readStatus = this.readStatus; + this.readStatus = 'closing'; + if (this.status !== 'reset' && this.status !== 'aborted' && this.timeline.closeRead == null) { + this.log.trace('send close read to remote'); + await this.sendCloseRead(options); + } + if (readStatus === 'ready') { + this.log.trace('ending internal source queue with %d queued bytes', this.streamSource.readableLength); + this.streamSource.end(); + } + this.log.trace('closed readable end of stream'); + } + async closeWrite(options = {}) { + if (this.writeStatus === 'closing' || this.writeStatus === 'closed') { + return; + } + this.log.trace('closing writable end of stream with starting write status "%s"', this.writeStatus); + if (this.writeStatus === 'ready') { + this.log.trace('sink was never sunk, sink an empty array'); + await raceSignal(this.sink([]), options.signal); + } + if (this.writeStatus === 'writing') { + // stop reading from the source passed to `.sink` in the microtask queue + // - this lets any data queued by the user in the current tick get read + // before we exit + await new Promise((resolve, reject) => { + queueMicrotask(() => { + this.log.trace('aborting source passed to .sink'); + this.sinkController.abort(); + raceSignal(this.sinkEnd.promise, options.signal) + .then(resolve, reject); + }); + }); + } + this.writeStatus = 'closed'; + this.log.trace('closed writable end of stream'); + } + /** + * Close immediately for reading and writing and send a reset message (local + * error) + */ + abort(err) { + if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') { + return; + } + this.log('abort with error', err); + // try to send a reset message + this.log('try to send reset to remote'); + const res = this.sendReset(); + if (isPromise(res)) { + res.catch((err) => { + this.log.error('error sending reset message', err); + }); + } + this.status = 'aborted'; + this.timeline.abort = Date.now(); + this._closeSinkAndSource(err); + this.onAbort?.(err); + } + /** + * Receive a reset message - close immediately for reading and writing (remote + * error) + */ + reset() { + if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') { + return; + } + const err = new CodeError('stream reset', ERR_STREAM_RESET); + this.status = 'reset'; + this.timeline.reset = Date.now(); + this._closeSinkAndSource(err); + this.onReset?.(); + } + _closeSinkAndSource(err) { + this._closeSink(err); + this._closeSource(err); + } + _closeSink(err) { + // if the sink function is running, cause it to end + if (this.writeStatus === 'writing') { + this.log.trace('end sink source'); + this.sinkController.abort(); + } + this.onSinkEnd(err); + } + _closeSource(err) { + // if the source is not ending, end it + if (this.readStatus !== 'closing' && this.readStatus !== 'closed') { + this.log.trace('ending source with %d bytes to be read by consumer', this.streamSource.readableLength); + this.readStatus = 'closing'; + this.streamSource.end(err); + } + } + /** + * The remote closed for writing so we should expect to receive no more + * messages + */ + remoteCloseWrite() { + if (this.readStatus === 'closing' || this.readStatus === 'closed') { + this.log('received remote close write but local source is already closed'); + return; + } + this.log.trace('remote close write'); + this._closeSource(); + } + /** + * The remote closed for reading so we should not send any more + * messages + */ + remoteCloseRead() { + if (this.writeStatus === 'closing' || this.writeStatus === 'closed') { + this.log('received remote close read but local sink is already closed'); + return; + } + this.log.trace('remote close read'); + this._closeSink(); + } + /** + * The underlying muxer has closed, no more messages can be sent or will + * be received, close immediately to free up resources + */ + destroy() { + if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') { + this.log('received destroy but we are already closed'); + return; + } + this.log.trace('stream destroyed'); + this._closeSinkAndSource(); + } + /** + * When an extending class reads data from it's implementation-specific source, + * call this method to allow the stream consumer to read the data. + */ + sourcePush(data) { + this.streamSource.push(data); + } + /** + * Returns the amount of unread data - can be used to prevent large amounts of + * data building up when the stream consumer is too slow. + */ + sourceReadableLength() { + return this.streamSource.readableLength; + } +} +//# sourceMappingURL=abstract-stream.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js.map new file mode 100644 index 000000000..4c4d66108 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/abstract-stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"abstract-stream.js","sourceRoot":"","sources":["../../src/abstract-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAiB,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,EAAwB,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAM/C,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAC3C,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;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AAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE;YACpF,IAAI,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAA;YACtD,OAAM;SACP;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAElC,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED;;;OAGG;IACH,UAAU,CAAE,IAAoB;QAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;;OAGG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAA;IACzC,CAAC;CA6BF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts new file mode 100644 index 000000000..dd30d4cd1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts @@ -0,0 +1,39 @@ +/** + * @packageDocumentation + * + * Provides strategies to sort a list of multiaddrs. + * + * @example + * + * ```typescript + * import { publicAddressesFirst } from '@libp2p/utils/address-sort' + * import { multiaddr } from '@multformats/multiaddr' + * + * + * const addresses = [ + * multiaddr('/ip4/127.0.0.1/tcp/9000'), + * multiaddr('/ip4/82.41.53.1/tcp/9000') + * ].sort(publicAddressesFirst) + * + * console.info(addresses) + * // ['/ip4/82.41.53.1/tcp/9000', '/ip4/127.0.0.1/tcp/9000'] + * ``` + */ +import type { Address } from '@libp2p/interface/peer-store'; +/** + * Compare function for array.sort() that moves public addresses to the start + * of the array. + */ +export declare function publicAddressesFirst(a: Address, b: Address): -1 | 0 | 1; +/** + * Compare function for array.sort() that moves certified addresses to the start + * of the array. + */ +export declare function certifiedAddressesFirst(a: Address, b: Address): -1 | 0 | 1; +/** + * Compare function for array.sort() that moves circuit relay addresses to the + * start of the array. + */ +export declare function circuitRelayAddressesLast(a: Address, b: Address): -1 | 0 | 1; +export declare function defaultAddressSort(a: Address, b: Address): -1 | 0 | 1; +//# sourceMappingURL=address-sort.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts.map new file mode 100644 index 000000000..0f2a6ef12 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"address-sort.d.ts","sourceRoot":"","sources":["../../src/address-sort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAWxE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAQ3E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAW7E;AAED,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAgBtE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js new file mode 100644 index 000000000..e8a393e2a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js @@ -0,0 +1,79 @@ +/** + * @packageDocumentation + * + * Provides strategies to sort a list of multiaddrs. + * + * @example + * + * ```typescript + * import { publicAddressesFirst } from '@libp2p/utils/address-sort' + * import { multiaddr } from '@multformats/multiaddr' + * + * + * const addresses = [ + * multiaddr('/ip4/127.0.0.1/tcp/9000'), + * multiaddr('/ip4/82.41.53.1/tcp/9000') + * ].sort(publicAddressesFirst) + * + * console.info(addresses) + * // ['/ip4/82.41.53.1/tcp/9000', '/ip4/127.0.0.1/tcp/9000'] + * ``` + */ +import { Circuit } from '@multiformats/multiaddr-matcher'; +import { isPrivate } from './multiaddr/is-private.js'; +/** + * Compare function for array.sort() that moves public addresses to the start + * of the array. + */ +export function publicAddressesFirst(a, b) { + const isAPrivate = isPrivate(a.multiaddr); + const isBPrivate = isPrivate(b.multiaddr); + if (isAPrivate && !isBPrivate) { + return 1; + } + else if (!isAPrivate && isBPrivate) { + return -1; + } + return 0; +} +/** + * Compare function for array.sort() that moves certified addresses to the start + * of the array. + */ +export function certifiedAddressesFirst(a, b) { + if (a.isCertified && !b.isCertified) { + return -1; + } + else if (!a.isCertified && b.isCertified) { + return 1; + } + return 0; +} +/** + * Compare function for array.sort() that moves circuit relay addresses to the + * start of the array. + */ +export function circuitRelayAddressesLast(a, b) { + const isACircuit = Circuit.exactMatch(a.multiaddr); + const isBCircuit = Circuit.exactMatch(b.multiaddr); + if (isACircuit && !isBCircuit) { + return 1; + } + else if (!isACircuit && isBCircuit) { + return -1; + } + return 0; +} +export function defaultAddressSort(a, b) { + const publicResult = publicAddressesFirst(a, b); + if (publicResult !== 0) { + return publicResult; + } + const relayResult = circuitRelayAddressesLast(a, b); + if (relayResult !== 0) { + return relayResult; + } + const certifiedResult = certifiedAddressesFirst(a, b); + return certifiedResult; +} +//# sourceMappingURL=address-sort.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js.map new file mode 100644 index 000000000..35711c64f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/address-sort.js.map @@ -0,0 +1 @@ +{"version":3,"file":"address-sort.js","sourceRoot":"","sources":["../../src/address-sort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAGrD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAE,CAAU,EAAE,CAAU;IAC1D,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACzC,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAEzC,IAAI,UAAU,IAAI,CAAC,UAAU,EAAE;QAC7B,OAAO,CAAC,CAAA;KACT;SAAM,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE;QACpC,OAAO,CAAC,CAAC,CAAA;KACV;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAE,CAAU,EAAE,CAAU;IAC7D,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE;QACnC,OAAO,CAAC,CAAC,CAAA;KACV;SAAM,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,EAAE;QAC1C,OAAO,CAAC,CAAA;KACT;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAE,CAAU,EAAE,CAAU;IAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAClD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAElD,IAAI,UAAU,IAAI,CAAC,UAAU,EAAE;QAC7B,OAAO,CAAC,CAAA;KACT;SAAM,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE;QACpC,OAAO,CAAC,CAAC,CAAA;KACV;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAE,CAAU,EAAE,CAAU;IACxD,MAAM,YAAY,GAAG,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE/C,IAAI,YAAY,KAAK,CAAC,EAAE;QACtB,OAAO,YAAY,CAAA;KACpB;IAED,MAAM,WAAW,GAAG,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEnD,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,OAAO,WAAW,CAAA;KACnB;IAED,MAAM,eAAe,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAErD,OAAO,eAAe,CAAA;AACxB,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts new file mode 100644 index 000000000..21672a034 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts @@ -0,0 +1,24 @@ +/** + * @packageDocumentation + * + * Provides strategies ensure arrays are equivalent. + * + * @example + * + * ```typescript + * import { arrayEquals } from '@libp2p/utils/array-equals' + * import { multiaddr } from '@multformats/multiaddr' + * + * const ma1 = multiaddr('/ip4/127.0.0.1/tcp/9000'), + * const ma2 = multiaddr('/ip4/82.41.53.1/tcp/9000') + * + * console.info(arrayEquals([ma1], [ma1])) // true + * console.info(arrayEquals([ma1], [ma2])) // false + * ``` + */ +/** + * Verify if two arrays of non primitive types with the "equals" function are equal. + * Compatible with multiaddr, peer-id and others. + */ +export declare function arrayEquals(a: any[], b: any[]): boolean; +//# sourceMappingURL=array-equals.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts.map new file mode 100644 index 000000000..42c52e4ec --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array-equals.d.ts","sourceRoot":"","sources":["../../src/array-equals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,wBAAgB,WAAW,CAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAUxD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js new file mode 100644 index 000000000..962413bf1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js @@ -0,0 +1,31 @@ +/** + * @packageDocumentation + * + * Provides strategies ensure arrays are equivalent. + * + * @example + * + * ```typescript + * import { arrayEquals } from '@libp2p/utils/array-equals' + * import { multiaddr } from '@multformats/multiaddr' + * + * const ma1 = multiaddr('/ip4/127.0.0.1/tcp/9000'), + * const ma2 = multiaddr('/ip4/82.41.53.1/tcp/9000') + * + * console.info(arrayEquals([ma1], [ma1])) // true + * console.info(arrayEquals([ma1], [ma2])) // false + * ``` + */ +/** + * Verify if two arrays of non primitive types with the "equals" function are equal. + * Compatible with multiaddr, peer-id and others. + */ +export function arrayEquals(a, b) { + const sort = (a, b) => a.toString().localeCompare(b.toString()); + if (a.length !== b.length) { + return false; + } + b.sort(sort); + return a.sort(sort).every((item, index) => b[index].equals(item)); +} +//# sourceMappingURL=array-equals.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js.map new file mode 100644 index 000000000..efc32c234 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/array-equals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array-equals.js","sourceRoot":"","sources":["../../src/array-equals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAE,CAAQ,EAAE,CAAQ;IAC7C,MAAM,IAAI,GAAG,CAAC,CAAM,EAAE,CAAM,EAAU,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;IAEjF,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,KAAK,CAAA;KACb;IAED,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;AACnE,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts new file mode 100644 index 000000000..d9c1145f1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts @@ -0,0 +1,4 @@ +import type { Logger } from '@libp2p/logger'; +import type { Source } from 'it-stream-types'; +export declare function closeSource(source: Source, log: Logger): void; +//# sourceMappingURL=close-source.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts.map new file mode 100644 index 000000000..fea2eebcd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"close-source.d.ts","sourceRoot":"","sources":["../../src/close-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAQvE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js new file mode 100644 index 000000000..f36f8da8b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js @@ -0,0 +1,11 @@ +import { getIterator } from 'get-iterator'; +import { isPromise } from './is-promise.js'; +export function closeSource(source, log) { + const res = getIterator(source).return?.(); + if (isPromise(res)) { + res.catch(err => { + log.error('could not cause iterator to return', err); + }); + } +} +//# sourceMappingURL=close-source.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js.map new file mode 100644 index 000000000..e8208c5bc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/close-source.js.map @@ -0,0 +1 @@ +{"version":3,"file":"close-source.js","sourceRoot":"","sources":["../../src/close-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,MAAM,UAAU,WAAW,CAAE,MAAuB,EAAE,GAAW;IAC/D,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAA;IAE1C,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE;QAClB,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACd,GAAG,CAAC,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;KACH;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts new file mode 100644 index 000000000..19e75f243 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts @@ -0,0 +1,22 @@ +/** + * @packageDocumentation + * + * The libp2p ecosystem has lots of repos with it comes several problems like: + * + * - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc. + * - Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc. + * + * These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated. + * + * @example + * + * Each function should be imported directly. + * + * ```js + * import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr' + * + * const ma = ipAndPortToMultiaddr('127.0.0.1', 9000) + * ``` + */ +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts.map new file mode 100644 index 000000000..2b6163dd9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js new file mode 100644 index 000000000..c84346760 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js @@ -0,0 +1,22 @@ +/** + * @packageDocumentation + * + * The libp2p ecosystem has lots of repos with it comes several problems like: + * + * - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc. + * - Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc. + * + * These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated. + * + * @example + * + * Each function should be imported directly. + * + * ```js + * import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr' + * + * const ma = ipAndPortToMultiaddr('127.0.0.1', 9000) + * ``` + */ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js.map new file mode 100644 index 000000000..d2003d1a2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts new file mode 100644 index 000000000..02dabcccd --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts @@ -0,0 +1,11 @@ +import { type Multiaddr } from '@multiformats/multiaddr'; +export declare const Errors: { + ERR_INVALID_IP_PARAMETER: string; + ERR_INVALID_PORT_PARAMETER: string; + ERR_INVALID_IP: string; +}; +/** + * Transform an IP, Port pair into a multiaddr + */ +export declare function ipPortToMultiaddr(ip: string, port: number | string): Multiaddr; +//# sourceMappingURL=ip-port-to-multiaddr.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts.map new file mode 100644 index 000000000..c48307d08 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ip-port-to-multiaddr.d.ts","sourceRoot":"","sources":["../../src/ip-port-to-multiaddr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,yBAAyB,CAAA;AAEnE,eAAO,MAAM,MAAM;;;;CAIlB,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAsB/E"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js new file mode 100644 index 000000000..004d24c63 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js @@ -0,0 +1,30 @@ +import { isIPv4, isIPv6 } from '@chainsafe/is-ip'; +import { CodeError } from '@libp2p/interface/errors'; +import { multiaddr } from '@multiformats/multiaddr'; +export const Errors = { + ERR_INVALID_IP_PARAMETER: 'ERR_INVALID_IP_PARAMETER', + ERR_INVALID_PORT_PARAMETER: 'ERR_INVALID_PORT_PARAMETER', + ERR_INVALID_IP: 'ERR_INVALID_IP' +}; +/** + * Transform an IP, Port pair into a multiaddr + */ +export function ipPortToMultiaddr(ip, port) { + if (typeof ip !== 'string') { + throw new CodeError(`invalid ip provided: ${ip}`, Errors.ERR_INVALID_IP_PARAMETER); // eslint-disable-line @typescript-eslint/restrict-template-expressions + } + if (typeof port === 'string') { + port = parseInt(port); + } + if (isNaN(port)) { + throw new CodeError(`invalid port provided: ${port}`, Errors.ERR_INVALID_PORT_PARAMETER); + } + if (isIPv4(ip)) { + return multiaddr(`/ip4/${ip}/tcp/${port}`); + } + if (isIPv6(ip)) { + return multiaddr(`/ip6/${ip}/tcp/${port}`); + } + throw new CodeError(`invalid ip:port for creating a multiaddr: ${ip}:${port}`, Errors.ERR_INVALID_IP); +} +//# sourceMappingURL=ip-port-to-multiaddr.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js.map new file mode 100644 index 000000000..66409a066 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/ip-port-to-multiaddr.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ip-port-to-multiaddr.js","sourceRoot":"","sources":["../../src/ip-port-to-multiaddr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAkB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,wBAAwB,EAAE,0BAA0B;IACpD,0BAA0B,EAAE,4BAA4B;IACxD,cAAc,EAAE,gBAAgB;CACjC,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAE,EAAU,EAAE,IAAqB;IAClE,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QAC1B,MAAM,IAAI,SAAS,CAAC,wBAAwB,EAAE,EAAE,EAAE,MAAM,CAAC,wBAAwB,CAAC,CAAA,CAAC,uEAAuE;KAC3J;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;KACtB;IAED,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;QACf,MAAM,IAAI,SAAS,CAAC,0BAA0B,IAAI,EAAE,EAAE,MAAM,CAAC,0BAA0B,CAAC,CAAA;KACzF;IAED,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE;QACd,OAAO,SAAS,CAAC,QAAQ,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAA;KAC3C;IAED,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE;QACd,OAAO,SAAS,CAAC,QAAQ,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAA;KAC3C;IAED,MAAM,IAAI,SAAS,CAAC,6CAA6C,EAAE,IAAI,IAAI,EAAE,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;AACvG,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts new file mode 100644 index 000000000..c8314c1f0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts @@ -0,0 +1,2 @@ +export declare function isPromise(thing: any): thing is Promise; +//# sourceMappingURL=is-promise.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts.map new file mode 100644 index 000000000..bb4c53954 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"is-promise.d.ts","sourceRoot":"","sources":["../../src/is-promise.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAE,CAAC,GAAG,OAAO,EAAG,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAQxE"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js new file mode 100644 index 000000000..1cac83951 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js @@ -0,0 +1,9 @@ +export function isPromise(thing) { + if (thing == null) { + return false; + } + return typeof thing.then === 'function' && + typeof thing.catch === 'function' && + typeof thing.finally === 'function'; +} +//# sourceMappingURL=is-promise.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js.map new file mode 100644 index 000000000..a0538615f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/is-promise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-promise.js","sourceRoot":"","sources":["../../src/is-promise.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAgB,KAAU;IACjD,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,KAAK,CAAA;KACb;IAED,OAAO,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;QACrC,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;QACjC,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,CAAA;AACvC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts new file mode 100644 index 000000000..111657b0f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts @@ -0,0 +1,6 @@ +import type { Multiaddr } from '@multiformats/multiaddr'; +/** + * Check if a given multiaddr is a loopback address. + */ +export declare function isLoopback(ma: Multiaddr): boolean; +//# sourceMappingURL=is-loopback.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts.map new file mode 100644 index 000000000..1e8d423e9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"is-loopback.d.ts","sourceRoot":"","sources":["../../../src/multiaddr/is-loopback.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,wBAAgB,UAAU,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAIlD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js new file mode 100644 index 000000000..3d7a4ce00 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js @@ -0,0 +1,9 @@ +import { isLoopbackAddr } from 'is-loopback-addr'; +/** + * Check if a given multiaddr is a loopback address. + */ +export function isLoopback(ma) { + const { address } = ma.nodeAddress(); + return isLoopbackAddr(address); +} +//# sourceMappingURL=is-loopback.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js.map new file mode 100644 index 000000000..f6b7a2e9a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-loopback.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-loopback.js","sourceRoot":"","sources":["../../../src/multiaddr/is-loopback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAE,EAAa;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAA;IAEpC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts new file mode 100644 index 000000000..9774971b2 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts @@ -0,0 +1,6 @@ +import type { Multiaddr } from '@multiformats/multiaddr'; +/** + * Check if a given multiaddr has a private address. + */ +export declare function isPrivate(ma: Multiaddr): boolean; +//# sourceMappingURL=is-private.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts.map new file mode 100644 index 000000000..50c983871 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"is-private.d.ts","sourceRoot":"","sources":["../../../src/multiaddr/is-private.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,wBAAgB,SAAS,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAQjD"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js new file mode 100644 index 000000000..84536f0b1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js @@ -0,0 +1,14 @@ +import isIpPrivate from 'private-ip'; +/** + * Check if a given multiaddr has a private address. + */ +export function isPrivate(ma) { + try { + const { address } = ma.nodeAddress(); + return Boolean(isIpPrivate(address)); + } + catch { + return true; + } +} +//# sourceMappingURL=is-private.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js.map new file mode 100644 index 000000000..be22fe77c --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/multiaddr/is-private.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-private.js","sourceRoot":"","sources":["../../../src/multiaddr/is-private.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,YAAY,CAAA;AAGpC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAE,EAAa;IACtC,IAAI;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAA;QAEpC,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;KACrC;IAAC,MAAM;QACN,OAAO,IAAI,CAAA;KACZ;AACH,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts new file mode 100644 index 000000000..61924699f --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts @@ -0,0 +1,33 @@ +import PQueue from 'p-queue'; +import type { PeerId } from '@libp2p/interface/peer-id'; +import type { QueueAddOptions, Options, Queue } from 'p-queue'; +interface RunFunction { + (): Promise; +} +export interface PeerPriorityQueueOptions extends QueueAddOptions { + peerId: PeerId; +} +/** + * Port of https://github.com/sindresorhus/p-queue/blob/main/source/priority-queue.ts + * that adds support for filtering jobs by peer id + */ +declare class PeerPriorityQueue implements Queue { + #private; + enqueue(run: RunFunction, options?: Partial): void; + dequeue(): RunFunction | undefined; + filter(options: Readonly>): RunFunction[]; + get size(): number; +} +/** + * Extends PQueue to add support for querying queued jobs by peer id + */ +export declare class PeerJobQueue extends PQueue { + constructor(options?: Options); + /** + * Returns true if this queue has a job for the passed peer id that has not yet + * started to run + */ + hasJob(peerId: PeerId): boolean; +} +export {}; +//# sourceMappingURL=peer-job-queue.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts.map new file mode 100644 index 000000000..5f43edcb0 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"peer-job-queue.d.ts","sourceRoot":"","sources":["../../src/peer-job-queue.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAuB9D,UAAU,WAAW;IAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE;AAE9C,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,MAAM,EAAE,MAAM,CAAA;CACf;AAQD;;;GAGG;AACH,cAAM,iBAAkB,YAAW,KAAK,CAAC,WAAW,EAAE,wBAAwB,CAAC;;IAG7E,OAAO,CAAE,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,IAAI;IA0B7E,OAAO,IAAK,WAAW,GAAG,SAAS;IAKnC,MAAM,CAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,GAAG,WAAW,EAAE;IAc5E,IAAI,IAAI,IAAK,MAAM,CAElB;CACF;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,MAAM,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;gBACtE,OAAO,GAAE,OAAO,CAAC,iBAAiB,EAAE,wBAAwB,CAAM;IAO/E;;;OAGG;IACH,MAAM,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAKjC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js new file mode 100644 index 000000000..92c364d59 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js @@ -0,0 +1,81 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +import { CodeError, ERR_INVALID_PARAMETERS } from '@libp2p/interface/errors'; +import PQueue from 'p-queue'; +// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound +// Used to compute insertion index to keep queue sorted after insertion +function lowerBound(array, value, comparator) { + let first = 0; + let count = array.length; + while (count > 0) { + const step = Math.trunc(count / 2); + let it = first + step; + if (comparator(array[it], value) <= 0) { + first = ++it; + count -= step + 1; + } + else { + count = step; + } + } + return first; +} +/** + * Port of https://github.com/sindresorhus/p-queue/blob/main/source/priority-queue.ts + * that adds support for filtering jobs by peer id + */ +class PeerPriorityQueue { + #queue = []; + enqueue(run, options) { + const peerId = options?.peerId; + const priority = options?.priority ?? 0; + if (peerId == null) { + throw new CodeError('missing peer id', ERR_INVALID_PARAMETERS); + } + const element = { + priority, + peerId, + run + }; + if (this.size > 0 && this.#queue[this.size - 1].priority >= priority) { + this.#queue.push(element); + return; + } + const index = lowerBound(this.#queue, element, (a, b) => b.priority - a.priority); + this.#queue.splice(index, 0, element); + } + dequeue() { + const item = this.#queue.shift(); + return item?.run; + } + filter(options) { + if (options.peerId != null) { + const peerId = options.peerId; + return this.#queue.filter((element) => peerId.equals(element.peerId)).map((element) => element.run); + } + return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run); + } + get size() { + return this.#queue.length; + } +} +/** + * Extends PQueue to add support for querying queued jobs by peer id + */ +export class PeerJobQueue extends PQueue { + constructor(options = {}) { + super({ + ...options, + queueClass: PeerPriorityQueue + }); + } + /** + * Returns true if this queue has a job for the passed peer id that has not yet + * started to run + */ + hasJob(peerId) { + return this.sizeBy({ + peerId + }) > 0; + } +} +//# sourceMappingURL=peer-job-queue.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js.map new file mode 100644 index 000000000..87dad39c5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/peer-job-queue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"peer-job-queue.js","sourceRoot":"","sources":["../../src/peer-job-queue.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OA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,OAAO,IAAI,CAAC,MAAM,CAAC;YACjB,MAAM;SACP,CAAC,GAAG,CAAC,CAAA;IACR,CAAC;CACF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts new file mode 100644 index 000000000..c030cc977 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts @@ -0,0 +1,15 @@ +import type { ComponentLogger } from '@libp2p/interface'; +import type { MultiaddrConnection, Stream } from '@libp2p/interface/connection'; +import type { Multiaddr } from '@multiformats/multiaddr'; +export interface StreamProperties { + stream: Stream; + remoteAddr: Multiaddr; + localAddr: Multiaddr; + logger: ComponentLogger; +} +/** + * Convert a duplex iterable into a MultiaddrConnection. + * https://github.com/libp2p/interface-transport#multiaddrconnection + */ +export declare function streamToMaConnection(props: StreamProperties): MultiaddrConnection; +//# sourceMappingURL=stream-to-ma-conn.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts.map new file mode 100644 index 000000000..f42a47e74 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stream-to-ma-conn.d.ts","sourceRoot":"","sources":["../../src/stream-to-ma-conn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,SAAS,CAAA;IACrB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,eAAe,CAAA;CACxB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,KAAK,EAAE,gBAAgB,GAAG,mBAAmB,CA2ElF"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js new file mode 100644 index 000000000..93894e786 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js @@ -0,0 +1,77 @@ +/** + * Convert a duplex iterable into a MultiaddrConnection. + * https://github.com/libp2p/interface-transport#multiaddrconnection + */ +export function streamToMaConnection(props) { + const { stream, remoteAddr, logger } = props; + const log = logger.forComponent('libp2p:stream:converter'); + let closedRead = false; + let closedWrite = false; + // piggyback on `stream.close` invocations to close maconn + const streamClose = stream.close.bind(stream); + stream.close = async (options) => { + await streamClose(options); + close(true); + }; + // piggyback on `stream.abort` invocations to close maconn + const streamAbort = stream.abort.bind(stream); + stream.abort = (err) => { + streamAbort(err); + close(true); + }; + // piggyback on `stream.sink` invocations to close maconn + const streamSink = stream.sink.bind(stream); + stream.sink = async (source) => { + try { + await streamSink(source); + } + catch (err) { + // If aborted we can safely ignore + if (err.type !== 'aborted') { + // If the source errored the socket will already have been destroyed by + // toIterable.duplex(). If the socket errored it will already be + // destroyed. There's nothing to do here except log the error & return. + log(err); + } + } + finally { + closedWrite = true; + close(); + } + }; + const maConn = { + log, + sink: stream.sink, + source: (async function* () { + try { + for await (const list of stream.source) { + if (list instanceof Uint8Array) { + yield list; + } + else { + yield* list; + } + } + } + finally { + closedRead = true; + close(); + } + }()), + remoteAddr, + timeline: { open: Date.now(), close: undefined }, + close: stream.close, + abort: stream.abort + }; + function close(force) { + if (force === true) { + closedRead = true; + closedWrite = true; + } + if (closedRead && closedWrite && maConn.timeline.close == null) { + maConn.timeline.close = Date.now(); + } + } + return maConn; +} +//# sourceMappingURL=stream-to-ma-conn.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js.map new file mode 100644 index 000000000..d6938f1f5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/src/stream-to-ma-conn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stream-to-ma-conn.js","sourceRoot":"","sources":["../../src/stream-to-ma-conn.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAE,KAAuB;IAC3D,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAA;IAE1D,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,WAAW,GAAG,KAAK,CAAA;IAEvB,0DAA0D;IAC1D,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE;QAC/B,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAA;IACb,CAAC,CAAA;IAED,0DAA0D;IAC1D,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE,EAAE;QACrB,WAAW,CA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G,IAAI,CAAA;YACjB,WAAW,GAAG,IAAI,CAAA;SACnB;QAED,IAAI,UAAU,IAAI,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,EAAE;YAC9D,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;SACnC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts new file mode 100644 index 000000000..f2d5ba5d1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=abstract-stream.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts.map new file mode 100644 index 000000000..f27c3c7a8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"abstract-stream.spec.d.ts","sourceRoot":"","sources":["../../test/abstract-stream.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js new file mode 100644 index 000000000..6a80e88f8 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js @@ -0,0 +1,147 @@ +import { logger } from '@libp2p/logger'; +import { expect } from 'aegir/chai'; +import delay from 'delay'; +import all from 'it-all'; +import drain from 'it-drain'; +import Sinon from 'sinon'; +import { Uint8ArrayList } from 'uint8arraylist'; +import { AbstractStream } from '../src/abstract-stream.js'; +class TestStream extends AbstractStream { + async sendNewStream(options) { + } + async sendData(buf, options) { + } + async sendReset(options) { + } + async sendCloseWrite(options) { + } + async sendCloseRead(options) { + } +} +describe('abstract stream', () => { + let stream; + beforeEach(() => { + stream = new TestStream({ + id: 'test', + direction: 'outbound', + log: logger('test'), + onEnd: () => { } + }); + }); + it('sends data', async () => { + const sendSpy = Sinon.spy(stream, 'sendData'); + const data = [ + Uint8Array.from([0, 1, 2, 3, 4]) + ]; + await stream.sink(data); + const call = sendSpy.getCall(0); + expect(call.args[0].subarray()).to.equalBytes(data[0]); + }); + it('receives data', async () => { + const data = new Uint8ArrayList(Uint8Array.from([0, 1, 2, 3, 4])); + stream.sourcePush(data); + stream.remoteCloseWrite(); + const output = await all(stream.source); + expect(output[0].subarray()).to.equalBytes(data.subarray()); + }); + it('closes', async () => { + const sendCloseReadSpy = Sinon.spy(stream, 'sendCloseRead'); + const sendCloseWriteSpy = Sinon.spy(stream, 'sendCloseWrite'); + const onEndSpy = Sinon.spy(stream, 'onEnd'); + await stream.close(); + expect(sendCloseReadSpy.calledOnce).to.be.true(); + expect(sendCloseWriteSpy.calledOnce).to.be.true(); + expect(onEndSpy.calledOnce).to.be.true(); + expect(stream).to.have.property('status', 'closed'); + expect(stream).to.have.property('writeStatus', 'closed'); + expect(stream).to.have.property('readStatus', 'closed'); + expect(stream).to.have.nested.property('timeline.close').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.closeRead').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.closeWrite').that.is.a('number'); + expect(stream).to.not.have.nested.property('timeline.reset'); + expect(stream).to.not.have.nested.property('timeline.abort'); + }); + it('closes for reading', async () => { + const sendCloseReadSpy = Sinon.spy(stream, 'sendCloseRead'); + const sendCloseWriteSpy = Sinon.spy(stream, 'sendCloseWrite'); + await stream.closeRead(); + expect(sendCloseReadSpy.calledOnce).to.be.true(); + expect(sendCloseWriteSpy.called).to.be.false(); + expect(stream).to.have.property('status', 'open'); + expect(stream).to.have.property('writeStatus', 'ready'); + expect(stream).to.have.property('readStatus', 'closed'); + expect(stream).to.not.have.nested.property('timeline.close'); + expect(stream).to.have.nested.property('timeline.closeRead').that.is.a('number'); + expect(stream).to.not.have.nested.property('timeline.closeWrite'); + expect(stream).to.not.have.nested.property('timeline.reset'); + expect(stream).to.not.have.nested.property('timeline.abort'); + }); + it('closes for writing', async () => { + const sendCloseReadSpy = Sinon.spy(stream, 'sendCloseRead'); + const sendCloseWriteSpy = Sinon.spy(stream, 'sendCloseWrite'); + await stream.closeWrite(); + expect(sendCloseReadSpy.called).to.be.false(); + expect(sendCloseWriteSpy.calledOnce).to.be.true(); + expect(stream).to.have.property('status', 'open'); + expect(stream).to.have.property('writeStatus', 'closed'); + expect(stream).to.have.property('readStatus', 'ready'); + expect(stream).to.not.have.nested.property('timeline.close'); + expect(stream).to.not.have.nested.property('timeline.closeRead'); + expect(stream).to.have.nested.property('timeline.closeWrite').that.is.a('number'); + expect(stream).to.not.have.nested.property('timeline.reset'); + expect(stream).to.not.have.nested.property('timeline.abort'); + }); + it('aborts', async () => { + const sendResetSpy = Sinon.spy(stream, 'sendReset'); + stream.abort(new Error('Urk!')); + expect(sendResetSpy.calledOnce).to.be.true(); + expect(stream).to.have.property('status', 'aborted'); + expect(stream).to.have.property('writeStatus', 'closed'); + expect(stream).to.have.property('readStatus', 'closed'); + expect(stream).to.have.nested.property('timeline.close').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.closeRead').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.closeWrite').that.is.a('number'); + expect(stream).to.not.have.nested.property('timeline.reset'); + expect(stream).to.have.nested.property('timeline.abort').that.is.a('number'); + await expect(stream.sink([])).to.eventually.be.rejected + .with.property('code', 'ERR_SINK_INVALID_STATE'); + await expect(drain(stream.source)).to.eventually.be.rejected + .with('Urk!'); + }); + it('gets reset remotely', async () => { + stream.reset(); + expect(stream).to.have.property('status', 'reset'); + expect(stream).to.have.property('writeStatus', 'closed'); + expect(stream).to.have.property('readStatus', 'closed'); + expect(stream).to.have.nested.property('timeline.close').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.closeRead').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.closeWrite').that.is.a('number'); + expect(stream).to.have.nested.property('timeline.reset').that.is.a('number'); + expect(stream).to.not.have.nested.property('timeline.abort'); + await expect(stream.sink([])).to.eventually.be.rejected + .with.property('code', 'ERR_SINK_INVALID_STATE'); + await expect(drain(stream.source)).to.eventually.be.rejected + .with.property('code', 'ERR_STREAM_RESET'); + }); + it('does not send close read when remote closes write', async () => { + const sendCloseReadSpy = Sinon.spy(stream, 'sendCloseRead'); + stream.remoteCloseWrite(); + await delay(100); + expect(sendCloseReadSpy.called).to.be.false(); + }); + it('does not send close write when remote closes read', async () => { + const sendCloseWriteSpy = Sinon.spy(stream, 'sendCloseWrite'); + stream.remoteCloseRead(); + await delay(100); + expect(sendCloseWriteSpy.called).to.be.false(); + }); + it('does not send close read or write when remote resets', async () => { + const sendCloseReadSpy = Sinon.spy(stream, 'sendCloseRead'); + const sendCloseWriteSpy = Sinon.spy(stream, 'sendCloseWrite'); + stream.reset(); + await delay(100); + expect(sendCloseReadSpy.called).to.be.false(); + expect(sendCloseWriteSpy.called).to.be.false(); + }); +}); +//# sourceMappingURL=abstract-stream.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js.map new file mode 100644 index 000000000..47aac23cf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/abstract-stream.spec.js.map @@ -0,0 +1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,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts new file mode 100644 index 000000000..349656f9d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=address-sort.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts.map new file mode 100644 index 000000000..ddfdc193a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"address-sort.spec.d.ts","sourceRoot":"","sources":["../../test/address-sort.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js new file mode 100644 index 000000000..f05cd5dca --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js @@ -0,0 +1,162 @@ +/* eslint-env mocha */ +import { multiaddr } from '@multiformats/multiaddr'; +import { expect } from 'aegir/chai'; +import { publicAddressesFirst, certifiedAddressesFirst, circuitRelayAddressesLast, defaultAddressSort } from '../src/address-sort.js'; +describe('address-sort', () => { + describe('public addresses first', () => { + it('should sort public addresses first', () => { + const publicAddress = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000'), + isCertified: false + }; + const privateAddress = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4000'), + isCertified: false + }; + const addresses = [ + privateAddress, + publicAddress + ]; + const sortedAddresses = addresses.sort(publicAddressesFirst); + expect(sortedAddresses).to.deep.equal([ + publicAddress, + privateAddress + ]); + }); + }); + describe('certified addresses first', () => { + it('should sort certified addresses first', () => { + const certifiedPublicAddress = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4001'), + isCertified: true + }; + const publicAddress = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000'), + isCertified: false + }; + const certifiedPrivateAddress = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), + isCertified: true + }; + const privateAddress = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4000'), + isCertified: false + }; + const addresses = [ + publicAddress, + certifiedPublicAddress, + certifiedPrivateAddress, + privateAddress + ]; + const sortedAddresses = addresses.sort(certifiedAddressesFirst); + expect(sortedAddresses).to.deep.equal([ + certifiedPublicAddress, + certifiedPrivateAddress, + publicAddress, + privateAddress + ]); + }); + }); + describe('circuit relay addresses last', () => { + it('should sort circuit relay addresses last', () => { + const publicAddress = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000'), + isCertified: false + }; + const publicRelay = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: false + }; + const addresses = [ + publicRelay, + publicAddress + ]; + const sortedAddresses = addresses.sort(circuitRelayAddressesLast); + expect(sortedAddresses).to.deep.equal([ + publicAddress, + publicRelay + ]); + }); + }); + describe('default address sort', () => { + it('should sort public, then public relay, then private, then private relay with certified addresses taking priority', () => { + const certifiedPublicAddress = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4001'), + isCertified: true + }; + const publicAddress = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000'), + isCertified: false + }; + const certifiedPublicRelay = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4001/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: true + }; + const publicRelay = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: false + }; + const certifiedPrivateAddress = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001'), + isCertified: true + }; + const privateAddress = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4000'), + isCertified: false + }; + const certifiedPrivateRelay = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: true + }; + const privateRelay = { + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4000/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: false + }; + const addresses = [ + privateAddress, + certifiedPrivateAddress, + publicRelay, + certifiedPublicRelay, + privateRelay, + publicAddress, + certifiedPublicAddress, + certifiedPrivateRelay + ].sort(() => { + return Math.random() > 0.5 ? -1 : 1; + }); + const sortedAddresses = addresses.sort(defaultAddressSort); + expect(sortedAddresses).to.deep.equal([ + certifiedPublicAddress, + publicAddress, + certifiedPublicRelay, + publicRelay, + certifiedPrivateAddress, + privateAddress, + certifiedPrivateRelay, + privateRelay + ]); + }); + it('should sort WebRTC over relay addresses before relay addresses', () => { + const publicRelay = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: false + }; + const webRTCOverRelay = { + multiaddr: multiaddr('/ip4/30.0.0.1/tcp/4000/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/webrtc/p2p/QmcrQZ6RJdpYuGvZqD5QEHAv6qX4BrQLJLQPQUrTrzdcgm'), + isCertified: false + }; + const addresses = [ + publicRelay, + webRTCOverRelay + ].sort(() => { + return Math.random() > 0.5 ? -1 : 1; + }); + const sortedAddresses = addresses.sort(defaultAddressSort); + expect(sortedAddresses).to.deep.equal([ + webRTCOverRelay, + publicRelay + ]); + }); + }); +}); +//# sourceMappingURL=address-sort.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js.map new file mode 100644 index 000000000..cd13c9400 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/address-sort.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"address-sort.spec.js","sourceRoot":"","sources":["../../test/address-sort.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAErI,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,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ClB,SAAS,EAAE,SAAS,CAAC,0IAA0I,CAAC;gBAChK,WAAW,EAAE,KAAK;aACnB,CAAA;YACD,MAAM,eAAe,GAAG;gBACtB,SAAS,EAAE,SAAS,CAAC,iJAAiJ,CAAC;gBACvK,WAAW,EAAE,KAAK;aACnB,CAAA;YAED,MAAM,SAAS,GAAG;gBAChB,WAAW;gBACX,eAAe;aAChB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACV,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACrC,CAAC,CAAC,CAAA;YAEF,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;YAC1D,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;gBACpC,eAAe;gBACf,WAAW;aACZ,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts new file mode 100644 index 000000000..f0d8e8948 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=array-equals.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts.map new file mode 100644 index 000000000..fe9e9f252 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array-equals.spec.d.ts","sourceRoot":"","sources":["../../test/array-equals.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js new file mode 100644 index 000000000..d504b669b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js @@ -0,0 +1,58 @@ +/* eslint-env mocha */ +import { multiaddr } from '@multiformats/multiaddr'; +import { expect } from 'aegir/chai'; +import { arrayEquals } from '../src/array-equals.js'; +describe('non primitive array equals', () => { + it('returns true if two arrays of multiaddrs are equal', () => { + const a = [ + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/dns4/test.libp2p.io') + ]; + const b = [ + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/dns4/test.libp2p.io') + ]; + expect(arrayEquals(a, b)).to.eql(true); + }); + it('returns true if two arrays of multiaddrs have the same content but different orders', () => { + const a = [ + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/dns4/test.libp2p.io') + ]; + const b = [ + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/dns4/test.libp2p.io') + ]; + expect(arrayEquals(a, b)).to.eql(true); + }); + it('returns false if two arrays of multiaddrs are different', () => { + const a = [ + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/dns4/test.libp2p.io') + ]; + const b = [ + multiaddr('/ip4/127.0.0.1/tcp/8001'), + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/dns4/test.libp2p.io') + ]; + expect(arrayEquals(a, b)).to.eql(false); + }); + it('returns false if two arrays of multiaddrs are partially equal, but different lengths', () => { + const a = [ + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/ip4/127.0.0.1/tcp/3000/ws'), + multiaddr('/dns4/test.libp2p.io') + ]; + const b = [ + multiaddr('/ip4/127.0.0.1/tcp/8000'), + multiaddr('/dns4/test.libp2p.io') + ]; + expect(arrayEquals(a, b)).to.eql(false); + }); +}); +//# sourceMappingURL=array-equals.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js.map new file mode 100644 index 000000000..d0ca9ab41 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/array-equals.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array-equals.spec.js","sourceRoot":"","sources":["../../test/array-equals.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,CAAC,GAAG;YACR,SAAS,CAAC,yBAAyB,CAAC;YACpC,SAAS,CAAC,4BAA4B,CAAC;YACvC,SAAS,CAAC,sBAAsB,CAAC;SAClC,CAAA;QAED,MAAM,CAAC,GAAG;YACR,SAAS,CAAC,yBAAyB,CAAC;YACpC,SAAS,CAAC,4BAA4B,CAAC;YACvC,SAAS,CAAC,sBAAsB,CAAC;SAClC,CAAA;QAED,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CAAC;YACpC,SAAS,CAAC,sBAAsB,CAAC;SAClC,CAAA;QAED,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts new file mode 100644 index 000000000..8bfd23a19 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=close-source.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts.map new file mode 100644 index 000000000..88c55b788 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"close-source.spec.d.ts","sourceRoot":"","sources":["../../test/close-source.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js new file mode 100644 index 000000000..592583a94 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js @@ -0,0 +1,22 @@ +import { expect } from 'aegir/chai'; +import { stubInterface } from 'sinon-ts'; +import { closeSource } from '../src/close-source.js'; +describe('close source', () => { + it('should close an async iterable', async () => { + let count = 0; + const iterable = (async function* () { + while (true) { + yield count++; + } + })(); + const val = await iterable.next(); + expect(val).to.have.property('done', false); + expect(val).to.have.property('value', 0); + closeSource(iterable, stubInterface()); + const last = await iterable.next(); + expect(last).to.have.property('done', true); + expect(last).to.have.property('value', undefined); + expect(count).to.equal(1); + }); +}); +//# sourceMappingURL=close-source.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js.map new file mode 100644 index 000000000..c6d46da00 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/close-source.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"close-source.spec.js","sourceRoot":"","sources":["../../test/close-source.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAGpD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,IAAI,KAAK,GAAG,CAAC,CAAA;QACb,MAAM,QAAQ,GAAG,CAAC,KAAK,SAAU,CAAC;YAChC,OAAO,IAAI,EAAE;gBACX,MAAM,KAAK,EAAE,CAAA;aACd;QACH,CAAC,CAAC,EAAE,CAAA;QAEJ,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QAC3C,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QAExC,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAU,CAAC,CAAA;QAE9C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAClC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC3C,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts new file mode 100644 index 000000000..891c3bcba --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ip-port-to-multiaddr.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts.map new file mode 100644 index 000000000..04dfe649b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ip-port-to-multiaddr.spec.d.ts","sourceRoot":"","sources":["../../test/ip-port-to-multiaddr.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js new file mode 100644 index 000000000..057ae03c6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js @@ -0,0 +1,40 @@ +/* eslint-env mocha */ +import { expect } from 'aegir/chai'; +import { ipPortToMultiaddr, Errors } from '../src/ip-port-to-multiaddr.js'; +describe('IP and port to Multiaddr', () => { + it('creates multiaddr from valid IPv4 IP and port', () => { + const ip = '127.0.0.1'; + const port = '9090'; + expect(ipPortToMultiaddr(ip, port).toString()).to.equal(`/ip4/${ip}/tcp/${port}`); + }); + it('creates multiaddr from valid IPv4 IP and numeric port', () => { + const ip = '127.0.0.1'; + const port = 9090; + expect(ipPortToMultiaddr(ip, port).toString()).to.equal(`/ip4/${ip}/tcp/${port}`); + }); + it('creates multiaddr from valid IPv4 in IPv6 IP and port', () => { + const ip = '0:0:0:0:0:0:101.45.75.219'; + const port = '9090'; + expect(ipPortToMultiaddr(ip, port).toString()).to.equal(`/ip6/::652d:4bdb/tcp/${port}`); + }); + it('creates multiaddr from valid IPv6 IP and port', () => { + const ip = '::1'; + const port = '9090'; + expect(ipPortToMultiaddr(ip, port).toString()).to.equal(`/ip6/${ip}/tcp/${port}`); + }); + it('throws for missing IP address', () => { + // @ts-expect-error invalid args + expect(() => ipPortToMultiaddr()).to.throw('invalid ip provided').with.property('code', Errors.ERR_INVALID_IP_PARAMETER); + }); + it('throws for invalid IP address', () => { + const ip = 'aewmrn4awoew'; + const port = '234'; + expect(() => ipPortToMultiaddr(ip, port)).to.throw('invalid ip:port for creating a multiaddr').with.property('code', Errors.ERR_INVALID_IP); + }); + it('throws for invalid port', () => { + const ip = '127.0.0.1'; + const port = 'garbage'; + expect(() => ipPortToMultiaddr(ip, port)).to.throw('invalid port provided').with.property('code', Errors.ERR_INVALID_PORT_PARAMETER); + }); +}); +//# sourceMappingURL=ip-port-to-multiaddr.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js.map new file mode 100644 index 000000000..5de1faa30 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/ip-port-to-multiaddr.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ip-port-to-multiaddr.spec.js","sourceRoot":"","sources":["../../test/ip-port-to-multiaddr.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAE1E,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,EAAE,GAAG,WAAW,CAAA;QACtB,MAAM,IAAI,GAAG,MAAM,CAAA;QACnB,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAA;IACnF,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,EAAE,GAAG,WAAW,CAAA;QACtB,MAAM,IAAI,GAAG,IAAI,CAAA;QACjB,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAA;IACnF,CAA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E,GAAG,EAAE;QACjC,MAAM,EAAE,GAAG,WAAW,CAAA;QACtB,MAAM,IAAI,GAAG,SAAS,CAAA;QACtB,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,0BAA0B,CAAC,CAAA;IACtI,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts new file mode 100644 index 000000000..3a1455d55 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=is-promise.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts.map new file mode 100644 index 000000000..c6f4c1116 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"is-promise.spec.d.ts","sourceRoot":"","sources":["../../test/is-promise.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js new file mode 100644 index 000000000..a7f9f797e --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js @@ -0,0 +1,28 @@ +import { expect } from 'aegir/chai'; +import { isPromise } from '../src/is-promise.js'; +describe('is-promise', () => { + it('should detect Promise.resolve', () => { + expect(isPromise(Promise.resolve('ok'))).to.be.true(); + }); + it('should detect Promise.reject', () => { + expect(isPromise(Promise.reject(new Error('not ok')).catch(() => { + // prevent unhandled promise rejection + }))).to.be.true(); + }); + it('should detect new Promise', () => { + expect(isPromise(new Promise((resolve, reject) => { }))).to.be.true(); + }); + it('should not detect boolean', () => { + expect(isPromise(true)).to.be.false(); + }); + it('should not detect object', () => { + expect(isPromise({})).to.be.false(); + }); + it('should not detect number', () => { + expect(isPromise({})).to.be.false(); + }); + it('should not detect partial promise', () => { + expect(isPromise({ then: true })).to.be.false(); + }); +}); +//# sourceMappingURL=is-promise.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js.map new file mode 100644 index 000000000..389a1b607 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/is-promise.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-promise.spec.js","sourceRoot":"","sources":["../../test/is-promise.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IACvD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAA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all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts new file mode 100644 index 000000000..b4a89ef0a --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=is-loopback.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts.map new file mode 100644 index 000000000..1f584c0d3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"is-loopback.spec.d.ts","sourceRoot":"","sources":["../../../test/multiaddr/is-loopback.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js new file mode 100644 index 000000000..93e1cd4f6 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js @@ -0,0 +1,50 @@ +/* eslint-env mocha */ +import { multiaddr } from '@multiformats/multiaddr'; +import { expect } from 'aegir/chai'; +import { isLoopback } from '../../src/multiaddr/is-loopback.js'; +describe('multiaddr isLoopback', () => { + it('identifies loopback ip4 multiaddrs', () => { + [ + multiaddr('/ip4/127.0.0.1/tcp/1000'), + multiaddr('/ip4/127.0.1.1/tcp/1000'), + multiaddr('/ip4/127.1.1.1/tcp/1000'), + multiaddr('/ip4/127.255.255.255/tcp/1000') + ].forEach(ma => { + expect(isLoopback(ma)).to.eql(true); + }); + }); + it('identifies non loopback ip4 multiaddrs', () => { + [ + multiaddr('/ip4/101.0.26.90/tcp/1000'), + multiaddr('/ip4/10.0.0.1/tcp/1000'), + multiaddr('/ip4/192.168.0.1/tcp/1000'), + multiaddr('/ip4/172.16.0.1/tcp/1000') + ].forEach(ma => { + expect(isLoopback(ma)).to.eql(false); + }); + }); + it('identifies loopback ip6 multiaddrs', () => { + [ + multiaddr('/ip6/::1/tcp/1000') + ].forEach(ma => { + expect(isLoopback(ma)).to.eql(true); + }); + }); + it('identifies non loopback ip6 multiaddrs', () => { + [ + multiaddr('/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/1000'), + multiaddr('/ip6/::/tcp/1000') + ].forEach(ma => { + expect(isLoopback(ma)).to.eql(false); + }); + }); + it('identifies other multiaddrs as not loopback addresses', () => { + [ + multiaddr('/dns4/wss0.bootstrap.libp2p.io/tcp/443'), + multiaddr('/dns6/wss0.bootstrap.libp2p.io/tcp/443') + ].forEach(ma => { + expect(isLoopback(ma)).to.eql(false); + }); + }); +}); +//# sourceMappingURL=is-loopback.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js.map new file mode 100644 index 000000000..96507cddb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-loopback.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-loopback.spec.js","sourceRoot":"","sources":["../../../test/multiaddr/is-loopback.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,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CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACb,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACtC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D;YACE,SAAS,CAAC,wCAAwC,CAAC;YACnD,SAAS,CAAC,wCAAwC,CAAC;SACpD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACb,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACtC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts new file mode 100644 index 000000000..2cce2a5d5 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=is-private.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts.map new file mode 100644 index 000000000..ec8658cb4 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"is-private.spec.d.ts","sourceRoot":"","sources":["../../../test/multiaddr/is-private.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js new file mode 100644 index 000000000..f1e07c301 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js @@ -0,0 +1,60 @@ +/* eslint-env mocha */ +import { multiaddr } from '@multiformats/multiaddr'; +import { expect } from 'aegir/chai'; +import { isPrivate } from '../../src/multiaddr/is-private.js'; +describe('multiaddr isPrivate', () => { + it('identifies private ip4 multiaddrs', () => { + [ + multiaddr('/ip4/127.0.0.1/tcp/1000'), + multiaddr('/ip4/10.0.0.1/tcp/1000'), + multiaddr('/ip4/192.168.0.1/tcp/1000'), + multiaddr('/ip4/172.16.0.1/tcp/1000') + ].forEach(ma => { + expect(isPrivate(ma)).to.eql(true); + }); + }); + it('identifies public ip4 multiaddrs', () => { + [ + multiaddr('/ip4/101.0.26.90/tcp/1000'), + multiaddr('/ip4/40.1.20.9/tcp/1000'), + multiaddr('/ip4/92.168.0.1/tcp/1000'), + multiaddr('/ip4/2.16.0.1/tcp/1000') + ].forEach(ma => { + expect(isPrivate(ma)).to.eql(false); + }); + }); + it('identifies private ip6 multiaddrs', () => { + [ + multiaddr('/ip6/fd52:8342:fc46:6c91:3ac9:86ff:fe31:7095/tcp/1000'), + multiaddr('/ip6/fd52:8342:fc46:6c91:3ac9:86ff:fe31:1/tcp/1000') + ].forEach(ma => { + expect(isPrivate(ma)).to.eql(true); + }); + }); + it('identifies public ip6 multiaddrs', () => { + [ + multiaddr('/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/1000'), + multiaddr('/ip6/2000:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/1000') + ].forEach(ma => { + expect(isPrivate(ma)).to.eql(false); + }); + }); + it('identifies other multiaddrs as not private addresses', () => { + [ + multiaddr('/dns4/wss0.bootstrap.libp2p.io/tcp/443'), + multiaddr('/dns6/wss0.bootstrap.libp2p.io/tcp/443') + ].forEach(ma => { + expect(isPrivate(ma)).to.eql(false); + }); + }); + it('identifies non-public addresses', () => { + [ + multiaddr('/ip4/127.0.0.1/tcp/1000/p2p-circuit'), + multiaddr('/unix/foo/bar/baz.sock'), + multiaddr('/ip4/127.0.0.1/sctp/1000') + ].forEach(ma => { + expect(isPrivate(ma)).to.eql(true); + }); + }); +}); +//# sourceMappingURL=is-private.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js.map new file mode 100644 index 000000000..d86bcb83b --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/multiaddr/is-private.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is-private.spec.js","sourceRoot":"","sources":["../../../test/multiaddr/is-private.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAE7D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C;YACE,SAAS,CAAC,yBAAyB,CAAC;YACpC,SAAS,CAAC,wBAAwB,CAAC;YACnC,SAAS,CAAC,2BAA2B,CAAC;YACtC,SAAS,CAAC,0BAA0B,CAAC;SACtC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACb,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACpC,C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AAG,CAAC,KAAK,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC;YACE,SAAS,CAAC,qCAAqC,CAAC;YAChD,SAAS,CAAC,wBAAwB,CAAC;YACnC,SAAS,CAAC,0BAA0B,CAAC;SACtC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACb,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts new file mode 100644 index 000000000..ef708e631 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=peer-job-queue.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts.map new file mode 100644 index 000000000..ac482ec29 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"peer-job-queue.spec.d.ts","sourceRoot":"","sources":["../../test/peer-job-queue.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js new file mode 100644 index 000000000..8439fa2c1 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js @@ -0,0 +1,31 @@ +/* eslint-env mocha */ +import { createEd25519PeerId } from '@libp2p/peer-id-factory'; +import { expect } from 'aegir/chai'; +import pDefer from 'p-defer'; +import { PeerJobQueue } from '../src/peer-job-queue.js'; +describe('peer job queue', () => { + it('should have jobs', async () => { + const deferred = pDefer(); + const peerIdA = await createEd25519PeerId(); + const peerIdB = await createEd25519PeerId(); + const queue = new PeerJobQueue({ + concurrency: 1 + }); + expect(queue.hasJob(peerIdA)).to.be.false(); + void queue.add(async () => { + await deferred.promise; + }, { + peerId: peerIdB + }); + void queue.add(async () => { + await deferred.promise; + }, { + peerId: peerIdA + }); + expect(queue.hasJob(peerIdA)).to.be.true(); + deferred.resolve(); + await queue.onIdle(); + expect(queue.hasJob(peerIdA)).to.be.false(); + }); +}); +//# sourceMappingURL=peer-job-queue.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js.map new file mode 100644 index 000000000..7a69362d9 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/peer-job-queue.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"peer-job-queue.spec.js","sourceRoot":"","sources":["../../test/peer-job-queue.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA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/utils/dist/test/stream-to-ma-conn.spec.d.ts new file mode 100644 index 000000000..650c5eddf --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stream-to-ma-conn.spec.d.ts.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.d.ts.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.d.ts.map new file mode 100644 index 000000000..9ed10549d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stream-to-ma-conn.spec.d.ts","sourceRoot":"","sources":["../../test/stream-to-ma-conn.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js new file mode 100644 index 000000000..ce1458c66 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js @@ -0,0 +1,68 @@ +/* eslint-env mocha */ +import { defaultLogger, logger } from '@libp2p/logger'; +import { multiaddr } from '@multiformats/multiaddr'; +import { expect } from 'aegir/chai'; +import all from 'it-all'; +import { pair } from 'it-pair'; +import { pipe } from 'it-pipe'; +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; +import { streamToMaConnection } from '../src/stream-to-ma-conn.js'; +function toMuxedStream(stream) { + const muxedStream = { + ...stream, + close: async () => { }, + closeRead: async () => { }, + closeWrite: async () => { }, + abort: () => { }, + direction: 'outbound', + timeline: { + open: Date.now() + }, + metadata: {}, + id: `muxed-stream-${Math.random()}`, + status: 'open', + readStatus: 'ready', + writeStatus: 'ready', + log: logger('muxed-stream') + }; + return muxedStream; +} +describe('Convert stream into a multiaddr connection', () => { + const localAddr = multiaddr('/ip4/101.45.75.219/tcp/6000'); + const remoteAddr = multiaddr('/ip4/100.46.74.201/tcp/6002'); + it('converts a stream and adds the provided metadata', async () => { + const stream = pair(); + const maConn = streamToMaConnection({ + stream: toMuxedStream(stream), + localAddr, + remoteAddr, + logger: defaultLogger() + }); + expect(maConn).to.exist(); + expect(maConn.sink).to.exist(); + expect(maConn.source).to.exist(); + expect(maConn.remoteAddr).to.eql(remoteAddr); + expect(maConn.timeline).to.exist(); + expect(maConn.timeline.open).to.exist(); + expect(maConn.timeline.close).to.not.exist(); + await maConn.close(); + expect(maConn.timeline.close).to.exist(); + }); + it('can stream data over the multiaddr connection', async () => { + const stream = pair(); + const maConn = streamToMaConnection({ + stream: toMuxedStream(stream), + localAddr, + remoteAddr, + logger: defaultLogger() + }); + const data = uint8ArrayFromString('hey'); + const streamData = await pipe(async function* () { + yield data; + }, maConn, async (source) => all(source)); + expect(streamData).to.eql([data]); + // underlying stream end closes the connection + expect(maConn.timeline.close).to.exist(); + }); +}); +//# sourceMappingURL=stream-to-ma-conn.spec.js.map \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js.map b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js.map new file mode 100644 index 000000000..a720f1506 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/test/stream-to-ma-conn.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stream-to-ma-conn.spec.js","sourceRoot":"","sources":["../../test/stream-to-ma-conn.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,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KAAK,SAAU,CAAC;YACd,MAAM,IAAI,CAAA;QACZ,CAAC,EACD,MAAM,EACN,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAC9B,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QACjC,8CAA8C;QAC9C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/tsconfig.tsbuildinfo b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/tsconfig.tsbuildinfo new file mode 100644 index 000000000..c50692c47 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../interface/dist/src/errors.d.ts","../../../node_modules/it-pushable/dist/src/index.d.ts","../../../node_modules/p-defer/index.d.ts","../../../node_modules/race-signal/dist/src/index.d.ts","../../../node_modules/uint8arraylist/dist/src/index.d.ts","../../../node_modules/get-iterator/dist/src/index.d.ts","../src/is-promise.ts","../../../node_modules/multiformats/dist/types/src/bases/interface.d.ts","../../../node_modules/multiformats/dist/types/src/block/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../../../node_modules/multiformats/dist/types/src/link/interface.d.ts","../../../node_modules/multiformats/dist/types/src/cid.d.ts","../../interface/dist/src/peer-id/index.d.ts","../../logger/dist/src/index.d.ts","../../../node_modules/it-stream-types/dist/src/index.d.ts","../src/close-source.ts","../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.d.ts","../../../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../../interface/dist/src/connection/index.d.ts","../../interface/dist/src/peer-info/index.d.ts","../../interface/dist/src/content-routing/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../interface/dist/src/events.d.ts","../../interface/dist/src/metrics/index.d.ts","../../interface/dist/src/peer-routing/index.d.ts","../../interface/dist/src/peer-store/index.d.ts","../../interface/dist/src/startable.d.ts","../../interface/dist/src/stream-handler/index.d.ts","../../interface/dist/src/topology/index.d.ts","../../interface/dist/src/stream-muxer/index.d.ts","../../interface/dist/src/transport/index.d.ts","../../interface/dist/src/index.d.ts","../src/abstract-stream.ts","../../../node_modules/@multiformats/multiaddr-matcher/dist/src/index.d.ts","../../../node_modules/private-ip/lib/index.d.ts","../src/multiaddr/is-private.ts","../src/address-sort.ts","../src/array-equals.ts","../src/index.ts","../../../node_modules/@chainsafe/is-ip/lib/is-ip.d.ts","../src/ip-port-to-multiaddr.ts","../../../node_modules/eventemitter3/index.d.ts","../../../node_modules/p-queue/dist/queue.d.ts","../../../node_modules/p-queue/dist/options.d.ts","../../../node_modules/p-queue/dist/priority-queue.d.ts","../../../node_modules/p-queue/dist/index.d.ts","../src/peer-job-queue.ts","../src/stream-to-ma-conn.ts","../../../node_modules/is-loopback-addr/dist/src/index.d.ts","../src/multiaddr/is-loopback.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/chai-parentheses/index.d.ts","../../../node_modules/@types/chai-subset/index.d.ts","../../../node_modules/chai-bites/index.d.ts","../../../node_modules/@types/chai-string/index.d.ts","../../../node_modules/aegir/dist/utils/chai.d.ts","../../../node_modules/delay/index.d.ts","../../../node_modules/it-all/dist/src/index.d.ts","../../../node_modules/it-drain/dist/src/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../test/abstract-stream.spec.ts","../test/address-sort.spec.ts","../test/array-equals.spec.ts","../../../node_modules/sinon-ts/dist/src/index.d.ts","../test/close-source.spec.ts","../test/ip-port-to-multiaddr.spec.ts","../test/is-promise.spec.ts","../../interface/dist/src/keys/index.d.ts","../../peer-id-factory/dist/src/index.d.ts","../test/peer-job-queue.spec.ts","../../../node_modules/it-pair/dist/src/index.d.ts","../../../node_modules/it-pipe/dist/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../../../node_modules/multiformats/dist/types/src/interface.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../../../node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../../../node_modules/multiformats/dist/types/src/varint.d.ts","../../../node_modules/multiformats/dist/types/src/bytes.d.ts","../../../node_modules/multiformats/dist/types/src/index.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/raw.d.ts","../../../node_modules/multiformats/dist/types/src/codecs/json.d.ts","../../../node_modules/multiformats/dist/types/src/bases/base.d.ts","../../../node_modules/multiformats/dist/types/src/basics.d.ts","../../../node_modules/uint8arrays/dist/src/util/bases.d.ts","../../../node_modules/uint8arrays/dist/src/from-string.d.ts","../test/stream-to-ma-conn.spec.ts","../test/multiaddr/is-loopback.spec.ts","../test/multiaddr/is-private.spec.ts","../../../node_modules/keyv/src/index.d.ts","../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../node_modules/@types/responselike/index.d.ts","../../../node_modules/@types/cacheable-request/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dns-packet/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/keyv/index.d.ts","../../../node_modules/@types/linkify-it/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash.random/index.d.ts","../../../node_modules/@types/lodash.range/index.d.ts","../../../node_modules/@types/mdurl/encode.d.ts","../../../node_modules/@types/mdurl/decode.d.ts","../../../node_modules/@types/mdurl/parse.d.ts","../../../node_modules/@types/mdurl/format.d.ts","../../../node_modules/@types/mdurl/index.d.ts","../../../node_modules/@types/markdown-it/lib/common/utils.d.ts","../../../node_modules/@types/markdown-it/lib/token.d.ts","../../../node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.ts","../../../node_modules/@types/markdown-it/lib/helpers/index.d.ts","../../../node_modules/@types/markdown-it/lib/ruler.d.ts","../../../node_modules/@types/markdown-it/lib/rules_block/state_block.d.ts","../../../node_modules/@types/markdown-it/lib/parser_block.d.ts","../../../node_modules/@types/markdown-it/lib/rules_core/state_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_core.d.ts","../../../node_modules/@types/markdown-it/lib/parser_inline.d.ts","../../../node_modules/@types/markdown-it/lib/renderer.d.ts","../../../node_modules/@types/markdown-it/lib/index.d.ts","../../../node_modules/@types/markdown-it/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/multicast-dns/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/retry/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/strip-bom/index.d.ts","../../../node_modules/@types/strip-json-comments/index.d.ts","../../../node_modules/@types/which/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/xsalsa20/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"0a8feee55ed6ae442195ab845273444933cfedb5bac54958938ca705099036b4","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1d58c629ad80ffc8b5c64d899c33d11e4ee02c8f167781065b89fd1c1f0d6363","fac83d4c6898d5bf90c508cc84409ded40fdc14611cf42d7fb750fb2c7847979","acd5d501223e3a7cdd229b501fce5fb071937b72bd05fa33e543eb21c8ee0aba","c71c8a94f58b8181759a57ba8631f57bfbaa23ed00bbd49610b6f953b78984d9","176f19f35d1cfa16aa7e3d7a2cf36c01431d256901163b8e9a3e628b315bbb0d","485ae32287d8df9e74f68a9dc96c9211a7cfe8b302717043a988a40d930330d2",{"version":"742e53902e78ad8122cdc90371f2d8fc5faece2b6e878d8d6efd812940d930e2","signature":"7aa3316879206abd223015013bf6c6ff3b10a6b06d10572213166a707110de23"},"f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","3b0253c238cf880be78a88fec2065eb4e3cb7ee1a0d0b02f88bb9468c0c2bf8a","cb4b40f34fe4b1d87c530a0f3c2c1e043e338829fab8cf5cbd92a91c8c1374b8","c84146dbc9d2e5f43d2cbf15485a4eabf90219dbb66c0d481f20f12d3851bffc",{"version":"32128252cd39418907d8a147f268c48d2b8d80a1f1389b00eba88a36c52bfaf5","signature":"2b81a24039ccd9ddedd6dbdf346d862cdeee25466d4a90a192b8939e498db264"},"5212dd78d1d63ab33332c8846a0ea5ce248159e74033cde16de48373036b4704","d71577e78c7a4257074aaf82f595724175210c89e8b467ef82f949a6cbd891bc","6f1269742a3253f9f0418764340cc049d110697f12dd5021f78efcdfb99099c9","eee82fbd46c101c733f2678a239b73e55c947ad1ef42d885d8221811bbe38ef9","99c24f331c9f4e75a779b9a988e942442db3cf29923ceb820d3bdd4ed1edfef2","d8b1ae2f0f761c8ce3cb48b8b7c784de8c1ee0eed942be1e895116be031c246d","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","b1ed4d62618cc9cee9a264ce3b70421d42219e6451f6a79d4f11019610681109","8ed569ceee71183d76f430860754926886ba6d2e84ef817a7a40afb85bbcc373","650d178c1248e84c587db73065745a62139a3bc6c209a92864f937d08a7ebf34","a11fa79b804b6e387126bada8286a400b2a2dcd4df496e5b8efa2d93186adad0","230eb449f719119cab1728252f20ecdd36d7a20cef659e4a51ada1a232a8aaad","85786f052b5dcd0b36564b657a9aea3e80f1fd0e76e4606a4400ec21928892c1","d9ee6bcbf3231a4446de6241fe71967f73d6ae7e7279c5540ee52e1dea4d3114","1bf687d978bdd6d5aff10b9eb0ff0695179f8594d4446946fd0182d6d25fa433","6688472a235825a83c602e9fb0b24f148783314a1c51f2539fcb024bed667967","a304b8daaddfc1c540707332ca2e671df57c430cc553b9d70eda9df948e103f1",{"version":"c9ff0d146eedd16e78b8c3f1a36f76ecb371fe1173cb450c894f1eba48ef16bd","signature":"75e0c62536016dac8cc0d825742ff7cc4c0455ebc86923e47edcc19edac0997c"},"b095fc8b641823c0a9dff9b0c7efa153db137c7c1512bb600995cf281b8f607f","db5a96761bf022851439f3e689ea8b7aca6055037647ba21501ed22d7c1b3bb3",{"version":"d7ed421554f0eef807322044d3cffea7ec2771b8cd97c67b528076a9a8c3b283","signature":"4c352d36197c9e29e078ce883643efb64cc298e3c00c06ab78fbfdd4c4054942"},{"version":"a9f78213590af9b60030f229d15779d4fb6af8d5b3db0fd9a508f757fb579782","signature":"38efa025cf48a42e6f449592f2bccb35729b182b1f6435701f75c6fe555b9cde"},{"version":"113db3ac0fe8c80ac188fb177fa22d31c468984ccd62a1d01bec0ee4af14b335","signature":"acf7eebb7892789362a3c4b294be30be9323f2942d37d208494b4ef9514b9cde"},{"version":"3f9ba5abd8cd7e746e5af53848a0735a07ac61d42d4e1c3974046923200a325d","signature":"a289d85f4205d15045c635cc128fd7d6a2ac1e995d0eba2f40f85878ebc4b989"},"017319c1e1df8aa24f5e7a13e071f7d038f080d8c0498e5edafb3468ff8f0e51",{"version":"b392b5b6aa78061abdb396cbd0bb07719fef5512c63cebda6f4a96031514d73b","signature":"3d0fc7bb7dd39dc9df952e0fb97874ab25fd491392a4453fa7f4e65aef307ac9"},"27679e96d1bd38c5938178aaf4abe8627493090b63d6bae2ce8436e6a87ebe4d","a77fbecee25688f568e18b43f8f54195d6c278a2a9a687ada5ab3d2f726524eb","e29f2b3a93ca3392fe29fa8e7b93985e854b44fe28e2b5c113f08296095bd6b7","d27956c8b392088a06d882e1edb58aab4d5cf5ab1229b73f99329ab21f352147","d643518d0b08b3d8d6e7f1fa884bca57ef95caaa1c312abbd9e1d4ed0d51c370",{"version":"2f03b5034f00ab282e04678eed91559b17bec00898341971c4f009b44f7b2d23","signature":"2808ffd2725582e383a1d994188f0ad0eb2c456dc9845e8b6aa327383adb061e"},{"version":"3719f4beedb87227ef78fcec7507e38d757fb1b90dc170f6cd44b75461731677","signature":"c49c1bb01dbcdf1c3c5956ce107052f7485c899fc3c9fc71d3c3be5c71d003d8"},"07978e331b95744087d1fa7ad48cc4d67eb092e12131534382f6e510cc47ec92",{"version":"8d56b56605f668cb2e385c11c250b777f35b4f5b88abca7147e3ebfbe7bd5d82","signature":"4f590c560ee71a07def1a8e0d663d9d7ddb0d806deab94d8ceaac1f6408ac314"},{"version":"4a2c144ea6f441e9616ec77fe9b1009b0cdf6db0cd9727b8d99623975cd6c693","affectsGlobalScope":true},{"version":"86e56d97b13ef0a58bc9c59aee782ae7d47d63802b5b32129ec5e5d62c20dbfa","affectsGlobalScope":true},{"version":"c1f79c6d85cd84518fd7349588b3c61bdc189f58e3866f925cbf4631c81e31f9","affectsGlobalScope":true},{"version":"54db406753da16e177f094aa66da79840f447de6d87ddd1543a80c9418c52545","affectsGlobalScope":true},{"version":"42f28f4cfca4a70bd89c1d55d76c7978275030b894f6793f36890265c11a83a4","affectsGlobalScope":true},{"version":"7cf1027da9599f056355b46bbea31dbf7f715f797dffb9cbb3402d4490c503e5","affectsGlobalScope":true},"96dbd0787b57ae02981d26d5f2441f0f8444fb46d7578c56527eab89cff13a7d","27573b15894c6311146838fa3b45786bacc013a4bca6c84adc1b11a4e7c8a4c0","5ccc3c7f73ef48c223635cd4506f21133560de7abc4c09c623327bb1b54386dc","687ec53a7422d8cf80477fffa82a2db211f724039267931642befcd4907aec26","7d2a0ba1297be385a89b5515b88cd31b4a1eeef5236f710166dc1b36b1741e1b","db0d9343e7723002290ea188ef47650dca80bb651986882220110bb1576f46a2",{"version":"4a9ac765c4a37932b6d958a0c4fe68b9561e2bba795985ed185afab9ab5aefa9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2ede17664554ade03b2726fd518688dc082ec16ac16d05b4a0df2e8dac068f64","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"4e7481d512e0c06b0362c59d04f23b0882d7ab5a2f488ef2a02e6b33319a349f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"8d16e3ff29dd0650435766702b01c2f7e9d1f289a48fcbf8e93687d6ecf33f26",{"version":"f7cf03df0844948ee0d6e357d5c7f6da98b36bd0e541d624a97917c4f861ebe5","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"bb1cc536321a00da93f6cc74d1d84f93a01dfec4bc0d0e091f9a9790bca2f397","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"81b836e62f4a586992d66731745142491e4b4205d2c986e923883282f646b72f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"e1712267198fc3dd7903d0b945d5049fd56d68cadaf986c0adc40235fee43488","81c6dd936bf342efbb1b1a5440a4300db5d39d70a6ad49ebc91ca7033ae9ce79",{"version":"68106a6a0c132da45e1d267d9b5b3cff4325605e53822bed06efcb4668be5495","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"e1ea54d2635ea7e40d668c71bd74fb4aa8671672a3421cb5a7dc06711d87aa23","56558ae167446acf230ea2cc072a835309a37ae63d286b484308afd8c504c2d6","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","88de5467cd5e4c2c1384629806d56ac1215657bddf39ef9f60a0e05beee2b131","ff5820394809bfc32a7e4586ff11b3c07327a0f4c756709aef92f1cd73d6da48","bfe2af20f3ff0579331661ef4c5d2597e0c31a7a0d760e41eaff0502bf064c4d","f52a0e53f79d7fd1c1c55a3cbda59499d4cce75f3188969024cdc286b29ad3ea","e2dd36a524ea5b13de1ed104ede9cea79696588175c1df1940d6a29113a4aee0","ac63a01fcac70315fc9b416e9a57e568b18032c7cfcaa314e1751f03ef71286f",{"version":"62c3a016b6d3ed4419832b570e300af09408b95537ac2ec3daab145191d5df4b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a9359f5711010117efaac4217642abe8c52cfd30cb3faefa38a4f1fcd27b927b","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"f36e8f65bb029d83ad80a4a63820132ce4d02daac1b6561de0cf321c3c6c014a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","5bfd23a4c8765d347e296639b75f50f4dfca445d2eb41ea0892e68b8976a0cdf","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","d58289beaadf0380170b0063569e1a01c60ee6b8f2dc3cccfff4fd965154d555","b8442e9db28157344d1bc5d8a5a256f1692de213f0c0ddeb84359834015a008c","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","68a0d0c508e1b6d8d23a519a8a0a3303dc5baa4849ca049f21e5bad41945e3fc","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","13e834b958fe7e9010d2161497f98916974a0618be7a773281a253a948da8b0d","dae5c8e0ca15779492744cb4071c5b3c94c2121940fbaefb43ca9a045557a0c9","f313731860257325f13351575f381fef333d4dfe30daf5a2e72f894208feea08","951b37f7d86f6012f09e6b35f1de57c69d75f16908cb0adaa56b93675ea0b853","a45efe8e9134ef64a5e3825944bc16fffaf130b82943844523d7a7f7c1fd91b2","969aa6509a994f4f3b09b99d5d29484d8d52a2522e133ef9b4e54af9a3e9feaf","f1ceb4cbff7fc122b13f8a43e4d60e279a174c93420b2d2f76a6c8ce87934d7f","0f9e381eecc5860f693c31fe463b3ca20a64ca9b8db0cf6208cd4a053f064809","95902d5561c6aac5dfc40568a12b0aca324037749dcd32a81f23423bfde69bab","5dfb2aca4136abdc5a2740f14be8134a6e6b66fd53470bb2e954e40f8abfaf3e","577463167dd69bd81f76697dfc3f7b22b77a6152f60a602a9218e52e3183ad67","b8396e9024d554b611cbe31a024b176ba7116063d19354b5a02dccd8f0118989","4b28e1c5bf88d891e07a1403358b81a51b3ba2eae1ffada51cca7476b5ac6407","7150ad575d28bf98fae321a1c0f10ad17b127927811f488ded6ff1d88d4244e5","8b155c4757d197969553de3762c8d23d5866710301de41e1b66b97c9ed867003","93733466609dd8bf72eace502a24ca7574bd073d934216e628f1b615c8d3cb3c","45e9228761aabcadb79c82fb3008523db334491525bdb8e74e0f26eaf7a4f7f4","aeacac2778c9821512b6b889da79ac31606a863610c8f28da1e483579627bf90","569fdb354062fc098a6a3ba93a029edf22d6fe480cf72b231b3c07832b2e7c97","bf9876e62fb7f4237deafab8c7444770ef6e82b4cad2d5dc768664ff340feeb2","6cf60e76d37faf0fbc2f80a873eab0fd545f6b1bf300e7f0823f956ddb3083e9","6adaa6103086f931e3eee20f0987e86e8879e9d13aa6bd6075ccfc58b9c5681c","ee0af0f2b8d3b4d0baf669f2ff6fcef4a8816a473c894cc7c905029f7505fed0","89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","1af1f2c02132bafa25c4c4b7c415e0a59ba959d6db6bd1800a43fb5d943e3f77","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318",{"version":"0ea93d01083b3d5863cc98cb589b5d0eac55d14417487f9e5e455dfa0b17c660","affectsGlobalScope":true},"62a8effc4dd17bbc2c05927b4ca5f67e73fdb458e203b128c041d0d70ffa6b55","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a",{"version":"525b52b38b44420fb1758c0917e7b67cf379f7f9477d2ba7343f3d5f50a44258","affectsGlobalScope":true},"4006c872e38a2c4e09c593bc0cdd32b7b4f5c4843910bea0def631c483fff6c5","ab6aa3a65d473871ee093e3b7b71ed0f9c69e07d1d4295f45c9efd91a771241d","dc5fa6012f710446a9ed04156d986bd81d9119c93ecb63d85c6a9d493264b5dc","f7163a5d37d21f636f6a5cd1c064ce95fada21917859a64b6cc49a8b6fd5c1a8","5aac5efd20619b522faeeb0badf250834850c605ad8c5fb91c6502a54057f413","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","5d30d04a14ed8527ac5d654dc345a4db11b593334c11a65efb6e4facc5484a0e","74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185"],"root":[67,76,180,[183,186],188,194,195,197,[210,212],[214,216],219,[235,237]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":false,"esModuleInterop":true,"module":7,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":false,"noUnusedLocals":true,"noUnusedParameters":false,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":9},"fileIdsList":[[162],[79,162],[77,78,162],[132,135,161,162,169,238,239,240],[162,198],[162,242],[162,169],[132,162,169],[162,262],[162,250,252,253,254,255,256,257,258,259,260,261,262],[162,250,251,253,254,255,256,257,258,259,260,261,262],[162,251,252,253,254,255,256,257,258,259,260,261,262],[162,250,251,252,254,255,256,257,258,259,260,261,262],[162,250,251,252,253,255,256,257,258,259,260,261,262],[162,250,251,252,253,254,256,257,258,259,260,261,262],[162,250,251,252,253,254,255,257,258,259,260,261,262],[162,250,251,252,253,254,255,256,258,259,260,261,262],[162,250,251,252,253,254,255,256,257,259,260,261,262],[162,250,251,252,253,254,255,256,257,258,260,261,262],[162,250,251,252,253,254,255,256,257,258,259,261,262],[162,250,251,252,253,254,255,256,257,258,259,260,262],[162,250,251,252,253,254,255,256,257,258,259,260,261],[162,284],[162,269],[162,273,274,275],[162,272],[162,274],[162,249,270,271,276,279,281,282,283],[162,271,277,278,284],[162,277,280],[162,271,272,277,284],[162,271,284],[162,286],[162,265,266,267,268],[126,132,162,169,244],[83,162],[119,162],[120,125,153,162],[121,132,133,140,150,161,162],[121,122,132,140,162],[123,162],[124,125,133,141,162],[125,150,158,162],[126,128,132,140,162],[127,162],[128,129,162],[132,162],[130,132,162],[119,132,162],[132,133,134,150,161,162],[132,133,134,147,150,153,162],[117,162,166],[128,132,135,140,150,161,162],[132,133,135,136,140,150,158,161,162],[135,137,150,158,161,162],[83,84,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168],[132,138,162],[139,161,162,166],[128,132,140,150,162],[141,162],[142,162],[119,143,162],[144,160,162,166],[145,162],[146,162],[132,147,148,162],[147,149,162,164],[120,132,150,151,152,153,162],[120,150,152,162],[150,151,162],[153,162],[154,162],[119,150,162],[132,156,157,162],[156,157,162],[125,140,150,158,162],[159,162],[140,160,162],[120,135,146,161,162],[125,162],[150,162,163],[139,162,164],[162,165],[120,125,132,134,143,150,161,162,164,166],[150,162,167],[135,150,162,169],[162,295,334],[162,295,319,334],[162,334],[162,295],[162,295,320,334],[162,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333],[162,320,334],[162,198,209],[162,208],[132,135,137,150,158,161,162,167,169],[162,341],[132,150,162,169],[162,198,199,200,201,202,203],[162,198,199],[75,162],[68,162],[162,228,229,230,231],[71,72,162],[71,162],[69,162],[162,222],[70,162],[70,162,224],[72,162,223,224,225,226,227],[68,69,70,71,162,222],[68,69,70,162],[162,189,190,191,192],[162,190],[162,190,191],[162,209],[162,233],[162,228,232],[94,98,161,162],[94,150,161,162],[89,162],[91,94,158,161,162],[140,158,162],[89,162,169],[91,94,140,161,162],[86,87,90,93,120,132,150,161,162],[86,92,162],[90,94,120,153,161,162,169],[120,162,169],[110,120,162,169],[88,89,162,169],[94,162],[88,89,90,91,92,93,94,95,96,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,162],[94,101,102,162],[92,94,102,103,162],[93,162],[86,89,94,162],[94,98,102,103,162],[98,162],[92,94,97,161,162],[86,91,92,94,98,101,162],[120,150,162],[89,94,110,120,162,166,169],[65,73,75,79,162,179],[72,81,162,179],[73,79,80,81,82,162,170,171,172,173,174,175,176,178],[80,162],[70,72,162],[73,79,162],[73,81,162,179],[65,75,80,162,179],[73,80,162],[79,80,162,170,177,179],[73,162],[73,162,217],[61,62,63,64,65,74,75,76,80,162,179],[162,173,181,183],[66,67,74,75,162],[61,79,162,187],[79,162,196],[79,162,182],[61,73,162,193],[79,80,162,179],[65,74,162,179,180,204,205,206,207,209],[79,162,184,204],[79,162,185,204],[76,162,179,204,213],[162,188,204],[67,162,204],[79,162,197,204],[79,162,183,204],[63,162,194,204,218],[65,74,75,79,80,162,195,204,206,220,221,234],[65,74,75,80,179],[173],[74,75],[79],[73,193],[79,80,179]],"referencedMap":[[187,1],[181,2],[78,2],[79,3],[77,2],[241,4],[199,5],[203,5],[201,5],[198,1],[243,6],[244,7],[239,1],[245,1],[246,1],[247,1],[248,8],[249,1],[263,9],[264,9],[251,10],[252,11],[250,12],[253,13],[254,14],[255,15],[256,16],[257,17],[258,18],[259,19],[260,20],[261,21],[262,22],[285,23],[270,24],[276,25],[274,1],[273,26],[275,27],[284,28],[279,29],[281,30],[282,31],[283,32],[277,1],[278,32],[280,32],[272,32],[271,1],[287,33],[266,1],[265,1],[268,24],[269,34],[267,24],[288,1],[289,1],[290,1],[242,1],[291,35],[83,36],[84,36],[119,37],[120,38],[121,39],[122,40],[123,41],[124,42],[125,43],[126,44],[127,45],[128,46],[129,46],[131,47],[130,48],[132,49],[133,50],[134,51],[118,52],[168,1],[135,53],[136,54],[137,55],[169,56],[138,57],[139,58],[140,59],[141,60],[142,61],[143,62],[144,63],[145,64],[146,65],[147,66],[148,66],[149,67],[150,68],[152,69],[151,70],[153,71],[154,72],[155,73],[156,74],[157,75],[158,76],[159,77],[160,78],[161,79],[162,80],[163,81],[164,82],[165,83],[166,84],[167,85],[292,1],[293,1],[240,86],[294,1],[319,87],[320,88],[295,89],[298,89],[317,87],[318,87],[308,87],[307,90],[305,87],[300,87],[313,87],[311,87],[315,87],[299,87],[312,87],[316,87],[301,87],[302,87],[314,87],[296,87],[303,87],[304,87],[306,87],[310,87],[321,91],[309,87],[297,87],[334,92],[333,1],[328,91],[330,93],[329,91],[322,91],[323,91],[325,91],[327,91],[331,93],[332,93],[324,93],[326,93],[335,94],[209,95],[208,1],[336,1],[337,1],[286,1],[338,1],[339,96],[340,7],[341,1],[342,97],[343,98],[204,99],[85,1],[202,5],[200,100],[205,1],[189,1],[66,1],[196,1],[206,1],[207,1],[220,101],[221,101],[62,1],[75,1],[238,47],[231,102],[68,1],[232,103],[69,104],[227,1],[72,105],[222,106],[230,107],[229,107],[224,108],[225,109],[70,1],[228,110],[223,111],[71,112],[226,1],[63,1],[193,113],[191,114],[192,115],[190,1],[182,1],[64,1],[213,116],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[65,1],[234,117],[233,118],[101,119],[108,120],[100,119],[115,121],[92,122],[91,123],[114,7],[109,124],[112,125],[94,126],[93,127],[89,128],[88,129],[111,130],[90,131],[95,132],[96,1],[99,132],[86,1],[117,133],[116,132],[103,134],[104,135],[106,136],[102,137],[105,138],[110,7],[97,139],[98,140],[107,141],[87,142],[113,143],[80,144],[82,145],[61,1],[170,8],[179,146],[217,1],[171,147],[73,148],[81,149],[172,150],[173,149],[174,1],[175,147],[177,151],[176,152],[178,153],[74,154],[218,155],[180,156],[184,157],[185,1],[76,158],[186,1],[188,159],[67,1],[197,160],[183,161],[194,162],[195,163],[210,164],[211,165],[212,166],[214,167],[215,168],[216,169],[236,170],[237,171],[219,172],[235,173]],"exportedModulesMap":[[187,1],[181,2],[78,2],[79,3],[77,2],[241,4],[199,5],[203,5],[201,5],[198,1],[243,6],[244,7],[239,1],[245,1],[246,1],[247,1],[248,8],[249,1],[263,9],[264,9],[251,10],[252,11],[250,12],[253,13],[254,14],[255,15],[256,16],[257,17],[258,18],[259,19],[260,20],[261,21],[262,22],[285,23],[270,24],[276,25],[274,1],[273,26],[275,27],[284,28],[279,29],[281,30],[282,31],[283,32],[277,1],[278,32],[280,32],[272,32],[271,1],[287,33],[266,1],[265,1],[268,24],[269,34],[267,24],[288,1],[289,1],[290,1],[242,1],[291,35],[83,36],[84,36],[119,37],[120,38],[121,39],[122,40],[123,41],[124,42],[125,43],[126,44],[127,45],[128,46],[129,46],[131,47],[130,48],[132,49],[133,50],[134,51],[118,52],[168,1],[135,53],[136,54],[137,55],[169,56],[138,57],[139,58],[140,59],[141,60],[142,61],[143,62],[144,63],[145,64],[146,65],[147,66],[148,66],[149,67],[150,68],[152,69],[151,70],[153,71],[154,72],[155,73],[156,74],[157,75],[158,76],[159,77],[160,78],[161,79],[162,80],[163,81],[164,82],[165,83],[166,84],[167,85],[292,1],[293,1],[240,86],[294,1],[319,87],[320,88],[295,89],[298,89],[317,87],[318,87],[308,87],[307,90],[305,87],[300,87],[313,87],[311,87],[315,87],[299,87],[312,87],[316,87],[301,87],[302,87],[314,87],[296,87],[303,87],[304,87],[306,87],[310,87],[321,91],[309,87],[297,87],[334,92],[333,1],[328,91],[330,93],[329,91],[322,91],[323,91],[325,91],[327,91],[331,93],[332,93],[324,93],[326,93],[335,94],[209,95],[208,1],[336,1],[337,1],[286,1],[338,1],[339,96],[340,7],[341,1],[342,97],[343,98],[204,99],[85,1],[202,5],[200,100],[205,1],[189,1],[66,1],[196,1],[206,1],[207,1],[220,101],[221,101],[62,1],[75,1],[238,47],[231,102],[68,1],[232,103],[69,104],[227,1],[72,105],[222,106],[230,107],[229,107],[224,108],[225,109],[70,1],[228,110],[223,111],[71,112],[226,1],[63,1],[193,113],[191,114],[192,115],[190,1],[182,1],[64,1],[213,116],[59,1],[60,1],[10,1],[11,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[12,1],[65,1],[234,117],[233,118],[101,119],[108,120],[100,119],[115,121],[92,122],[91,123],[114,7],[109,124],[112,125],[94,126],[93,127],[89,128],[88,129],[111,130],[90,131],[95,132],[96,1],[99,132],[86,1],[117,133],[116,132],[103,134],[104,135],[106,136],[102,137],[105,138],[110,7],[97,139],[98,140],[107,141],[87,142],[113,143],[80,144],[82,145],[61,1],[170,8],[179,146],[217,1],[171,147],[73,148],[81,149],[172,150],[173,149],[174,1],[175,147],[177,151],[176,152],[178,153],[74,154],[218,155],[180,174],[184,175],[76,176],[188,177],[197,177],[183,177],[194,178],[195,179]],"semanticDiagnosticsPerFile":[187,181,78,79,77,241,199,203,201,198,243,244,239,245,246,247,248,249,263,264,251,252,250,253,254,255,256,257,258,259,260,261,262,285,270,276,274,273,275,284,279,281,282,283,277,278,280,272,271,287,266,265,268,269,267,288,289,290,242,291,83,84,119,120,121,122,123,124,125,126,127,128,129,131,130,132,133,134,118,168,135,136,137,169,138,139,140,141,142,143,144,145,146,147,148,149,150,152,151,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,292,293,240,294,319,320,295,298,317,318,308,307,305,300,313,311,315,299,312,316,301,302,314,296,303,304,306,310,321,309,297,334,333,328,330,329,322,323,325,327,331,332,324,326,335,209,208,336,337,286,338,339,340,341,342,343,204,85,202,200,205,189,66,196,206,207,220,221,62,75,238,231,68,232,69,227,72,222,230,229,224,225,70,228,223,71,226,63,193,191,192,190,182,64,213,59,60,10,11,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,1,58,12,65,234,233,101,108,100,115,92,91,114,109,112,94,93,89,88,111,90,95,96,99,86,117,116,103,104,106,102,105,110,97,98,107,87,113,80,82,61,170,179,217,171,73,81,172,173,174,175,177,176,178,74,218,180,184,185,76,186,188,67,197,183,194,195,210,211,212,214,215,216,236,237,219,235],"latestChangedDtsFile":"./test/multiaddr/is-private.spec.d.ts"},"version":"5.2.2"} \ No newline at end of file diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/package.json new file mode 100644 index 000000000..9d51389cc --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/package.json @@ -0,0 +1,118 @@ +{ + "name": "@libp2p/utils", + "version": "4.0.7", + "description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem", + "license": "Apache-2.0 OR MIT", + "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/utils#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/libp2p/js-libp2p.git" + }, + "bugs": { + "url": "https://github.com/libp2p/js-libp2p/issues" + }, + "type": "module", + "types": "./dist/src/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ], + "src/*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ] + } + }, + "files": [ + "src", + "dist", + "!dist/test", + "!**/*.tsbuildinfo" + ], + "exports": { + ".": { + "types": "./src/index.d.ts", + "import": "./dist/src/index.js" + }, + "./abstract-stream": { + "types": "./dist/src/abstract-stream.d.ts", + "import": "./dist/src/abstract-stream.js" + }, + "./address-sort": { + "types": "./dist/src/address-sort.d.ts", + "import": "./dist/src/address-sort.js" + }, + "./array-equals": { + "types": "./dist/src/array-equals.d.ts", + "import": "./dist/src/array-equals.js" + }, + "./close-source": { + "types": "./dist/src/close-source.d.ts", + "import": "./dist/src/close-source.js" + }, + "./ip-port-to-multiaddr": { + "types": "./dist/src/ip-port-to-multiaddr.d.ts", + "import": "./dist/src/ip-port-to-multiaddr.js" + }, + "./is-promise": { + "types": "./dist/src/is-promise.d.ts", + "import": "./dist/src/is-promise.js" + }, + "./multiaddr/is-loopback": { + "types": "./dist/src/multiaddr/is-loopback.d.ts", + "import": "./dist/src/multiaddr/is-loopback.js" + }, + "./multiaddr/is-private": { + "types": "./dist/src/multiaddr/is-private.d.ts", + "import": "./dist/src/multiaddr/is-private.js" + }, + "./peer-job-queue": { + "types": "./dist/src/peer-job-queue.d.ts", + "import": "./dist/src/peer-job-queue.js" + }, + "./stream-to-ma-conn": { + "types": "./dist/src/stream-to-ma-conn.d.ts", + "import": "./dist/src/stream-to-ma-conn.js" + } + }, + "eslintConfig": { + "extends": "ipfs", + "parserOptions": { + "project": true, + "sourceType": "module" + } + }, + "scripts": { + "clean": "aegir clean", + "lint": "aegir lint", + "dep-check": "aegir dep-check", + "build": "aegir build", + "test": "aegir test", + "test:chrome": "aegir test -t browser --cov", + "test:chrome-webworker": "aegir test -t webworker", + "test:firefox": "aegir test -t browser -- --browser firefox", + "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", + "test:node": "aegir test -t node --cov", + "test:electron-main": "aegir test -t electron-main" + }, + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/interface": "file:../interface", + "@multiformats/multiaddr": "^12.1.10", + "@multiformats/multiaddr-matcher": "^1.1.0", + "get-iterator": "^2.0.1", + "is-loopback-addr": "^2.0.1", + "it-pushable": "^3.2.2", + "it-stream-types": "^2.0.1", + "p-queue": "^7.4.1", + "private-ip": "^3.0.1", + "race-signal": "^1.0.1", + "uint8arraylist": "^2.4.3" + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/abstract-stream.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/abstract-stream.ts new file mode 100644 index 000000000..a1baf9cf3 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/abstract-stream.ts @@ -0,0 +1,509 @@ +import { CodeError } from '@libp2p/interface/errors' +import { type Pushable, pushable } from 'it-pushable' +import defer, { type DeferredPromise } from 'p-defer' +import { raceSignal } from 'race-signal' +import { Uint8ArrayList } from 'uint8arraylist' +import { closeSource } from './close-source.js' +import type { AbortOptions } from '@libp2p/interface' +import type { Direction, ReadStatus, Stream, StreamStatus, StreamTimeline, WriteStatus } from '@libp2p/interface/connection' +import type { Logger } from '@libp2p/logger' +import type { Source } from 'it-stream-types' + +const ERR_STREAM_RESET = 'ERR_STREAM_RESET' +const ERR_SINK_INVALID_STATE = 'ERR_SINK_INVALID_STATE' +const DEFAULT_SEND_CLOSE_WRITE_TIMEOUT = 5000 + +export interface AbstractStreamInit { + /** + * A unique identifier for this stream + */ + id: string + + /** + * The stream direction + */ + direction: Direction + + /** + * A Logger implementation used to log stream-specific information + */ + log: Logger + + /** + * User specific stream metadata + */ + metadata?: Record + + /** + * Invoked when the stream ends + */ + onEnd?(err?: Error | undefined): void + + /** + * Invoked when the readable end of the stream is closed + */ + onCloseRead?(): void + + /** + * Invoked when the writable end of the stream is closed + */ + onCloseWrite?(): void + + /** + * Invoked when the the stream has been reset by the remote + */ + onReset?(): void + + /** + * Invoked when the the stream has errored + */ + onAbort?(err: Error): void + + /** + * How long to wait in ms for stream data to be written to the underlying + * connection when closing the writable end of the stream. (default: 500) + */ + closeTimeout?: number + + /** + * After the stream sink has closed, a limit on how long it takes to send + * a close-write message to the remote peer. + */ + sendCloseWriteTimeout?: number +} + +function isPromise (thing: any): thing is Promise { + if (thing == null) { + return false + } + + return typeof thing.then === 'function' && + typeof thing.catch === 'function' && + typeof thing.finally === 'function' +} + +export abstract class AbstractStream implements Stream { + public id: string + public direction: Direction + public timeline: StreamTimeline + public protocol?: string + public metadata: Record + public source: AsyncGenerator + public status: StreamStatus + public readStatus: ReadStatus + public writeStatus: WriteStatus + public readonly log: Logger + + private readonly sinkController: AbortController + private readonly sinkEnd: DeferredPromise + private readonly closed: DeferredPromise + private endErr: Error | undefined + private readonly streamSource: Pushable + private readonly onEnd?: (err?: Error | undefined) => void + private readonly onCloseRead?: () => void + private readonly onCloseWrite?: () => void + private readonly onReset?: () => void + private readonly onAbort?: (err: Error) => void + private readonly sendCloseWriteTimeout: number + + constructor (init: AbstractStreamInit) { + this.sinkController = new AbortController() + this.sinkEnd = defer() + this.closed = defer() + this.log = init.log + + // stream status + this.status = 'open' + this.readStatus = 'ready' + this.writeStatus = 'ready' + + this.id = init.id + this.metadata = init.metadata ?? {} + this.direction = init.direction + this.timeline = { + open: Date.now() + } + this.sendCloseWriteTimeout = init.sendCloseWriteTimeout ?? DEFAULT_SEND_CLOSE_WRITE_TIMEOUT + + this.onEnd = init.onEnd + this.onCloseRead = init?.onCloseRead + this.onCloseWrite = init?.onCloseWrite + this.onReset = init?.onReset + this.onAbort = init?.onAbort + + this.source = this.streamSource = pushable({ + onEnd: (err) => { + if (err != null) { + this.log.trace('source ended with error', err) + } else { + this.log.trace('source ended') + } + + this.onSourceEnd(err) + } + }) + + // necessary because the libp2p upgrader wraps the sink function + this.sink = this.sink.bind(this) + } + + async sink (source: Source): Promise { + if (this.writeStatus !== 'ready') { + throw new CodeError(`writable end state is "${this.writeStatus}" not "ready"`, ERR_SINK_INVALID_STATE) + } + + try { + this.writeStatus = 'writing' + + const options: AbortOptions = { + signal: this.sinkController.signal + } + + if (this.direction === 'outbound') { // If initiator, open a new stream + const res = this.sendNewStream(options) + + if (isPromise(res)) { + await res + } + } + + const abortListener = (): void => { + closeSource(source, this.log) + } + + try { + this.sinkController.signal.addEventListener('abort', abortListener) + + this.log.trace('sink reading from source') + + for await (let data of source) { + data = data instanceof Uint8Array ? new Uint8ArrayList(data) : data + + const res = this.sendData(data, options) + + if (isPromise(res)) { // eslint-disable-line max-depth + await res + } + } + } finally { + this.sinkController.signal.removeEventListener('abort', abortListener) + } + + this.log.trace('sink finished reading from source, write status is "%s"', this.writeStatus) + + if (this.writeStatus === 'writing') { + this.writeStatus = 'closing' + + this.log.trace('send close write to remote') + await this.sendCloseWrite({ + signal: AbortSignal.timeout(this.sendCloseWriteTimeout) + }) + + this.writeStatus = 'closed' + } + + this.onSinkEnd() + } catch (err: any) { + this.log.trace('sink ended with error, calling abort with error', err) + this.abort(err) + + throw err + } finally { + this.log.trace('resolve sink end') + this.sinkEnd.resolve() + } + } + + protected onSourceEnd (err?: Error): void { + if (this.timeline.closeRead != null) { + return + } + + this.timeline.closeRead = Date.now() + this.readStatus = 'closed' + + if (err != null && this.endErr == null) { + this.endErr = err + } + + this.onCloseRead?.() + + if (this.timeline.closeWrite != null) { + this.log.trace('source and sink ended') + this.timeline.close = Date.now() + + if (this.status !== 'aborted' && this.status !== 'reset') { + this.status = 'closed' + } + + if (this.onEnd != null) { + this.onEnd(this.endErr) + } + + this.closed.resolve() + } else { + this.log.trace('source ended, waiting for sink to end') + } + } + + protected onSinkEnd (err?: Error): void { + if (this.timeline.closeWrite != null) { + return + } + + this.timeline.closeWrite = Date.now() + this.writeStatus = 'closed' + + if (err != null && this.endErr == null) { + this.endErr = err + } + + this.onCloseWrite?.() + + if (this.timeline.closeRead != null) { + this.log.trace('sink and source ended') + this.timeline.close = Date.now() + + if (this.status !== 'aborted' && this.status !== 'reset') { + this.status = 'closed' + } + + if (this.onEnd != null) { + this.onEnd(this.endErr) + } + + this.closed.resolve() + } else { + this.log.trace('sink ended, waiting for source to end') + } + } + + // Close for both Reading and Writing + async close (options?: AbortOptions): Promise { + this.log.trace('closing gracefully') + + this.status = 'closing' + + await Promise.all([ + this.closeRead(options), + this.closeWrite(options) + ]) + + // wait for read and write ends to close + await raceSignal(this.closed.promise, options?.signal) + + this.status = 'closed' + + this.log.trace('closed gracefully') + } + + async closeRead (options: AbortOptions = {}): Promise { + if (this.readStatus === 'closing' || this.readStatus === 'closed') { + return + } + + this.log.trace('closing readable end of stream with starting read status "%s"', this.readStatus) + + const readStatus = this.readStatus + this.readStatus = 'closing' + + if (this.status !== 'reset' && this.status !== 'aborted' && this.timeline.closeRead == null) { + this.log.trace('send close read to remote') + await this.sendCloseRead(options) + } + + if (readStatus === 'ready') { + this.log.trace('ending internal source queue with %d queued bytes', this.streamSource.readableLength) + this.streamSource.end() + } + + this.log.trace('closed readable end of stream') + } + + async closeWrite (options: AbortOptions = {}): Promise { + if (this.writeStatus === 'closing' || this.writeStatus === 'closed') { + return + } + + this.log.trace('closing writable end of stream with starting write status "%s"', this.writeStatus) + + if (this.writeStatus === 'ready') { + this.log.trace('sink was never sunk, sink an empty array') + + await raceSignal(this.sink([]), options.signal) + } + + if (this.writeStatus === 'writing') { + // stop reading from the source passed to `.sink` in the microtask queue + // - this lets any data queued by the user in the current tick get read + // before we exit + await new Promise((resolve, reject) => { + queueMicrotask(() => { + this.log.trace('aborting source passed to .sink') + this.sinkController.abort() + raceSignal(this.sinkEnd.promise, options.signal) + .then(resolve, reject) + }) + }) + } + + this.writeStatus = 'closed' + + this.log.trace('closed writable end of stream') + } + + /** + * Close immediately for reading and writing and send a reset message (local + * error) + */ + abort (err: Error): void { + if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') { + return + } + + this.log('abort with error', err) + + // try to send a reset message + this.log('try to send reset to remote') + const res = this.sendReset() + + if (isPromise(res)) { + res.catch((err) => { + this.log.error('error sending reset message', err) + }) + } + + this.status = 'aborted' + this.timeline.abort = Date.now() + this._closeSinkAndSource(err) + this.onAbort?.(err) + } + + /** + * Receive a reset message - close immediately for reading and writing (remote + * error) + */ + reset (): void { + if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') { + return + } + + const err = new CodeError('stream reset', ERR_STREAM_RESET) + + this.status = 'reset' + this.timeline.reset = Date.now() + this._closeSinkAndSource(err) + this.onReset?.() + } + + _closeSinkAndSource (err?: Error): void { + this._closeSink(err) + this._closeSource(err) + } + + _closeSink (err?: Error): void { + // if the sink function is running, cause it to end + if (this.writeStatus === 'writing') { + this.log.trace('end sink source') + this.sinkController.abort() + } + + this.onSinkEnd(err) + } + + _closeSource (err?: Error): void { + // if the source is not ending, end it + if (this.readStatus !== 'closing' && this.readStatus !== 'closed') { + this.log.trace('ending source with %d bytes to be read by consumer', this.streamSource.readableLength) + this.readStatus = 'closing' + this.streamSource.end(err) + } + } + + /** + * The remote closed for writing so we should expect to receive no more + * messages + */ + remoteCloseWrite (): void { + if (this.readStatus === 'closing' || this.readStatus === 'closed') { + this.log('received remote close write but local source is already closed') + return + } + + this.log.trace('remote close write') + this._closeSource() + } + + /** + * The remote closed for reading so we should not send any more + * messages + */ + remoteCloseRead (): void { + if (this.writeStatus === 'closing' || this.writeStatus === 'closed') { + this.log('received remote close read but local sink is already closed') + return + } + + this.log.trace('remote close read') + this._closeSink() + } + + /** + * The underlying muxer has closed, no more messages can be sent or will + * be received, close immediately to free up resources + */ + destroy (): void { + if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') { + this.log('received destroy but we are already closed') + return + } + + this.log.trace('stream destroyed') + + this._closeSinkAndSource() + } + + /** + * When an extending class reads data from it's implementation-specific source, + * call this method to allow the stream consumer to read the data. + */ + sourcePush (data: Uint8ArrayList): void { + this.streamSource.push(data) + } + + /** + * Returns the amount of unread data - can be used to prevent large amounts of + * data building up when the stream consumer is too slow. + */ + sourceReadableLength (): number { + return this.streamSource.readableLength + } + + /** + * Send a message to the remote muxer informing them a new stream is being + * opened + */ + abstract sendNewStream (options?: AbortOptions): void | Promise + + /** + * Send a data message to the remote muxer + */ + abstract sendData (buf: Uint8ArrayList, options?: AbortOptions): void | Promise + + /** + * Send a reset message to the remote muxer + */ + abstract sendReset (options?: AbortOptions): void | Promise + + /** + * Send a message to the remote muxer, informing them no more data messages + * will be sent by this end of the stream + */ + abstract sendCloseWrite (options?: AbortOptions): void | Promise + + /** + * Send a message to the remote muxer, informing them no more data messages + * will be read by this end of the stream + */ + abstract sendCloseRead (options?: AbortOptions): void | Promise +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/address-sort.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/address-sort.ts new file mode 100644 index 000000000..5773a2d90 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/address-sort.ts @@ -0,0 +1,91 @@ +/** + * @packageDocumentation + * + * Provides strategies to sort a list of multiaddrs. + * + * @example + * + * ```typescript + * import { publicAddressesFirst } from '@libp2p/utils/address-sort' + * import { multiaddr } from '@multformats/multiaddr' + * + * + * const addresses = [ + * multiaddr('/ip4/127.0.0.1/tcp/9000'), + * multiaddr('/ip4/82.41.53.1/tcp/9000') + * ].sort(publicAddressesFirst) + * + * console.info(addresses) + * // ['/ip4/82.41.53.1/tcp/9000', '/ip4/127.0.0.1/tcp/9000'] + * ``` + */ + +import { Circuit } from '@multiformats/multiaddr-matcher' +import { isPrivate } from './multiaddr/is-private.js' +import type { Address } from '@libp2p/interface/peer-store' + +/** + * Compare function for array.sort() that moves public addresses to the start + * of the array. + */ +export function publicAddressesFirst (a: Address, b: Address): -1 | 0 | 1 { + const isAPrivate = isPrivate(a.multiaddr) + const isBPrivate = isPrivate(b.multiaddr) + + if (isAPrivate && !isBPrivate) { + return 1 + } else if (!isAPrivate && isBPrivate) { + return -1 + } + + return 0 +} + +/** + * Compare function for array.sort() that moves certified addresses to the start + * of the array. + */ +export function certifiedAddressesFirst (a: Address, b: Address): -1 | 0 | 1 { + if (a.isCertified && !b.isCertified) { + return -1 + } else if (!a.isCertified && b.isCertified) { + return 1 + } + + return 0 +} + +/** + * Compare function for array.sort() that moves circuit relay addresses to the + * start of the array. + */ +export function circuitRelayAddressesLast (a: Address, b: Address): -1 | 0 | 1 { + const isACircuit = Circuit.exactMatch(a.multiaddr) + const isBCircuit = Circuit.exactMatch(b.multiaddr) + + if (isACircuit && !isBCircuit) { + return 1 + } else if (!isACircuit && isBCircuit) { + return -1 + } + + return 0 +} + +export function defaultAddressSort (a: Address, b: Address): -1 | 0 | 1 { + const publicResult = publicAddressesFirst(a, b) + + if (publicResult !== 0) { + return publicResult + } + + const relayResult = circuitRelayAddressesLast(a, b) + + if (relayResult !== 0) { + return relayResult + } + + const certifiedResult = certifiedAddressesFirst(a, b) + + return certifiedResult +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/array-equals.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/array-equals.ts new file mode 100644 index 000000000..e94499acb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/array-equals.ts @@ -0,0 +1,34 @@ +/** + * @packageDocumentation + * + * Provides strategies ensure arrays are equivalent. + * + * @example + * + * ```typescript + * import { arrayEquals } from '@libp2p/utils/array-equals' + * import { multiaddr } from '@multformats/multiaddr' + * + * const ma1 = multiaddr('/ip4/127.0.0.1/tcp/9000'), + * const ma2 = multiaddr('/ip4/82.41.53.1/tcp/9000') + * + * console.info(arrayEquals([ma1], [ma1])) // true + * console.info(arrayEquals([ma1], [ma2])) // false + * ``` + */ + +/** + * Verify if two arrays of non primitive types with the "equals" function are equal. + * Compatible with multiaddr, peer-id and others. + */ +export function arrayEquals (a: any[], b: any[]): boolean { + const sort = (a: any, b: any): number => a.toString().localeCompare(b.toString()) + + if (a.length !== b.length) { + return false + } + + b.sort(sort) + + return a.sort(sort).every((item, index) => b[index].equals(item)) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/close-source.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/close-source.ts new file mode 100644 index 000000000..34738838d --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/close-source.ts @@ -0,0 +1,14 @@ +import { getIterator } from 'get-iterator' +import { isPromise } from './is-promise.js' +import type { Logger } from '@libp2p/logger' +import type { Source } from 'it-stream-types' + +export function closeSource (source: Source, log: Logger): void { + const res = getIterator(source).return?.() + + if (isPromise(res)) { + res.catch(err => { + log.error('could not cause iterator to return', err) + }) + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/index.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/index.ts new file mode 100644 index 000000000..cd0c2aa24 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/index.ts @@ -0,0 +1,22 @@ +/** + * @packageDocumentation + * + * The libp2p ecosystem has lots of repos with it comes several problems like: + * + * - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc. + * - Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc. + * + * These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated. + * + * @example + * + * Each function should be imported directly. + * + * ```js + * import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr' + * + * const ma = ipAndPortToMultiaddr('127.0.0.1', 9000) + * ``` + */ + +export {} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/ip-port-to-multiaddr.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/ip-port-to-multiaddr.ts new file mode 100644 index 000000000..08571eb92 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/ip-port-to-multiaddr.ts @@ -0,0 +1,36 @@ +import { isIPv4, isIPv6 } from '@chainsafe/is-ip' +import { CodeError } from '@libp2p/interface/errors' +import { type Multiaddr, multiaddr } from '@multiformats/multiaddr' + +export const Errors = { + ERR_INVALID_IP_PARAMETER: 'ERR_INVALID_IP_PARAMETER', + ERR_INVALID_PORT_PARAMETER: 'ERR_INVALID_PORT_PARAMETER', + ERR_INVALID_IP: 'ERR_INVALID_IP' +} + +/** + * Transform an IP, Port pair into a multiaddr + */ +export function ipPortToMultiaddr (ip: string, port: number | string): Multiaddr { + if (typeof ip !== 'string') { + throw new CodeError(`invalid ip provided: ${ip}`, Errors.ERR_INVALID_IP_PARAMETER) // eslint-disable-line @typescript-eslint/restrict-template-expressions + } + + if (typeof port === 'string') { + port = parseInt(port) + } + + if (isNaN(port)) { + throw new CodeError(`invalid port provided: ${port}`, Errors.ERR_INVALID_PORT_PARAMETER) + } + + if (isIPv4(ip)) { + return multiaddr(`/ip4/${ip}/tcp/${port}`) + } + + if (isIPv6(ip)) { + return multiaddr(`/ip6/${ip}/tcp/${port}`) + } + + throw new CodeError(`invalid ip:port for creating a multiaddr: ${ip}:${port}`, Errors.ERR_INVALID_IP) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/is-promise.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/is-promise.ts new file mode 100644 index 000000000..9a9478a37 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/is-promise.ts @@ -0,0 +1,9 @@ +export function isPromise (thing: any): thing is Promise { + if (thing == null) { + return false + } + + return typeof thing.then === 'function' && + typeof thing.catch === 'function' && + typeof thing.finally === 'function' +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-loopback.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-loopback.ts new file mode 100644 index 000000000..d66f54568 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-loopback.ts @@ -0,0 +1,11 @@ +import { isLoopbackAddr } from 'is-loopback-addr' +import type { Multiaddr } from '@multiformats/multiaddr' + +/** + * Check if a given multiaddr is a loopback address. + */ +export function isLoopback (ma: Multiaddr): boolean { + const { address } = ma.nodeAddress() + + return isLoopbackAddr(address) +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-private.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-private.ts new file mode 100644 index 000000000..ab563e032 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/multiaddr/is-private.ts @@ -0,0 +1,15 @@ +import isIpPrivate from 'private-ip' +import type { Multiaddr } from '@multiformats/multiaddr' + +/** + * Check if a given multiaddr has a private address. + */ +export function isPrivate (ma: Multiaddr): boolean { + try { + const { address } = ma.nodeAddress() + + return Boolean(isIpPrivate(address)) + } catch { + return true + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/peer-job-queue.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/peer-job-queue.ts new file mode 100644 index 000000000..671179800 --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/peer-job-queue.ts @@ -0,0 +1,118 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ + +import { CodeError, ERR_INVALID_PARAMETERS } from '@libp2p/interface/errors' +import PQueue from 'p-queue' +import type { PeerId } from '@libp2p/interface/peer-id' +import type { QueueAddOptions, Options, Queue } from 'p-queue' + +// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound +// Used to compute insertion index to keep queue sorted after insertion +function lowerBound (array: readonly T[], value: T, comparator: (a: T, b: T) => number): number { + let first = 0 + let count = array.length + + while (count > 0) { + const step = Math.trunc(count / 2) + let it = first + step + + if (comparator(array[it]!, value) <= 0) { + first = ++it + count -= step + 1 + } else { + count = step + } + } + + return first +} + +interface RunFunction { (): Promise } + +export interface PeerPriorityQueueOptions extends QueueAddOptions { + peerId: PeerId +} + +interface PeerJob { + priority: number + peerId: PeerId + run: RunFunction +} + +/** + * Port of https://github.com/sindresorhus/p-queue/blob/main/source/priority-queue.ts + * that adds support for filtering jobs by peer id + */ +class PeerPriorityQueue implements Queue { + readonly #queue: PeerJob[] = [] + + enqueue (run: RunFunction, options?: Partial): void { + const peerId = options?.peerId + const priority = options?.priority ?? 0 + + if (peerId == null) { + throw new CodeError('missing peer id', ERR_INVALID_PARAMETERS) + } + + const element: PeerJob = { + priority, + peerId, + run + } + + if (this.size > 0 && this.#queue[this.size - 1]!.priority >= priority) { + this.#queue.push(element) + return + } + + const index = lowerBound( + this.#queue, element, + (a: Readonly, b: Readonly) => b.priority! - a.priority! + ) + this.#queue.splice(index, 0, element) + } + + dequeue (): RunFunction | undefined { + const item = this.#queue.shift() + return item?.run + } + + filter (options: Readonly>): RunFunction[] { + if (options.peerId != null) { + const peerId = options.peerId + + return this.#queue.filter( + (element: Readonly) => peerId.equals(element.peerId) + ).map((element: Readonly<{ run: RunFunction }>) => element.run) + } + + return this.#queue.filter( + (element: Readonly) => element.priority === options.priority + ).map((element: Readonly<{ run: RunFunction }>) => element.run) + } + + get size (): number { + return this.#queue.length + } +} + +/** + * Extends PQueue to add support for querying queued jobs by peer id + */ +export class PeerJobQueue extends PQueue { + constructor (options: Options = {}) { + super({ + ...options, + queueClass: PeerPriorityQueue + }) + } + + /** + * Returns true if this queue has a job for the passed peer id that has not yet + * started to run + */ + hasJob (peerId: PeerId): boolean { + return this.sizeBy({ + peerId + }) > 0 + } +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/stream-to-ma-conn.ts b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/stream-to-ma-conn.ts new file mode 100644 index 000000000..ff2f919cb --- /dev/null +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/utils/src/stream-to-ma-conn.ts @@ -0,0 +1,91 @@ +import type { ComponentLogger } from '@libp2p/interface' +import type { MultiaddrConnection, Stream } from '@libp2p/interface/connection' +import type { Multiaddr } from '@multiformats/multiaddr' + +export interface StreamProperties { + stream: Stream + remoteAddr: Multiaddr + localAddr: Multiaddr + logger: ComponentLogger +} + +/** + * Convert a duplex iterable into a MultiaddrConnection. + * https://github.com/libp2p/interface-transport#multiaddrconnection + */ +export function streamToMaConnection (props: StreamProperties): MultiaddrConnection { + const { stream, remoteAddr, logger } = props + const log = logger.forComponent('libp2p:stream:converter') + + let closedRead = false + let closedWrite = false + + // piggyback on `stream.close` invocations to close maconn + const streamClose = stream.close.bind(stream) + stream.close = async (options) => { + await streamClose(options) + close(true) + } + + // piggyback on `stream.abort` invocations to close maconn + const streamAbort = stream.abort.bind(stream) + stream.abort = (err) => { + streamAbort(err) + close(true) + } + + // piggyback on `stream.sink` invocations to close maconn + const streamSink = stream.sink.bind(stream) + stream.sink = async (source) => { + try { + await streamSink(source) + } catch (err: any) { + // If aborted we can safely ignore + if (err.type !== 'aborted') { + // If the source errored the socket will already have been destroyed by + // toIterable.duplex(). If the socket errored it will already be + // destroyed. There's nothing to do here except log the error & return. + log(err) + } + } finally { + closedWrite = true + close() + } + } + + const maConn: MultiaddrConnection = { + log, + sink: stream.sink, + source: (async function * () { + try { + for await (const list of stream.source) { + if (list instanceof Uint8Array) { + yield list + } else { + yield * list + } + } + } finally { + closedRead = true + close() + } + }()), + remoteAddr, + timeline: { open: Date.now(), close: undefined }, + close: stream.close, + abort: stream.abort + } + + function close (force?: boolean): void { + if (force === true) { + closedRead = true + closedWrite = true + } + + if (closedRead && closedWrite && maConn.timeline.close == null) { + maConn.timeline.close = Date.now() + } + } + + return maConn +} diff --git a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/yamux/package.json b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/yamux/package.json index 9b436b752..29ea01580 100644 --- a/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/yamux/package.json +++ b/perf/impl/js-libp2p/v1.0-uint8arraylists-all-the-way-down/yamux/package.json @@ -171,21 +171,13 @@ "docs": "aegir docs" }, "dependencies": { - "@libp2p/interface": "next", + "@libp2p/interface": "file:../interface", "@libp2p/logger": "next", + "@libp2p/utils": "file:../utils", "get-iterator": "^2.0.1", "it-foreach": "^2.0.3", "it-pipe": "^3.0.1", "it-pushable": "^3.2.0", "uint8arraylist": "^2.4.3" - }, - "devDependencies": { - "@dapplion/benchmark": "^0.2.4", - "@libp2p/interface-compliance-tests": "next", - "@libp2p/mplex": "next", - "aegir": "^40.0.1", - "it-drain": "^3.0.2", - "it-pair": "^2.0.6", - "it-stream-types": "^2.0.1" } }