@waku/rln 0.1.6-006cd41.0 → 0.1.6-0877e51.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/bundle/_virtual/index2.js +1 -1
- package/bundle/index.js +2 -1
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/checksum.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/cipher.js +4 -4
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/class.js +7 -7
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/functional.js +7 -7
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/index.js +6 -6
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/kdf.js +5 -5
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/password.js +1 -1
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1 -1
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/schema-validation.js +2 -2
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/types.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_assert.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_sha2.js +3 -3
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_u64.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/cryptoBrowser.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/hmac.js +3 -3
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/pbkdf2.js +4 -4
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/scrypt.js +5 -5
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/sha256.js +3 -3
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/sha512.js +4 -4
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/utils.js +2 -2
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +7 -7
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +7 -7
- package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +1 -1
- package/bundle/node_modules/@noble/hashes/esm/_assert.js +6 -32
- package/bundle/node_modules/@noble/hashes/esm/_md.js +22 -11
- package/bundle/node_modules/@noble/hashes/esm/_u64.js +4 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@noble/hashes/esm/hmac.js +19 -10
- package/bundle/{packages/rln/node_modules/@noble/hashes/esm/sha256.js → node_modules/@noble/hashes/esm/sha2.js} +36 -50
- package/bundle/node_modules/@noble/hashes/esm/sha256.js +5 -102
- package/bundle/node_modules/@noble/hashes/esm/sha3.js +30 -24
- package/bundle/node_modules/@noble/hashes/esm/utils.js +69 -18
- package/bundle/node_modules/bn.js/lib/bn.js +1 -0
- package/bundle/node_modules/ethereum-cryptography/esm/sha256.js +1 -1
- package/bundle/node_modules/{@ethersproject/keccak256/node_modules/js-sha3 → js-sha3}/src/sha3.js +2 -2
- package/bundle/packages/core/dist/lib/message/version_0.js +1 -4
- package/bundle/packages/rln/dist/contract/constants.js +8 -1
- package/bundle/packages/rln/dist/contract/rln_base_contract.js +135 -74
- package/bundle/packages/rln/dist/credentials_manager.js +18 -16
- package/bundle/packages/rln/dist/identity.js +37 -7
- package/bundle/packages/rln/dist/keystore/cipher.js +3 -3
- package/bundle/packages/rln/dist/keystore/keystore.js +16 -12
- package/bundle/packages/rln/dist/message.js +11 -0
- package/bundle/packages/rln/dist/utils/bytes.js +14 -16
- package/dist/.tsbuildinfo +1 -1
- package/dist/contract/constants.d.ts +6 -0
- package/dist/contract/constants.js +6 -0
- 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 +32 -22
- package/dist/contract/rln_base_contract.js +135 -74
- package/dist/contract/rln_base_contract.js.map +1 -1
- package/dist/contract/types.d.ts +5 -0
- package/dist/contract/types.js.map +1 -1
- package/dist/credentials_manager.js +17 -15
- package/dist/credentials_manager.js.map +1 -1
- package/dist/identity.d.ts +11 -2
- package/dist/identity.js +23 -6
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/keystore/keystore.js +15 -11
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/types.d.ts +2 -2
- package/dist/message.d.ts +5 -4
- package/dist/message.js +2 -0
- package/dist/message.js.map +1 -1
- package/dist/utils/bytes.d.ts +2 -6
- package/dist/utils/bytes.js +13 -15
- package/dist/utils/bytes.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/contract/constants.ts +9 -0
- package/src/contract/index.ts +1 -0
- package/src/contract/rln_base_contract.ts +176 -113
- package/src/contract/types.ts +5 -0
- package/src/credentials_manager.ts +28 -22
- package/src/identity.ts +32 -6
- package/src/index.ts +3 -1
- package/src/keystore/keystore.ts +32 -26
- package/src/keystore/types.ts +2 -2
- package/src/message.ts +7 -4
- package/src/utils/bytes.ts +21 -25
- package/src/utils/index.ts +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_assert.js +0 -43
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_sha2.js +0 -116
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/utils.js +0 -43
- package/dist/contract/test-utils.d.ts +0 -39
- package/dist/contract/test-utils.js +0 -118
- package/dist/contract/test-utils.js.map +0 -1
- package/src/contract/test-utils.ts +0 -179
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +0 -0
package/src/keystore/keystore.ts
CHANGED
@@ -14,15 +14,13 @@ import {
|
|
14
14
|
import _ from "lodash";
|
15
15
|
import { v4 as uuidV4 } from "uuid";
|
16
16
|
|
17
|
-
import { buildBigIntFromUint8Array } from "../utils/bytes.js";
|
18
|
-
|
19
17
|
import { decryptEipKeystore, keccak256Checksum } from "./cipher.js";
|
20
18
|
import { isCredentialValid, isKeystoreValid } from "./schema_validator.js";
|
21
19
|
import type {
|
22
20
|
Keccak256Hash,
|
23
21
|
KeystoreEntity,
|
22
|
+
KeystoreMembershipInfo,
|
24
23
|
MembershipHash,
|
25
|
-
MembershipInfo,
|
26
24
|
Password,
|
27
25
|
Sha256Hash
|
28
26
|
} from "./types.js";
|
@@ -250,26 +248,25 @@ export class Keystore {
|
|
250
248
|
const str = bytesToUtf8(bytes);
|
251
249
|
const obj = JSON.parse(str);
|
252
250
|
|
253
|
-
|
251
|
+
const idCommitmentLE = Keystore.fromArraylikeToBytes(
|
252
|
+
_.get(obj, "identityCredential.idCommitment", [])
|
253
|
+
);
|
254
|
+
const idTrapdoorLE = Keystore.fromArraylikeToBytes(
|
255
|
+
_.get(obj, "identityCredential.idTrapdoor", [])
|
256
|
+
);
|
257
|
+
const idNullifierLE = Keystore.fromArraylikeToBytes(
|
258
|
+
_.get(obj, "identityCredential.idNullifier", [])
|
259
|
+
);
|
260
|
+
const idSecretHashLE = Keystore.fromArraylikeToBytes(
|
261
|
+
_.get(obj, "identityCredential.idSecretHash", [])
|
262
|
+
);
|
263
|
+
|
254
264
|
return {
|
255
265
|
identity: {
|
256
|
-
IDCommitment:
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
_.get(obj, "identityCredential.idTrapdoor", [])
|
261
|
-
),
|
262
|
-
IDNullifier: Keystore.fromArraylikeToBytes(
|
263
|
-
_.get(obj, "identityCredential.idNullifier", [])
|
264
|
-
),
|
265
|
-
IDCommitmentBigInt: buildBigIntFromUint8Array(
|
266
|
-
Keystore.fromArraylikeToBytes(
|
267
|
-
_.get(obj, "identityCredential.idCommitment", [])
|
268
|
-
)
|
269
|
-
),
|
270
|
-
IDSecretHash: Keystore.fromArraylikeToBytes(
|
271
|
-
_.get(obj, "identityCredential.idSecretHash", [])
|
272
|
-
)
|
266
|
+
IDCommitment: idCommitmentLE,
|
267
|
+
IDTrapdoor: idTrapdoorLE,
|
268
|
+
IDNullifier: idNullifierLE,
|
269
|
+
IDSecretHash: idSecretHashLE
|
273
270
|
},
|
274
271
|
membership: {
|
275
272
|
treeIndex: _.get(obj, "treeIndex"),
|
@@ -310,7 +307,9 @@ export class Keystore {
|
|
310
307
|
|
311
308
|
// follows nwaku implementation
|
312
309
|
// https://github.com/waku-org/nwaku/blob/f05528d4be3d3c876a8b07f9bb7dfaae8aa8ec6e/waku/waku_keystore/protocol_types.nim#L111
|
313
|
-
private static computeMembershipHash(
|
310
|
+
private static computeMembershipHash(
|
311
|
+
info: KeystoreMembershipInfo
|
312
|
+
): MembershipHash {
|
314
313
|
return bytesToHex(
|
315
314
|
sha256(utf8ToBytes(`${info.chainId}${info.address}${info.treeIndex}`))
|
316
315
|
).toUpperCase();
|
@@ -319,14 +318,21 @@ export class Keystore {
|
|
319
318
|
// follows nwaku implementation
|
320
319
|
// https://github.com/waku-org/nwaku/blob/f05528d4be3d3c876a8b07f9bb7dfaae8aa8ec6e/waku/waku_keystore/protocol_types.nim#L98
|
321
320
|
private static fromIdentityToBytes(options: KeystoreEntity): Uint8Array {
|
321
|
+
function toLittleEndian(bytes: Uint8Array): Uint8Array {
|
322
|
+
return new Uint8Array(bytes).reverse();
|
323
|
+
}
|
322
324
|
return utf8ToBytes(
|
323
325
|
JSON.stringify({
|
324
326
|
treeIndex: options.membership.treeIndex,
|
325
327
|
identityCredential: {
|
326
|
-
idCommitment: Array.from(
|
327
|
-
|
328
|
-
|
329
|
-
|
328
|
+
idCommitment: Array.from(
|
329
|
+
toLittleEndian(options.identity.IDCommitment)
|
330
|
+
),
|
331
|
+
idNullifier: Array.from(toLittleEndian(options.identity.IDNullifier)),
|
332
|
+
idSecretHash: Array.from(
|
333
|
+
toLittleEndian(options.identity.IDSecretHash)
|
334
|
+
),
|
335
|
+
idTrapdoor: Array.from(toLittleEndian(options.identity.IDTrapdoor))
|
330
336
|
},
|
331
337
|
membershipContract: {
|
332
338
|
chainId: options.membership.chainId,
|
package/src/keystore/types.ts
CHANGED
@@ -7,7 +7,7 @@ export type Password = string | Uint8Array;
|
|
7
7
|
|
8
8
|
// see reference
|
9
9
|
// https://github.com/waku-org/nwaku/blob/f05528d4be3d3c876a8b07f9bb7dfaae8aa8ec6e/waku/waku_keystore/protocol_types.nim#L111
|
10
|
-
export type
|
10
|
+
export type KeystoreMembershipInfo = {
|
11
11
|
chainId: string;
|
12
12
|
address: string;
|
13
13
|
treeIndex: number;
|
@@ -16,7 +16,7 @@ export type MembershipInfo = {
|
|
16
16
|
|
17
17
|
export type KeystoreEntity = {
|
18
18
|
identity: IdentityCredential;
|
19
|
-
membership:
|
19
|
+
membership: KeystoreMembershipInfo;
|
20
20
|
};
|
21
21
|
|
22
22
|
export type DecryptedCredentials = KeystoreEntity;
|
package/src/message.ts
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
import { message } from "@waku/core";
|
1
2
|
import type {
|
2
3
|
IDecodedMessage,
|
3
4
|
IMessage,
|
4
|
-
IRateLimitProof
|
5
|
+
IRateLimitProof,
|
6
|
+
IRlnMessage
|
5
7
|
} from "@waku/interfaces";
|
6
8
|
import * as utils from "@waku/utils/bytes";
|
7
9
|
|
@@ -13,12 +15,13 @@ export function toRLNSignal(contentTopic: string, msg: IMessage): Uint8Array {
|
|
13
15
|
return new Uint8Array([...(msg.payload ?? []), ...contentTopicBytes]);
|
14
16
|
}
|
15
17
|
|
16
|
-
export class RlnMessage<T extends IDecodedMessage> implements
|
18
|
+
export class RlnMessage<T extends IDecodedMessage> implements IRlnMessage {
|
17
19
|
public pubsubTopic = "";
|
20
|
+
public version = message.version_0.Version;
|
18
21
|
|
19
22
|
public constructor(
|
20
|
-
|
21
|
-
|
23
|
+
private rlnInstance: RLNInstance,
|
24
|
+
private msg: T,
|
22
25
|
public rateLimitProof: IRateLimitProof | undefined
|
23
26
|
) {}
|
24
27
|
|
package/src/utils/bytes.ts
CHANGED
@@ -17,18 +17,13 @@ export function concatenate(...input: Uint8Array[]): Uint8Array {
|
|
17
17
|
return result;
|
18
18
|
}
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
min: number
|
28
|
-
): void {
|
29
|
-
if (value > max || value < min)
|
30
|
-
throw new RangeError('"value" argument is out of bounds');
|
31
|
-
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
20
|
+
export function switchEndianness(bytes: Uint8Array): Uint8Array {
|
21
|
+
return new Uint8Array(bytes.reverse());
|
22
|
+
}
|
23
|
+
|
24
|
+
export function buildBigIntFromUint8ArrayBE(bytes: Uint8Array): bigint {
|
25
|
+
// Interpret bytes as big-endian
|
26
|
+
return bytes.reduce((acc, byte) => (acc << 8n) + BigInt(byte), 0n);
|
32
27
|
}
|
33
28
|
|
34
29
|
export function writeUIntLE(
|
@@ -56,19 +51,6 @@ export function writeUIntLE(
|
|
56
51
|
return buf;
|
57
52
|
}
|
58
53
|
|
59
|
-
/**
|
60
|
-
* Transforms Uint8Array into BigInt
|
61
|
-
* @param array: Uint8Array
|
62
|
-
* @returns BigInt
|
63
|
-
*/
|
64
|
-
export function buildBigIntFromUint8Array(
|
65
|
-
array: Uint8Array,
|
66
|
-
byteOffset: number = 0
|
67
|
-
): bigint {
|
68
|
-
const dataView = new DataView(array.buffer);
|
69
|
-
return dataView.getBigUint64(byteOffset, true);
|
70
|
-
}
|
71
|
-
|
72
54
|
/**
|
73
55
|
* Fills with zeros to set length
|
74
56
|
* @param array little endian Uint8Array
|
@@ -82,3 +64,17 @@ export function zeroPadLE(array: Uint8Array, length: number): Uint8Array {
|
|
82
64
|
}
|
83
65
|
return result;
|
84
66
|
}
|
67
|
+
|
68
|
+
// Adapted from https://github.com/feross/buffer
|
69
|
+
function checkInt(
|
70
|
+
buf: Uint8Array,
|
71
|
+
value: number,
|
72
|
+
offset: number,
|
73
|
+
ext: number,
|
74
|
+
max: number,
|
75
|
+
min: number
|
76
|
+
): void {
|
77
|
+
if (value > max || value < min)
|
78
|
+
throw new RangeError('"value" argument is out of bounds');
|
79
|
+
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
80
|
+
}
|
package/src/utils/index.ts
CHANGED
@@ -1,43 +0,0 @@
|
|
1
|
-
function number(n) {
|
2
|
-
if (!Number.isSafeInteger(n) || n < 0)
|
3
|
-
throw new Error(`Wrong positive integer: ${n}`);
|
4
|
-
}
|
5
|
-
function bool(b) {
|
6
|
-
if (typeof b !== 'boolean')
|
7
|
-
throw new Error(`Expected boolean, not ${b}`);
|
8
|
-
}
|
9
|
-
function bytes(b, ...lengths) {
|
10
|
-
if (!(b instanceof Uint8Array))
|
11
|
-
throw new TypeError('Expected Uint8Array');
|
12
|
-
if (lengths.length > 0 && !lengths.includes(b.length))
|
13
|
-
throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
|
14
|
-
}
|
15
|
-
function hash(hash) {
|
16
|
-
if (typeof hash !== 'function' || typeof hash.create !== 'function')
|
17
|
-
throw new Error('Hash should be wrapped by utils.wrapConstructor');
|
18
|
-
number(hash.outputLen);
|
19
|
-
number(hash.blockLen);
|
20
|
-
}
|
21
|
-
function exists(instance, checkFinished = true) {
|
22
|
-
if (instance.destroyed)
|
23
|
-
throw new Error('Hash instance has been destroyed');
|
24
|
-
if (checkFinished && instance.finished)
|
25
|
-
throw new Error('Hash#digest() has already been called');
|
26
|
-
}
|
27
|
-
function output(out, instance) {
|
28
|
-
bytes(out);
|
29
|
-
const min = instance.outputLen;
|
30
|
-
if (out.length < min) {
|
31
|
-
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
const assert = {
|
35
|
-
number,
|
36
|
-
bool,
|
37
|
-
bytes,
|
38
|
-
hash,
|
39
|
-
exists,
|
40
|
-
output,
|
41
|
-
};
|
42
|
-
|
43
|
-
export { bool, bytes, assert as default, exists, hash, number, output };
|
@@ -1,116 +0,0 @@
|
|
1
|
-
import assert from './_assert.js';
|
2
|
-
import { Hash, createView, toBytes } from './utils.js';
|
3
|
-
|
4
|
-
// Polyfill for Safari 14
|
5
|
-
function setBigUint64(view, byteOffset, value, isLE) {
|
6
|
-
if (typeof view.setBigUint64 === 'function')
|
7
|
-
return view.setBigUint64(byteOffset, value, isLE);
|
8
|
-
const _32n = BigInt(32);
|
9
|
-
const _u32_max = BigInt(0xffffffff);
|
10
|
-
const wh = Number((value >> _32n) & _u32_max);
|
11
|
-
const wl = Number(value & _u32_max);
|
12
|
-
const h = isLE ? 4 : 0;
|
13
|
-
const l = isLE ? 0 : 4;
|
14
|
-
view.setUint32(byteOffset + h, wh, isLE);
|
15
|
-
view.setUint32(byteOffset + l, wl, isLE);
|
16
|
-
}
|
17
|
-
// Base SHA2 class (RFC 6234)
|
18
|
-
class SHA2 extends Hash {
|
19
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
20
|
-
super();
|
21
|
-
this.blockLen = blockLen;
|
22
|
-
this.outputLen = outputLen;
|
23
|
-
this.padOffset = padOffset;
|
24
|
-
this.isLE = isLE;
|
25
|
-
this.finished = false;
|
26
|
-
this.length = 0;
|
27
|
-
this.pos = 0;
|
28
|
-
this.destroyed = false;
|
29
|
-
this.buffer = new Uint8Array(blockLen);
|
30
|
-
this.view = createView(this.buffer);
|
31
|
-
}
|
32
|
-
update(data) {
|
33
|
-
assert.exists(this);
|
34
|
-
const { view, buffer, blockLen } = this;
|
35
|
-
data = toBytes(data);
|
36
|
-
const len = data.length;
|
37
|
-
for (let pos = 0; pos < len;) {
|
38
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
39
|
-
// Fast path: we have at least one block in input, cast it to view and process
|
40
|
-
if (take === blockLen) {
|
41
|
-
const dataView = createView(data);
|
42
|
-
for (; blockLen <= len - pos; pos += blockLen)
|
43
|
-
this.process(dataView, pos);
|
44
|
-
continue;
|
45
|
-
}
|
46
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
47
|
-
this.pos += take;
|
48
|
-
pos += take;
|
49
|
-
if (this.pos === blockLen) {
|
50
|
-
this.process(view, 0);
|
51
|
-
this.pos = 0;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
this.length += data.length;
|
55
|
-
this.roundClean();
|
56
|
-
return this;
|
57
|
-
}
|
58
|
-
digestInto(out) {
|
59
|
-
assert.exists(this);
|
60
|
-
assert.output(out, this);
|
61
|
-
this.finished = true;
|
62
|
-
// Padding
|
63
|
-
// We can avoid allocation of buffer for padding completely if it
|
64
|
-
// was previously not allocated here. But it won't change performance.
|
65
|
-
const { buffer, view, blockLen, isLE } = this;
|
66
|
-
let { pos } = this;
|
67
|
-
// append the bit '1' to the message
|
68
|
-
buffer[pos++] = 0b10000000;
|
69
|
-
this.buffer.subarray(pos).fill(0);
|
70
|
-
// we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again
|
71
|
-
if (this.padOffset > blockLen - pos) {
|
72
|
-
this.process(view, 0);
|
73
|
-
pos = 0;
|
74
|
-
}
|
75
|
-
// Pad until full block byte with zeros
|
76
|
-
for (let i = pos; i < blockLen; i++)
|
77
|
-
buffer[i] = 0;
|
78
|
-
// Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that
|
79
|
-
// You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.
|
80
|
-
// So we just write lowest 64 bits of that value.
|
81
|
-
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
82
|
-
this.process(view, 0);
|
83
|
-
const oview = createView(out);
|
84
|
-
const len = this.outputLen;
|
85
|
-
// NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT
|
86
|
-
if (len % 4)
|
87
|
-
throw new Error('_sha2: outputLen should be aligned to 32bit');
|
88
|
-
const outLen = len / 4;
|
89
|
-
const state = this.get();
|
90
|
-
if (outLen > state.length)
|
91
|
-
throw new Error('_sha2: outputLen bigger than state');
|
92
|
-
for (let i = 0; i < outLen; i++)
|
93
|
-
oview.setUint32(4 * i, state[i], isLE);
|
94
|
-
}
|
95
|
-
digest() {
|
96
|
-
const { buffer, outputLen } = this;
|
97
|
-
this.digestInto(buffer);
|
98
|
-
const res = buffer.slice(0, outputLen);
|
99
|
-
this.destroy();
|
100
|
-
return res;
|
101
|
-
}
|
102
|
-
_cloneInto(to) {
|
103
|
-
to || (to = new this.constructor());
|
104
|
-
to.set(...this.get());
|
105
|
-
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
106
|
-
to.length = length;
|
107
|
-
to.pos = pos;
|
108
|
-
to.finished = finished;
|
109
|
-
to.destroyed = destroyed;
|
110
|
-
if (length % blockLen)
|
111
|
-
to.buffer.set(buffer);
|
112
|
-
return to;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
|
116
|
-
export { SHA2 };
|
@@ -1,43 +0,0 @@
|
|
1
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
2
|
-
// The import here is via the package name. This is to ensure
|
3
|
-
// that exports mapping/resolution does fall into place.
|
4
|
-
// Cast array to view
|
5
|
-
const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
6
|
-
// The rotate right (circular right shift) operation for uint32
|
7
|
-
const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);
|
8
|
-
const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;
|
9
|
-
// There is almost no big endian hardware, but js typed arrays uses platform specific endianness.
|
10
|
-
// So, just to be sure not to corrupt anything.
|
11
|
-
if (!isLE)
|
12
|
-
throw new Error('Non little-endian hardware is not supported');
|
13
|
-
Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));
|
14
|
-
function utf8ToBytes(str) {
|
15
|
-
if (typeof str !== 'string') {
|
16
|
-
throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`);
|
17
|
-
}
|
18
|
-
return new TextEncoder().encode(str);
|
19
|
-
}
|
20
|
-
function toBytes(data) {
|
21
|
-
if (typeof data === 'string')
|
22
|
-
data = utf8ToBytes(data);
|
23
|
-
if (!(data instanceof Uint8Array))
|
24
|
-
throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`);
|
25
|
-
return data;
|
26
|
-
}
|
27
|
-
// For runtime check if class implements interface
|
28
|
-
class Hash {
|
29
|
-
// Safe version that clones internal state
|
30
|
-
clone() {
|
31
|
-
return this._cloneInto();
|
32
|
-
}
|
33
|
-
}
|
34
|
-
function wrapConstructor(hashConstructor) {
|
35
|
-
const hashC = (message) => hashConstructor().update(toBytes(message)).digest();
|
36
|
-
const tmp = hashConstructor();
|
37
|
-
hashC.outputLen = tmp.outputLen;
|
38
|
-
hashC.blockLen = tmp.blockLen;
|
39
|
-
hashC.create = () => hashConstructor();
|
40
|
-
return hashC;
|
41
|
-
}
|
42
|
-
|
43
|
-
export { Hash, createView, isLE, rotr, toBytes, utf8ToBytes, wrapConstructor };
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import * as ethers from "ethers";
|
2
|
-
import sinon from "sinon";
|
3
|
-
import type { IdentityCredential } from "../identity.js";
|
4
|
-
export declare const mockRateLimits: {
|
5
|
-
minRate: number;
|
6
|
-
maxRate: number;
|
7
|
-
maxTotalRate: number;
|
8
|
-
currentTotalRate: number;
|
9
|
-
};
|
10
|
-
type MockProvider = {
|
11
|
-
getLogs: () => never[];
|
12
|
-
getBlockNumber: () => Promise<number>;
|
13
|
-
getNetwork: () => Promise<{
|
14
|
-
chainId: number;
|
15
|
-
}>;
|
16
|
-
};
|
17
|
-
type MockFilters = {
|
18
|
-
MembershipRegistered: () => {
|
19
|
-
address: string;
|
20
|
-
};
|
21
|
-
MembershipErased: () => {
|
22
|
-
address: string;
|
23
|
-
};
|
24
|
-
MembershipExpired: () => {
|
25
|
-
address: string;
|
26
|
-
};
|
27
|
-
};
|
28
|
-
export declare function createMockProvider(): MockProvider;
|
29
|
-
export declare function createMockFilters(): MockFilters;
|
30
|
-
type ContractOverrides = Partial<{
|
31
|
-
filters: Record<string, unknown>;
|
32
|
-
[key: string]: unknown;
|
33
|
-
}>;
|
34
|
-
export declare function createMockRegistryContract(overrides?: ContractOverrides): ethers.Contract;
|
35
|
-
export declare function mockRLNRegisteredEvent(idCommitment?: string): ethers.Event;
|
36
|
-
export declare function formatIdCommitment(idCommitmentBigInt: bigint): string;
|
37
|
-
export declare function createRegisterStub(identity: IdentityCredential): sinon.SinonStub;
|
38
|
-
export declare function verifyRegistration(decryptedCredentials: any, identity: IdentityCredential, registerStub: sinon.SinonStub, insertMemberSpy: sinon.SinonStub): void;
|
39
|
-
export {};
|
@@ -1,118 +0,0 @@
|
|
1
|
-
import { hexToBytes } from "@waku/utils/bytes";
|
2
|
-
import { expect } from "chai";
|
3
|
-
import * as ethers from "ethers";
|
4
|
-
import sinon from "sinon";
|
5
|
-
import { DEFAULT_RATE_LIMIT, LINEA_CONTRACT } from "./constants.js";
|
6
|
-
export const mockRateLimits = {
|
7
|
-
minRate: 20,
|
8
|
-
maxRate: 600,
|
9
|
-
maxTotalRate: 1200,
|
10
|
-
currentTotalRate: 500
|
11
|
-
};
|
12
|
-
export function createMockProvider() {
|
13
|
-
return {
|
14
|
-
getLogs: () => [],
|
15
|
-
getBlockNumber: () => Promise.resolve(1000),
|
16
|
-
getNetwork: () => Promise.resolve({ chainId: 11155111 })
|
17
|
-
};
|
18
|
-
}
|
19
|
-
export function createMockFilters() {
|
20
|
-
return {
|
21
|
-
MembershipRegistered: () => ({ address: LINEA_CONTRACT.address }),
|
22
|
-
MembershipErased: () => ({ address: LINEA_CONTRACT.address }),
|
23
|
-
MembershipExpired: () => ({ address: LINEA_CONTRACT.address })
|
24
|
-
};
|
25
|
-
}
|
26
|
-
export function createMockRegistryContract(overrides = {}) {
|
27
|
-
const filters = {
|
28
|
-
MembershipRegistered: () => ({ address: LINEA_CONTRACT.address }),
|
29
|
-
MembershipErased: () => ({ address: LINEA_CONTRACT.address }),
|
30
|
-
MembershipExpired: () => ({ address: LINEA_CONTRACT.address })
|
31
|
-
};
|
32
|
-
const baseContract = {
|
33
|
-
minMembershipRateLimit: () => Promise.resolve(ethers.BigNumber.from(mockRateLimits.minRate)),
|
34
|
-
maxMembershipRateLimit: () => Promise.resolve(ethers.BigNumber.from(mockRateLimits.maxRate)),
|
35
|
-
maxTotalRateLimit: () => Promise.resolve(ethers.BigNumber.from(mockRateLimits.maxTotalRate)),
|
36
|
-
currentTotalRateLimit: () => Promise.resolve(ethers.BigNumber.from(mockRateLimits.currentTotalRate)),
|
37
|
-
queryFilter: () => [],
|
38
|
-
provider: createMockProvider(),
|
39
|
-
filters,
|
40
|
-
on: () => ({}),
|
41
|
-
removeAllListeners: () => ({}),
|
42
|
-
register: () => ({
|
43
|
-
wait: () => Promise.resolve({
|
44
|
-
events: [mockRLNRegisteredEvent()]
|
45
|
-
})
|
46
|
-
}),
|
47
|
-
estimateGas: {
|
48
|
-
register: () => Promise.resolve(ethers.BigNumber.from(100000))
|
49
|
-
},
|
50
|
-
functions: {
|
51
|
-
register: () => Promise.resolve()
|
52
|
-
},
|
53
|
-
getMemberIndex: () => Promise.resolve(null),
|
54
|
-
interface: {
|
55
|
-
getEvent: (eventName) => ({
|
56
|
-
name: eventName,
|
57
|
-
format: () => { }
|
58
|
-
})
|
59
|
-
},
|
60
|
-
address: LINEA_CONTRACT.address
|
61
|
-
};
|
62
|
-
// Merge overrides while preserving filters
|
63
|
-
const merged = {
|
64
|
-
...baseContract,
|
65
|
-
...overrides,
|
66
|
-
filters: { ...filters, ...(overrides.filters || {}) }
|
67
|
-
};
|
68
|
-
return merged;
|
69
|
-
}
|
70
|
-
export function mockRLNRegisteredEvent(idCommitment) {
|
71
|
-
return {
|
72
|
-
args: {
|
73
|
-
idCommitment: idCommitment ||
|
74
|
-
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
|
75
|
-
membershipRateLimit: ethers.BigNumber.from(DEFAULT_RATE_LIMIT),
|
76
|
-
index: ethers.BigNumber.from(1)
|
77
|
-
},
|
78
|
-
event: "MembershipRegistered"
|
79
|
-
};
|
80
|
-
}
|
81
|
-
export function formatIdCommitment(idCommitmentBigInt) {
|
82
|
-
return "0x" + idCommitmentBigInt.toString(16).padStart(64, "0");
|
83
|
-
}
|
84
|
-
export function createRegisterStub(identity) {
|
85
|
-
return sinon.stub().callsFake(() => ({
|
86
|
-
wait: () => Promise.resolve({
|
87
|
-
events: [
|
88
|
-
{
|
89
|
-
event: "MembershipRegistered",
|
90
|
-
args: {
|
91
|
-
idCommitment: formatIdCommitment(identity.IDCommitmentBigInt),
|
92
|
-
membershipRateLimit: ethers.BigNumber.from(DEFAULT_RATE_LIMIT),
|
93
|
-
index: ethers.BigNumber.from(1)
|
94
|
-
}
|
95
|
-
}
|
96
|
-
]
|
97
|
-
})
|
98
|
-
}));
|
99
|
-
}
|
100
|
-
export function verifyRegistration(decryptedCredentials, identity, registerStub, insertMemberSpy) {
|
101
|
-
if (!decryptedCredentials) {
|
102
|
-
throw new Error("Decrypted credentials should not be undefined");
|
103
|
-
}
|
104
|
-
// Verify registration call
|
105
|
-
expect(registerStub.calledWith(sinon.match.same(identity.IDCommitmentBigInt), sinon.match.same(DEFAULT_RATE_LIMIT), sinon.match.array, sinon.match.object)).to.be.true;
|
106
|
-
// Verify credential properties
|
107
|
-
expect(decryptedCredentials).to.have.property("identity");
|
108
|
-
expect(decryptedCredentials).to.have.property("membership");
|
109
|
-
expect(decryptedCredentials.membership).to.include({
|
110
|
-
address: LINEA_CONTRACT.address,
|
111
|
-
treeIndex: 1
|
112
|
-
});
|
113
|
-
// Verify member insertion
|
114
|
-
const expectedIdCommitment = ethers.utils.zeroPad(hexToBytes(formatIdCommitment(identity.IDCommitmentBigInt)), 32);
|
115
|
-
expect(insertMemberSpy.callCount).to.equal(1);
|
116
|
-
expect(insertMemberSpy.getCall(0).args[0]).to.deep.equal(expectedIdCommitment);
|
117
|
-
}
|
118
|
-
//# sourceMappingURL=test-utils.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../src/contract/test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,GAAG;IACZ,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,GAAG;CACtB,CAAC;AAcF,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;QACjB,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAA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