@waku/rln 0.1.4 → 0.1.5-164df63.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 +5 -0
- package/bundle/_virtual/index2.js +1 -1
- package/bundle/index.js +4 -1
- package/bundle/packages/rln/dist/contract/abi.js +502 -248
- package/bundle/packages/rln/dist/contract/constants.js +5 -4
- package/bundle/packages/rln/dist/contract/rln_base_contract.js +483 -0
- package/bundle/packages/rln/dist/contract/rln_contract.js +32 -358
- package/bundle/packages/rln/dist/contract/types.js +9 -0
- package/bundle/packages/rln/dist/create.js +1 -1
- package/bundle/packages/rln/dist/credentials_manager.js +215 -0
- package/bundle/packages/rln/dist/keystore/cipher.js +3 -3
- package/bundle/packages/rln/dist/keystore/keystore.js +12 -7
- package/bundle/packages/rln/dist/rln.js +56 -166
- package/bundle/packages/rln/dist/utils/bytes.js +8 -2
- package/bundle/packages/rln/dist/utils/metamask.js +2 -2
- package/bundle/packages/rln/dist/zerokit.js +5 -5
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/checksum.js +3 -3
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/cipher.js +4 -4
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/class.js +7 -7
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/functional.js +7 -7
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/index.js +6 -6
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/kdf.js +5 -5
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/password.js +1 -1
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1 -1
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/schema-validation.js +2 -2
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/types.js +1 -1
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +3 -3
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +7 -7
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +3 -3
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +3 -3
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +3 -3
- package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +7 -7
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/_assert.js +1 -1
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/_sha2.js +3 -3
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/_u64.js +1 -1
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/cryptoBrowser.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_assert.js +43 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_sha2.js +116 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/hmac.js +79 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/sha256.js +126 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/utils.js +43 -0
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/hmac.js +3 -3
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/pbkdf2.js +4 -4
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/scrypt.js +5 -5
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/sha256.js +3 -3
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/sha512.js +4 -4
- package/bundle/{node_modules/@chainsafe/bls-keystore → packages/rln}/node_modules/@noble/hashes/utils.js +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/codec.test-utils.d.ts +36 -0
- package/dist/codec.test-utils.js +56 -0
- package/dist/codec.test-utils.js.map +1 -0
- package/dist/contract/abi.d.ts +21 -17
- package/dist/contract/abi.js +502 -248
- package/dist/contract/abi.js.map +1 -1
- package/dist/contract/constants.d.ts +22 -18
- package/dist/contract/constants.js +3 -3
- package/dist/contract/constants.js.map +1 -1
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +1 -0
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/rln_base_contract.d.ts +90 -0
- package/dist/contract/rln_base_contract.js +466 -0
- package/dist/contract/rln_base_contract.js.map +1 -0
- package/dist/contract/rln_contract.d.ts +5 -115
- package/dist/contract/rln_contract.js +30 -355
- package/dist/contract/rln_contract.js.map +1 -1
- package/dist/contract/test-setup.d.ts +26 -0
- package/dist/contract/test-setup.js +56 -0
- package/dist/contract/test-setup.js.map +1 -0
- package/dist/contract/test-utils.d.ts +39 -0
- package/dist/contract/test-utils.js +118 -0
- package/dist/contract/test-utils.js.map +1 -0
- package/dist/contract/types.d.ts +45 -0
- package/dist/contract/types.js +8 -0
- package/dist/contract/types.js.map +1 -0
- package/dist/create.js +1 -1
- package/dist/create.js.map +1 -1
- package/dist/credentials_manager.d.ts +44 -0
- package/dist/credentials_manager.js +197 -0
- package/dist/credentials_manager.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/keystore/keystore.js +11 -6
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/types.d.ts +4 -3
- package/dist/rln.d.ts +9 -52
- package/dist/rln.js +54 -163
- package/dist/rln.js.map +1 -1
- package/dist/types.d.ts +27 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/bytes.js +8 -2
- package/dist/utils/bytes.js.map +1 -1
- package/dist/zerokit.d.ts +3 -3
- package/dist/zerokit.js +5 -5
- package/dist/zerokit.js.map +1 -1
- package/package.json +1 -91
- package/src/codec.test-utils.ts +80 -0
- package/src/contract/abi.ts +502 -248
- package/src/contract/constants.ts +3 -3
- package/src/contract/index.ts +1 -0
- package/src/contract/rln_base_contract.ts +712 -0
- package/src/contract/rln_contract.ts +37 -579
- package/src/contract/test-setup.ts +86 -0
- package/src/contract/test-utils.ts +179 -0
- package/src/contract/types.ts +53 -0
- package/src/create.ts +1 -1
- package/src/credentials_manager.ts +282 -0
- package/src/index.ts +19 -2
- package/src/keystore/keystore.ts +23 -12
- package/src/keystore/types.ts +4 -3
- package/src/rln.ts +67 -258
- package/src/types.ts +31 -0
- package/src/utils/bytes.ts +10 -2
- package/src/zerokit.ts +3 -3
- package/bundle/_virtual/__node-resolve_empty.js +0 -6
- package/bundle/_virtual/_node-resolve_empty.js +0 -3
- package/bundle/_virtual/bn.js +0 -3
- package/bundle/_virtual/common.js +0 -3
- package/bundle/_virtual/common2.js +0 -3
- package/bundle/_virtual/hash.js +0 -3
- package/bundle/_virtual/inherits_browser.js +0 -3
- package/bundle/_virtual/ripemd.js +0 -3
- package/bundle/_virtual/sha.js +0 -3
- package/bundle/_virtual/sha3.js +0 -3
- package/bundle/_virtual/utils3.js +0 -3
- package/bundle/node_modules/@ethersproject/abi/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/abi/lib.esm/abi-coder.js +0 -96
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +0 -148
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/address.js +0 -26
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js +0 -20
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/array.js +0 -210
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js +0 -18
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js +0 -30
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js +0 -26
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/null.js +0 -22
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/number.js +0 -43
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/string.js +0 -19
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js +0 -58
- package/bundle/node_modules/@ethersproject/abi/lib.esm/fragments.js +0 -854
- package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +0 -609
- package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +0 -66
- package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +0 -302
- package/bundle/node_modules/@ethersproject/address/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/address/lib.esm/index.js +0 -110
- package/bundle/node_modules/@ethersproject/base64/lib.esm/base64.js +0 -20
- package/bundle/node_modules/@ethersproject/basex/lib.esm/index.js +0 -120
- package/bundle/node_modules/@ethersproject/bignumber/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js +0 -287
- package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/bytes/lib.esm/index.js +0 -402
- package/bundle/node_modules/@ethersproject/constants/lib.esm/addresses.js +0 -3
- package/bundle/node_modules/@ethersproject/constants/lib.esm/bignumbers.js +0 -8
- package/bundle/node_modules/@ethersproject/constants/lib.esm/hashes.js +0 -3
- package/bundle/node_modules/@ethersproject/contracts/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +0 -893
- package/bundle/node_modules/@ethersproject/hash/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js +0 -256
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js +0 -36
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +0 -135
- package/bundle/node_modules/@ethersproject/hash/lib.esm/id.js +0 -8
- package/bundle/node_modules/@ethersproject/hash/lib.esm/namehash.js +0 -64
- package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +0 -443
- package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +0 -8
- package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/logger/lib.esm/index.js +0 -352
- package/bundle/node_modules/@ethersproject/networks/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/networks/lib.esm/index.js +0 -266
- package/bundle/node_modules/@ethersproject/properties/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +0 -127
- package/bundle/node_modules/@ethersproject/providers/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +0 -2007
- package/bundle/node_modules/@ethersproject/providers/lib.esm/formatter.js +0 -422
- package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +0 -674
- package/bundle/node_modules/@ethersproject/providers/lib.esm/web3-provider.js +0 -132
- package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/rlp/lib.esm/index.js +0 -120
- package/bundle/node_modules/@ethersproject/sha2/lib.esm/sha2.js +0 -8
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +0 -2478
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/index.js +0 -76
- package/bundle/node_modules/@ethersproject/strings/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/strings/lib.esm/utf8.js +0 -219
- package/bundle/node_modules/@ethersproject/transactions/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +0 -279
- package/bundle/node_modules/@ethersproject/web/lib.esm/_version.js +0 -3
- package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +0 -69
- package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +0 -404
- package/bundle/node_modules/bech32/index.js +0 -187
- package/bundle/node_modules/bn.js/lib/bn.js +0 -3361
- package/bundle/node_modules/hash.js/lib/hash/common.js +0 -97
- package/bundle/node_modules/hash.js/lib/hash/hmac.js +0 -51
- package/bundle/node_modules/hash.js/lib/hash/ripemd.js +0 -152
- package/bundle/node_modules/hash.js/lib/hash/sha/1.js +0 -81
- package/bundle/node_modules/hash.js/lib/hash/sha/224.js +0 -33
- package/bundle/node_modules/hash.js/lib/hash/sha/256.js +0 -113
- package/bundle/node_modules/hash.js/lib/hash/sha/384.js +0 -39
- package/bundle/node_modules/hash.js/lib/hash/sha/512.js +0 -336
- package/bundle/node_modules/hash.js/lib/hash/sha/common.js +0 -53
- package/bundle/node_modules/hash.js/lib/hash/sha.js +0 -14
- package/bundle/node_modules/hash.js/lib/hash/utils.js +0 -282
- package/bundle/node_modules/hash.js/lib/hash.js +0 -33
- package/bundle/node_modules/inherits/inherits_browser.js +0 -33
- package/bundle/node_modules/js-sha3/src/sha3.js +0 -660
- package/bundle/node_modules/minimalistic-assert/index.js +0 -13
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +0 -0
- /package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
import { cipherDecrypt as cipherDecrypt_1 } from '
|
2
|
-
import { kdf as kdf_2 } from '
|
3
|
-
import { normalizePassword as normalizePassword_1 } from '
|
1
|
+
import { cipherDecrypt as cipherDecrypt_1 } from '../../node_modules/@chainsafe/bls-keystore/lib/cipher.js';
|
2
|
+
import { kdf as kdf_2 } from '../../node_modules/@chainsafe/bls-keystore/lib/kdf.js';
|
3
|
+
import { normalizePassword as normalizePassword_1 } from '../../node_modules/@chainsafe/bls-keystore/lib/password.js';
|
4
4
|
import { keccak256 } from '../../../../node_modules/ethereum-cryptography/esm/keccak.js';
|
5
5
|
import { hexToBytes } from '../../../../node_modules/ethereum-cryptography/esm/utils.js';
|
6
6
|
import { concatBytes, bytesToHex } from '../../../../node_modules/@noble/hashes/esm/utils.js';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '
|
1
|
+
import '../../node_modules/@chainsafe/bls-keystore/lib/index.js';
|
2
2
|
import '../../../interfaces/dist/protocols.js';
|
3
3
|
import '../../../interfaces/dist/connection_manager.js';
|
4
4
|
import '../../../interfaces/dist/health_indicator.js';
|
@@ -176,7 +176,8 @@ class Keystore {
|
|
176
176
|
membership: {
|
177
177
|
treeIndex: _.get(obj, "treeIndex"),
|
178
178
|
chainId: _.get(obj, "membershipContract.chainId"),
|
179
|
-
address: _.get(obj, "membershipContract.address")
|
179
|
+
address: _.get(obj, "membershipContract.address"),
|
180
|
+
rateLimit: _.get(obj, "userMessageLimit")
|
180
181
|
}
|
181
182
|
};
|
182
183
|
}
|
@@ -186,6 +187,9 @@ class Keystore {
|
|
186
187
|
}
|
187
188
|
}
|
188
189
|
static fromArraylikeToBytes(obj) {
|
190
|
+
if (Array.isArray(obj)) {
|
191
|
+
return new Uint8Array(obj);
|
192
|
+
}
|
189
193
|
const bytes = [];
|
190
194
|
let index = 0;
|
191
195
|
let lastElement = obj[index];
|
@@ -207,15 +211,16 @@ class Keystore {
|
|
207
211
|
return utf8ToBytes(JSON.stringify({
|
208
212
|
treeIndex: options.membership.treeIndex,
|
209
213
|
identityCredential: {
|
210
|
-
idCommitment: options.identity.IDCommitment,
|
211
|
-
idNullifier: options.identity.IDNullifier,
|
212
|
-
idSecretHash: options.identity.IDSecretHash,
|
213
|
-
idTrapdoor: options.identity.IDTrapdoor
|
214
|
+
idCommitment: Array.from(options.identity.IDCommitment),
|
215
|
+
idNullifier: Array.from(options.identity.IDNullifier),
|
216
|
+
idSecretHash: Array.from(options.identity.IDSecretHash),
|
217
|
+
idTrapdoor: Array.from(options.identity.IDTrapdoor)
|
214
218
|
},
|
215
219
|
membershipContract: {
|
216
220
|
chainId: options.membership.chainId,
|
217
221
|
address: options.membership.address
|
218
|
-
}
|
222
|
+
},
|
223
|
+
userMessageLimit: options.membership.rateLimit
|
219
224
|
}));
|
220
225
|
}
|
221
226
|
}
|
@@ -21,167 +21,45 @@ import { Logger } from '../../utils/dist/logger/index.js';
|
|
21
21
|
import '../../core/dist/lib/metadata/metadata.js';
|
22
22
|
import __wbg_init, { init_panic_hook, newRLN } from '../../../node_modules/@waku/zerokit-rln-wasm/rln_wasm.js';
|
23
23
|
import { createRLNEncoder, createRLNDecoder } from './codec.js';
|
24
|
-
import {
|
25
|
-
import {
|
26
|
-
import { Keystore } from './keystore/keystore.js';
|
24
|
+
import { DEFAULT_RATE_LIMIT } from './contract/constants.js';
|
25
|
+
import { RLNCredentialsManager } from './credentials_manager.js';
|
27
26
|
import verificationKey from './resources/verification_key.js';
|
28
27
|
import { builder } from './resources/witness_calculator.js';
|
29
|
-
import { extractMetaMaskSigner } from './utils/metamask.js';
|
30
|
-
import './utils/epoch.js';
|
31
28
|
import { Zerokit } from './zerokit.js';
|
32
29
|
|
33
30
|
const log = new Logger("waku:rln");
|
34
|
-
|
35
|
-
try {
|
36
|
-
const url = new URL("./resources/rln.wasm", import.meta.url);
|
37
|
-
const response = await fetch(url);
|
38
|
-
if (!response.ok) {
|
39
|
-
throw new Error(`Failed to fetch witness calculator: ${response.status} ${response.statusText}`);
|
40
|
-
}
|
41
|
-
return await builder(new Uint8Array(await response.arrayBuffer()), false);
|
42
|
-
}
|
43
|
-
catch (error) {
|
44
|
-
log.error("Error loading witness calculator:", error);
|
45
|
-
throw new Error(`Failed to load witness calculator: ${error instanceof Error ? error.message : String(error)}`);
|
46
|
-
}
|
47
|
-
}
|
48
|
-
async function loadZkey() {
|
49
|
-
try {
|
50
|
-
const url = new URL("./resources/rln_final.zkey", import.meta.url);
|
51
|
-
const response = await fetch(url);
|
52
|
-
if (!response.ok) {
|
53
|
-
throw new Error(`Failed to fetch zkey: ${response.status} ${response.statusText}`);
|
54
|
-
}
|
55
|
-
return new Uint8Array(await response.arrayBuffer());
|
56
|
-
}
|
57
|
-
catch (error) {
|
58
|
-
log.error("Error loading zkey:", error);
|
59
|
-
throw new Error(`Failed to load zkey: ${error instanceof Error ? error.message : String(error)}`);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* Create an instance of RLN
|
64
|
-
* @returns RLNInstance
|
65
|
-
*/
|
66
|
-
async function create() {
|
67
|
-
try {
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
69
|
-
await __wbg_init?.();
|
70
|
-
init_panic_hook();
|
71
|
-
const witnessCalculator = await loadWitnessCalculator();
|
72
|
-
const zkey = await loadZkey();
|
73
|
-
const stringEncoder = new TextEncoder();
|
74
|
-
const vkey = stringEncoder.encode(JSON.stringify(verificationKey));
|
75
|
-
const DEPTH = 20;
|
76
|
-
const zkRLN = newRLN(DEPTH, zkey, vkey);
|
77
|
-
const zerokit = new Zerokit(zkRLN, witnessCalculator, DEFAULT_RATE_LIMIT);
|
78
|
-
return new RLNInstance(zerokit);
|
79
|
-
}
|
80
|
-
catch (error) {
|
81
|
-
log.error("Failed to initialize RLN:", error);
|
82
|
-
throw error;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
class RLNInstance {
|
31
|
+
class RLNInstance extends RLNCredentialsManager {
|
86
32
|
zerokit;
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
_credentials;
|
93
|
-
constructor(zerokit) {
|
94
|
-
this.zerokit = zerokit;
|
95
|
-
}
|
96
|
-
get contract() {
|
97
|
-
return this._contract;
|
98
|
-
}
|
99
|
-
get signer() {
|
100
|
-
return this._signer;
|
101
|
-
}
|
102
|
-
async start(options = {}) {
|
103
|
-
if (this.started || this.starting) {
|
104
|
-
return;
|
105
|
-
}
|
106
|
-
this.starting = true;
|
33
|
+
/**
|
34
|
+
* Create an instance of RLN
|
35
|
+
* @returns RLNInstance
|
36
|
+
*/
|
37
|
+
static async create() {
|
107
38
|
try {
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
40
|
+
await __wbg_init?.();
|
41
|
+
init_panic_hook();
|
42
|
+
const witnessCalculator = await RLNInstance.loadWitnessCalculator();
|
43
|
+
const zkey = await RLNInstance.loadZkey();
|
44
|
+
const stringEncoder = new TextEncoder();
|
45
|
+
const vkey = stringEncoder.encode(JSON.stringify(verificationKey));
|
46
|
+
const DEPTH = 20;
|
47
|
+
const zkRLN = newRLN(DEPTH, zkey, vkey);
|
48
|
+
const zerokit = new Zerokit(zkRLN, witnessCalculator, DEFAULT_RATE_LIMIT);
|
49
|
+
return new RLNInstance(zerokit);
|
50
|
+
}
|
51
|
+
catch (error) {
|
52
|
+
log.error("Failed to initialize RLN:", error);
|
53
|
+
throw error;
|
121
54
|
}
|
122
|
-
finally {
|
123
|
-
this.starting = false;
|
124
|
-
}
|
125
|
-
}
|
126
|
-
async determineStartOptions(options, credentials) {
|
127
|
-
let chainId = credentials?.membership.chainId;
|
128
|
-
const address = credentials?.membership.address ||
|
129
|
-
options.address ||
|
130
|
-
SEPOLIA_CONTRACT.address;
|
131
|
-
if (address === SEPOLIA_CONTRACT.address) {
|
132
|
-
chainId = SEPOLIA_CONTRACT.chainId;
|
133
|
-
}
|
134
|
-
const signer = options.signer || (await extractMetaMaskSigner());
|
135
|
-
const currentChainId = await signer.getChainId();
|
136
|
-
if (chainId && chainId !== currentChainId) {
|
137
|
-
throw Error(`Failed to start RLN contract, chain ID of contract is different from current one: contract-${chainId}, current network-${currentChainId}`);
|
138
|
-
}
|
139
|
-
return {
|
140
|
-
signer,
|
141
|
-
address
|
142
|
-
};
|
143
55
|
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
}
|
148
|
-
if ("identity" in credentials) {
|
149
|
-
return { credentials };
|
150
|
-
}
|
151
|
-
const keystore = Keystore.fromString(credentials.keystore);
|
152
|
-
if (!keystore) {
|
153
|
-
return {};
|
154
|
-
}
|
155
|
-
const decryptedCredentials = await keystore.readCredential(credentials.id, credentials.password);
|
156
|
-
return {
|
157
|
-
keystore,
|
158
|
-
credentials: decryptedCredentials
|
159
|
-
};
|
160
|
-
}
|
161
|
-
async registerMembership(options) {
|
162
|
-
if (!this.contract) {
|
163
|
-
throw Error("RLN Contract is not initialized.");
|
164
|
-
}
|
165
|
-
let identity = "identity" in options && options.identity;
|
166
|
-
if ("signature" in options) {
|
167
|
-
identity = this.zerokit.generateSeededIdentityCredential(options.signature);
|
168
|
-
}
|
169
|
-
if (!identity) {
|
170
|
-
throw Error("Missing signature or identity to register membership.");
|
171
|
-
}
|
172
|
-
return this.contract.registerWithIdentity(identity);
|
173
|
-
}
|
174
|
-
/**
|
175
|
-
* Changes credentials in use by relying on provided Keystore earlier in rln.start
|
176
|
-
* @param id: string, hash of credentials to select from Keystore
|
177
|
-
* @param password: string or bytes to use to decrypt credentials from Keystore
|
178
|
-
*/
|
179
|
-
async useCredentials(id, password) {
|
180
|
-
this._credentials = await this.keystore?.readCredential(id, password);
|
56
|
+
constructor(zerokit) {
|
57
|
+
super(zerokit);
|
58
|
+
this.zerokit = zerokit;
|
181
59
|
}
|
182
60
|
async createEncoder(options) {
|
183
61
|
const { credentials: decryptedCredentials } = await RLNInstance.decryptCredentialsIfNeeded(options.credentials);
|
184
|
-
const credentials = decryptedCredentials || this.
|
62
|
+
const credentials = decryptedCredentials || this.credentials;
|
185
63
|
if (!credentials) {
|
186
64
|
throw Error("Failed to create Encoder: missing RLN credentials. Use createRLNEncoder directly.");
|
187
65
|
}
|
@@ -193,28 +71,40 @@ class RLNInstance {
|
|
193
71
|
credential: credentials.identity
|
194
72
|
});
|
195
73
|
}
|
196
|
-
async verifyCredentialsAgainstContract(credentials) {
|
197
|
-
if (!this._contract) {
|
198
|
-
throw Error("Failed to verify chain coordinates: no contract initialized.");
|
199
|
-
}
|
200
|
-
const registryAddress = credentials.membership.address;
|
201
|
-
const currentRegistryAddress = this._contract.address;
|
202
|
-
if (registryAddress !== currentRegistryAddress) {
|
203
|
-
throw Error(`Failed to verify chain coordinates: credentials contract address=${registryAddress} is not equal to registryContract address=${currentRegistryAddress}`);
|
204
|
-
}
|
205
|
-
const chainId = credentials.membership.chainId;
|
206
|
-
const network = await this._contract.provider.getNetwork();
|
207
|
-
const currentChainId = network.chainId;
|
208
|
-
if (chainId !== currentChainId) {
|
209
|
-
throw Error(`Failed to verify chain coordinates: credentials chainID=${chainId} is not equal to registryContract chainID=${currentChainId}`);
|
210
|
-
}
|
211
|
-
}
|
212
74
|
createDecoder(contentTopic) {
|
213
75
|
return createRLNDecoder({
|
214
76
|
rlnInstance: this,
|
215
77
|
decoder: createDecoder(contentTopic)
|
216
78
|
});
|
217
79
|
}
|
80
|
+
static async loadWitnessCalculator() {
|
81
|
+
try {
|
82
|
+
const url = new URL("./resources/rln.wasm", import.meta.url);
|
83
|
+
const response = await fetch(url);
|
84
|
+
if (!response.ok) {
|
85
|
+
throw new Error(`Failed to fetch witness calculator: ${response.status} ${response.statusText}`);
|
86
|
+
}
|
87
|
+
return await builder(new Uint8Array(await response.arrayBuffer()), false);
|
88
|
+
}
|
89
|
+
catch (error) {
|
90
|
+
log.error("Error loading witness calculator:", error);
|
91
|
+
throw new Error(`Failed to load witness calculator: ${error instanceof Error ? error.message : String(error)}`);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
static async loadZkey() {
|
95
|
+
try {
|
96
|
+
const url = new URL("./resources/rln_final.zkey", import.meta.url);
|
97
|
+
const response = await fetch(url);
|
98
|
+
if (!response.ok) {
|
99
|
+
throw new Error(`Failed to fetch zkey: ${response.status} ${response.statusText}`);
|
100
|
+
}
|
101
|
+
return new Uint8Array(await response.arrayBuffer());
|
102
|
+
}
|
103
|
+
catch (error) {
|
104
|
+
log.error("Error loading zkey:", error);
|
105
|
+
throw new Error(`Failed to load zkey: ${error instanceof Error ? error.message : String(error)}`);
|
106
|
+
}
|
107
|
+
}
|
218
108
|
}
|
219
109
|
|
220
|
-
export { RLNInstance
|
110
|
+
export { RLNInstance };
|
@@ -45,8 +45,14 @@ function writeUIntLE(buf, value, offset, byteLength, noAssert) {
|
|
45
45
|
* @returns BigInt
|
46
46
|
*/
|
47
47
|
function buildBigIntFromUint8Array(array, byteOffset = 0) {
|
48
|
-
|
49
|
-
|
48
|
+
// Convert byte array to BigInt in big-endian format (to match nwaku)
|
49
|
+
let result = 0n;
|
50
|
+
// Process all 32 bytes (or the available bytes if less)
|
51
|
+
const length = Math.min(array.length - byteOffset, 32);
|
52
|
+
for (let i = 0; i < length; i++) {
|
53
|
+
result = (result << 8n) | BigInt(array[byteOffset + i]);
|
54
|
+
}
|
55
|
+
return result;
|
50
56
|
}
|
51
57
|
/**
|
52
58
|
* Fills with zeros to set length
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import * as providers from '@ethersproject/providers';
|
2
2
|
|
3
3
|
const extractMetaMaskSigner = async () => {
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -7,7 +7,7 @@ const extractMetaMaskSigner = async () => {
|
|
7
7
|
throw Error("Missing or invalid Ethereum provider. Please install a Web3 wallet such as MetaMask.");
|
8
8
|
}
|
9
9
|
await ethereum.request({ method: "eth_requestAccounts" });
|
10
|
-
const provider = new Web3Provider(ethereum, "any");
|
10
|
+
const provider = new providers.Web3Provider(ethereum, "any");
|
11
11
|
return provider.getSigner();
|
12
12
|
};
|
13
13
|
|
@@ -8,11 +8,11 @@ import { epochIntToBytes, dateToEpoch } from './utils/epoch.js';
|
|
8
8
|
class Zerokit {
|
9
9
|
zkRLN;
|
10
10
|
witnessCalculator;
|
11
|
-
|
12
|
-
constructor(zkRLN, witnessCalculator,
|
11
|
+
_rateLimit;
|
12
|
+
constructor(zkRLN, witnessCalculator, _rateLimit = DEFAULT_RATE_LIMIT) {
|
13
13
|
this.zkRLN = zkRLN;
|
14
14
|
this.witnessCalculator = witnessCalculator;
|
15
|
-
this.
|
15
|
+
this._rateLimit = _rateLimit;
|
16
16
|
}
|
17
17
|
get getZkRLN() {
|
18
18
|
return this.zkRLN;
|
@@ -20,8 +20,8 @@ class Zerokit {
|
|
20
20
|
get getWitnessCalculator() {
|
21
21
|
return this.witnessCalculator;
|
22
22
|
}
|
23
|
-
get
|
24
|
-
return this.
|
23
|
+
get rateLimit() {
|
24
|
+
return this._rateLimit;
|
25
25
|
}
|
26
26
|
generateIdentityCredentials() {
|
27
27
|
const memKeys = generateExtendedMembershipKey(this.zkRLN); // TODO: rename this function in zerokit rln-wasm
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/checksum.js
RENAMED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as checksum$1 } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as checksum$1 } from '../../../../../../_virtual/checksum.js';
|
3
3
|
import '../node_modules/ethereum-cryptography/sha256.js';
|
4
4
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
5
|
-
import { __exports as sha256 } from '
|
5
|
+
import { __exports as sha256 } from '../../../../../../_virtual/sha256.js';
|
6
6
|
|
7
7
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
8
8
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/cipher.js
RENAMED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as cipher } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as cipher } from '../../../../../../_virtual/cipher.js';
|
3
3
|
import '../node_modules/ethereum-cryptography/random.js';
|
4
4
|
import '../node_modules/ethereum-cryptography/aes.js';
|
5
5
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
6
|
-
import { __exports as random } from '
|
7
|
-
import { __exports as aes } from '
|
6
|
+
import { __exports as random } from '../../../../../../_virtual/random.js';
|
7
|
+
import { __exports as aes } from '../../../../../../_virtual/aes.js';
|
8
8
|
|
9
9
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10
10
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/class.js
RENAMED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as _class } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as _class } from '../../../../../../_virtual/class.js';
|
3
3
|
import './kdf.js';
|
4
4
|
import './checksum.js';
|
5
5
|
import './cipher.js';
|
6
6
|
import './functional.js';
|
7
7
|
import './schema-validation.js';
|
8
|
-
import { __exports as kdf } from '
|
9
|
-
import { __exports as checksum } from '
|
10
|
-
import { __exports as cipher } from '
|
11
|
-
import { __exports as functional } from '
|
12
|
-
import { __exports as schemaValidation } from '
|
8
|
+
import { __exports as kdf } from '../../../../../../_virtual/kdf.js';
|
9
|
+
import { __exports as checksum } from '../../../../../../_virtual/checksum.js';
|
10
|
+
import { __exports as cipher } from '../../../../../../_virtual/cipher.js';
|
11
|
+
import { __exports as functional } from '../../../../../../_virtual/functional.js';
|
12
|
+
import { __exports as schemaValidation } from '../../../../../../_virtual/schema-validation.js';
|
13
13
|
|
14
14
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15
15
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/functional.js
RENAMED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as functional } from '
|
3
|
-
import require$$0 from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as functional } from '../../../../../../_virtual/functional.js';
|
3
|
+
import require$$0 from '../../../../../../_virtual/index2.js';
|
4
4
|
import './kdf.js';
|
5
5
|
import './checksum.js';
|
6
6
|
import './cipher.js';
|
7
7
|
import './password.js';
|
8
8
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
9
|
-
import { __exports as kdf } from '
|
10
|
-
import { __exports as checksum } from '
|
11
|
-
import { __exports as cipher } from '
|
12
|
-
import { __exports as password } from '
|
9
|
+
import { __exports as kdf } from '../../../../../../_virtual/kdf.js';
|
10
|
+
import { __exports as checksum } from '../../../../../../_virtual/checksum.js';
|
11
|
+
import { __exports as cipher } from '../../../../../../_virtual/cipher.js';
|
12
|
+
import { __exports as password } from '../../../../../../_virtual/password.js';
|
13
13
|
|
14
14
|
(function (exports) {
|
15
15
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/index.js
RENAMED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as lib } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as lib } from '../../../../../../_virtual/index.js';
|
3
3
|
import './types.js';
|
4
4
|
import './functional.js';
|
5
5
|
import './class.js';
|
6
6
|
import './schema-validation.js';
|
7
|
-
import { __exports as types } from '
|
8
|
-
import { __exports as functional } from '
|
9
|
-
import { __exports as _class } from '
|
10
|
-
import { __exports as schemaValidation } from '
|
7
|
+
import { __exports as types } from '../../../../../../_virtual/types.js';
|
8
|
+
import { __exports as functional } from '../../../../../../_virtual/functional.js';
|
9
|
+
import { __exports as _class } from '../../../../../../_virtual/class.js';
|
10
|
+
import { __exports as schemaValidation } from '../../../../../../_virtual/schema-validation.js';
|
11
11
|
|
12
12
|
(function (exports) {
|
13
13
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/kdf.js
RENAMED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as kdf$1 } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as kdf$1 } from '../../../../../../_virtual/kdf.js';
|
3
3
|
import '../node_modules/ethereum-cryptography/random.js';
|
4
4
|
import '../node_modules/ethereum-cryptography/pbkdf2.js';
|
5
5
|
import '../node_modules/ethereum-cryptography/scrypt.js';
|
6
6
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
7
|
-
import { __exports as random } from '
|
8
|
-
import { __exports as pbkdf2 } from '
|
9
|
-
import { __exports as scrypt } from '
|
7
|
+
import { __exports as random } from '../../../../../../_virtual/random.js';
|
8
|
+
import { __exports as pbkdf2 } from '../../../../../../_virtual/pbkdf2.js';
|
9
|
+
import { __exports as scrypt } from '../../../../../../_virtual/scrypt.js';
|
10
10
|
|
11
11
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{node_modules → packages/rln/node_modules}/@chainsafe/bls-keystore/lib/password.js
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as password } from '
|
1
|
+
import { __exports as password } from '../../../../../../_virtual/password.js';
|
2
2
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
3
3
|
|
4
4
|
Object.defineProperty(password, "__esModule", { value: true });
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as schemaValidationGenerated } from '
|
1
|
+
import { __exports as schemaValidationGenerated } from '../../../../../../_virtual/schema-validation-generated.js';
|
2
2
|
|
3
3
|
Object.defineProperty(schemaValidationGenerated, "__esModule", { value: true });
|
4
4
|
schemaValidationGenerated.Keystore = void 0;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { __exports as schemaValidation } from '
|
1
|
+
import { __exports as schemaValidation } from '../../../../../../_virtual/schema-validation.js';
|
2
2
|
import './schema-validation-generated.js';
|
3
|
-
import { __exports as schemaValidationGenerated } from '
|
3
|
+
import { __exports as schemaValidationGenerated } from '../../../../../../_virtual/schema-validation-generated.js';
|
4
4
|
|
5
5
|
Object.defineProperty(schemaValidation, "__esModule", { value: true });
|
6
6
|
schemaValidation.isValidKeystore = schemaValidation.validateKeystore = schemaValidation.schemaValidationErrors = void 0;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __exports as aes } from '
|
2
|
-
import '
|
1
|
+
import { __exports as aes } from '../../../../../../../_virtual/aes.js';
|
2
|
+
import '../../../../@noble/hashes/cryptoBrowser.js';
|
3
3
|
import { u as utilsExports } from './utils.js';
|
4
|
-
import { __exports as cryptoBrowser } from '
|
4
|
+
import { __exports as cryptoBrowser } from '../../../../../../../_virtual/cryptoBrowser.js';
|
5
5
|
|
6
6
|
Object.defineProperty(aes, "__esModule", { value: true });
|
7
7
|
aes.decrypt = aes.encrypt = void 0;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { __exports as pbkdf2$1 } from '
|
2
|
-
import '
|
3
|
-
import '
|
4
|
-
import '
|
1
|
+
import { __exports as pbkdf2$1 } from '../../../../../../../_virtual/pbkdf2.js';
|
2
|
+
import '../../../../@noble/hashes/pbkdf2.js';
|
3
|
+
import '../../../../@noble/hashes/sha256.js';
|
4
|
+
import '../../../../@noble/hashes/sha512.js';
|
5
5
|
import { u as utilsExports } from './utils.js';
|
6
|
-
import { __exports as pbkdf2$2 } from '
|
7
|
-
import { __exports as sha256 } from '
|
8
|
-
import { __exports as sha512 } from '
|
6
|
+
import { __exports as pbkdf2$2 } from '../../../../../../../_virtual/pbkdf22.js';
|
7
|
+
import { __exports as sha256 } from '../../../../../../../_virtual/sha2562.js';
|
8
|
+
import { __exports as sha512 } from '../../../../../../../_virtual/sha512.js';
|
9
9
|
|
10
10
|
Object.defineProperty(pbkdf2$1, "__esModule", { value: true });
|
11
11
|
pbkdf2$1.pbkdf2Sync = pbkdf2$1.pbkdf2 = void 0;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { __exports as random } from '
|
2
|
-
import '
|
3
|
-
import { __exports as utils } from '
|
1
|
+
import { __exports as random } from '../../../../../../../_virtual/random.js';
|
2
|
+
import '../../../../@noble/hashes/utils.js';
|
3
|
+
import { __exports as utils } from '../../../../../../../_virtual/utils.js';
|
4
4
|
|
5
5
|
Object.defineProperty(random, "__esModule", { value: true });
|
6
6
|
random.getRandomBytes = random.getRandomBytesSync = void 0;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __exports as scrypt$1 } from '
|
2
|
-
import '
|
1
|
+
import { __exports as scrypt$1 } from '../../../../../../../_virtual/scrypt.js';
|
2
|
+
import '../../../../@noble/hashes/scrypt.js';
|
3
3
|
import { u as utilsExports } from './utils.js';
|
4
|
-
import { __exports as scrypt$2 } from '
|
4
|
+
import { __exports as scrypt$2 } from '../../../../../../../_virtual/scrypt2.js';
|
5
5
|
|
6
6
|
Object.defineProperty(scrypt$1, "__esModule", { value: true });
|
7
7
|
scrypt$1.scryptSync = scrypt$1.scrypt = void 0;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __exports as sha256 } from '
|
2
|
-
import '
|
1
|
+
import { __exports as sha256 } from '../../../../../../../_virtual/sha256.js';
|
2
|
+
import '../../../../@noble/hashes/sha256.js';
|
3
3
|
import { u as utilsExports } from './utils.js';
|
4
|
-
import { __exports as sha256$1 } from '
|
4
|
+
import { __exports as sha256$1 } from '../../../../../../../_virtual/sha2562.js';
|
5
5
|
|
6
6
|
Object.defineProperty(sha256, "__esModule", { value: true });
|
7
7
|
sha256.sha256 = void 0;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { commonjsRequire } from '
|
3
|
-
import { __module as utils } from '
|
4
|
-
import '
|
5
|
-
import '
|
6
|
-
import { __exports as _assert } from '
|
7
|
-
import { __exports as utils$1 } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { commonjsRequire } from '../../../../../../../_virtual/_commonjs-dynamic-modules.js';
|
3
|
+
import { __module as utils } from '../../../../../../../_virtual/utils2.js';
|
4
|
+
import '../../../../@noble/hashes/_assert.js';
|
5
|
+
import '../../../../@noble/hashes/utils.js';
|
6
|
+
import { __exports as _assert } from '../../../../../../../_virtual/_assert.js';
|
7
|
+
import { __exports as utils$1 } from '../../../../../../../_virtual/utils.js';
|
8
8
|
|
9
9
|
utils.exports;
|
10
10
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as _assert } from '
|
1
|
+
import { __exports as _assert } from '../../../../../_virtual/_assert.js';
|
2
2
|
|
3
3
|
Object.defineProperty(_assert, "__esModule", { value: true });
|
4
4
|
_assert.output = _assert.exists = _assert.hash = _assert.bytes = _assert.bool = _assert.number = void 0;
|