@waku/rln 0.1.3-f6d5deb → 0.1.4-0e49a1e.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
package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation-generated.js
ADDED
@@ -0,0 +1,1253 @@
|
|
1
|
+
import { __exports as schemaValidationGenerated } from '../../../../../../_virtual/schema-validation-generated.js';
|
2
|
+
|
3
|
+
Object.defineProperty(schemaValidationGenerated, "__esModule", { value: true });
|
4
|
+
schemaValidationGenerated.Keystore = undefined;
|
5
|
+
schemaValidationGenerated.Keystore = validate19;
|
6
|
+
const pattern0 = new RegExp("^pbkdf2$", "u");
|
7
|
+
const pattern1 = new RegExp("^hmac-sha256$", "u");
|
8
|
+
const pattern2 = new RegExp("^$", "u");
|
9
|
+
const pattern3 = new RegExp("^scrypt$", "u");
|
10
|
+
const pattern4 = new RegExp("^([A-Fa-f0-9]{2}){32}$", "u");
|
11
|
+
function validate12(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; const _errs0 = errors; const _errs1 = errors; if (errors === _errs1) {
|
12
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
13
|
+
let missing0;
|
14
|
+
if ((((data.function === undefined) && (missing0 = "function")) || ((data.message === undefined) && (missing0 = "message"))) || ((data.params === undefined) && (missing0 = "params"))) {
|
15
|
+
validate12.errors = [{ instancePath, schemaPath: "#/definitions/Module/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
if (data.function !== undefined) {
|
20
|
+
const _errs3 = errors;
|
21
|
+
if (typeof data.function !== "string") {
|
22
|
+
validate12.errors = [{ instancePath: instancePath + "/function", schemaPath: "#/definitions/Module/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
var valid2 = _errs3 === errors;
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
var valid2 = true;
|
29
|
+
}
|
30
|
+
if (valid2) {
|
31
|
+
if (data.params !== undefined) {
|
32
|
+
let data1 = data.params;
|
33
|
+
const _errs5 = errors;
|
34
|
+
if (!(data1 && typeof data1 == "object" && !Array.isArray(data1))) {
|
35
|
+
validate12.errors = [{ instancePath: instancePath + "/params", schemaPath: "#/definitions/Module/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
36
|
+
return false;
|
37
|
+
}
|
38
|
+
var valid2 = _errs5 === errors;
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
var valid2 = true;
|
42
|
+
}
|
43
|
+
if (valid2) {
|
44
|
+
if (data.message !== undefined) {
|
45
|
+
const _errs7 = errors;
|
46
|
+
if (typeof data.message !== "string") {
|
47
|
+
validate12.errors = [{ instancePath: instancePath + "/message", schemaPath: "#/definitions/Module/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
var valid2 = _errs7 === errors;
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
var valid2 = true;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
validate12.errors = [{ instancePath, schemaPath: "#/definitions/Module/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
61
|
+
return false;
|
62
|
+
}
|
63
|
+
} var valid0 = _errs0 === errors; if (valid0) {
|
64
|
+
const _errs9 = errors;
|
65
|
+
const _errs10 = errors;
|
66
|
+
let valid3 = false;
|
67
|
+
let passing0 = null;
|
68
|
+
const _errs11 = errors;
|
69
|
+
const _errs12 = errors;
|
70
|
+
if (errors === _errs12) {
|
71
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
72
|
+
if (data.function !== undefined) {
|
73
|
+
let data3 = data.function;
|
74
|
+
const _errs14 = errors;
|
75
|
+
if (errors === _errs14) {
|
76
|
+
if (typeof data3 === "string") {
|
77
|
+
if (!pattern0.test(data3)) {
|
78
|
+
const err0 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/Pbkdf2Module/properties/function/pattern", keyword: "pattern", params: { pattern: "^pbkdf2$" }, message: "must match pattern \"" + "^pbkdf2$" + "\"" };
|
79
|
+
if (vErrors === null) {
|
80
|
+
vErrors = [err0];
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
vErrors.push(err0);
|
84
|
+
}
|
85
|
+
errors++;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
else {
|
89
|
+
const err1 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/Pbkdf2Module/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
90
|
+
if (vErrors === null) {
|
91
|
+
vErrors = [err1];
|
92
|
+
}
|
93
|
+
else {
|
94
|
+
vErrors.push(err1);
|
95
|
+
}
|
96
|
+
errors++;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
var valid5 = _errs14 === errors;
|
100
|
+
}
|
101
|
+
else {
|
102
|
+
var valid5 = true;
|
103
|
+
}
|
104
|
+
if (valid5) {
|
105
|
+
if (data.params !== undefined) {
|
106
|
+
let data4 = data.params;
|
107
|
+
const _errs16 = errors;
|
108
|
+
if (errors === _errs16) {
|
109
|
+
if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
|
110
|
+
let missing1;
|
111
|
+
if (((((data4.dklen === undefined) && (missing1 = "dklen")) || ((data4.c === undefined) && (missing1 = "c"))) || ((data4.prf === undefined) && (missing1 = "prf"))) || ((data4.salt === undefined) && (missing1 = "salt"))) {
|
112
|
+
const err2 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/Pbkdf2Module/properties/params/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
|
113
|
+
if (vErrors === null) {
|
114
|
+
vErrors = [err2];
|
115
|
+
}
|
116
|
+
else {
|
117
|
+
vErrors.push(err2);
|
118
|
+
}
|
119
|
+
errors++;
|
120
|
+
}
|
121
|
+
else {
|
122
|
+
if (data4.dklen !== undefined) {
|
123
|
+
let data5 = data4.dklen;
|
124
|
+
const _errs18 = errors;
|
125
|
+
if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) {
|
126
|
+
const err3 = { instancePath: instancePath + "/params/dklen", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/dklen/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
127
|
+
if (vErrors === null) {
|
128
|
+
vErrors = [err3];
|
129
|
+
}
|
130
|
+
else {
|
131
|
+
vErrors.push(err3);
|
132
|
+
}
|
133
|
+
errors++;
|
134
|
+
}
|
135
|
+
if (errors === _errs18) {
|
136
|
+
if ((typeof data5 == "number") && (isFinite(data5))) {
|
137
|
+
if (data5 < 0 || isNaN(data5)) {
|
138
|
+
const err4 = { instancePath: instancePath + "/params/dklen", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/dklen/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
|
139
|
+
if (vErrors === null) {
|
140
|
+
vErrors = [err4];
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
vErrors.push(err4);
|
144
|
+
}
|
145
|
+
errors++;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
var valid6 = _errs18 === errors;
|
150
|
+
}
|
151
|
+
else {
|
152
|
+
var valid6 = true;
|
153
|
+
}
|
154
|
+
if (valid6) {
|
155
|
+
if (data4.c !== undefined) {
|
156
|
+
let data6 = data4.c;
|
157
|
+
const _errs20 = errors;
|
158
|
+
if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
|
159
|
+
const err5 = { instancePath: instancePath + "/params/c", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/c/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
160
|
+
if (vErrors === null) {
|
161
|
+
vErrors = [err5];
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
vErrors.push(err5);
|
165
|
+
}
|
166
|
+
errors++;
|
167
|
+
}
|
168
|
+
if (errors === _errs20) {
|
169
|
+
if ((typeof data6 == "number") && (isFinite(data6))) {
|
170
|
+
if (data6 < 0 || isNaN(data6)) {
|
171
|
+
const err6 = { instancePath: instancePath + "/params/c", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/c/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
|
172
|
+
if (vErrors === null) {
|
173
|
+
vErrors = [err6];
|
174
|
+
}
|
175
|
+
else {
|
176
|
+
vErrors.push(err6);
|
177
|
+
}
|
178
|
+
errors++;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}
|
182
|
+
var valid6 = _errs20 === errors;
|
183
|
+
}
|
184
|
+
else {
|
185
|
+
var valid6 = true;
|
186
|
+
}
|
187
|
+
if (valid6) {
|
188
|
+
if (data4.prf !== undefined) {
|
189
|
+
let data7 = data4.prf;
|
190
|
+
const _errs22 = errors;
|
191
|
+
if (errors === _errs22) {
|
192
|
+
if (typeof data7 === "string") {
|
193
|
+
if (!pattern1.test(data7)) {
|
194
|
+
const err7 = { instancePath: instancePath + "/params/prf", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/prf/pattern", keyword: "pattern", params: { pattern: "^hmac-sha256$" }, message: "must match pattern \"" + "^hmac-sha256$" + "\"" };
|
195
|
+
if (vErrors === null) {
|
196
|
+
vErrors = [err7];
|
197
|
+
}
|
198
|
+
else {
|
199
|
+
vErrors.push(err7);
|
200
|
+
}
|
201
|
+
errors++;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
else {
|
205
|
+
const err8 = { instancePath: instancePath + "/params/prf", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/prf/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
206
|
+
if (vErrors === null) {
|
207
|
+
vErrors = [err8];
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
vErrors.push(err8);
|
211
|
+
}
|
212
|
+
errors++;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
var valid6 = _errs22 === errors;
|
216
|
+
}
|
217
|
+
else {
|
218
|
+
var valid6 = true;
|
219
|
+
}
|
220
|
+
if (valid6) {
|
221
|
+
if (data4.salt !== undefined) {
|
222
|
+
const _errs24 = errors;
|
223
|
+
if (typeof data4.salt !== "string") {
|
224
|
+
const err9 = { instancePath: instancePath + "/params/salt", schemaPath: "#/definitions/Pbkdf2Module/properties/params/properties/salt/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
225
|
+
if (vErrors === null) {
|
226
|
+
vErrors = [err9];
|
227
|
+
}
|
228
|
+
else {
|
229
|
+
vErrors.push(err9);
|
230
|
+
}
|
231
|
+
errors++;
|
232
|
+
}
|
233
|
+
var valid6 = _errs24 === errors;
|
234
|
+
}
|
235
|
+
else {
|
236
|
+
var valid6 = true;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
else {
|
244
|
+
const err10 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/Pbkdf2Module/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
245
|
+
if (vErrors === null) {
|
246
|
+
vErrors = [err10];
|
247
|
+
}
|
248
|
+
else {
|
249
|
+
vErrors.push(err10);
|
250
|
+
}
|
251
|
+
errors++;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
var valid5 = _errs16 === errors;
|
255
|
+
}
|
256
|
+
else {
|
257
|
+
var valid5 = true;
|
258
|
+
}
|
259
|
+
if (valid5) {
|
260
|
+
if (data.message !== undefined) {
|
261
|
+
let data9 = data.message;
|
262
|
+
const _errs26 = errors;
|
263
|
+
if (errors === _errs26) {
|
264
|
+
if (typeof data9 === "string") {
|
265
|
+
if (!pattern2.test(data9)) {
|
266
|
+
const err11 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/Pbkdf2Module/properties/message/pattern", keyword: "pattern", params: { pattern: "^$" }, message: "must match pattern \"" + "^$" + "\"" };
|
267
|
+
if (vErrors === null) {
|
268
|
+
vErrors = [err11];
|
269
|
+
}
|
270
|
+
else {
|
271
|
+
vErrors.push(err11);
|
272
|
+
}
|
273
|
+
errors++;
|
274
|
+
}
|
275
|
+
}
|
276
|
+
else {
|
277
|
+
const err12 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/Pbkdf2Module/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
278
|
+
if (vErrors === null) {
|
279
|
+
vErrors = [err12];
|
280
|
+
}
|
281
|
+
else {
|
282
|
+
vErrors.push(err12);
|
283
|
+
}
|
284
|
+
errors++;
|
285
|
+
}
|
286
|
+
}
|
287
|
+
var valid5 = _errs26 === errors;
|
288
|
+
}
|
289
|
+
else {
|
290
|
+
var valid5 = true;
|
291
|
+
}
|
292
|
+
}
|
293
|
+
}
|
294
|
+
}
|
295
|
+
else {
|
296
|
+
const err13 = { instancePath, schemaPath: "#/definitions/Pbkdf2Module/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
297
|
+
if (vErrors === null) {
|
298
|
+
vErrors = [err13];
|
299
|
+
}
|
300
|
+
else {
|
301
|
+
vErrors.push(err13);
|
302
|
+
}
|
303
|
+
errors++;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
var _valid0 = _errs11 === errors;
|
307
|
+
if (_valid0) {
|
308
|
+
valid3 = true;
|
309
|
+
passing0 = 0;
|
310
|
+
}
|
311
|
+
const _errs28 = errors;
|
312
|
+
const _errs29 = errors;
|
313
|
+
if (errors === _errs29) {
|
314
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
315
|
+
if (data.function !== undefined) {
|
316
|
+
let data10 = data.function;
|
317
|
+
const _errs31 = errors;
|
318
|
+
if (errors === _errs31) {
|
319
|
+
if (typeof data10 === "string") {
|
320
|
+
if (!pattern3.test(data10)) {
|
321
|
+
const err14 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/ScryptModule/properties/function/pattern", keyword: "pattern", params: { pattern: "^scrypt$" }, message: "must match pattern \"" + "^scrypt$" + "\"" };
|
322
|
+
if (vErrors === null) {
|
323
|
+
vErrors = [err14];
|
324
|
+
}
|
325
|
+
else {
|
326
|
+
vErrors.push(err14);
|
327
|
+
}
|
328
|
+
errors++;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
else {
|
332
|
+
const err15 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/ScryptModule/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
333
|
+
if (vErrors === null) {
|
334
|
+
vErrors = [err15];
|
335
|
+
}
|
336
|
+
else {
|
337
|
+
vErrors.push(err15);
|
338
|
+
}
|
339
|
+
errors++;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
var valid8 = _errs31 === errors;
|
343
|
+
}
|
344
|
+
else {
|
345
|
+
var valid8 = true;
|
346
|
+
}
|
347
|
+
if (valid8) {
|
348
|
+
if (data.params !== undefined) {
|
349
|
+
let data11 = data.params;
|
350
|
+
const _errs33 = errors;
|
351
|
+
if (errors === _errs33) {
|
352
|
+
if (data11 && typeof data11 == "object" && !Array.isArray(data11)) {
|
353
|
+
let missing2;
|
354
|
+
if ((((((data11.dklen === undefined) && (missing2 = "dklen")) || ((data11.n === undefined) && (missing2 = "n"))) || ((data11.p === undefined) && (missing2 = "p"))) || ((data11.r === undefined) && (missing2 = "r"))) || ((data11.salt === undefined) && (missing2 = "salt"))) {
|
355
|
+
const err16 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/ScryptModule/properties/params/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" };
|
356
|
+
if (vErrors === null) {
|
357
|
+
vErrors = [err16];
|
358
|
+
}
|
359
|
+
else {
|
360
|
+
vErrors.push(err16);
|
361
|
+
}
|
362
|
+
errors++;
|
363
|
+
}
|
364
|
+
else {
|
365
|
+
if (data11.dklen !== undefined) {
|
366
|
+
let data12 = data11.dklen;
|
367
|
+
const _errs35 = errors;
|
368
|
+
if (!(((typeof data12 == "number") && (!(data12 % 1) && !isNaN(data12))) && (isFinite(data12)))) {
|
369
|
+
const err17 = { instancePath: instancePath + "/params/dklen", schemaPath: "#/definitions/ScryptModule/properties/params/properties/dklen/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
370
|
+
if (vErrors === null) {
|
371
|
+
vErrors = [err17];
|
372
|
+
}
|
373
|
+
else {
|
374
|
+
vErrors.push(err17);
|
375
|
+
}
|
376
|
+
errors++;
|
377
|
+
}
|
378
|
+
if (errors === _errs35) {
|
379
|
+
if ((typeof data12 == "number") && (isFinite(data12))) {
|
380
|
+
if (data12 < 0 || isNaN(data12)) {
|
381
|
+
const err18 = { instancePath: instancePath + "/params/dklen", schemaPath: "#/definitions/ScryptModule/properties/params/properties/dklen/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
|
382
|
+
if (vErrors === null) {
|
383
|
+
vErrors = [err18];
|
384
|
+
}
|
385
|
+
else {
|
386
|
+
vErrors.push(err18);
|
387
|
+
}
|
388
|
+
errors++;
|
389
|
+
}
|
390
|
+
}
|
391
|
+
}
|
392
|
+
var valid9 = _errs35 === errors;
|
393
|
+
}
|
394
|
+
else {
|
395
|
+
var valid9 = true;
|
396
|
+
}
|
397
|
+
if (valid9) {
|
398
|
+
if (data11.n !== undefined) {
|
399
|
+
let data13 = data11.n;
|
400
|
+
const _errs37 = errors;
|
401
|
+
if (!(((typeof data13 == "number") && (!(data13 % 1) && !isNaN(data13))) && (isFinite(data13)))) {
|
402
|
+
const err19 = { instancePath: instancePath + "/params/n", schemaPath: "#/definitions/ScryptModule/properties/params/properties/n/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
403
|
+
if (vErrors === null) {
|
404
|
+
vErrors = [err19];
|
405
|
+
}
|
406
|
+
else {
|
407
|
+
vErrors.push(err19);
|
408
|
+
}
|
409
|
+
errors++;
|
410
|
+
}
|
411
|
+
if (errors === _errs37) {
|
412
|
+
if ((typeof data13 == "number") && (isFinite(data13))) {
|
413
|
+
if (data13 < 0 || isNaN(data13)) {
|
414
|
+
const err20 = { instancePath: instancePath + "/params/n", schemaPath: "#/definitions/ScryptModule/properties/params/properties/n/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
|
415
|
+
if (vErrors === null) {
|
416
|
+
vErrors = [err20];
|
417
|
+
}
|
418
|
+
else {
|
419
|
+
vErrors.push(err20);
|
420
|
+
}
|
421
|
+
errors++;
|
422
|
+
}
|
423
|
+
}
|
424
|
+
}
|
425
|
+
var valid9 = _errs37 === errors;
|
426
|
+
}
|
427
|
+
else {
|
428
|
+
var valid9 = true;
|
429
|
+
}
|
430
|
+
if (valid9) {
|
431
|
+
if (data11.p !== undefined) {
|
432
|
+
let data14 = data11.p;
|
433
|
+
const _errs39 = errors;
|
434
|
+
if (!(((typeof data14 == "number") && (!(data14 % 1) && !isNaN(data14))) && (isFinite(data14)))) {
|
435
|
+
const err21 = { instancePath: instancePath + "/params/p", schemaPath: "#/definitions/ScryptModule/properties/params/properties/p/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
436
|
+
if (vErrors === null) {
|
437
|
+
vErrors = [err21];
|
438
|
+
}
|
439
|
+
else {
|
440
|
+
vErrors.push(err21);
|
441
|
+
}
|
442
|
+
errors++;
|
443
|
+
}
|
444
|
+
if (errors === _errs39) {
|
445
|
+
if ((typeof data14 == "number") && (isFinite(data14))) {
|
446
|
+
if (data14 < 0 || isNaN(data14)) {
|
447
|
+
const err22 = { instancePath: instancePath + "/params/p", schemaPath: "#/definitions/ScryptModule/properties/params/properties/p/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
|
448
|
+
if (vErrors === null) {
|
449
|
+
vErrors = [err22];
|
450
|
+
}
|
451
|
+
else {
|
452
|
+
vErrors.push(err22);
|
453
|
+
}
|
454
|
+
errors++;
|
455
|
+
}
|
456
|
+
}
|
457
|
+
}
|
458
|
+
var valid9 = _errs39 === errors;
|
459
|
+
}
|
460
|
+
else {
|
461
|
+
var valid9 = true;
|
462
|
+
}
|
463
|
+
if (valid9) {
|
464
|
+
if (data11.r !== undefined) {
|
465
|
+
let data15 = data11.r;
|
466
|
+
const _errs41 = errors;
|
467
|
+
if (!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))) {
|
468
|
+
const err23 = { instancePath: instancePath + "/params/r", schemaPath: "#/definitions/ScryptModule/properties/params/properties/r/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
469
|
+
if (vErrors === null) {
|
470
|
+
vErrors = [err23];
|
471
|
+
}
|
472
|
+
else {
|
473
|
+
vErrors.push(err23);
|
474
|
+
}
|
475
|
+
errors++;
|
476
|
+
}
|
477
|
+
if (errors === _errs41) {
|
478
|
+
if ((typeof data15 == "number") && (isFinite(data15))) {
|
479
|
+
if (data15 < 0 || isNaN(data15)) {
|
480
|
+
const err24 = { instancePath: instancePath + "/params/r", schemaPath: "#/definitions/ScryptModule/properties/params/properties/r/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
|
481
|
+
if (vErrors === null) {
|
482
|
+
vErrors = [err24];
|
483
|
+
}
|
484
|
+
else {
|
485
|
+
vErrors.push(err24);
|
486
|
+
}
|
487
|
+
errors++;
|
488
|
+
}
|
489
|
+
}
|
490
|
+
}
|
491
|
+
var valid9 = _errs41 === errors;
|
492
|
+
}
|
493
|
+
else {
|
494
|
+
var valid9 = true;
|
495
|
+
}
|
496
|
+
if (valid9) {
|
497
|
+
if (data11.salt !== undefined) {
|
498
|
+
let data16 = data11.salt;
|
499
|
+
const _errs43 = errors;
|
500
|
+
if (errors === _errs43) {
|
501
|
+
if (typeof data16 === "string") {
|
502
|
+
if (!pattern4.test(data16)) {
|
503
|
+
const err25 = { instancePath: instancePath + "/params/salt", schemaPath: "#/definitions/ScryptModule/properties/params/properties/salt/pattern", keyword: "pattern", params: { pattern: "^([A-Fa-f0-9]{2}){32}$" }, message: "must match pattern \"" + "^([A-Fa-f0-9]{2}){32}$" + "\"" };
|
504
|
+
if (vErrors === null) {
|
505
|
+
vErrors = [err25];
|
506
|
+
}
|
507
|
+
else {
|
508
|
+
vErrors.push(err25);
|
509
|
+
}
|
510
|
+
errors++;
|
511
|
+
}
|
512
|
+
}
|
513
|
+
else {
|
514
|
+
const err26 = { instancePath: instancePath + "/params/salt", schemaPath: "#/definitions/ScryptModule/properties/params/properties/salt/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
515
|
+
if (vErrors === null) {
|
516
|
+
vErrors = [err26];
|
517
|
+
}
|
518
|
+
else {
|
519
|
+
vErrors.push(err26);
|
520
|
+
}
|
521
|
+
errors++;
|
522
|
+
}
|
523
|
+
}
|
524
|
+
var valid9 = _errs43 === errors;
|
525
|
+
}
|
526
|
+
else {
|
527
|
+
var valid9 = true;
|
528
|
+
}
|
529
|
+
}
|
530
|
+
}
|
531
|
+
}
|
532
|
+
}
|
533
|
+
}
|
534
|
+
}
|
535
|
+
else {
|
536
|
+
const err27 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/ScryptModule/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
537
|
+
if (vErrors === null) {
|
538
|
+
vErrors = [err27];
|
539
|
+
}
|
540
|
+
else {
|
541
|
+
vErrors.push(err27);
|
542
|
+
}
|
543
|
+
errors++;
|
544
|
+
}
|
545
|
+
}
|
546
|
+
var valid8 = _errs33 === errors;
|
547
|
+
}
|
548
|
+
else {
|
549
|
+
var valid8 = true;
|
550
|
+
}
|
551
|
+
if (valid8) {
|
552
|
+
if (data.message !== undefined) {
|
553
|
+
let data17 = data.message;
|
554
|
+
const _errs45 = errors;
|
555
|
+
if (errors === _errs45) {
|
556
|
+
if (typeof data17 === "string") {
|
557
|
+
if (!pattern2.test(data17)) {
|
558
|
+
const err28 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/ScryptModule/properties/message/pattern", keyword: "pattern", params: { pattern: "^$" }, message: "must match pattern \"" + "^$" + "\"" };
|
559
|
+
if (vErrors === null) {
|
560
|
+
vErrors = [err28];
|
561
|
+
}
|
562
|
+
else {
|
563
|
+
vErrors.push(err28);
|
564
|
+
}
|
565
|
+
errors++;
|
566
|
+
}
|
567
|
+
}
|
568
|
+
else {
|
569
|
+
const err29 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/ScryptModule/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
570
|
+
if (vErrors === null) {
|
571
|
+
vErrors = [err29];
|
572
|
+
}
|
573
|
+
else {
|
574
|
+
vErrors.push(err29);
|
575
|
+
}
|
576
|
+
errors++;
|
577
|
+
}
|
578
|
+
}
|
579
|
+
var valid8 = _errs45 === errors;
|
580
|
+
}
|
581
|
+
else {
|
582
|
+
var valid8 = true;
|
583
|
+
}
|
584
|
+
}
|
585
|
+
}
|
586
|
+
}
|
587
|
+
else {
|
588
|
+
const err30 = { instancePath, schemaPath: "#/definitions/ScryptModule/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
589
|
+
if (vErrors === null) {
|
590
|
+
vErrors = [err30];
|
591
|
+
}
|
592
|
+
else {
|
593
|
+
vErrors.push(err30);
|
594
|
+
}
|
595
|
+
errors++;
|
596
|
+
}
|
597
|
+
}
|
598
|
+
var _valid0 = _errs28 === errors;
|
599
|
+
if (_valid0 && valid3) {
|
600
|
+
valid3 = false;
|
601
|
+
passing0 = [passing0, 1];
|
602
|
+
}
|
603
|
+
else {
|
604
|
+
if (_valid0) {
|
605
|
+
valid3 = true;
|
606
|
+
passing0 = 1;
|
607
|
+
}
|
608
|
+
}
|
609
|
+
if (!valid3) {
|
610
|
+
const err31 = { instancePath, schemaPath: "#/allOf/1/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
|
611
|
+
if (vErrors === null) {
|
612
|
+
vErrors = [err31];
|
613
|
+
}
|
614
|
+
else {
|
615
|
+
vErrors.push(err31);
|
616
|
+
}
|
617
|
+
errors++;
|
618
|
+
validate12.errors = vErrors;
|
619
|
+
return false;
|
620
|
+
}
|
621
|
+
else {
|
622
|
+
errors = _errs10;
|
623
|
+
if (vErrors !== null) {
|
624
|
+
if (_errs10) {
|
625
|
+
vErrors.length = _errs10;
|
626
|
+
}
|
627
|
+
else {
|
628
|
+
vErrors = null;
|
629
|
+
}
|
630
|
+
}
|
631
|
+
}
|
632
|
+
var valid0 = _errs9 === errors;
|
633
|
+
} validate12.errors = vErrors; return errors === 0; }
|
634
|
+
const pattern6 = new RegExp("^sha256$", "u");
|
635
|
+
function validate14(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; const _errs0 = errors; const _errs1 = errors; if (errors === _errs1) {
|
636
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
637
|
+
let missing0;
|
638
|
+
if ((((data.function === undefined) && (missing0 = "function")) || ((data.message === undefined) && (missing0 = "message"))) || ((data.params === undefined) && (missing0 = "params"))) {
|
639
|
+
validate14.errors = [{ instancePath, schemaPath: "#/definitions/Module/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
640
|
+
return false;
|
641
|
+
}
|
642
|
+
else {
|
643
|
+
if (data.function !== undefined) {
|
644
|
+
const _errs3 = errors;
|
645
|
+
if (typeof data.function !== "string") {
|
646
|
+
validate14.errors = [{ instancePath: instancePath + "/function", schemaPath: "#/definitions/Module/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
647
|
+
return false;
|
648
|
+
}
|
649
|
+
var valid2 = _errs3 === errors;
|
650
|
+
}
|
651
|
+
else {
|
652
|
+
var valid2 = true;
|
653
|
+
}
|
654
|
+
if (valid2) {
|
655
|
+
if (data.params !== undefined) {
|
656
|
+
let data1 = data.params;
|
657
|
+
const _errs5 = errors;
|
658
|
+
if (!(data1 && typeof data1 == "object" && !Array.isArray(data1))) {
|
659
|
+
validate14.errors = [{ instancePath: instancePath + "/params", schemaPath: "#/definitions/Module/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
660
|
+
return false;
|
661
|
+
}
|
662
|
+
var valid2 = _errs5 === errors;
|
663
|
+
}
|
664
|
+
else {
|
665
|
+
var valid2 = true;
|
666
|
+
}
|
667
|
+
if (valid2) {
|
668
|
+
if (data.message !== undefined) {
|
669
|
+
const _errs7 = errors;
|
670
|
+
if (typeof data.message !== "string") {
|
671
|
+
validate14.errors = [{ instancePath: instancePath + "/message", schemaPath: "#/definitions/Module/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
672
|
+
return false;
|
673
|
+
}
|
674
|
+
var valid2 = _errs7 === errors;
|
675
|
+
}
|
676
|
+
else {
|
677
|
+
var valid2 = true;
|
678
|
+
}
|
679
|
+
}
|
680
|
+
}
|
681
|
+
}
|
682
|
+
}
|
683
|
+
else {
|
684
|
+
validate14.errors = [{ instancePath, schemaPath: "#/definitions/Module/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
685
|
+
return false;
|
686
|
+
}
|
687
|
+
} var valid0 = _errs0 === errors; if (valid0) {
|
688
|
+
const _errs9 = errors;
|
689
|
+
const _errs10 = errors;
|
690
|
+
let valid3 = false;
|
691
|
+
let passing0 = null;
|
692
|
+
const _errs11 = errors;
|
693
|
+
const _errs12 = errors;
|
694
|
+
if (errors === _errs12) {
|
695
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
696
|
+
if (data.function !== undefined) {
|
697
|
+
let data3 = data.function;
|
698
|
+
const _errs14 = errors;
|
699
|
+
if (errors === _errs14) {
|
700
|
+
if (typeof data3 === "string") {
|
701
|
+
if (!pattern6.test(data3)) {
|
702
|
+
const err0 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/Sha2Module/properties/function/pattern", keyword: "pattern", params: { pattern: "^sha256$" }, message: "must match pattern \"" + "^sha256$" + "\"" };
|
703
|
+
if (vErrors === null) {
|
704
|
+
vErrors = [err0];
|
705
|
+
}
|
706
|
+
else {
|
707
|
+
vErrors.push(err0);
|
708
|
+
}
|
709
|
+
errors++;
|
710
|
+
}
|
711
|
+
}
|
712
|
+
else {
|
713
|
+
const err1 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/Sha2Module/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
714
|
+
if (vErrors === null) {
|
715
|
+
vErrors = [err1];
|
716
|
+
}
|
717
|
+
else {
|
718
|
+
vErrors.push(err1);
|
719
|
+
}
|
720
|
+
errors++;
|
721
|
+
}
|
722
|
+
}
|
723
|
+
var valid5 = _errs14 === errors;
|
724
|
+
}
|
725
|
+
else {
|
726
|
+
var valid5 = true;
|
727
|
+
}
|
728
|
+
if (valid5) {
|
729
|
+
if (data.params !== undefined) {
|
730
|
+
let data4 = data.params;
|
731
|
+
const _errs16 = errors;
|
732
|
+
if (errors === _errs16) {
|
733
|
+
if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
|
734
|
+
for (const key0 in data4) {
|
735
|
+
const err2 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/Sha2Module/properties/params/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
736
|
+
if (vErrors === null) {
|
737
|
+
vErrors = [err2];
|
738
|
+
}
|
739
|
+
else {
|
740
|
+
vErrors.push(err2);
|
741
|
+
}
|
742
|
+
errors++;
|
743
|
+
break;
|
744
|
+
}
|
745
|
+
}
|
746
|
+
else {
|
747
|
+
const err3 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/Sha2Module/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
748
|
+
if (vErrors === null) {
|
749
|
+
vErrors = [err3];
|
750
|
+
}
|
751
|
+
else {
|
752
|
+
vErrors.push(err3);
|
753
|
+
}
|
754
|
+
errors++;
|
755
|
+
}
|
756
|
+
}
|
757
|
+
var valid5 = _errs16 === errors;
|
758
|
+
}
|
759
|
+
else {
|
760
|
+
var valid5 = true;
|
761
|
+
}
|
762
|
+
if (valid5) {
|
763
|
+
if (data.message !== undefined) {
|
764
|
+
let data5 = data.message;
|
765
|
+
const _errs19 = errors;
|
766
|
+
if (errors === _errs19) {
|
767
|
+
if (typeof data5 === "string") {
|
768
|
+
if (!pattern4.test(data5)) {
|
769
|
+
const err4 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/Sha2Module/properties/message/pattern", keyword: "pattern", params: { pattern: "^([A-Fa-f0-9]{2}){32}$" }, message: "must match pattern \"" + "^([A-Fa-f0-9]{2}){32}$" + "\"" };
|
770
|
+
if (vErrors === null) {
|
771
|
+
vErrors = [err4];
|
772
|
+
}
|
773
|
+
else {
|
774
|
+
vErrors.push(err4);
|
775
|
+
}
|
776
|
+
errors++;
|
777
|
+
}
|
778
|
+
}
|
779
|
+
else {
|
780
|
+
const err5 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/Sha2Module/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
781
|
+
if (vErrors === null) {
|
782
|
+
vErrors = [err5];
|
783
|
+
}
|
784
|
+
else {
|
785
|
+
vErrors.push(err5);
|
786
|
+
}
|
787
|
+
errors++;
|
788
|
+
}
|
789
|
+
}
|
790
|
+
var valid5 = _errs19 === errors;
|
791
|
+
}
|
792
|
+
else {
|
793
|
+
var valid5 = true;
|
794
|
+
}
|
795
|
+
}
|
796
|
+
}
|
797
|
+
}
|
798
|
+
else {
|
799
|
+
const err6 = { instancePath, schemaPath: "#/definitions/Sha2Module/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
800
|
+
if (vErrors === null) {
|
801
|
+
vErrors = [err6];
|
802
|
+
}
|
803
|
+
else {
|
804
|
+
vErrors.push(err6);
|
805
|
+
}
|
806
|
+
errors++;
|
807
|
+
}
|
808
|
+
}
|
809
|
+
var _valid0 = _errs11 === errors;
|
810
|
+
if (_valid0) {
|
811
|
+
valid3 = true;
|
812
|
+
passing0 = 0;
|
813
|
+
}
|
814
|
+
if (!valid3) {
|
815
|
+
const err7 = { instancePath, schemaPath: "#/allOf/1/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
|
816
|
+
if (vErrors === null) {
|
817
|
+
vErrors = [err7];
|
818
|
+
}
|
819
|
+
else {
|
820
|
+
vErrors.push(err7);
|
821
|
+
}
|
822
|
+
errors++;
|
823
|
+
validate14.errors = vErrors;
|
824
|
+
return false;
|
825
|
+
}
|
826
|
+
else {
|
827
|
+
errors = _errs10;
|
828
|
+
if (vErrors !== null) {
|
829
|
+
if (_errs10) {
|
830
|
+
vErrors.length = _errs10;
|
831
|
+
}
|
832
|
+
else {
|
833
|
+
vErrors = null;
|
834
|
+
}
|
835
|
+
}
|
836
|
+
}
|
837
|
+
var valid0 = _errs9 === errors;
|
838
|
+
} validate14.errors = vErrors; return errors === 0; }
|
839
|
+
const pattern8 = new RegExp("^aes-128-ctr$", "u");
|
840
|
+
const pattern9 = new RegExp("^([A-Fa-f0-9]{2}){16}$", "u");
|
841
|
+
function validate16(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; const _errs0 = errors; const _errs1 = errors; if (errors === _errs1) {
|
842
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
843
|
+
let missing0;
|
844
|
+
if ((((data.function === undefined) && (missing0 = "function")) || ((data.message === undefined) && (missing0 = "message"))) || ((data.params === undefined) && (missing0 = "params"))) {
|
845
|
+
validate16.errors = [{ instancePath, schemaPath: "#/definitions/Module/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
846
|
+
return false;
|
847
|
+
}
|
848
|
+
else {
|
849
|
+
if (data.function !== undefined) {
|
850
|
+
const _errs3 = errors;
|
851
|
+
if (typeof data.function !== "string") {
|
852
|
+
validate16.errors = [{ instancePath: instancePath + "/function", schemaPath: "#/definitions/Module/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
853
|
+
return false;
|
854
|
+
}
|
855
|
+
var valid2 = _errs3 === errors;
|
856
|
+
}
|
857
|
+
else {
|
858
|
+
var valid2 = true;
|
859
|
+
}
|
860
|
+
if (valid2) {
|
861
|
+
if (data.params !== undefined) {
|
862
|
+
let data1 = data.params;
|
863
|
+
const _errs5 = errors;
|
864
|
+
if (!(data1 && typeof data1 == "object" && !Array.isArray(data1))) {
|
865
|
+
validate16.errors = [{ instancePath: instancePath + "/params", schemaPath: "#/definitions/Module/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
866
|
+
return false;
|
867
|
+
}
|
868
|
+
var valid2 = _errs5 === errors;
|
869
|
+
}
|
870
|
+
else {
|
871
|
+
var valid2 = true;
|
872
|
+
}
|
873
|
+
if (valid2) {
|
874
|
+
if (data.message !== undefined) {
|
875
|
+
const _errs7 = errors;
|
876
|
+
if (typeof data.message !== "string") {
|
877
|
+
validate16.errors = [{ instancePath: instancePath + "/message", schemaPath: "#/definitions/Module/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
878
|
+
return false;
|
879
|
+
}
|
880
|
+
var valid2 = _errs7 === errors;
|
881
|
+
}
|
882
|
+
else {
|
883
|
+
var valid2 = true;
|
884
|
+
}
|
885
|
+
}
|
886
|
+
}
|
887
|
+
}
|
888
|
+
}
|
889
|
+
else {
|
890
|
+
validate16.errors = [{ instancePath, schemaPath: "#/definitions/Module/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
891
|
+
return false;
|
892
|
+
}
|
893
|
+
} var valid0 = _errs0 === errors; if (valid0) {
|
894
|
+
const _errs9 = errors;
|
895
|
+
const _errs10 = errors;
|
896
|
+
let valid3 = false;
|
897
|
+
let passing0 = null;
|
898
|
+
const _errs11 = errors;
|
899
|
+
const _errs12 = errors;
|
900
|
+
if (errors === _errs12) {
|
901
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
902
|
+
if (data.function !== undefined) {
|
903
|
+
let data3 = data.function;
|
904
|
+
const _errs14 = errors;
|
905
|
+
if (errors === _errs14) {
|
906
|
+
if (typeof data3 === "string") {
|
907
|
+
if (!pattern8.test(data3)) {
|
908
|
+
const err0 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/Aes128CtrModule/properties/function/pattern", keyword: "pattern", params: { pattern: "^aes-128-ctr$" }, message: "must match pattern \"" + "^aes-128-ctr$" + "\"" };
|
909
|
+
if (vErrors === null) {
|
910
|
+
vErrors = [err0];
|
911
|
+
}
|
912
|
+
else {
|
913
|
+
vErrors.push(err0);
|
914
|
+
}
|
915
|
+
errors++;
|
916
|
+
}
|
917
|
+
}
|
918
|
+
else {
|
919
|
+
const err1 = { instancePath: instancePath + "/function", schemaPath: "#/definitions/Aes128CtrModule/properties/function/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
920
|
+
if (vErrors === null) {
|
921
|
+
vErrors = [err1];
|
922
|
+
}
|
923
|
+
else {
|
924
|
+
vErrors.push(err1);
|
925
|
+
}
|
926
|
+
errors++;
|
927
|
+
}
|
928
|
+
}
|
929
|
+
var valid5 = _errs14 === errors;
|
930
|
+
}
|
931
|
+
else {
|
932
|
+
var valid5 = true;
|
933
|
+
}
|
934
|
+
if (valid5) {
|
935
|
+
if (data.params !== undefined) {
|
936
|
+
let data4 = data.params;
|
937
|
+
const _errs16 = errors;
|
938
|
+
if (errors === _errs16) {
|
939
|
+
if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
|
940
|
+
let missing1;
|
941
|
+
if ((data4.iv === undefined) && (missing1 = "iv")) {
|
942
|
+
const err2 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/Aes128CtrModule/properties/params/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
|
943
|
+
if (vErrors === null) {
|
944
|
+
vErrors = [err2];
|
945
|
+
}
|
946
|
+
else {
|
947
|
+
vErrors.push(err2);
|
948
|
+
}
|
949
|
+
errors++;
|
950
|
+
}
|
951
|
+
else {
|
952
|
+
if (data4.iv !== undefined) {
|
953
|
+
let data5 = data4.iv;
|
954
|
+
const _errs18 = errors;
|
955
|
+
if (errors === _errs18) {
|
956
|
+
if (typeof data5 === "string") {
|
957
|
+
if (!pattern9.test(data5)) {
|
958
|
+
const err3 = { instancePath: instancePath + "/params/iv", schemaPath: "#/definitions/Aes128CtrModule/properties/params/properties/iv/pattern", keyword: "pattern", params: { pattern: "^([A-Fa-f0-9]{2}){16}$" }, message: "must match pattern \"" + "^([A-Fa-f0-9]{2}){16}$" + "\"" };
|
959
|
+
if (vErrors === null) {
|
960
|
+
vErrors = [err3];
|
961
|
+
}
|
962
|
+
else {
|
963
|
+
vErrors.push(err3);
|
964
|
+
}
|
965
|
+
errors++;
|
966
|
+
}
|
967
|
+
}
|
968
|
+
else {
|
969
|
+
const err4 = { instancePath: instancePath + "/params/iv", schemaPath: "#/definitions/Aes128CtrModule/properties/params/properties/iv/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
970
|
+
if (vErrors === null) {
|
971
|
+
vErrors = [err4];
|
972
|
+
}
|
973
|
+
else {
|
974
|
+
vErrors.push(err4);
|
975
|
+
}
|
976
|
+
errors++;
|
977
|
+
}
|
978
|
+
}
|
979
|
+
}
|
980
|
+
}
|
981
|
+
}
|
982
|
+
else {
|
983
|
+
const err5 = { instancePath: instancePath + "/params", schemaPath: "#/definitions/Aes128CtrModule/properties/params/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
984
|
+
if (vErrors === null) {
|
985
|
+
vErrors = [err5];
|
986
|
+
}
|
987
|
+
else {
|
988
|
+
vErrors.push(err5);
|
989
|
+
}
|
990
|
+
errors++;
|
991
|
+
}
|
992
|
+
}
|
993
|
+
var valid5 = _errs16 === errors;
|
994
|
+
}
|
995
|
+
else {
|
996
|
+
var valid5 = true;
|
997
|
+
}
|
998
|
+
if (valid5) {
|
999
|
+
if (data.message !== undefined) {
|
1000
|
+
let data6 = data.message;
|
1001
|
+
const _errs20 = errors;
|
1002
|
+
if (errors === _errs20) {
|
1003
|
+
if (typeof data6 === "string") {
|
1004
|
+
if (!pattern4.test(data6)) {
|
1005
|
+
const err6 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/Aes128CtrModule/properties/message/pattern", keyword: "pattern", params: { pattern: "^([A-Fa-f0-9]{2}){32}$" }, message: "must match pattern \"" + "^([A-Fa-f0-9]{2}){32}$" + "\"" };
|
1006
|
+
if (vErrors === null) {
|
1007
|
+
vErrors = [err6];
|
1008
|
+
}
|
1009
|
+
else {
|
1010
|
+
vErrors.push(err6);
|
1011
|
+
}
|
1012
|
+
errors++;
|
1013
|
+
}
|
1014
|
+
}
|
1015
|
+
else {
|
1016
|
+
const err7 = { instancePath: instancePath + "/message", schemaPath: "#/definitions/Aes128CtrModule/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
1017
|
+
if (vErrors === null) {
|
1018
|
+
vErrors = [err7];
|
1019
|
+
}
|
1020
|
+
else {
|
1021
|
+
vErrors.push(err7);
|
1022
|
+
}
|
1023
|
+
errors++;
|
1024
|
+
}
|
1025
|
+
}
|
1026
|
+
var valid5 = _errs20 === errors;
|
1027
|
+
}
|
1028
|
+
else {
|
1029
|
+
var valid5 = true;
|
1030
|
+
}
|
1031
|
+
}
|
1032
|
+
}
|
1033
|
+
}
|
1034
|
+
else {
|
1035
|
+
const err8 = { instancePath, schemaPath: "#/definitions/Aes128CtrModule/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
1036
|
+
if (vErrors === null) {
|
1037
|
+
vErrors = [err8];
|
1038
|
+
}
|
1039
|
+
else {
|
1040
|
+
vErrors.push(err8);
|
1041
|
+
}
|
1042
|
+
errors++;
|
1043
|
+
}
|
1044
|
+
}
|
1045
|
+
var _valid0 = _errs11 === errors;
|
1046
|
+
if (_valid0) {
|
1047
|
+
valid3 = true;
|
1048
|
+
passing0 = 0;
|
1049
|
+
}
|
1050
|
+
if (!valid3) {
|
1051
|
+
const err9 = { instancePath, schemaPath: "#/allOf/1/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
|
1052
|
+
if (vErrors === null) {
|
1053
|
+
vErrors = [err9];
|
1054
|
+
}
|
1055
|
+
else {
|
1056
|
+
vErrors.push(err9);
|
1057
|
+
}
|
1058
|
+
errors++;
|
1059
|
+
validate16.errors = vErrors;
|
1060
|
+
return false;
|
1061
|
+
}
|
1062
|
+
else {
|
1063
|
+
errors = _errs10;
|
1064
|
+
if (vErrors !== null) {
|
1065
|
+
if (_errs10) {
|
1066
|
+
vErrors.length = _errs10;
|
1067
|
+
}
|
1068
|
+
else {
|
1069
|
+
vErrors = null;
|
1070
|
+
}
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
var valid0 = _errs9 === errors;
|
1074
|
+
} validate16.errors = vErrors; return errors === 0; }
|
1075
|
+
const pattern11 = new RegExp("^([A-Fa-f0-9]{2}){48}$", "u");
|
1076
|
+
const formats0 = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
1077
|
+
function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (errors === 0) {
|
1078
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
1079
|
+
let missing0;
|
1080
|
+
if (((((data.crypto === undefined) && (missing0 = "crypto")) || ((data.path === undefined) && (missing0 = "path"))) || ((data.uuid === undefined) && (missing0 = "uuid"))) || ((data.version === undefined) && (missing0 = "version"))) {
|
1081
|
+
validate19.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
1082
|
+
return false;
|
1083
|
+
}
|
1084
|
+
else {
|
1085
|
+
if (data.crypto !== undefined) {
|
1086
|
+
let data0 = data.crypto;
|
1087
|
+
const _errs1 = errors;
|
1088
|
+
if (errors === _errs1) {
|
1089
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
1090
|
+
let missing1;
|
1091
|
+
if ((((data0.kdf === undefined) && (missing1 = "kdf")) || ((data0.checksum === undefined) && (missing1 = "checksum"))) || ((data0.cipher === undefined) && (missing1 = "cipher"))) {
|
1092
|
+
validate19.errors = [{ instancePath: instancePath + "/crypto", schemaPath: "#/properties/crypto/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
|
1093
|
+
return false;
|
1094
|
+
}
|
1095
|
+
else {
|
1096
|
+
if (data0.kdf !== undefined) {
|
1097
|
+
const _errs3 = errors;
|
1098
|
+
if (!(validate12(data0.kdf, { instancePath: instancePath + "/crypto/kdf", parentData: data0, parentDataProperty: "kdf", rootData }))) {
|
1099
|
+
vErrors = vErrors === null ? validate12.errors : vErrors.concat(validate12.errors);
|
1100
|
+
errors = vErrors.length;
|
1101
|
+
}
|
1102
|
+
var valid1 = _errs3 === errors;
|
1103
|
+
}
|
1104
|
+
else {
|
1105
|
+
var valid1 = true;
|
1106
|
+
}
|
1107
|
+
if (valid1) {
|
1108
|
+
if (data0.checksum !== undefined) {
|
1109
|
+
const _errs4 = errors;
|
1110
|
+
if (!(validate14(data0.checksum, { instancePath: instancePath + "/crypto/checksum", parentData: data0, parentDataProperty: "checksum", rootData }))) {
|
1111
|
+
vErrors = vErrors === null ? validate14.errors : vErrors.concat(validate14.errors);
|
1112
|
+
errors = vErrors.length;
|
1113
|
+
}
|
1114
|
+
var valid1 = _errs4 === errors;
|
1115
|
+
}
|
1116
|
+
else {
|
1117
|
+
var valid1 = true;
|
1118
|
+
}
|
1119
|
+
if (valid1) {
|
1120
|
+
if (data0.cipher !== undefined) {
|
1121
|
+
const _errs5 = errors;
|
1122
|
+
if (!(validate16(data0.cipher, { instancePath: instancePath + "/crypto/cipher", parentData: data0, parentDataProperty: "cipher", rootData }))) {
|
1123
|
+
vErrors = vErrors === null ? validate16.errors : vErrors.concat(validate16.errors);
|
1124
|
+
errors = vErrors.length;
|
1125
|
+
}
|
1126
|
+
var valid1 = _errs5 === errors;
|
1127
|
+
}
|
1128
|
+
else {
|
1129
|
+
var valid1 = true;
|
1130
|
+
}
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
else {
|
1136
|
+
validate19.errors = [{ instancePath: instancePath + "/crypto", schemaPath: "#/properties/crypto/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
1137
|
+
return false;
|
1138
|
+
}
|
1139
|
+
}
|
1140
|
+
var valid0 = _errs1 === errors;
|
1141
|
+
}
|
1142
|
+
else {
|
1143
|
+
var valid0 = true;
|
1144
|
+
}
|
1145
|
+
if (valid0) {
|
1146
|
+
if (data.pubkey !== undefined) {
|
1147
|
+
let data4 = data.pubkey;
|
1148
|
+
const _errs6 = errors;
|
1149
|
+
if (errors === _errs6) {
|
1150
|
+
if (typeof data4 === "string") {
|
1151
|
+
if (!pattern11.test(data4)) {
|
1152
|
+
validate19.errors = [{ instancePath: instancePath + "/pubkey", schemaPath: "#/properties/pubkey/pattern", keyword: "pattern", params: { pattern: "^([A-Fa-f0-9]{2}){48}$" }, message: "must match pattern \"" + "^([A-Fa-f0-9]{2}){48}$" + "\"" }];
|
1153
|
+
return false;
|
1154
|
+
}
|
1155
|
+
}
|
1156
|
+
else {
|
1157
|
+
validate19.errors = [{ instancePath: instancePath + "/pubkey", schemaPath: "#/properties/pubkey/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
1158
|
+
return false;
|
1159
|
+
}
|
1160
|
+
}
|
1161
|
+
var valid0 = _errs6 === errors;
|
1162
|
+
}
|
1163
|
+
else {
|
1164
|
+
var valid0 = true;
|
1165
|
+
}
|
1166
|
+
if (valid0) {
|
1167
|
+
if (data.path !== undefined) {
|
1168
|
+
const _errs8 = errors;
|
1169
|
+
if (typeof data.path !== "string") {
|
1170
|
+
validate19.errors = [{ instancePath: instancePath + "/path", schemaPath: "#/properties/path/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
1171
|
+
return false;
|
1172
|
+
}
|
1173
|
+
var valid0 = _errs8 === errors;
|
1174
|
+
}
|
1175
|
+
else {
|
1176
|
+
var valid0 = true;
|
1177
|
+
}
|
1178
|
+
if (valid0) {
|
1179
|
+
if (data.description !== undefined) {
|
1180
|
+
const _errs10 = errors;
|
1181
|
+
if (typeof data.description !== "string") {
|
1182
|
+
validate19.errors = [{ instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
1183
|
+
return false;
|
1184
|
+
}
|
1185
|
+
var valid0 = _errs10 === errors;
|
1186
|
+
}
|
1187
|
+
else {
|
1188
|
+
var valid0 = true;
|
1189
|
+
}
|
1190
|
+
if (valid0) {
|
1191
|
+
if (data.uuid !== undefined) {
|
1192
|
+
let data7 = data.uuid;
|
1193
|
+
const _errs12 = errors;
|
1194
|
+
if (errors === _errs12) {
|
1195
|
+
if (errors === _errs12) {
|
1196
|
+
if (typeof data7 === "string") {
|
1197
|
+
if (!(formats0.test(data7))) {
|
1198
|
+
validate19.errors = [{ instancePath: instancePath + "/uuid", schemaPath: "#/properties/uuid/format", keyword: "format", params: { format: "uuid" }, message: "must match format \"" + "uuid" + "\"" }];
|
1199
|
+
return false;
|
1200
|
+
}
|
1201
|
+
}
|
1202
|
+
else {
|
1203
|
+
validate19.errors = [{ instancePath: instancePath + "/uuid", schemaPath: "#/properties/uuid/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
1204
|
+
return false;
|
1205
|
+
}
|
1206
|
+
}
|
1207
|
+
}
|
1208
|
+
var valid0 = _errs12 === errors;
|
1209
|
+
}
|
1210
|
+
else {
|
1211
|
+
var valid0 = true;
|
1212
|
+
}
|
1213
|
+
if (valid0) {
|
1214
|
+
if (data.version !== undefined) {
|
1215
|
+
let data8 = data.version;
|
1216
|
+
const _errs14 = errors;
|
1217
|
+
if (!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))) {
|
1218
|
+
validate19.errors = [{ instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
1219
|
+
return false;
|
1220
|
+
}
|
1221
|
+
if (errors === _errs14) {
|
1222
|
+
if ((typeof data8 == "number") && (isFinite(data8))) {
|
1223
|
+
if (data8 > 4 || isNaN(data8)) {
|
1224
|
+
validate19.errors = [{ instancePath: instancePath + "/version", schemaPath: "#/properties/version/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4 }, message: "must be <= 4" }];
|
1225
|
+
return false;
|
1226
|
+
}
|
1227
|
+
else {
|
1228
|
+
if (data8 < 4 || isNaN(data8)) {
|
1229
|
+
validate19.errors = [{ instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 4 }, message: "must be >= 4" }];
|
1230
|
+
return false;
|
1231
|
+
}
|
1232
|
+
}
|
1233
|
+
}
|
1234
|
+
}
|
1235
|
+
var valid0 = _errs14 === errors;
|
1236
|
+
}
|
1237
|
+
else {
|
1238
|
+
var valid0 = true;
|
1239
|
+
}
|
1240
|
+
}
|
1241
|
+
}
|
1242
|
+
}
|
1243
|
+
}
|
1244
|
+
}
|
1245
|
+
}
|
1246
|
+
}
|
1247
|
+
else {
|
1248
|
+
validate19.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
1249
|
+
return false;
|
1250
|
+
}
|
1251
|
+
} validate19.errors = vErrors; return errors === 0; }
|
1252
|
+
|
1253
|
+
export { schemaValidationGenerated as default };
|