@waku/rln 0.1.3-f6d5deb → 0.1.4-2a94244.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -186
- package/bundle/_virtual/__node-resolve_empty.js +6 -0
- package/bundle/_virtual/_assert.js +3 -0
- package/bundle/_virtual/_commonjs-dynamic-modules.js +5 -0
- package/bundle/_virtual/_commonjsHelpers.js +32 -0
- package/bundle/_virtual/_node-resolve_empty.js +3 -0
- package/bundle/_virtual/_sha2.js +3 -0
- package/bundle/_virtual/_u64.js +3 -0
- package/bundle/_virtual/aes.js +3 -0
- package/bundle/_virtual/bn.js +3 -0
- package/bundle/_virtual/browser.js +3 -0
- package/bundle/_virtual/checksum.js +3 -0
- package/bundle/_virtual/cipher.js +3 -0
- package/bundle/_virtual/class.js +3 -0
- package/bundle/_virtual/common.js +3 -0
- package/bundle/_virtual/common2.js +3 -0
- package/bundle/_virtual/cryptoBrowser.js +3 -0
- package/bundle/_virtual/functional.js +3 -0
- package/bundle/_virtual/hash.js +3 -0
- package/bundle/_virtual/hmac.js +3 -0
- package/bundle/_virtual/index.js +3 -0
- package/bundle/_virtual/index2.js +6 -0
- package/bundle/_virtual/inherits_browser.js +3 -0
- package/bundle/_virtual/kdf.js +3 -0
- package/bundle/_virtual/lodash.js +3 -0
- package/bundle/_virtual/password.js +3 -0
- package/bundle/_virtual/pbkdf2.js +3 -0
- package/bundle/_virtual/pbkdf22.js +3 -0
- package/bundle/_virtual/random.js +3 -0
- package/bundle/_virtual/ripemd.js +3 -0
- package/bundle/_virtual/schema-validation-generated.js +3 -0
- package/bundle/_virtual/schema-validation.js +3 -0
- package/bundle/_virtual/scrypt.js +3 -0
- package/bundle/_virtual/scrypt2.js +3 -0
- package/bundle/_virtual/sha.js +3 -0
- package/bundle/_virtual/sha256.js +3 -0
- package/bundle/_virtual/sha2562.js +3 -0
- package/bundle/_virtual/sha3.js +3 -0
- package/bundle/_virtual/sha512.js +3 -0
- package/bundle/_virtual/types.js +3 -0
- package/bundle/_virtual/utils.js +3 -0
- package/bundle/_virtual/utils2.js +3 -0
- package/bundle/_virtual/utils3.js +3 -0
- package/bundle/index.js +12 -74804
- package/bundle/node_modules/@ethersproject/abi/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/abi-coder.js +96 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +148 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/address.js +26 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js +20 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/array.js +210 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js +18 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js +30 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js +26 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/null.js +22 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/number.js +43 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/string.js +19 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js +58 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/fragments.js +854 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +609 -0
- package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +66 -0
- package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +302 -0
- package/bundle/node_modules/@ethersproject/address/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/address/lib.esm/index.js +110 -0
- package/bundle/node_modules/@ethersproject/base64/lib.esm/base64.js +20 -0
- package/bundle/node_modules/@ethersproject/basex/lib.esm/index.js +120 -0
- package/bundle/node_modules/@ethersproject/bignumber/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js +287 -0
- package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/bytes/lib.esm/index.js +402 -0
- package/bundle/node_modules/@ethersproject/constants/lib.esm/addresses.js +3 -0
- package/bundle/node_modules/@ethersproject/constants/lib.esm/bignumbers.js +8 -0
- package/bundle/node_modules/@ethersproject/constants/lib.esm/hashes.js +3 -0
- package/bundle/node_modules/@ethersproject/contracts/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +893 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js +256 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js +36 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +135 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/id.js +8 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/namehash.js +64 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +443 -0
- package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +8 -0
- package/bundle/node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +660 -0
- package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/logger/lib.esm/index.js +352 -0
- package/bundle/node_modules/@ethersproject/networks/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/networks/lib.esm/index.js +248 -0
- package/bundle/node_modules/@ethersproject/properties/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +127 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +2007 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/formatter.js +422 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +674 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/web3-provider.js +132 -0
- package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/rlp/lib.esm/index.js +120 -0
- package/bundle/node_modules/@ethersproject/sha2/lib.esm/sha2.js +8 -0
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +2430 -0
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/index.js +76 -0
- package/bundle/node_modules/@ethersproject/strings/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/strings/lib.esm/utf8.js +219 -0
- package/bundle/node_modules/@ethersproject/transactions/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +279 -0
- package/bundle/node_modules/@ethersproject/web/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +69 -0
- package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +404 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/convert.js +15 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +20 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/protocols-table.js +92 -0
- package/bundle/node_modules/@noble/hashes/esm/_assert.js +37 -0
- package/bundle/node_modules/@noble/hashes/esm/_md.js +132 -0
- package/bundle/node_modules/@noble/hashes/esm/_u64.js +29 -0
- package/bundle/node_modules/@noble/hashes/esm/sha256.js +113 -0
- package/bundle/node_modules/@noble/hashes/esm/sha3.js +210 -0
- package/bundle/node_modules/@noble/hashes/esm/utils.js +144 -0
- package/bundle/node_modules/@waku/zerokit-rln-wasm/rln_wasm.js +756 -0
- package/bundle/node_modules/bech32/index.js +187 -0
- package/bundle/node_modules/bn.js/lib/bn.js +3361 -0
- package/bundle/node_modules/debug/src/browser.js +283 -0
- package/bundle/node_modules/debug/src/common.js +295 -0
- package/bundle/node_modules/ethereum-cryptography/esm/keccak.js +10 -0
- package/bundle/node_modules/ethereum-cryptography/esm/sha256.js +6 -0
- package/bundle/node_modules/ethereum-cryptography/esm/utils.js +24 -0
- package/bundle/node_modules/hash.js/lib/hash/common.js +97 -0
- package/bundle/node_modules/hash.js/lib/hash/hmac.js +51 -0
- package/bundle/node_modules/hash.js/lib/hash/ripemd.js +152 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/1.js +81 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/224.js +33 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/256.js +113 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/384.js +39 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/512.js +336 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/common.js +53 -0
- package/bundle/node_modules/hash.js/lib/hash/sha.js +14 -0
- package/bundle/node_modules/hash.js/lib/hash/utils.js +282 -0
- package/bundle/node_modules/hash.js/lib/hash.js +33 -0
- package/bundle/node_modules/inherits/inherits_browser.js +33 -0
- package/bundle/node_modules/it-length-prefixed/dist/src/decode.js +6 -0
- package/bundle/node_modules/lodash/lodash.js +17207 -0
- package/bundle/node_modules/minimalistic-assert/index.js +13 -0
- package/bundle/node_modules/ms/index.js +172 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base.js +205 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base10.js +9 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base16.js +16 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base2.js +10 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base256emoji.js +41 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base32.js +58 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base36.js +14 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base58.js +14 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base64.js +28 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base8.js +10 -0
- package/bundle/node_modules/multiformats/dist/src/bases/identity.js +11 -0
- package/bundle/node_modules/multiformats/dist/src/basics.js +15 -0
- package/bundle/node_modules/multiformats/dist/src/bytes.js +18 -0
- package/bundle/node_modules/multiformats/dist/src/codecs/json.js +2 -0
- package/bundle/node_modules/multiformats/dist/src/vendor/base-x.js +170 -0
- package/bundle/node_modules/protons-runtime/dist/src/codec.js +20 -0
- package/bundle/node_modules/protons-runtime/dist/src/codecs/enum.js +24 -0
- package/bundle/node_modules/protons-runtime/dist/src/codecs/message.js +7 -0
- package/bundle/node_modules/protons-runtime/dist/src/decode.js +8 -0
- package/bundle/node_modules/protons-runtime/dist/src/encode.js +11 -0
- package/bundle/node_modules/protons-runtime/dist/src/index.js +30 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/float.js +54 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/longbits.js +175 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/pool.js +28 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/reader.js +367 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/utf8.js +99 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/writer.js +438 -0
- package/bundle/node_modules/uint8-varint/dist/src/index.js +124 -0
- package/bundle/node_modules/uint8arrays/dist/src/alloc.js +17 -0
- package/bundle/node_modules/uint8arrays/dist/src/from-string.js +19 -0
- package/bundle/node_modules/uint8arrays/dist/src/util/bases.js +49 -0
- package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +21 -0
- package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +18 -0
- package/bundle/packages/core/dist/lib/filter/filter.js +27 -0
- package/bundle/packages/core/dist/lib/light_push/light_push.js +27 -0
- package/bundle/packages/core/dist/lib/message/version_0.js +154 -0
- package/bundle/packages/core/dist/lib/metadata/metadata.js +27 -0
- package/bundle/packages/core/dist/lib/store/store.js +27 -0
- package/bundle/packages/interfaces/dist/connection_manager.js +19 -0
- package/bundle/packages/interfaces/dist/constants.js +6 -0
- package/bundle/packages/interfaces/dist/health_indicator.js +12 -0
- package/bundle/packages/interfaces/dist/protocols.js +92 -0
- package/bundle/packages/proto/dist/generated/filter.js +445 -0
- package/bundle/packages/proto/dist/generated/filter_v2.js +424 -0
- package/bundle/packages/proto/dist/generated/light_push.js +389 -0
- package/bundle/packages/proto/dist/generated/message.js +213 -0
- package/bundle/packages/proto/dist/generated/metadata.js +130 -0
- package/bundle/packages/proto/dist/generated/peer_exchange.js +209 -0
- package/bundle/packages/proto/dist/generated/sds_message.js +105 -0
- package/bundle/packages/proto/dist/generated/store_v3.js +490 -0
- package/bundle/packages/proto/dist/generated/topic_only_message.js +61 -0
- package/bundle/packages/rln/dist/codec.js +93 -0
- package/bundle/packages/rln/dist/contract/abi.js +394 -0
- package/bundle/packages/rln/dist/contract/constants.js +27 -0
- package/bundle/packages/rln/dist/contract/rln_contract.js +438 -0
- package/bundle/packages/rln/dist/create.js +9 -0
- package/bundle/packages/rln/dist/identity.js +30 -0
- package/bundle/packages/rln/dist/keystore/cipher.js +31 -0
- package/bundle/packages/rln/dist/keystore/credential_validation_generated.js +119 -0
- package/bundle/packages/rln/dist/keystore/keystore.js +223 -0
- package/bundle/packages/rln/dist/keystore/keystore_validation_generated.js +74 -0
- package/bundle/packages/rln/dist/keystore/schema_validator.js +20 -0
- package/bundle/packages/rln/dist/message.js +51 -0
- package/bundle/packages/rln/dist/proof.js +54 -0
- package/bundle/packages/rln/dist/resources/verification_key.js +112 -0
- package/bundle/packages/rln/dist/resources/witness_calculator.js +330 -0
- package/bundle/packages/rln/dist/rln.js +220 -0
- package/bundle/packages/rln/dist/root_tracker.js +76 -0
- package/bundle/packages/rln/dist/utils/bytes.js +65 -0
- package/bundle/packages/rln/dist/utils/epoch.js +39 -0
- package/bundle/packages/rln/dist/utils/hash.js +10 -0
- package/bundle/packages/rln/dist/utils/metamask.js +14 -0
- package/bundle/packages/rln/dist/zerokit.js +128 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/checksum.js +52 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/cipher.js +65 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/class.js +99 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/functional.js +103 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/index.js +28 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/kdf.js +78 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/password.js +17 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1253 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation.js +40 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/types.js +5 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +103 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +41 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +17 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +23 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +12 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +77 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +215 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +3 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +3 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +21 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +31 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +96 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +6 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +66 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +24 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +6 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/_assert.js +52 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/_sha2.js +124 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/_u64.js +71 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/cryptoBrowser.js +10 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/hmac.js +88 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/pbkdf2.js +99 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/scrypt.js +233 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/sha256.js +133 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/sha512.js +243 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/utils.js +167 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/rng.js +13 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/stringify.js +28 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/v4.js +19 -0
- package/bundle/packages/utils/dist/bytes/index.js +44 -0
- package/bundle/packages/utils/dist/common/sharding/index.js +91 -0
- package/bundle/packages/utils/dist/logger/index.js +31 -0
- package/bundle/resources/verification_key.d.ts +13 -0
- package/bundle/resources/verification_key.js +112 -0
- package/bundle/resources/witness_calculator.d.ts +11 -0
- package/bundle/resources/witness_calculator.js +328 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/codec.d.ts +5 -5
- package/dist/codec.js +6 -6
- package/dist/codec.js.map +1 -1
- package/dist/contract/abi.d.ts +42 -0
- package/dist/contract/abi.js +393 -0
- package/dist/contract/abi.js.map +1 -0
- package/dist/contract/constants.d.ts +59 -3
- package/dist/contract/constants.js +21 -63
- package/dist/contract/constants.js.map +1 -1
- package/dist/contract/rln_contract.d.ts +98 -17
- package/dist/contract/rln_contract.js +292 -71
- package/dist/contract/rln_contract.js.map +1 -1
- package/dist/identity.js +5 -2
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/keystore/cipher.js +3 -3
- package/dist/keystore/cipher.js.map +1 -1
- package/dist/keystore/credential_validation_generated.js.map +1 -1
- package/dist/keystore/keystore.js +4 -4
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/keystore_validation_generated.js.map +1 -1
- package/dist/message.js +3 -3
- package/dist/message.js.map +1 -1
- package/dist/proof.js +3 -2
- package/dist/proof.js.map +1 -1
- package/dist/resources/verification_key.d.ts +12 -11
- package/dist/resources/verification_key.js +103 -103
- package/dist/resources/witness_calculator.d.ts +10 -15
- package/dist/resources/witness_calculator.js +302 -265
- package/dist/rln.d.ts +5 -1
- package/dist/rln.js +56 -28
- package/dist/rln.js.map +1 -1
- package/dist/root_tracker.js.map +1 -1
- package/dist/utils/epoch.js +5 -5
- package/dist/utils/epoch.js.map +1 -1
- package/dist/zerokit.d.ts +13 -9
- package/dist/zerokit.js +40 -20
- package/dist/zerokit.js.map +1 -1
- package/package.json +1 -146
- package/src/codec.ts +26 -22
- package/src/contract/abi.ts +392 -0
- package/src/contract/constants.ts +28 -0
- package/src/contract/index.ts +2 -0
- package/src/contract/rln_contract.ts +686 -0
- package/src/identity.ts +8 -4
- package/src/index.ts +4 -9
- package/src/keystore/cipher.ts +54 -0
- package/src/keystore/credential_validation_generated.ts +7 -0
- package/src/keystore/index.ts +5 -0
- package/src/keystore/keystore.ts +330 -0
- package/src/keystore/keystore_validation_generated.ts +7 -0
- package/src/keystore/schema_validator.ts +34 -0
- package/src/keystore/types.ts +36 -0
- package/src/message.ts +10 -10
- package/src/proof.ts +13 -11
- package/src/resources/verification_key.d.ts +13 -0
- package/src/resources/witness_calculator.d.ts +11 -0
- package/src/rln.ts +76 -31
- package/src/root_tracker.ts +7 -6
- package/src/utils/bytes.ts +84 -0
- package/src/utils/epoch.ts +30 -0
- package/src/utils/hash.ts +15 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/metamask.ts +17 -0
- package/src/zerokit.ts +95 -33
- package/bundle/assets/rln_wasm_bg-a503e304.wasm +0 -0
- package/dist/resources/verification_key.js.map +0 -1
- package/dist/resources/witness_calculator.js.map +0 -1
- /package/bundle/{assets/rln-6ded2896.wasm → resources/rln.wasm} +0 -0
- /package/bundle/{assets/rln_final-8b299152.zkey → resources/rln_final.zkey} +0 -0
@@ -0,0 +1,336 @@
|
|
1
|
+
import '../utils.js';
|
2
|
+
import '../common.js';
|
3
|
+
import { m as minimalisticAssert } from '../../../../minimalistic-assert/index.js';
|
4
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
|
5
|
+
import { __exports as common$1 } from '../../../../../_virtual/common.js';
|
6
|
+
|
7
|
+
var utils = utils$1;
|
8
|
+
var common = common$1;
|
9
|
+
var assert = minimalisticAssert;
|
10
|
+
|
11
|
+
var rotr64_hi = utils.rotr64_hi;
|
12
|
+
var rotr64_lo = utils.rotr64_lo;
|
13
|
+
var shr64_hi = utils.shr64_hi;
|
14
|
+
var shr64_lo = utils.shr64_lo;
|
15
|
+
var sum64 = utils.sum64;
|
16
|
+
var sum64_hi = utils.sum64_hi;
|
17
|
+
var sum64_lo = utils.sum64_lo;
|
18
|
+
var sum64_4_hi = utils.sum64_4_hi;
|
19
|
+
var sum64_4_lo = utils.sum64_4_lo;
|
20
|
+
var sum64_5_hi = utils.sum64_5_hi;
|
21
|
+
var sum64_5_lo = utils.sum64_5_lo;
|
22
|
+
|
23
|
+
var BlockHash = common.BlockHash;
|
24
|
+
|
25
|
+
var sha512_K = [
|
26
|
+
0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
|
27
|
+
0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
|
28
|
+
0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
|
29
|
+
0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
|
30
|
+
0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
|
31
|
+
0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
|
32
|
+
0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
|
33
|
+
0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
|
34
|
+
0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
|
35
|
+
0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
|
36
|
+
0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
|
37
|
+
0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
|
38
|
+
0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
|
39
|
+
0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
|
40
|
+
0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
|
41
|
+
0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
|
42
|
+
0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
|
43
|
+
0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
|
44
|
+
0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
|
45
|
+
0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
|
46
|
+
0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
|
47
|
+
0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
|
48
|
+
0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
|
49
|
+
0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
|
50
|
+
0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
|
51
|
+
0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
|
52
|
+
0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
|
53
|
+
0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
|
54
|
+
0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
|
55
|
+
0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
|
56
|
+
0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
|
57
|
+
0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
|
58
|
+
0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
|
59
|
+
0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
|
60
|
+
0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
|
61
|
+
0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
|
62
|
+
0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
|
63
|
+
0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
|
64
|
+
0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
|
65
|
+
0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
|
66
|
+
];
|
67
|
+
|
68
|
+
function SHA512() {
|
69
|
+
if (!(this instanceof SHA512))
|
70
|
+
return new SHA512();
|
71
|
+
|
72
|
+
BlockHash.call(this);
|
73
|
+
this.h = [
|
74
|
+
0x6a09e667, 0xf3bcc908,
|
75
|
+
0xbb67ae85, 0x84caa73b,
|
76
|
+
0x3c6ef372, 0xfe94f82b,
|
77
|
+
0xa54ff53a, 0x5f1d36f1,
|
78
|
+
0x510e527f, 0xade682d1,
|
79
|
+
0x9b05688c, 0x2b3e6c1f,
|
80
|
+
0x1f83d9ab, 0xfb41bd6b,
|
81
|
+
0x5be0cd19, 0x137e2179 ];
|
82
|
+
this.k = sha512_K;
|
83
|
+
this.W = new Array(160);
|
84
|
+
}
|
85
|
+
utils.inherits(SHA512, BlockHash);
|
86
|
+
var _512 = SHA512;
|
87
|
+
|
88
|
+
SHA512.blockSize = 1024;
|
89
|
+
SHA512.outSize = 512;
|
90
|
+
SHA512.hmacStrength = 192;
|
91
|
+
SHA512.padLength = 128;
|
92
|
+
|
93
|
+
SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
|
94
|
+
var W = this.W;
|
95
|
+
|
96
|
+
// 32 x 32bit words
|
97
|
+
for (var i = 0; i < 32; i++)
|
98
|
+
W[i] = msg[start + i];
|
99
|
+
for (; i < W.length; i += 2) {
|
100
|
+
var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
|
101
|
+
var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
|
102
|
+
var c1_hi = W[i - 14]; // i - 7
|
103
|
+
var c1_lo = W[i - 13];
|
104
|
+
var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
|
105
|
+
var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
|
106
|
+
var c3_hi = W[i - 32]; // i - 16
|
107
|
+
var c3_lo = W[i - 31];
|
108
|
+
|
109
|
+
W[i] = sum64_4_hi(
|
110
|
+
c0_hi, c0_lo,
|
111
|
+
c1_hi, c1_lo,
|
112
|
+
c2_hi, c2_lo,
|
113
|
+
c3_hi, c3_lo);
|
114
|
+
W[i + 1] = sum64_4_lo(
|
115
|
+
c0_hi, c0_lo,
|
116
|
+
c1_hi, c1_lo,
|
117
|
+
c2_hi, c2_lo,
|
118
|
+
c3_hi, c3_lo);
|
119
|
+
}
|
120
|
+
};
|
121
|
+
|
122
|
+
SHA512.prototype._update = function _update(msg, start) {
|
123
|
+
this._prepareBlock(msg, start);
|
124
|
+
|
125
|
+
var W = this.W;
|
126
|
+
|
127
|
+
var ah = this.h[0];
|
128
|
+
var al = this.h[1];
|
129
|
+
var bh = this.h[2];
|
130
|
+
var bl = this.h[3];
|
131
|
+
var ch = this.h[4];
|
132
|
+
var cl = this.h[5];
|
133
|
+
var dh = this.h[6];
|
134
|
+
var dl = this.h[7];
|
135
|
+
var eh = this.h[8];
|
136
|
+
var el = this.h[9];
|
137
|
+
var fh = this.h[10];
|
138
|
+
var fl = this.h[11];
|
139
|
+
var gh = this.h[12];
|
140
|
+
var gl = this.h[13];
|
141
|
+
var hh = this.h[14];
|
142
|
+
var hl = this.h[15];
|
143
|
+
|
144
|
+
assert(this.k.length === W.length);
|
145
|
+
for (var i = 0; i < W.length; i += 2) {
|
146
|
+
var c0_hi = hh;
|
147
|
+
var c0_lo = hl;
|
148
|
+
var c1_hi = s1_512_hi(eh, el);
|
149
|
+
var c1_lo = s1_512_lo(eh, el);
|
150
|
+
var c2_hi = ch64_hi(eh, el, fh, fl, gh);
|
151
|
+
var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
|
152
|
+
var c3_hi = this.k[i];
|
153
|
+
var c3_lo = this.k[i + 1];
|
154
|
+
var c4_hi = W[i];
|
155
|
+
var c4_lo = W[i + 1];
|
156
|
+
|
157
|
+
var T1_hi = sum64_5_hi(
|
158
|
+
c0_hi, c0_lo,
|
159
|
+
c1_hi, c1_lo,
|
160
|
+
c2_hi, c2_lo,
|
161
|
+
c3_hi, c3_lo,
|
162
|
+
c4_hi, c4_lo);
|
163
|
+
var T1_lo = sum64_5_lo(
|
164
|
+
c0_hi, c0_lo,
|
165
|
+
c1_hi, c1_lo,
|
166
|
+
c2_hi, c2_lo,
|
167
|
+
c3_hi, c3_lo,
|
168
|
+
c4_hi, c4_lo);
|
169
|
+
|
170
|
+
c0_hi = s0_512_hi(ah, al);
|
171
|
+
c0_lo = s0_512_lo(ah, al);
|
172
|
+
c1_hi = maj64_hi(ah, al, bh, bl, ch);
|
173
|
+
c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
|
174
|
+
|
175
|
+
var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
|
176
|
+
var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
|
177
|
+
|
178
|
+
hh = gh;
|
179
|
+
hl = gl;
|
180
|
+
|
181
|
+
gh = fh;
|
182
|
+
gl = fl;
|
183
|
+
|
184
|
+
fh = eh;
|
185
|
+
fl = el;
|
186
|
+
|
187
|
+
eh = sum64_hi(dh, dl, T1_hi, T1_lo);
|
188
|
+
el = sum64_lo(dl, dl, T1_hi, T1_lo);
|
189
|
+
|
190
|
+
dh = ch;
|
191
|
+
dl = cl;
|
192
|
+
|
193
|
+
ch = bh;
|
194
|
+
cl = bl;
|
195
|
+
|
196
|
+
bh = ah;
|
197
|
+
bl = al;
|
198
|
+
|
199
|
+
ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
|
200
|
+
al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
|
201
|
+
}
|
202
|
+
|
203
|
+
sum64(this.h, 0, ah, al);
|
204
|
+
sum64(this.h, 2, bh, bl);
|
205
|
+
sum64(this.h, 4, ch, cl);
|
206
|
+
sum64(this.h, 6, dh, dl);
|
207
|
+
sum64(this.h, 8, eh, el);
|
208
|
+
sum64(this.h, 10, fh, fl);
|
209
|
+
sum64(this.h, 12, gh, gl);
|
210
|
+
sum64(this.h, 14, hh, hl);
|
211
|
+
};
|
212
|
+
|
213
|
+
SHA512.prototype._digest = function digest(enc) {
|
214
|
+
if (enc === 'hex')
|
215
|
+
return utils.toHex32(this.h, 'big');
|
216
|
+
else
|
217
|
+
return utils.split32(this.h, 'big');
|
218
|
+
};
|
219
|
+
|
220
|
+
function ch64_hi(xh, xl, yh, yl, zh) {
|
221
|
+
var r = (xh & yh) ^ ((~xh) & zh);
|
222
|
+
if (r < 0)
|
223
|
+
r += 0x100000000;
|
224
|
+
return r;
|
225
|
+
}
|
226
|
+
|
227
|
+
function ch64_lo(xh, xl, yh, yl, zh, zl) {
|
228
|
+
var r = (xl & yl) ^ ((~xl) & zl);
|
229
|
+
if (r < 0)
|
230
|
+
r += 0x100000000;
|
231
|
+
return r;
|
232
|
+
}
|
233
|
+
|
234
|
+
function maj64_hi(xh, xl, yh, yl, zh) {
|
235
|
+
var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
|
236
|
+
if (r < 0)
|
237
|
+
r += 0x100000000;
|
238
|
+
return r;
|
239
|
+
}
|
240
|
+
|
241
|
+
function maj64_lo(xh, xl, yh, yl, zh, zl) {
|
242
|
+
var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
|
243
|
+
if (r < 0)
|
244
|
+
r += 0x100000000;
|
245
|
+
return r;
|
246
|
+
}
|
247
|
+
|
248
|
+
function s0_512_hi(xh, xl) {
|
249
|
+
var c0_hi = rotr64_hi(xh, xl, 28);
|
250
|
+
var c1_hi = rotr64_hi(xl, xh, 2); // 34
|
251
|
+
var c2_hi = rotr64_hi(xl, xh, 7); // 39
|
252
|
+
|
253
|
+
var r = c0_hi ^ c1_hi ^ c2_hi;
|
254
|
+
if (r < 0)
|
255
|
+
r += 0x100000000;
|
256
|
+
return r;
|
257
|
+
}
|
258
|
+
|
259
|
+
function s0_512_lo(xh, xl) {
|
260
|
+
var c0_lo = rotr64_lo(xh, xl, 28);
|
261
|
+
var c1_lo = rotr64_lo(xl, xh, 2); // 34
|
262
|
+
var c2_lo = rotr64_lo(xl, xh, 7); // 39
|
263
|
+
|
264
|
+
var r = c0_lo ^ c1_lo ^ c2_lo;
|
265
|
+
if (r < 0)
|
266
|
+
r += 0x100000000;
|
267
|
+
return r;
|
268
|
+
}
|
269
|
+
|
270
|
+
function s1_512_hi(xh, xl) {
|
271
|
+
var c0_hi = rotr64_hi(xh, xl, 14);
|
272
|
+
var c1_hi = rotr64_hi(xh, xl, 18);
|
273
|
+
var c2_hi = rotr64_hi(xl, xh, 9); // 41
|
274
|
+
|
275
|
+
var r = c0_hi ^ c1_hi ^ c2_hi;
|
276
|
+
if (r < 0)
|
277
|
+
r += 0x100000000;
|
278
|
+
return r;
|
279
|
+
}
|
280
|
+
|
281
|
+
function s1_512_lo(xh, xl) {
|
282
|
+
var c0_lo = rotr64_lo(xh, xl, 14);
|
283
|
+
var c1_lo = rotr64_lo(xh, xl, 18);
|
284
|
+
var c2_lo = rotr64_lo(xl, xh, 9); // 41
|
285
|
+
|
286
|
+
var r = c0_lo ^ c1_lo ^ c2_lo;
|
287
|
+
if (r < 0)
|
288
|
+
r += 0x100000000;
|
289
|
+
return r;
|
290
|
+
}
|
291
|
+
|
292
|
+
function g0_512_hi(xh, xl) {
|
293
|
+
var c0_hi = rotr64_hi(xh, xl, 1);
|
294
|
+
var c1_hi = rotr64_hi(xh, xl, 8);
|
295
|
+
var c2_hi = shr64_hi(xh, xl, 7);
|
296
|
+
|
297
|
+
var r = c0_hi ^ c1_hi ^ c2_hi;
|
298
|
+
if (r < 0)
|
299
|
+
r += 0x100000000;
|
300
|
+
return r;
|
301
|
+
}
|
302
|
+
|
303
|
+
function g0_512_lo(xh, xl) {
|
304
|
+
var c0_lo = rotr64_lo(xh, xl, 1);
|
305
|
+
var c1_lo = rotr64_lo(xh, xl, 8);
|
306
|
+
var c2_lo = shr64_lo(xh, xl, 7);
|
307
|
+
|
308
|
+
var r = c0_lo ^ c1_lo ^ c2_lo;
|
309
|
+
if (r < 0)
|
310
|
+
r += 0x100000000;
|
311
|
+
return r;
|
312
|
+
}
|
313
|
+
|
314
|
+
function g1_512_hi(xh, xl) {
|
315
|
+
var c0_hi = rotr64_hi(xh, xl, 19);
|
316
|
+
var c1_hi = rotr64_hi(xl, xh, 29); // 61
|
317
|
+
var c2_hi = shr64_hi(xh, xl, 6);
|
318
|
+
|
319
|
+
var r = c0_hi ^ c1_hi ^ c2_hi;
|
320
|
+
if (r < 0)
|
321
|
+
r += 0x100000000;
|
322
|
+
return r;
|
323
|
+
}
|
324
|
+
|
325
|
+
function g1_512_lo(xh, xl) {
|
326
|
+
var c0_lo = rotr64_lo(xh, xl, 19);
|
327
|
+
var c1_lo = rotr64_lo(xl, xh, 29); // 61
|
328
|
+
var c2_lo = shr64_lo(xh, xl, 6);
|
329
|
+
|
330
|
+
var r = c0_lo ^ c1_lo ^ c2_lo;
|
331
|
+
if (r < 0)
|
332
|
+
r += 0x100000000;
|
333
|
+
return r;
|
334
|
+
}
|
335
|
+
|
336
|
+
export { _512 as _ };
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { __exports as common } from '../../../../../_virtual/common2.js';
|
2
|
+
import '../utils.js';
|
3
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
|
4
|
+
|
5
|
+
var utils = utils$1;
|
6
|
+
var rotr32 = utils.rotr32;
|
7
|
+
|
8
|
+
function ft_1(s, x, y, z) {
|
9
|
+
if (s === 0)
|
10
|
+
return ch32(x, y, z);
|
11
|
+
if (s === 1 || s === 3)
|
12
|
+
return p32(x, y, z);
|
13
|
+
if (s === 2)
|
14
|
+
return maj32(x, y, z);
|
15
|
+
}
|
16
|
+
common.ft_1 = ft_1;
|
17
|
+
|
18
|
+
function ch32(x, y, z) {
|
19
|
+
return (x & y) ^ ((~x) & z);
|
20
|
+
}
|
21
|
+
common.ch32 = ch32;
|
22
|
+
|
23
|
+
function maj32(x, y, z) {
|
24
|
+
return (x & y) ^ (x & z) ^ (y & z);
|
25
|
+
}
|
26
|
+
common.maj32 = maj32;
|
27
|
+
|
28
|
+
function p32(x, y, z) {
|
29
|
+
return x ^ y ^ z;
|
30
|
+
}
|
31
|
+
common.p32 = p32;
|
32
|
+
|
33
|
+
function s0_256(x) {
|
34
|
+
return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
|
35
|
+
}
|
36
|
+
common.s0_256 = s0_256;
|
37
|
+
|
38
|
+
function s1_256(x) {
|
39
|
+
return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
|
40
|
+
}
|
41
|
+
common.s1_256 = s1_256;
|
42
|
+
|
43
|
+
function g0_256(x) {
|
44
|
+
return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
|
45
|
+
}
|
46
|
+
common.g0_256 = g0_256;
|
47
|
+
|
48
|
+
function g1_256(x) {
|
49
|
+
return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
|
50
|
+
}
|
51
|
+
common.g1_256 = g1_256;
|
52
|
+
|
53
|
+
export { common as default };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { __exports as sha } from '../../../../_virtual/sha.js';
|
2
|
+
import { _ as _1 } from './sha/1.js';
|
3
|
+
import { _ as _224 } from './sha/224.js';
|
4
|
+
import { _ as _256 } from './sha/256.js';
|
5
|
+
import { _ as _384 } from './sha/384.js';
|
6
|
+
import { _ as _512 } from './sha/512.js';
|
7
|
+
|
8
|
+
sha.sha1 = _1;
|
9
|
+
sha.sha224 = _224;
|
10
|
+
sha.sha256 = _256;
|
11
|
+
sha.sha384 = _384;
|
12
|
+
sha.sha512 = _512;
|
13
|
+
|
14
|
+
export { sha as default };
|
@@ -0,0 +1,282 @@
|
|
1
|
+
import { __exports as utils } from '../../../../_virtual/utils3.js';
|
2
|
+
import { m as minimalisticAssert } from '../../../minimalistic-assert/index.js';
|
3
|
+
import { i as inherits_browserExports } from '../../../inherits/inherits_browser.js';
|
4
|
+
|
5
|
+
var assert = minimalisticAssert;
|
6
|
+
var inherits = inherits_browserExports;
|
7
|
+
|
8
|
+
utils.inherits = inherits;
|
9
|
+
|
10
|
+
function isSurrogatePair(msg, i) {
|
11
|
+
if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
|
12
|
+
return false;
|
13
|
+
}
|
14
|
+
if (i < 0 || i + 1 >= msg.length) {
|
15
|
+
return false;
|
16
|
+
}
|
17
|
+
return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
|
18
|
+
}
|
19
|
+
|
20
|
+
function toArray(msg, enc) {
|
21
|
+
if (Array.isArray(msg))
|
22
|
+
return msg.slice();
|
23
|
+
if (!msg)
|
24
|
+
return [];
|
25
|
+
var res = [];
|
26
|
+
if (typeof msg === 'string') {
|
27
|
+
if (!enc) {
|
28
|
+
// Inspired by stringToUtf8ByteArray() in closure-library by Google
|
29
|
+
// https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
|
30
|
+
// Apache License 2.0
|
31
|
+
// https://github.com/google/closure-library/blob/master/LICENSE
|
32
|
+
var p = 0;
|
33
|
+
for (var i = 0; i < msg.length; i++) {
|
34
|
+
var c = msg.charCodeAt(i);
|
35
|
+
if (c < 128) {
|
36
|
+
res[p++] = c;
|
37
|
+
} else if (c < 2048) {
|
38
|
+
res[p++] = (c >> 6) | 192;
|
39
|
+
res[p++] = (c & 63) | 128;
|
40
|
+
} else if (isSurrogatePair(msg, i)) {
|
41
|
+
c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
|
42
|
+
res[p++] = (c >> 18) | 240;
|
43
|
+
res[p++] = ((c >> 12) & 63) | 128;
|
44
|
+
res[p++] = ((c >> 6) & 63) | 128;
|
45
|
+
res[p++] = (c & 63) | 128;
|
46
|
+
} else {
|
47
|
+
res[p++] = (c >> 12) | 224;
|
48
|
+
res[p++] = ((c >> 6) & 63) | 128;
|
49
|
+
res[p++] = (c & 63) | 128;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
} else if (enc === 'hex') {
|
53
|
+
msg = msg.replace(/[^a-z0-9]+/ig, '');
|
54
|
+
if (msg.length % 2 !== 0)
|
55
|
+
msg = '0' + msg;
|
56
|
+
for (i = 0; i < msg.length; i += 2)
|
57
|
+
res.push(parseInt(msg[i] + msg[i + 1], 16));
|
58
|
+
}
|
59
|
+
} else {
|
60
|
+
for (i = 0; i < msg.length; i++)
|
61
|
+
res[i] = msg[i] | 0;
|
62
|
+
}
|
63
|
+
return res;
|
64
|
+
}
|
65
|
+
utils.toArray = toArray;
|
66
|
+
|
67
|
+
function toHex(msg) {
|
68
|
+
var res = '';
|
69
|
+
for (var i = 0; i < msg.length; i++)
|
70
|
+
res += zero2(msg[i].toString(16));
|
71
|
+
return res;
|
72
|
+
}
|
73
|
+
utils.toHex = toHex;
|
74
|
+
|
75
|
+
function htonl(w) {
|
76
|
+
var res = (w >>> 24) |
|
77
|
+
((w >>> 8) & 0xff00) |
|
78
|
+
((w << 8) & 0xff0000) |
|
79
|
+
((w & 0xff) << 24);
|
80
|
+
return res >>> 0;
|
81
|
+
}
|
82
|
+
utils.htonl = htonl;
|
83
|
+
|
84
|
+
function toHex32(msg, endian) {
|
85
|
+
var res = '';
|
86
|
+
for (var i = 0; i < msg.length; i++) {
|
87
|
+
var w = msg[i];
|
88
|
+
if (endian === 'little')
|
89
|
+
w = htonl(w);
|
90
|
+
res += zero8(w.toString(16));
|
91
|
+
}
|
92
|
+
return res;
|
93
|
+
}
|
94
|
+
utils.toHex32 = toHex32;
|
95
|
+
|
96
|
+
function zero2(word) {
|
97
|
+
if (word.length === 1)
|
98
|
+
return '0' + word;
|
99
|
+
else
|
100
|
+
return word;
|
101
|
+
}
|
102
|
+
utils.zero2 = zero2;
|
103
|
+
|
104
|
+
function zero8(word) {
|
105
|
+
if (word.length === 7)
|
106
|
+
return '0' + word;
|
107
|
+
else if (word.length === 6)
|
108
|
+
return '00' + word;
|
109
|
+
else if (word.length === 5)
|
110
|
+
return '000' + word;
|
111
|
+
else if (word.length === 4)
|
112
|
+
return '0000' + word;
|
113
|
+
else if (word.length === 3)
|
114
|
+
return '00000' + word;
|
115
|
+
else if (word.length === 2)
|
116
|
+
return '000000' + word;
|
117
|
+
else if (word.length === 1)
|
118
|
+
return '0000000' + word;
|
119
|
+
else
|
120
|
+
return word;
|
121
|
+
}
|
122
|
+
utils.zero8 = zero8;
|
123
|
+
|
124
|
+
function join32(msg, start, end, endian) {
|
125
|
+
var len = end - start;
|
126
|
+
assert(len % 4 === 0);
|
127
|
+
var res = new Array(len / 4);
|
128
|
+
for (var i = 0, k = start; i < res.length; i++, k += 4) {
|
129
|
+
var w;
|
130
|
+
if (endian === 'big')
|
131
|
+
w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
|
132
|
+
else
|
133
|
+
w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
|
134
|
+
res[i] = w >>> 0;
|
135
|
+
}
|
136
|
+
return res;
|
137
|
+
}
|
138
|
+
utils.join32 = join32;
|
139
|
+
|
140
|
+
function split32(msg, endian) {
|
141
|
+
var res = new Array(msg.length * 4);
|
142
|
+
for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
|
143
|
+
var m = msg[i];
|
144
|
+
if (endian === 'big') {
|
145
|
+
res[k] = m >>> 24;
|
146
|
+
res[k + 1] = (m >>> 16) & 0xff;
|
147
|
+
res[k + 2] = (m >>> 8) & 0xff;
|
148
|
+
res[k + 3] = m & 0xff;
|
149
|
+
} else {
|
150
|
+
res[k + 3] = m >>> 24;
|
151
|
+
res[k + 2] = (m >>> 16) & 0xff;
|
152
|
+
res[k + 1] = (m >>> 8) & 0xff;
|
153
|
+
res[k] = m & 0xff;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
return res;
|
157
|
+
}
|
158
|
+
utils.split32 = split32;
|
159
|
+
|
160
|
+
function rotr32(w, b) {
|
161
|
+
return (w >>> b) | (w << (32 - b));
|
162
|
+
}
|
163
|
+
utils.rotr32 = rotr32;
|
164
|
+
|
165
|
+
function rotl32(w, b) {
|
166
|
+
return (w << b) | (w >>> (32 - b));
|
167
|
+
}
|
168
|
+
utils.rotl32 = rotl32;
|
169
|
+
|
170
|
+
function sum32(a, b) {
|
171
|
+
return (a + b) >>> 0;
|
172
|
+
}
|
173
|
+
utils.sum32 = sum32;
|
174
|
+
|
175
|
+
function sum32_3(a, b, c) {
|
176
|
+
return (a + b + c) >>> 0;
|
177
|
+
}
|
178
|
+
utils.sum32_3 = sum32_3;
|
179
|
+
|
180
|
+
function sum32_4(a, b, c, d) {
|
181
|
+
return (a + b + c + d) >>> 0;
|
182
|
+
}
|
183
|
+
utils.sum32_4 = sum32_4;
|
184
|
+
|
185
|
+
function sum32_5(a, b, c, d, e) {
|
186
|
+
return (a + b + c + d + e) >>> 0;
|
187
|
+
}
|
188
|
+
utils.sum32_5 = sum32_5;
|
189
|
+
|
190
|
+
function sum64(buf, pos, ah, al) {
|
191
|
+
var bh = buf[pos];
|
192
|
+
var bl = buf[pos + 1];
|
193
|
+
|
194
|
+
var lo = (al + bl) >>> 0;
|
195
|
+
var hi = (lo < al ? 1 : 0) + ah + bh;
|
196
|
+
buf[pos] = hi >>> 0;
|
197
|
+
buf[pos + 1] = lo;
|
198
|
+
}
|
199
|
+
utils.sum64 = sum64;
|
200
|
+
|
201
|
+
function sum64_hi(ah, al, bh, bl) {
|
202
|
+
var lo = (al + bl) >>> 0;
|
203
|
+
var hi = (lo < al ? 1 : 0) + ah + bh;
|
204
|
+
return hi >>> 0;
|
205
|
+
}
|
206
|
+
utils.sum64_hi = sum64_hi;
|
207
|
+
|
208
|
+
function sum64_lo(ah, al, bh, bl) {
|
209
|
+
var lo = al + bl;
|
210
|
+
return lo >>> 0;
|
211
|
+
}
|
212
|
+
utils.sum64_lo = sum64_lo;
|
213
|
+
|
214
|
+
function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
|
215
|
+
var carry = 0;
|
216
|
+
var lo = al;
|
217
|
+
lo = (lo + bl) >>> 0;
|
218
|
+
carry += lo < al ? 1 : 0;
|
219
|
+
lo = (lo + cl) >>> 0;
|
220
|
+
carry += lo < cl ? 1 : 0;
|
221
|
+
lo = (lo + dl) >>> 0;
|
222
|
+
carry += lo < dl ? 1 : 0;
|
223
|
+
|
224
|
+
var hi = ah + bh + ch + dh + carry;
|
225
|
+
return hi >>> 0;
|
226
|
+
}
|
227
|
+
utils.sum64_4_hi = sum64_4_hi;
|
228
|
+
|
229
|
+
function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
|
230
|
+
var lo = al + bl + cl + dl;
|
231
|
+
return lo >>> 0;
|
232
|
+
}
|
233
|
+
utils.sum64_4_lo = sum64_4_lo;
|
234
|
+
|
235
|
+
function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
|
236
|
+
var carry = 0;
|
237
|
+
var lo = al;
|
238
|
+
lo = (lo + bl) >>> 0;
|
239
|
+
carry += lo < al ? 1 : 0;
|
240
|
+
lo = (lo + cl) >>> 0;
|
241
|
+
carry += lo < cl ? 1 : 0;
|
242
|
+
lo = (lo + dl) >>> 0;
|
243
|
+
carry += lo < dl ? 1 : 0;
|
244
|
+
lo = (lo + el) >>> 0;
|
245
|
+
carry += lo < el ? 1 : 0;
|
246
|
+
|
247
|
+
var hi = ah + bh + ch + dh + eh + carry;
|
248
|
+
return hi >>> 0;
|
249
|
+
}
|
250
|
+
utils.sum64_5_hi = sum64_5_hi;
|
251
|
+
|
252
|
+
function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
|
253
|
+
var lo = al + bl + cl + dl + el;
|
254
|
+
|
255
|
+
return lo >>> 0;
|
256
|
+
}
|
257
|
+
utils.sum64_5_lo = sum64_5_lo;
|
258
|
+
|
259
|
+
function rotr64_hi(ah, al, num) {
|
260
|
+
var r = (al << (32 - num)) | (ah >>> num);
|
261
|
+
return r >>> 0;
|
262
|
+
}
|
263
|
+
utils.rotr64_hi = rotr64_hi;
|
264
|
+
|
265
|
+
function rotr64_lo(ah, al, num) {
|
266
|
+
var r = (ah << (32 - num)) | (al >>> num);
|
267
|
+
return r >>> 0;
|
268
|
+
}
|
269
|
+
utils.rotr64_lo = rotr64_lo;
|
270
|
+
|
271
|
+
function shr64_hi(ah, al, num) {
|
272
|
+
return ah >>> num;
|
273
|
+
}
|
274
|
+
utils.shr64_hi = shr64_hi;
|
275
|
+
|
276
|
+
function shr64_lo(ah, al, num) {
|
277
|
+
var r = (ah << (32 - num)) | (al >>> num);
|
278
|
+
return r >>> 0;
|
279
|
+
}
|
280
|
+
utils.shr64_lo = shr64_lo;
|
281
|
+
|
282
|
+
export { utils as default };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { getDefaultExportFromCjs } from '../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as hash$1 } from '../../../_virtual/hash.js';
|
3
|
+
import './hash/utils.js';
|
4
|
+
import './hash/common.js';
|
5
|
+
import './hash/sha.js';
|
6
|
+
import './hash/ripemd.js';
|
7
|
+
import { h as hmac } from './hash/hmac.js';
|
8
|
+
import { __exports as utils } from '../../../_virtual/utils3.js';
|
9
|
+
import { __exports as common } from '../../../_virtual/common.js';
|
10
|
+
import { __exports as sha } from '../../../_virtual/sha.js';
|
11
|
+
import { __exports as ripemd } from '../../../_virtual/ripemd.js';
|
12
|
+
|
13
|
+
(function (exports) {
|
14
|
+
var hash = exports;
|
15
|
+
|
16
|
+
hash.utils = utils;
|
17
|
+
hash.common = common;
|
18
|
+
hash.sha = sha;
|
19
|
+
hash.ripemd = ripemd;
|
20
|
+
hash.hmac = hmac;
|
21
|
+
|
22
|
+
// Proxy hash functions to the main object
|
23
|
+
hash.sha1 = hash.sha.sha1;
|
24
|
+
hash.sha256 = hash.sha.sha256;
|
25
|
+
hash.sha224 = hash.sha.sha224;
|
26
|
+
hash.sha384 = hash.sha.sha384;
|
27
|
+
hash.sha512 = hash.sha.sha512;
|
28
|
+
hash.ripemd160 = hash.ripemd.ripemd160;
|
29
|
+
} (hash$1));
|
30
|
+
|
31
|
+
var hash = /*@__PURE__*/getDefaultExportFromCjs(hash$1);
|
32
|
+
|
33
|
+
export { hash as default };
|