@waku/rln 0.1.3 → 0.1.4-d27db21.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,51 @@
|
|
1
|
+
import './utils.js';
|
2
|
+
import { m as minimalisticAssert } from '../../../minimalistic-assert/index.js';
|
3
|
+
import { __exports as utils$1 } from '../../../../_virtual/utils3.js';
|
4
|
+
|
5
|
+
var utils = utils$1;
|
6
|
+
var assert = minimalisticAssert;
|
7
|
+
|
8
|
+
function Hmac(hash, key, enc) {
|
9
|
+
if (!(this instanceof Hmac))
|
10
|
+
return new Hmac(hash, key, enc);
|
11
|
+
this.Hash = hash;
|
12
|
+
this.blockSize = hash.blockSize / 8;
|
13
|
+
this.outSize = hash.outSize / 8;
|
14
|
+
this.inner = null;
|
15
|
+
this.outer = null;
|
16
|
+
|
17
|
+
this._init(utils.toArray(key, enc));
|
18
|
+
}
|
19
|
+
var hmac = Hmac;
|
20
|
+
|
21
|
+
Hmac.prototype._init = function init(key) {
|
22
|
+
// Shorten key, if needed
|
23
|
+
if (key.length > this.blockSize)
|
24
|
+
key = new this.Hash().update(key).digest();
|
25
|
+
assert(key.length <= this.blockSize);
|
26
|
+
|
27
|
+
// Add padding to key
|
28
|
+
for (var i = key.length; i < this.blockSize; i++)
|
29
|
+
key.push(0);
|
30
|
+
|
31
|
+
for (i = 0; i < key.length; i++)
|
32
|
+
key[i] ^= 0x36;
|
33
|
+
this.inner = new this.Hash().update(key);
|
34
|
+
|
35
|
+
// 0x36 ^ 0x5c = 0x6a
|
36
|
+
for (i = 0; i < key.length; i++)
|
37
|
+
key[i] ^= 0x6a;
|
38
|
+
this.outer = new this.Hash().update(key);
|
39
|
+
};
|
40
|
+
|
41
|
+
Hmac.prototype.update = function update(msg, enc) {
|
42
|
+
this.inner.update(msg, enc);
|
43
|
+
return this;
|
44
|
+
};
|
45
|
+
|
46
|
+
Hmac.prototype.digest = function digest(enc) {
|
47
|
+
this.outer.update(this.inner.digest());
|
48
|
+
return this.outer.digest(enc);
|
49
|
+
};
|
50
|
+
|
51
|
+
export { hmac as h };
|
@@ -0,0 +1,152 @@
|
|
1
|
+
import { __exports as ripemd } from '../../../../_virtual/ripemd.js';
|
2
|
+
import './utils.js';
|
3
|
+
import './common.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
|
+
|
10
|
+
var rotl32 = utils.rotl32;
|
11
|
+
var sum32 = utils.sum32;
|
12
|
+
var sum32_3 = utils.sum32_3;
|
13
|
+
var sum32_4 = utils.sum32_4;
|
14
|
+
var BlockHash = common.BlockHash;
|
15
|
+
|
16
|
+
function RIPEMD160() {
|
17
|
+
if (!(this instanceof RIPEMD160))
|
18
|
+
return new RIPEMD160();
|
19
|
+
|
20
|
+
BlockHash.call(this);
|
21
|
+
|
22
|
+
this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
|
23
|
+
this.endian = 'little';
|
24
|
+
}
|
25
|
+
utils.inherits(RIPEMD160, BlockHash);
|
26
|
+
ripemd.ripemd160 = RIPEMD160;
|
27
|
+
|
28
|
+
RIPEMD160.blockSize = 512;
|
29
|
+
RIPEMD160.outSize = 160;
|
30
|
+
RIPEMD160.hmacStrength = 192;
|
31
|
+
RIPEMD160.padLength = 64;
|
32
|
+
|
33
|
+
RIPEMD160.prototype._update = function update(msg, start) {
|
34
|
+
var A = this.h[0];
|
35
|
+
var B = this.h[1];
|
36
|
+
var C = this.h[2];
|
37
|
+
var D = this.h[3];
|
38
|
+
var E = this.h[4];
|
39
|
+
var Ah = A;
|
40
|
+
var Bh = B;
|
41
|
+
var Ch = C;
|
42
|
+
var Dh = D;
|
43
|
+
var Eh = E;
|
44
|
+
for (var j = 0; j < 80; j++) {
|
45
|
+
var T = sum32(
|
46
|
+
rotl32(
|
47
|
+
sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
|
48
|
+
s[j]),
|
49
|
+
E);
|
50
|
+
A = E;
|
51
|
+
E = D;
|
52
|
+
D = rotl32(C, 10);
|
53
|
+
C = B;
|
54
|
+
B = T;
|
55
|
+
T = sum32(
|
56
|
+
rotl32(
|
57
|
+
sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
|
58
|
+
sh[j]),
|
59
|
+
Eh);
|
60
|
+
Ah = Eh;
|
61
|
+
Eh = Dh;
|
62
|
+
Dh = rotl32(Ch, 10);
|
63
|
+
Ch = Bh;
|
64
|
+
Bh = T;
|
65
|
+
}
|
66
|
+
T = sum32_3(this.h[1], C, Dh);
|
67
|
+
this.h[1] = sum32_3(this.h[2], D, Eh);
|
68
|
+
this.h[2] = sum32_3(this.h[3], E, Ah);
|
69
|
+
this.h[3] = sum32_3(this.h[4], A, Bh);
|
70
|
+
this.h[4] = sum32_3(this.h[0], B, Ch);
|
71
|
+
this.h[0] = T;
|
72
|
+
};
|
73
|
+
|
74
|
+
RIPEMD160.prototype._digest = function digest(enc) {
|
75
|
+
if (enc === 'hex')
|
76
|
+
return utils.toHex32(this.h, 'little');
|
77
|
+
else
|
78
|
+
return utils.split32(this.h, 'little');
|
79
|
+
};
|
80
|
+
|
81
|
+
function f(j, x, y, z) {
|
82
|
+
if (j <= 15)
|
83
|
+
return x ^ y ^ z;
|
84
|
+
else if (j <= 31)
|
85
|
+
return (x & y) | ((~x) & z);
|
86
|
+
else if (j <= 47)
|
87
|
+
return (x | (~y)) ^ z;
|
88
|
+
else if (j <= 63)
|
89
|
+
return (x & z) | (y & (~z));
|
90
|
+
else
|
91
|
+
return x ^ (y | (~z));
|
92
|
+
}
|
93
|
+
|
94
|
+
function K(j) {
|
95
|
+
if (j <= 15)
|
96
|
+
return 0x00000000;
|
97
|
+
else if (j <= 31)
|
98
|
+
return 0x5a827999;
|
99
|
+
else if (j <= 47)
|
100
|
+
return 0x6ed9eba1;
|
101
|
+
else if (j <= 63)
|
102
|
+
return 0x8f1bbcdc;
|
103
|
+
else
|
104
|
+
return 0xa953fd4e;
|
105
|
+
}
|
106
|
+
|
107
|
+
function Kh(j) {
|
108
|
+
if (j <= 15)
|
109
|
+
return 0x50a28be6;
|
110
|
+
else if (j <= 31)
|
111
|
+
return 0x5c4dd124;
|
112
|
+
else if (j <= 47)
|
113
|
+
return 0x6d703ef3;
|
114
|
+
else if (j <= 63)
|
115
|
+
return 0x7a6d76e9;
|
116
|
+
else
|
117
|
+
return 0x00000000;
|
118
|
+
}
|
119
|
+
|
120
|
+
var r = [
|
121
|
+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
122
|
+
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
|
123
|
+
3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
|
124
|
+
1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
|
125
|
+
4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
|
126
|
+
];
|
127
|
+
|
128
|
+
var rh = [
|
129
|
+
5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
|
130
|
+
6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
|
131
|
+
15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
|
132
|
+
8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
|
133
|
+
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
|
134
|
+
];
|
135
|
+
|
136
|
+
var s = [
|
137
|
+
11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
|
138
|
+
7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
|
139
|
+
11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
|
140
|
+
11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
|
141
|
+
9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
|
142
|
+
];
|
143
|
+
|
144
|
+
var sh = [
|
145
|
+
8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
|
146
|
+
9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
|
147
|
+
9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
|
148
|
+
15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
|
149
|
+
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
|
150
|
+
];
|
151
|
+
|
152
|
+
export { ripemd as default };
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import '../utils.js';
|
2
|
+
import '../common.js';
|
3
|
+
import './common.js';
|
4
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
|
5
|
+
import { __exports as common$1 } from '../../../../../_virtual/common.js';
|
6
|
+
import { __exports as common$2 } from '../../../../../_virtual/common2.js';
|
7
|
+
|
8
|
+
var utils = utils$1;
|
9
|
+
var common = common$1;
|
10
|
+
var shaCommon = common$2;
|
11
|
+
|
12
|
+
var rotl32 = utils.rotl32;
|
13
|
+
var sum32 = utils.sum32;
|
14
|
+
var sum32_5 = utils.sum32_5;
|
15
|
+
var ft_1 = shaCommon.ft_1;
|
16
|
+
var BlockHash = common.BlockHash;
|
17
|
+
|
18
|
+
var sha1_K = [
|
19
|
+
0x5A827999, 0x6ED9EBA1,
|
20
|
+
0x8F1BBCDC, 0xCA62C1D6
|
21
|
+
];
|
22
|
+
|
23
|
+
function SHA1() {
|
24
|
+
if (!(this instanceof SHA1))
|
25
|
+
return new SHA1();
|
26
|
+
|
27
|
+
BlockHash.call(this);
|
28
|
+
this.h = [
|
29
|
+
0x67452301, 0xefcdab89, 0x98badcfe,
|
30
|
+
0x10325476, 0xc3d2e1f0 ];
|
31
|
+
this.W = new Array(80);
|
32
|
+
}
|
33
|
+
|
34
|
+
utils.inherits(SHA1, BlockHash);
|
35
|
+
var _1 = SHA1;
|
36
|
+
|
37
|
+
SHA1.blockSize = 512;
|
38
|
+
SHA1.outSize = 160;
|
39
|
+
SHA1.hmacStrength = 80;
|
40
|
+
SHA1.padLength = 64;
|
41
|
+
|
42
|
+
SHA1.prototype._update = function _update(msg, start) {
|
43
|
+
var W = this.W;
|
44
|
+
|
45
|
+
for (var i = 0; i < 16; i++)
|
46
|
+
W[i] = msg[start + i];
|
47
|
+
|
48
|
+
for(; i < W.length; i++)
|
49
|
+
W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
|
50
|
+
|
51
|
+
var a = this.h[0];
|
52
|
+
var b = this.h[1];
|
53
|
+
var c = this.h[2];
|
54
|
+
var d = this.h[3];
|
55
|
+
var e = this.h[4];
|
56
|
+
|
57
|
+
for (i = 0; i < W.length; i++) {
|
58
|
+
var s = ~~(i / 20);
|
59
|
+
var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
|
60
|
+
e = d;
|
61
|
+
d = c;
|
62
|
+
c = rotl32(b, 30);
|
63
|
+
b = a;
|
64
|
+
a = t;
|
65
|
+
}
|
66
|
+
|
67
|
+
this.h[0] = sum32(this.h[0], a);
|
68
|
+
this.h[1] = sum32(this.h[1], b);
|
69
|
+
this.h[2] = sum32(this.h[2], c);
|
70
|
+
this.h[3] = sum32(this.h[3], d);
|
71
|
+
this.h[4] = sum32(this.h[4], e);
|
72
|
+
};
|
73
|
+
|
74
|
+
SHA1.prototype._digest = function digest(enc) {
|
75
|
+
if (enc === 'hex')
|
76
|
+
return utils.toHex32(this.h, 'big');
|
77
|
+
else
|
78
|
+
return utils.split32(this.h, 'big');
|
79
|
+
};
|
80
|
+
|
81
|
+
export { _1 as _ };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import '../utils.js';
|
2
|
+
import { _ as _256 } from './256.js';
|
3
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
|
4
|
+
|
5
|
+
var utils = utils$1;
|
6
|
+
var SHA256 = _256;
|
7
|
+
|
8
|
+
function SHA224() {
|
9
|
+
if (!(this instanceof SHA224))
|
10
|
+
return new SHA224();
|
11
|
+
|
12
|
+
SHA256.call(this);
|
13
|
+
this.h = [
|
14
|
+
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
|
15
|
+
0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
|
16
|
+
}
|
17
|
+
utils.inherits(SHA224, SHA256);
|
18
|
+
var _224 = SHA224;
|
19
|
+
|
20
|
+
SHA224.blockSize = 512;
|
21
|
+
SHA224.outSize = 224;
|
22
|
+
SHA224.hmacStrength = 192;
|
23
|
+
SHA224.padLength = 64;
|
24
|
+
|
25
|
+
SHA224.prototype._digest = function digest(enc) {
|
26
|
+
// Just truncate output
|
27
|
+
if (enc === 'hex')
|
28
|
+
return utils.toHex32(this.h.slice(0, 7), 'big');
|
29
|
+
else
|
30
|
+
return utils.split32(this.h.slice(0, 7), 'big');
|
31
|
+
};
|
32
|
+
|
33
|
+
export { _224 as _ };
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import '../utils.js';
|
2
|
+
import '../common.js';
|
3
|
+
import './common.js';
|
4
|
+
import { m as minimalisticAssert } from '../../../../minimalistic-assert/index.js';
|
5
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
|
6
|
+
import { __exports as common$1 } from '../../../../../_virtual/common.js';
|
7
|
+
import { __exports as common$2 } from '../../../../../_virtual/common2.js';
|
8
|
+
|
9
|
+
var utils = utils$1;
|
10
|
+
var common = common$1;
|
11
|
+
var shaCommon = common$2;
|
12
|
+
var assert = minimalisticAssert;
|
13
|
+
|
14
|
+
var sum32 = utils.sum32;
|
15
|
+
var sum32_4 = utils.sum32_4;
|
16
|
+
var sum32_5 = utils.sum32_5;
|
17
|
+
var ch32 = shaCommon.ch32;
|
18
|
+
var maj32 = shaCommon.maj32;
|
19
|
+
var s0_256 = shaCommon.s0_256;
|
20
|
+
var s1_256 = shaCommon.s1_256;
|
21
|
+
var g0_256 = shaCommon.g0_256;
|
22
|
+
var g1_256 = shaCommon.g1_256;
|
23
|
+
|
24
|
+
var BlockHash = common.BlockHash;
|
25
|
+
|
26
|
+
var sha256_K = [
|
27
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
28
|
+
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
29
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
30
|
+
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
31
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
|
32
|
+
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
33
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
|
34
|
+
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
35
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
36
|
+
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
37
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
|
38
|
+
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
39
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
|
40
|
+
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
41
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
42
|
+
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
43
|
+
];
|
44
|
+
|
45
|
+
function SHA256() {
|
46
|
+
if (!(this instanceof SHA256))
|
47
|
+
return new SHA256();
|
48
|
+
|
49
|
+
BlockHash.call(this);
|
50
|
+
this.h = [
|
51
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
52
|
+
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
|
53
|
+
];
|
54
|
+
this.k = sha256_K;
|
55
|
+
this.W = new Array(64);
|
56
|
+
}
|
57
|
+
utils.inherits(SHA256, BlockHash);
|
58
|
+
var _256 = SHA256;
|
59
|
+
|
60
|
+
SHA256.blockSize = 512;
|
61
|
+
SHA256.outSize = 256;
|
62
|
+
SHA256.hmacStrength = 192;
|
63
|
+
SHA256.padLength = 64;
|
64
|
+
|
65
|
+
SHA256.prototype._update = function _update(msg, start) {
|
66
|
+
var W = this.W;
|
67
|
+
|
68
|
+
for (var i = 0; i < 16; i++)
|
69
|
+
W[i] = msg[start + i];
|
70
|
+
for (; i < W.length; i++)
|
71
|
+
W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
|
72
|
+
|
73
|
+
var a = this.h[0];
|
74
|
+
var b = this.h[1];
|
75
|
+
var c = this.h[2];
|
76
|
+
var d = this.h[3];
|
77
|
+
var e = this.h[4];
|
78
|
+
var f = this.h[5];
|
79
|
+
var g = this.h[6];
|
80
|
+
var h = this.h[7];
|
81
|
+
|
82
|
+
assert(this.k.length === W.length);
|
83
|
+
for (i = 0; i < W.length; i++) {
|
84
|
+
var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
|
85
|
+
var T2 = sum32(s0_256(a), maj32(a, b, c));
|
86
|
+
h = g;
|
87
|
+
g = f;
|
88
|
+
f = e;
|
89
|
+
e = sum32(d, T1);
|
90
|
+
d = c;
|
91
|
+
c = b;
|
92
|
+
b = a;
|
93
|
+
a = sum32(T1, T2);
|
94
|
+
}
|
95
|
+
|
96
|
+
this.h[0] = sum32(this.h[0], a);
|
97
|
+
this.h[1] = sum32(this.h[1], b);
|
98
|
+
this.h[2] = sum32(this.h[2], c);
|
99
|
+
this.h[3] = sum32(this.h[3], d);
|
100
|
+
this.h[4] = sum32(this.h[4], e);
|
101
|
+
this.h[5] = sum32(this.h[5], f);
|
102
|
+
this.h[6] = sum32(this.h[6], g);
|
103
|
+
this.h[7] = sum32(this.h[7], h);
|
104
|
+
};
|
105
|
+
|
106
|
+
SHA256.prototype._digest = function digest(enc) {
|
107
|
+
if (enc === 'hex')
|
108
|
+
return utils.toHex32(this.h, 'big');
|
109
|
+
else
|
110
|
+
return utils.split32(this.h, 'big');
|
111
|
+
};
|
112
|
+
|
113
|
+
export { _256 as _ };
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import '../utils.js';
|
2
|
+
import { _ as _512 } from './512.js';
|
3
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
|
4
|
+
|
5
|
+
var utils = utils$1;
|
6
|
+
|
7
|
+
var SHA512 = _512;
|
8
|
+
|
9
|
+
function SHA384() {
|
10
|
+
if (!(this instanceof SHA384))
|
11
|
+
return new SHA384();
|
12
|
+
|
13
|
+
SHA512.call(this);
|
14
|
+
this.h = [
|
15
|
+
0xcbbb9d5d, 0xc1059ed8,
|
16
|
+
0x629a292a, 0x367cd507,
|
17
|
+
0x9159015a, 0x3070dd17,
|
18
|
+
0x152fecd8, 0xf70e5939,
|
19
|
+
0x67332667, 0xffc00b31,
|
20
|
+
0x8eb44a87, 0x68581511,
|
21
|
+
0xdb0c2e0d, 0x64f98fa7,
|
22
|
+
0x47b5481d, 0xbefa4fa4 ];
|
23
|
+
}
|
24
|
+
utils.inherits(SHA384, SHA512);
|
25
|
+
var _384 = SHA384;
|
26
|
+
|
27
|
+
SHA384.blockSize = 1024;
|
28
|
+
SHA384.outSize = 384;
|
29
|
+
SHA384.hmacStrength = 192;
|
30
|
+
SHA384.padLength = 128;
|
31
|
+
|
32
|
+
SHA384.prototype._digest = function digest(enc) {
|
33
|
+
if (enc === 'hex')
|
34
|
+
return utils.toHex32(this.h.slice(0, 12), 'big');
|
35
|
+
else
|
36
|
+
return utils.split32(this.h.slice(0, 12), 'big');
|
37
|
+
};
|
38
|
+
|
39
|
+
export { _384 as _ };
|