@semaphore-protocol/proof 4.0.0-beta.1 → 4.0.0-beta.11

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.
@@ -1,158 +1,21 @@
1
1
  /**
2
2
  * @module @semaphore-protocol/proof
3
- * @version 4.0.0-beta.1
3
+ * @version 4.0.0-beta.11
4
4
  * @file A library to generate and verify Semaphore proofs.
5
5
  * @copyright Ethereum Foundation 2024
6
6
  * @license MIT
7
7
  * @see [Github]{@link https://github.com/semaphore-protocol/semaphore/tree/main/packages/proof}
8
8
  */
9
- import { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils';
10
- export { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils';
11
- import { requireNumber, requireDefined, requireObject, requireTypes, requireString, requireArray } from '@semaphore-protocol/utils/errors';
9
+ import { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils/proof-packing';
10
+ export { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils/proof-packing';
11
+ import { MIN_DEPTH, MAX_DEPTH } from '@semaphore-protocol/utils/constants';
12
+ import { requireDefined, requireObject, requireTypes, requireNumber, requireString, requireArray } from '@zk-kit/utils/error-handlers';
13
+ import { maybeGetSnarkArtifacts, Project } from '@zk-kit/artifacts';
12
14
  import { groth16 } from 'snarkjs';
13
- import { existsSync, readdirSync, createWriteStream } from 'node:fs';
14
- import { mkdir } from 'node:fs/promises';
15
- import os from 'node:os';
16
- import { dirname } from 'node:path';
17
- import { Readable } from 'node:stream';
18
- import { finished } from 'node:stream/promises';
19
15
  import { keccak256 } from 'ethers/crypto';
20
16
  import { toBeHex, toBigInt as toBigInt$1 } from 'ethers/utils';
21
17
  import { encodeBytes32String } from 'ethers/abi';
22
18
 
23
- /******************************************************************************
24
- Copyright (c) Microsoft Corporation.
25
-
26
- Permission to use, copy, modify, and/or distribute this software for any
27
- purpose with or without fee is hereby granted.
28
-
29
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
30
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
31
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
32
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
33
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
34
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
35
- PERFORMANCE OF THIS SOFTWARE.
36
- ***************************************************************************** */
37
- /* global Reflect, Promise, SuppressedError, Symbol */
38
-
39
-
40
- var __assign = function() {
41
- __assign = Object.assign || function __assign(t) {
42
- for (var s, i = 1, n = arguments.length; i < n; i++) {
43
- s = arguments[i];
44
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
45
- }
46
- return t;
47
- };
48
- return __assign.apply(this, arguments);
49
- };
50
-
51
- function __awaiter(thisArg, _arguments, P, generator) {
52
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
53
- return new (P || (P = Promise))(function (resolve, reject) {
54
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
55
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
56
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
57
- step((generator = generator.apply(thisArg, _arguments || [])).next());
58
- });
59
- }
60
-
61
- function __generator(thisArg, body) {
62
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
63
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
64
- function verb(n) { return function (v) { return step([n, v]); }; }
65
- function step(op) {
66
- if (f) throw new TypeError("Generator is already executing.");
67
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
68
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
69
- if (y = 0, t) op = [op[0] & 2, t.value];
70
- switch (op[0]) {
71
- case 0: case 1: t = op; break;
72
- case 4: _.label++; return { value: op[1], done: false };
73
- case 5: _.label++; y = op[1]; op = [0]; continue;
74
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
75
- default:
76
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
77
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
78
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
79
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
80
- if (t[2]) _.ops.pop();
81
- _.trys.pop(); continue;
82
- }
83
- op = body.call(thisArg, _);
84
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
85
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
86
- }
87
- }
88
-
89
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
90
- var e = new Error(message);
91
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
92
- };
93
-
94
- /**
95
- * A utility function to download the zero-knowledge artifacts from an external server.
96
- * @param url The URL from which to download the artifacts.
97
- * @param outputPath The path in which to save the artifacts.
98
- */
99
- function download(url, outputPath) {
100
- return __awaiter(this, void 0, void 0, function () {
101
- var response, dir, fileStream;
102
- return __generator(this, function (_a) {
103
- switch (_a.label) {
104
- case 0: return [4 /*yield*/, fetch(url)];
105
- case 1:
106
- response = _a.sent();
107
- if (!response.ok) {
108
- throw new Error("Failed to fetch ".concat(url, ": ").concat(response.statusText));
109
- }
110
- dir = dirname(outputPath);
111
- return [4 /*yield*/, mkdir(dir, { recursive: true })];
112
- case 2:
113
- _a.sent();
114
- fileStream = createWriteStream(outputPath);
115
- return [4 /*yield*/, finished(Readable.fromWeb(response.body).pipe(fileStream))];
116
- case 3:
117
- _a.sent();
118
- return [2 /*return*/];
119
- }
120
- });
121
- });
122
- }
123
- /**
124
- * Downloads the zero-knowledge artifacts and returns their paths.
125
- * Artifacts exist for each tree depth supported by Semaphore, and
126
- * they were generated in a trusted-setup.
127
- * @param treeDepth The depth of the tree.
128
- * @returns The zero-knowledge artifacts paths.
129
- */
130
- function getSnarkArtifacts(treeDepth) {
131
- return __awaiter(this, void 0, void 0, function () {
132
- var tmpDir, tmpPath;
133
- return __generator(this, function (_a) {
134
- switch (_a.label) {
135
- case 0:
136
- requireNumber(treeDepth, "treeDepth");
137
- tmpDir = "semaphore-proof";
138
- tmpPath = "".concat(os.tmpdir(), "/").concat(tmpDir, "-").concat(treeDepth);
139
- if (!(!existsSync(tmpPath) || readdirSync(tmpPath).length !== 2)) return [3 /*break*/, 3];
140
- return [4 /*yield*/, download("https://semaphore.cedoor.dev/artifacts/".concat(treeDepth, "/semaphore.wasm"), "".concat(tmpPath, "/semaphore.wasm"))];
141
- case 1:
142
- _a.sent();
143
- return [4 /*yield*/, download("https://semaphore.cedoor.dev/artifacts/".concat(treeDepth, "/semaphore.zkey"), "".concat(tmpPath, "/semaphore.zkey"))];
144
- case 2:
145
- _a.sent();
146
- _a.label = 3;
147
- case 3: return [2 /*return*/, {
148
- wasmFilePath: "".concat(tmpPath, "/semaphore.wasm"),
149
- zkeyFilePath: "".concat(tmpPath, "/semaphore.zkey")
150
- }];
151
- }
152
- });
153
- });
154
- }
155
-
156
19
  /**
157
20
  * Creates a keccak256 hash of a message compatible with the SNARK scalar modulus.
158
21
  * @param message The message to be hashed.
@@ -163,7 +26,7 @@ function hash(message) {
163
26
  }
164
27
 
165
28
  /**
166
- * Converts a bignumberish to a bigint.
29
+ * Converts a bignumberish or a text to a bigint.
167
30
  * @param value The value to be converted to bigint.
168
31
  * @return The value converted to bigint.
169
32
  */
@@ -193,89 +56,79 @@ function toBigInt(value) {
193
56
  * or they will be automatically fetched.
194
57
  * @param identity The Semaphore identity.
195
58
  * @param groupOrMerkleProof The Semaphore group or its Merkle proof.
196
- * @param scope The Semaphore scope.
197
59
  * @param message The Semaphore message.
60
+ * @param scope The Semaphore scope.
198
61
  * @param merkleTreeDepth The depth of the tree with which the circuit was compiled.
199
- * @param snarkArtifacts The SNARK artifacts.
62
+ * @param snarkArtifacts See {@link https://zkkit.pse.dev/interfaces/_zk_kit_utils.SnarkArtifacts.html | SnarkArtifacts}.
200
63
  * @returns The Semaphore proof ready to be verified.
201
64
  */
202
- function generateProof(identity, groupOrMerkleProof, message, scope, merkleTreeDepth, snarkArtifacts) {
203
- return __awaiter(this, void 0, void 0, function () {
204
- var merkleProof, leafIndex, merkleProofLength, merkleProofIndices, merkleProofSiblings, i, _a, proof, publicSignals;
205
- return __generator(this, function (_b) {
206
- switch (_b.label) {
207
- case 0:
208
- requireDefined(identity, "identity");
209
- requireDefined(groupOrMerkleProof, "groupOrMerkleProof");
210
- requireDefined(message, "message");
211
- requireDefined(scope, "scope");
212
- requireObject(identity, "identity");
213
- requireObject(groupOrMerkleProof, "groupOrMerkleProof");
214
- requireTypes(message, "message", ["string", "bigint", "number", "uint8array"]);
215
- requireTypes(scope, "scope", ["string", "bigint", "number", "uint8array"]);
216
- if (merkleTreeDepth) {
217
- requireNumber(merkleTreeDepth, "merkleTreeDepth");
218
- }
219
- if (snarkArtifacts) {
220
- requireObject(snarkArtifacts, "snarkArtifacts");
221
- }
222
- // Message and scope can be strings, numbers or buffers (i.e. Uint8Array).
223
- // They will be converted to bigints anyway.
224
- message = toBigInt(message);
225
- scope = toBigInt(scope);
226
- // The second parameter can be either a Merkle proof or a group.
227
- // If it is a group the Merkle proof will be calculated here.
228
- if ("siblings" in groupOrMerkleProof) {
229
- merkleProof = groupOrMerkleProof;
230
- }
231
- else {
232
- leafIndex = groupOrMerkleProof.indexOf(identity.commitment);
233
- merkleProof = groupOrMerkleProof.generateMerkleProof(leafIndex);
234
- }
235
- merkleProofLength = merkleProof.siblings.length;
236
- if (merkleTreeDepth !== undefined) {
237
- if (merkleTreeDepth < 1 || merkleTreeDepth > 12) {
238
- throw new TypeError("The tree depth must be a number between 1 and 12");
239
- }
240
- }
241
- else {
242
- merkleTreeDepth = merkleProofLength;
243
- }
244
- if (!!snarkArtifacts) return [3 /*break*/, 2];
245
- return [4 /*yield*/, getSnarkArtifacts(merkleTreeDepth)];
246
- case 1:
247
- snarkArtifacts = _b.sent();
248
- _b.label = 2;
249
- case 2:
250
- merkleProofIndices = [];
251
- merkleProofSiblings = merkleProof.siblings;
252
- for (i = 0; i < merkleTreeDepth; i += 1) {
253
- merkleProofIndices.push((merkleProof.index >> i) & 1);
254
- if (merkleProofSiblings[i] === undefined) {
255
- merkleProofSiblings[i] = "0";
256
- }
257
- }
258
- return [4 /*yield*/, groth16.fullProve({
259
- secret: identity.secretScalar,
260
- merkleProofLength: merkleProofLength,
261
- merkleProofIndices: merkleProofIndices,
262
- merkleProofSiblings: merkleProofSiblings,
263
- scope: hash(scope),
264
- message: hash(message)
265
- }, snarkArtifacts.wasmFilePath, snarkArtifacts.zkeyFilePath)];
266
- case 3:
267
- _a = _b.sent(), proof = _a.proof, publicSignals = _a.publicSignals;
268
- return [2 /*return*/, {
269
- merkleTreeDepth: merkleTreeDepth,
270
- merkleTreeRoot: publicSignals[0],
271
- nullifier: publicSignals[1],
272
- message: message.toString(),
273
- scope: scope.toString(),
274
- points: packGroth16Proof(proof)
275
- }];
276
- }
277
- });
278
- });
65
+ async function generateProof(identity, groupOrMerkleProof, message, scope, merkleTreeDepth, snarkArtifacts) {
66
+ requireDefined(identity, "identity");
67
+ requireDefined(groupOrMerkleProof, "groupOrMerkleProof");
68
+ requireDefined(message, "message");
69
+ requireDefined(scope, "scope");
70
+ requireObject(identity, "identity");
71
+ requireObject(groupOrMerkleProof, "groupOrMerkleProof");
72
+ requireTypes(message, "message", ["string", "bigint", "number", "Uint8Array"]);
73
+ requireTypes(scope, "scope", ["string", "bigint", "number", "Uint8Array"]);
74
+ if (merkleTreeDepth) {
75
+ requireNumber(merkleTreeDepth, "merkleTreeDepth");
76
+ }
77
+ if (snarkArtifacts) {
78
+ requireObject(snarkArtifacts, "snarkArtifacts");
79
+ }
80
+ // Message and scope can be strings, numbers or buffers (i.e. Uint8Array).
81
+ // They will be converted to bigints anyway.
82
+ message = toBigInt(message);
83
+ scope = toBigInt(scope);
84
+ let merkleProof;
85
+ // The second parameter can be either a Merkle proof or a group.
86
+ // If it is a group the Merkle proof will be calculated here.
87
+ if ("siblings" in groupOrMerkleProof) {
88
+ merkleProof = groupOrMerkleProof;
89
+ }
90
+ else {
91
+ const leafIndex = groupOrMerkleProof.indexOf(identity.commitment);
92
+ merkleProof = groupOrMerkleProof.generateMerkleProof(leafIndex);
93
+ }
94
+ const merkleProofLength = merkleProof.siblings.length;
95
+ if (merkleTreeDepth !== undefined) {
96
+ if (merkleTreeDepth < MIN_DEPTH || merkleTreeDepth > MAX_DEPTH) {
97
+ throw new TypeError(`The tree depth must be a number between ${MIN_DEPTH} and ${MAX_DEPTH}`);
98
+ }
99
+ }
100
+ else {
101
+ merkleTreeDepth = merkleProofLength;
102
+ }
103
+ // If the Snark artifacts are not defined they will be automatically downloaded.
104
+ snarkArtifacts ?? (snarkArtifacts = await maybeGetSnarkArtifacts(Project.SEMAPHORE, { parameters: [merkleTreeDepth] }));
105
+ const { wasm, zkey } = snarkArtifacts;
106
+ // The index must be converted to a list of indices, 1 for each tree level.
107
+ // The missing siblings can be set to 0, as they won't be used in the circuit.
108
+ const merkleProofIndices = [];
109
+ const merkleProofSiblings = merkleProof.siblings;
110
+ for (let i = 0; i < merkleTreeDepth; i += 1) {
111
+ merkleProofIndices.push((merkleProof.index >> i) & 1);
112
+ if (merkleProofSiblings[i] === undefined) {
113
+ merkleProofSiblings[i] = 0n;
114
+ }
115
+ }
116
+ const { proof, publicSignals } = await groth16.fullProve({
117
+ secret: identity.secretScalar,
118
+ merkleProofLength,
119
+ merkleProofIndices,
120
+ merkleProofSiblings,
121
+ scope: hash(scope),
122
+ message: hash(message)
123
+ }, wasm, zkey);
124
+ return {
125
+ merkleTreeDepth,
126
+ merkleTreeRoot: publicSignals[0],
127
+ nullifier: publicSignals[1],
128
+ message: message.toString(),
129
+ scope: scope.toString(),
130
+ points: packGroth16Proof(proof)
131
+ };
279
132
  }
280
133
 
281
134
  var protocol = "groth16";
@@ -317,12 +170,292 @@ var vk_gamma_2 = [
317
170
  var vk_delta_2 = [
318
171
  [
319
172
  [
320
- "16293410697967515504861065986355060225819302510590370360517024529684437085892",
321
- "563562783592406106461234396505774794044312891062077216951605541624542949349"
173
+ "13059836359816425778553975687206846338164409479984923255114294465523619970040",
174
+ "3494501265090266483323776427125076982570488036063792468650150218138148835293"
175
+ ],
176
+ [
177
+ "18815265419617029498036243865004357229581831642357407445454759910979500165426",
178
+ "15151249351679674757179857367151108866106292017800258580857323337349056252481"
179
+ ],
180
+ [
181
+ "1",
182
+ "0"
183
+ ]
184
+ ],
185
+ [
186
+ [
187
+ "21284355201064049515013725567964698308458995747497567769096321545369178267664",
188
+ "13532761187117457776267167491166240112603073699238075603358405884195273308130"
189
+ ],
190
+ [
191
+ "13755025500407841928271808574327563222159647895255773830113509677575485710439",
192
+ "14708709266814413125869923160757837040371326884025433917243343433022571511137"
193
+ ],
194
+ [
195
+ "1",
196
+ "0"
197
+ ]
198
+ ],
199
+ [
200
+ [
201
+ "16786097788016607790742808610154813235622999962925024769202024012743068916317",
202
+ "16288589209448575059850904513787407047800601393647902754951819632644221425590"
203
+ ],
204
+ [
205
+ "19054287618327819080244377924220084730619755297417179223777968789329427435290",
206
+ "11802625068933862043088882453234658125803235172103758441218874440784454679433"
207
+ ],
208
+ [
209
+ "1",
210
+ "0"
211
+ ]
212
+ ],
213
+ [
214
+ [
215
+ "2467775821309410353298170614346797970620091442818193435415958276311437053860",
216
+ "6754034540226318773202391358963433276871786953717809855694353846932854329785"
217
+ ],
218
+ [
219
+ "11900626424250849274937718621509251345343138630887182003298279365567651532774",
220
+ "3795882684032276797539296527637960192876033451771193231958863625204108357841"
221
+ ],
222
+ [
223
+ "1",
224
+ "0"
225
+ ]
226
+ ],
227
+ [
228
+ [
229
+ "12933614295322559340061757843860755814119074678469087137971477853826215320477",
230
+ "17333116859502962840043101407562668240640230466282480836955810105410227775068"
231
+ ],
232
+ [
233
+ "7294988186022326345519392644681725286083380252049244042196946627153179228896",
234
+ "16047936521695868738870018107292105532713465015164559404074987652783597045737"
235
+ ],
236
+ [
237
+ "1",
238
+ "0"
239
+ ]
240
+ ],
241
+ [
242
+ [
243
+ "13605330538883882809690822917231786498790079369748019502396183248967388405806",
244
+ "15568762761287080334123901982501029099057449591979709935902691107711749249022"
245
+ ],
246
+ [
247
+ "663727981727505127530084497770681234757756087785765426261978801707046251460",
248
+ "4557473062770366777369570006933550632897701110895009604852123748934703573598"
249
+ ],
250
+ [
251
+ "1",
252
+ "0"
253
+ ]
254
+ ],
255
+ [
256
+ [
257
+ "5537576101367227927432290079717223894972087264645714861714512123692630233528",
258
+ "19054688611757691116083119485406638328516261425570134055761099438916542083510"
259
+ ],
260
+ [
261
+ "8586836112195763056179953883229406431968181502947295115552125062679854083702",
262
+ "6979029193706864774816090585159218044225824044811622589489754672108831626492"
263
+ ],
264
+ [
265
+ "1",
266
+ "0"
267
+ ]
268
+ ],
269
+ [
270
+ [
271
+ "15652564582439405385221211230207905588664570626471430290387353913847742289423",
272
+ "19578851418759832732932704168311617005093075745056434533146726479017829863318"
273
+ ],
274
+ [
275
+ "14106834159967458301881233489789009851186059673153032928358078463768578862295",
276
+ "16643936505220289641562675739145660599904253967999119934999861447807565341362"
277
+ ],
278
+ [
279
+ "1",
280
+ "0"
281
+ ]
282
+ ],
283
+ [
284
+ [
285
+ "9848634919654176463577373224145330482034525085313091961003436980620107331892",
286
+ "1685688713043683238718199465856766482066511448257730427497355513493739531611"
287
+ ],
288
+ [
289
+ "13480350431152755858527378560944736211973688467090758274688486468999380580617",
290
+ "18196877315995240142437674253225787667859373842602255491217815157552464034485"
291
+ ],
292
+ [
293
+ "1",
294
+ "0"
295
+ ]
296
+ ],
297
+ [
298
+ [
299
+ "12236736981369574728236515244179429788162438563725746867632140895351148551552",
300
+ "21786356007381173571659640827279042005211499352757309589075661822822184336792"
301
+ ],
302
+ [
303
+ "19080091339088228168648496513310089433965291972445393982881627786426476832461",
304
+ "10863564205627431677272082241703292907572336123388414891152924237169726048989"
305
+ ],
306
+ [
307
+ "1",
308
+ "0"
309
+ ]
310
+ ],
311
+ [
312
+ [
313
+ "18087906293812032247545697502040580639160189604135547745784396926653417233054",
314
+ "10309025318092075922877899889998376514894538129513157785184221239491816007275"
315
+ ],
316
+ [
317
+ "184008375360758173891663157848136305080059410478051745043500682115967930421",
318
+ "13762379406944901802406147105406409563171519837674920666882385732457367565067"
319
+ ],
320
+ [
321
+ "1",
322
+ "0"
323
+ ]
324
+ ],
325
+ [
326
+ [
327
+ "13069258073213826018511225623792777048865648697927965549278238995976541682378",
328
+ "1756370075610000391065900031440928534228372460166358020032744967867009404739"
329
+ ],
330
+ [
331
+ "9140577809263846446846557996533548785843500894717723604305025713383218414559",
332
+ "7782751275919236901187777136923054830643484083829974136976698114515315637057"
333
+ ],
334
+ [
335
+ "1",
336
+ "0"
337
+ ]
338
+ ],
339
+ [
340
+ [
341
+ "4288116053201917097935075684000732434752594062540657362132573163825118214678",
342
+ "2013822349576539187255170167791292904450945890590676031546564364203578428335"
343
+ ],
344
+ [
345
+ "21859395070840197113042028262962323095719784329051140880224965059514424348831",
346
+ "8077112032513125799331495973006800784299892868940747570902318145444056767128"
347
+ ],
348
+ [
349
+ "1",
350
+ "0"
351
+ ]
352
+ ],
353
+ [
354
+ [
355
+ "19016912455127243850008892664785684778896975209193735443658242892839245034020",
356
+ "20175815417917544319876056782814914933529560976800336038485418111883227853782"
357
+ ],
358
+ [
359
+ "1733299003416816864259549315192082251876301168870557296608277844652111933728",
360
+ "16407892224237245445759181057634763320099880121738727631152800143921701752766"
361
+ ],
362
+ [
363
+ "1",
364
+ "0"
365
+ ]
366
+ ],
367
+ [
368
+ [
369
+ "6459673724557348935705566417966034360840940513046631280825724658596691372236",
370
+ "11732104488418080835742848495999449390672991477162489659934147182999672535901"
371
+ ],
372
+ [
373
+ "4646055529276583783430546562443788975802459143056296894781022758410365840191",
374
+ "6029012855434716453595719715412319477813852483210244923240854148622030700333"
375
+ ],
376
+ [
377
+ "1",
378
+ "0"
379
+ ]
380
+ ],
381
+ [
382
+ [
383
+ "18119791555976875181530385865721092494224184674421992280086192965672251542369",
384
+ "10984413251461965647935549809134853212592257018647144589799535518309030045652"
385
+ ],
386
+ [
387
+ "7130566849274623382593449799430907546738108731698918345554426216822781939144",
388
+ "9145503195549781954670301741558506961167250692965330519317415426822517754673"
389
+ ],
390
+ [
391
+ "1",
392
+ "0"
393
+ ]
394
+ ],
395
+ [
396
+ [
397
+ "20130681839683286699999162868559569892047546290445540680321104858780927447891",
398
+ "13720910810322640236241345084228368577289121108674469591653285046643807920592"
399
+ ],
400
+ [
401
+ "19975766244574254201679709416326566199725210321908005962311647177117814001433",
402
+ "19384575604207898920571405644263255260754982283494527106631330593535635397279"
403
+ ],
404
+ [
405
+ "1",
406
+ "0"
407
+ ]
408
+ ],
409
+ [
410
+ [
411
+ "9443203291481021710901029750383878696924345181407701672283832773787973929357",
412
+ "3623654015087414721623407943467672461002500175886362625657458770102123762131"
413
+ ],
414
+ [
415
+ "20783980223895248302225054295761481013954415663729096577932141772215407111525",
416
+ "10936780876916181422574139993481684366447129939437423271868090426234211011172"
417
+ ],
418
+ [
419
+ "1",
420
+ "0"
421
+ ]
422
+ ],
423
+ [
424
+ [
425
+ "9354292212142814677109747486323108648096936042340817605919210179321989308917",
426
+ "2691056408064763934730579100312307365419695285915108108510025624053099691059"
427
+ ],
428
+ [
429
+ "6884402260223763449545988617300286545815739386455462315027606685140336580267",
430
+ "20671296014916566316534621652773273840585037550883195749265386216295483140229"
431
+ ],
432
+ [
433
+ "1",
434
+ "0"
435
+ ]
436
+ ],
437
+ [
438
+ [
439
+ "18234746072930724806231995798390096761122848034387635694143726587529010836110",
440
+ "3068590229007175726652350825575975480933564242399453586465825082294647475860"
441
+ ],
442
+ [
443
+ "20400009938273944278780991216131489368203720208632049864993233212641381825170",
444
+ "1919684949146675959680323349314941369203574019150554584779991024393742280845"
445
+ ],
446
+ [
447
+ "1",
448
+ "0"
449
+ ]
450
+ ],
451
+ [
452
+ [
453
+ "2774371060614150609505152344392883392716265245943510628736114293073040141197",
454
+ "8447854758365235234650174914302032784976268667989384822851416849728373375962"
322
455
  ],
323
456
  [
324
- "10971164449179097832515056670594147898894418081309026322805549037082528587660",
325
- "718666295291146285397081607986058864287612968465033527894198098928522749430"
457
+ "7186617426186972817855986804168941432350281910461206569148058741387131498151",
458
+ "3015263507065482193204789265551006236425156693888783715997203837690906201829"
326
459
  ],
327
460
  [
328
461
  "1",
@@ -331,12 +464,12 @@ var vk_delta_2 = [
331
464
  ],
332
465
  [
333
466
  [
334
- "8087990171976409378525016197066789089596692733769545253942804888352233244331",
335
- "6925326031648378844726759441690273332175949886518827719224741736678266471462"
467
+ "8966253575788130771852727739125896841145906149133271403123431077749138822231",
468
+ "4840070530275546035801699608444700918579228818207171384987643157345263587158"
336
469
  ],
337
470
  [
338
- "15618724583521291135890928658458637081479213437530496494788106479523123480134",
339
- "10115242383701466910539784663900956956505212347433548599529944880163612117847"
471
+ "9962709838557371377047621521224985762013252610725145923403828793639693121455",
472
+ "2601469036026438601891277833343663261084005848061139271388586828809996187097"
340
473
  ],
341
474
  [
342
475
  "1",
@@ -345,12 +478,12 @@ var vk_delta_2 = [
345
478
  ],
346
479
  [
347
480
  [
348
- "7699563868952902688273782470023919811229667532027732585467624469008534197561",
349
- "7699900854308622607636895140107457213471038801393300399043779958706267744510"
481
+ "5094820268025857505363635119835975858756772232205804973699906431827658031964",
482
+ "10518236799651118399986483301765863768027777545669908907880159551621810126849"
350
483
  ],
351
484
  [
352
- "15390497513810955087868026868634948499789494261604405008298272598684585331879",
353
- "8605006500231713390564760089884965869867818332514275728271802101761117177706"
485
+ "11572692692867396499761538666196116586305865304015349724077332249273828973395",
486
+ "20859555010758118604073361508744352301840967631704468041131681426037983213002"
354
487
  ],
355
488
  [
356
489
  "1",
@@ -359,12 +492,12 @@ var vk_delta_2 = [
359
492
  ],
360
493
  [
361
494
  [
362
- "2561989864654045354260435368824127763249975523256535586391379695256700207392",
363
- "9243647856126339588200227750973237380809101852206502177952556679680468734813"
495
+ "19629232294794264734516475644320504923384252747453171010407820919121492093097",
496
+ "11661383417324806615558394659220516610247089928376070440522188291505784724873"
364
497
  ],
365
498
  [
366
- "18264861452415533737686303596832882667852638121244187636443702248458018416929",
367
- "1308059969166897152269078839315249187046718124106168932020710683189419160756"
499
+ "8350002947339764206858601679633707444815132923435432091284098864968718952059",
500
+ "14618693275952711587232205373188572480239428452313785044400368360917578177396"
368
501
  ],
369
502
  [
370
503
  "1",
@@ -373,12 +506,12 @@ var vk_delta_2 = [
373
506
  ],
374
507
  [
375
508
  [
376
- "21307904757295729894500052152251151076177124351059746872940558537429181679313",
377
- "12554869896570109663558999106053541183136083706372178136870048170147558661370"
509
+ "12950215329375055291643630373560741963997558430433168794073218970044384415372",
510
+ "5174537185495146345702880156705283203902425396197383898540057654655066753579"
378
511
  ],
379
512
  [
380
- "11194665041440536766843756304212299788817698936187605770131686430625103172681",
381
- "13447792161027167738515744919555311619301071111923271126707713963292614473975"
513
+ "4431630864873466361387108635543958095498731270116355616225197767733734128861",
514
+ "18440638825319565738488991729556785679573678682023564191514526390075411141690"
382
515
  ],
383
516
  [
384
517
  "1",
@@ -387,12 +520,12 @@ var vk_delta_2 = [
387
520
  ],
388
521
  [
389
522
  [
390
- "11706947284665470438085734275890584651957983546291282232304205898476084974953",
391
- "6841243505372324564043525805425666596605335849634400049689614462868641599622"
523
+ "5801648383242377039158295944236326894031930402176012010819307534933038347985",
524
+ "8179214450876128189786889463050502216503192251068580710356475166830402701708"
392
525
  ],
393
526
  [
394
- "2674642993002069213220912300725195098434544703961492590713058622848310061455",
395
- "8134420958061302592465696766566203845441024351721660066575866529624350946525"
527
+ "19870706029300681613622543188539567928777315763585981640693685194301201982407",
528
+ "4693973538356763613860391593814220138320073026815959512078454125381217645788"
396
529
  ],
397
530
  [
398
531
  "1",
@@ -401,12 +534,12 @@ var vk_delta_2 = [
401
534
  ],
402
535
  [
403
536
  [
404
- "14347453588631116202352669855016330076170847581618919999243717038742915487177",
405
- "16222168105567777760688113388791710300819703656136395550799888633073848798053"
537
+ "2064976285344404756281594929698931000697669900063301194291518290834961490240",
538
+ "20277284114925687078224763520355726939257825143391929434570333974997434560805"
406
539
  ],
407
540
  [
408
- "5558376366205739247464101507558623934779699722049069497418188353860561540238",
409
- "1551977748690015855031859376084014992267998166583511614295554470740621685494"
541
+ "15643195784077230042834999110691483687428735466231422370142767293471863700387",
542
+ "7222144325382158947774651546068992150829509045485292683383357637997517326148"
410
543
  ],
411
544
  [
412
545
  "1",
@@ -415,12 +548,12 @@ var vk_delta_2 = [
415
548
  ],
416
549
  [
417
550
  [
418
- "13742810756711208866393269789950822956196651488331544225304557369739035583007",
419
- "8039261311473792027408130340265108867783988336829815266149766357424909552805"
551
+ "17975202799537991792439304164891754483380324452259562307747422259512624823212",
552
+ "5477988853386650384703921094948844062358006867640221757094709122931664258074"
420
553
  ],
421
554
  [
422
- "1426283383724925735279168010737048062664480092231550167387716017170422478271",
423
- "5732605965679620193714116075516176231919315490749768120227762344555213912038"
555
+ "11185225860338384901020382557488674560018020486665010314728105461398537090194",
556
+ "13848136879177885045281819032248904935976168943919823007775235047173993770157"
424
557
  ],
425
558
  [
426
559
  "1",
@@ -429,12 +562,12 @@ var vk_delta_2 = [
429
562
  ],
430
563
  [
431
564
  [
432
- "4869230832458710492613139050501069397194236257402947715710705773326736170245",
433
- "12816421563768297608770270654146762017343826741755988834647936785087288245221"
565
+ "14471888142065071281382782958750780204583311859320300053251117611975834609601",
566
+ "21436730469129810957180793723899276883659861043977115336277237822651402972650"
434
567
  ],
435
568
  [
436
- "11073344652802336528382437239976464979745376329678013840706100925574578891663",
437
- "18301439700961740613282752163964601039402055729651579152511810295028351855917"
569
+ "12134671815483061401460971926351313472095768998015505567590046606262972345606",
570
+ "12182522103530455236540896653238430557347694672470208631350018699627212167843"
438
571
  ],
439
572
  [
440
573
  "1",
@@ -443,12 +576,12 @@ var vk_delta_2 = [
443
576
  ],
444
577
  [
445
578
  [
446
- "11544253490899949675932185200523769178642714850738952025947643180461452257027",
447
- "10621957863293158040009666146187340406300006617270113507997717497098731431645"
579
+ "13908385405190960757317970925252036009769791894761756953363068981012257735159",
580
+ "5443396004119553565732772035623066322784594051319016117482037304612664713531"
448
581
  ],
449
582
  [
450
- "49583159539136224825737189586941489049516773623689603831917260806184061698",
451
- "19367886286197174023585178612664391272570357530876044259219178006444442279835"
583
+ "7952693491971973340290086005063781112666070579182591177579397309500032398151",
584
+ "2222951903387607415437785840368382110522618780807171086914436920475598995149"
452
585
  ],
453
586
  [
454
587
  "1",
@@ -457,12 +590,12 @@ var vk_delta_2 = [
457
590
  ],
458
591
  [
459
592
  [
460
- "20152340858374022568747410447956756883573367358669429548835673215400335225747",
461
- "6919690594446594824660388293695365136302375315018989420609208580270256193473"
593
+ "7839940132195146952355178362620770241816809643056324587040019650105609048932",
594
+ "1773488589187652791865678688444883762637006202264973733401143478796059566247"
462
595
  ],
463
596
  [
464
- "16509772385894559653132866836382733797078280267167499296517180188027714772070",
465
- "11674218038035204128186342498577020603218612593894174060137243207689886423596"
597
+ "14809325803961768849764967899586584580664329200871180582417984535228799191623",
598
+ "5994728489052927149244186850512435646422353844489887091765127572037304975403"
466
599
  ],
467
600
  [
468
601
  "1",
@@ -471,12 +604,12 @@ var vk_delta_2 = [
471
604
  ],
472
605
  [
473
606
  [
474
- "21672319732433045166991956534762990382763080837755725716637027617201056105221",
475
- "3246325158773052647788911340476235648870186305670446321333841273770228016262"
607
+ "12512046153695559034086723653253082259198022071585962475345129380985810571529",
608
+ "16305074860092225839285572393658030116082973338409399324682327571791603645660"
476
609
  ],
477
610
  [
478
- "5332470123606111842725808071294486759248878958039162159296029608796276205941",
479
- "1097625536358560225015844871776096852794298581720514105921271391131873344240"
611
+ "3474997222527127765405001531284334239342007770926956394825252881969982209496",
612
+ "607599331353561746153970361104975756620522710317553470868937971490837920782"
480
613
  ],
481
614
  [
482
615
  "1",
@@ -517,368 +650,906 @@ var vk_alphabeta_12 = [
517
650
  var IC = [
518
651
  [
519
652
  [
520
- "16397970494781113622140409380710514277504568512202481522431528914560031562762",
521
- "15987991045804318696151558137607070651882190737142560406194591976742796145195",
653
+ "11373228439083951786763438874368468668602473169346848394664028118071804690004",
654
+ "2392728274936215006016716287711141290248196217507457308817981648956555973842",
522
655
  "1"
523
656
  ],
524
657
  [
525
- "19175554796060272870947844726785784415291967441071791144616572094703752022787",
526
- "14708716857471570462880683190724447733812118518043273649838616424043548023127",
658
+ "21165236263460891597139480651611604342552675916374159149811150532317922022637",
659
+ "2205889866435138776852640052657720558691248366998420655585799331913362910317",
527
660
  "1"
528
661
  ],
529
662
  [
530
- "5109703116431086866657790821388182053265093586387384935734011036204399393630",
531
- "1612476077210311180626421664389270104678910550524363357381847966959374674423",
663
+ "5142950424486523257531761394520431861723450305642839631787321698382624066484",
664
+ "15189409525440736600177098582380596261100810741418368942552492853472187151232",
532
665
  "1"
533
666
  ],
534
667
  [
535
- "16028984344157742576452936855797086856968817024956118691418341585143424903639",
536
- "6905323418829609143361434077039383502192920586565275784934386988372483556465",
668
+ "15166768161845773257369241904008805578918273462394677953758522994830670545180",
669
+ "11585842449811129847758954303386730558495513604993443241740010514431580852767",
537
670
  "1"
538
671
  ],
539
672
  [
540
- "5037234187699234788733084505200789125332575456459095878140727750253994537245",
541
- "5152780378461098676484401284161685966625077837157208907964141131514955942959",
673
+ "18309269743519286170259635930367379586611051469932392196263349325096833776404",
674
+ "5169422438906150387687192335052847822734742081564185146089879581734761329500",
542
675
  "1"
543
676
  ]
544
677
  ],
545
678
  [
546
679
  [
547
- "19573269191775350978579562905764743103417752180580176229566975904395505694207",
548
- "2381522187377974692257359562587606852360557473353020907100590706767276986457",
680
+ "9858819933413872566321287453112479619079314892623028633956302548255682218967",
681
+ "8978980794620905465584214544974627507731009260328687273037813961789203643024",
549
682
  "1"
550
683
  ],
551
684
  [
552
- "3570865353993345507636525265023758855364727230473021611280650482974485897542",
553
- "3026650225811133060402545160946181194870257210933662802529138266788423022235",
685
+ "10076358326823042048333094257819800797834453359160913022846795563251044706095",
686
+ "19803968301016597767781555029004899114416563609613744105056144083718519453457",
554
687
  "1"
555
688
  ],
556
689
  [
557
- "10948020004642082805202152014062303498984706484599503419636897666877701726029",
558
- "16425328653566008388486740080892552688012772956429074139489785673820307770702",
690
+ "5163620256392555974431339018883081297271688900512864797552560460039668157036",
691
+ "14255936460639291949681319740874191007595598327244735898045668418052144766452",
559
692
  "1"
560
693
  ],
561
694
  [
562
- "20638502839000044414864636985783149953889799151008745227055624454042471377832",
563
- "977321369609271151576827768083353705509746900519279122286818202637470656742",
695
+ "14537605621065916653836904827349546258169731169287489407049733321313440129043",
696
+ "13697104552179432948127977631695913762483329167428550338828664939969524379194",
564
697
  "1"
565
698
  ],
566
699
  [
567
- "18662986393280647182646025762677321210586855801774577114215804961111542726195",
568
- "9182414327249389553719378979750943052880001176853490206379257023646169811116",
700
+ "10518837188707767707511411972157042015637825295037224566646839468274503919246",
701
+ "20859740531774787409224706405964614133972994888613078458739440328759279998775",
569
702
  "1"
570
703
  ]
571
704
  ],
572
705
  [
573
706
  [
574
- "1172653041469601107707030355715854571110526375194334139771259673595104816259",
575
- "139822645729727942447876327389754883087551266970976361358585992124005959663",
707
+ "8295798606560676055262757451569098075661634806877203374010954805416034560369",
708
+ "17823033916327857017646050340986899797748134226556967395794361949180557598708",
576
709
  "1"
577
710
  ],
578
711
  [
579
- "807568760006422352594797418374693945705914727214443753238278163089338607471",
580
- "19362805143026565781098954744725161233661862485826387437200176803022106919133",
712
+ "7863282428525672743372793899382505053760053469668593484933349016990801573594",
713
+ "18331488006684435728676028523354067877257617459721620528326034910754871664656",
581
714
  "1"
582
715
  ],
583
716
  [
584
- "9457043262004277983171082100772969689099515860060732671699192102623198243288",
585
- "19229090298682361289811638032020124933114889462217199961448135904896325661193",
717
+ "3208791308718324440134969236351379590643354353649811828887575168234009128404",
718
+ "10257765481441384707633559757593912517257134336953024015057545492286789467798",
586
719
  "1"
587
720
  ],
588
721
  [
589
- "18883326163102164343877677909116984239805709949130729675634413304023108763212",
590
- "2795333364660917174391473381893559091159208514832297547909172862364581446206",
722
+ "211202131360446365222702196868578991195656024430005775334667458570635430182",
723
+ "20847900408506094777967626429608261593000174750467914924458433091857566381170",
591
724
  "1"
592
725
  ],
593
726
  [
594
- "18012979848063967305324818138773222084850070233834350625943804711450349870116",
595
- "11425098272720529401115253745902976848228234025625773037823969253767737500443",
727
+ "12874163201492094577931796006056258188942453406826318262453514614280169978298",
728
+ "6030254908603478785612749007917517401778254879153565233016575793713168729906",
596
729
  "1"
597
730
  ]
598
731
  ],
599
732
  [
600
733
  [
601
- "5735580005765404165535708760854311053102182143614810924129912232734875728422",
602
- "12547270286864340931439010083179993915942911007015778927394042746771813715897",
734
+ "5698226291009392212509456603087660757167892215070748391710298686451794945150",
735
+ "6157973895099184288402315817801807399850034827661856468278605062696847353498",
603
736
  "1"
604
737
  ],
605
738
  [
606
- "17861179987982979247789643870162154315308943006677455616368767345181299723498",
607
- "12520843301982976970226379882714814545061255956743392202788539428471921045815",
739
+ "15141526076642728649535042926649597908183234939224775055067110611584500129001",
740
+ "4384760212321739848884344304193577499977798066111221580475869690599633722806",
608
741
  "1"
609
742
  ],
610
743
  [
611
- "709419095293140562723620898844593712074413125125086760533949250121053456086",
612
- "20254885558410038279405227446341995510955697359900050994091569463713580982280",
744
+ "4172483707996304656828832165635673373391709578552982633845732115764569616109",
745
+ "18703118242791177268087540217341214701751955061868356627779317654228486952499",
613
746
  "1"
614
747
  ],
615
748
  [
616
- "8876829807505794597615690202974184696287415186921508358861381955321520402876",
617
- "9692396410060123455009190221005078571838194435772371581970098240972280778466",
749
+ "19450300041750343627209216069867232901980973906626832440586455706765725761024",
750
+ "16059746288175455494980620176090534670137960271693908437020084988051972211964",
618
751
  "1"
619
752
  ],
620
753
  [
621
- "11541729643712807778212647011796800767186857085220105751644556558522744760878",
622
- "7117533920695574619512162711113223946930183977424569115798612426749467545080",
754
+ "20545976615820429183066000767405817531114365884543728191728740956241774393365",
755
+ "441682222632036954103668474012025602234972690129065917741930205184363335774",
623
756
  "1"
624
757
  ]
625
758
  ],
626
759
  [
627
760
  [
628
- "7022760843802757109079393624924627417630030139055381384837279305453559861026",
629
- "14368180091281110030022253036601349874026580767275461373222397498585380849175",
761
+ "5694780594861626040122686431862072023944220266576706715410778734338641503716",
762
+ "8712472904136893949123536631603982882802768648960668490262215595304129180625",
630
763
  "1"
631
764
  ],
632
765
  [
633
- "20362090815079102760789516334841889611927869342884580401494938701237909313479",
634
- "11683916255585393494577805363227207275174890005674166623110857790951330330248",
766
+ "1995786476093573828491499692373505173525336583145392096683467783999902548268",
767
+ "4926925836258627177637371690839427994092983220113811290959738100072290144384",
635
768
  "1"
636
769
  ],
637
770
  [
638
- "21680925564107543632769644144771629045807478787600735681275069556336841549441",
639
- "1554686039880869088226596836931999292372497423378849142389700108361111176287",
771
+ "3791559722445528845247206264702403543222196830021730221796818130566106209767",
772
+ "18417761581887733852915376127193234657558128442956795523445623750943914605716",
640
773
  "1"
641
774
  ],
642
775
  [
643
- "9553151402225656007352139561853210183786116738154807824913092141416366824324",
644
- "21774504332021003611111291017295441063483107704370481606906960187337904118400",
776
+ "6559711611059474660788123194641390228396298237139470196512451543415077405796",
777
+ "10546964127996233691569839986330212916129646278460480030759233831657936468012",
645
778
  "1"
646
779
  ],
647
780
  [
648
- "3472743162059388238264946309663113383560193397376658519781344886918012396958",
649
- "21850707327192737842691835772722844106916466129654852946865863108319178245521",
781
+ "19639002331873293572459373894235941550278985499149213248754356208213460657162",
782
+ "16617740711303077578250556582154106231075844388484693766277639059298286987625",
650
783
  "1"
651
784
  ]
652
785
  ],
653
786
  [
654
787
  [
655
- "14007544454490183581525584522132854274412440955138184221862170710084681738226",
656
- "9427297140302346741340407818949601657384670126565058224960470754064287232598",
788
+ "10137887164821194167739010222610234245229180897989876335252633099720202939025",
789
+ "13556557929447859629157159796541922173969485671491640178139584889369979056605",
657
790
  "1"
658
791
  ],
659
792
  [
660
- "9424279417196769259939653963004219272435595656090601392111859177294419276463",
661
- "5159704841441138198509282351301933053602549958584575945916187562678590534936",
793
+ "18001826336416230108554083436980932740049468855770464827475781769090259294957",
794
+ "10997751199060512644156045915284269336171252742084691214654620601348632057908",
662
795
  "1"
663
796
  ],
664
797
  [
665
- "5934282708091541939003757621608766449985810436411564642900129758520734711260",
666
- "6572936900512215029112509161886160866328777917297795430264727434969553346474",
798
+ "79913969765597476108932900497715672182891152853885723893501837676479334643",
799
+ "5339064100797178384601587097901074769415731437415874905101259438574150065725",
667
800
  "1"
668
801
  ],
669
802
  [
670
- "17332317297867087005634642159909283377570778576256008720318658354552654813365",
671
- "20469716791176463599463762213563135543375669917658488173798369718370224346075",
803
+ "11790468783349396195257730524002236946005794800506042451697489501177528985869",
804
+ "2058745275642252757008568790584694831559296102476273845301514491747777902",
672
805
  "1"
673
806
  ],
674
807
  [
675
- "11895216520141526042182770992519307655836464153974170586288146149131884093776",
676
- "2345310584279491449819095573562431881564998414485162753036518957549727207513",
808
+ "8569838436054970055409792695113682207394942064434307728493565465575383738014",
809
+ "13183322615830117090366962414504200812495447396240587506161350006490578304105",
677
810
  "1"
678
811
  ]
679
812
  ],
680
813
  [
681
814
  [
682
- "15084362489402846752495176069529022447007294106313236924068931072406922960482",
683
- "17446301099629553693162731281967866078816607293341610477850995414321505446665",
815
+ "3610567344582501189941093515503625764015617358100951789070992465620388014770",
816
+ "10092557495034796324189431780067983533486688638792444215776822879681822814418",
684
817
  "1"
685
818
  ],
686
819
  [
687
- "15416633712259927998995598381829216728913683600537032862643171407716059372732",
688
- "6910124994917236999728700744617337824847623550680442113266553962793201270115",
820
+ "1266136239205073111432095590744834423814511894190159459963868637184138842722",
821
+ "11374864676654295041142699893206238903356920702572230940823052344171478284171",
689
822
  "1"
690
823
  ],
691
824
  [
692
- "3240338086312503075747637551773566329150860621223080774242357236897458479365",
693
- "9706162939164863315053907226494918827393300584078535638283184502242772542378",
825
+ "7496182320409371534981231046400216671163346135425875811178408606577271153492",
826
+ "1462528704706444827904493040179558039394825924259061934534583958249261959624",
694
827
  "1"
695
828
  ],
696
829
  [
697
- "3821371825593696440611637099905775310839636477646533943959149234595561019388",
698
- "12220054708690507765048929995921680127285008492320123722886943219569231705313",
830
+ "16141406653410498360525438265360373701532563198050057601030953589813051750690",
831
+ "14018180053857919258735952789533727227462568550710713906158448711665296451356",
699
832
  "1"
700
833
  ],
701
834
  [
702
- "16484014909498227505527128570845947338361237083477117662394990633734193572570",
703
- "15639273550026538537711009501005182488432976272250651065072907504931158455474",
835
+ "511374127838749625770334668647416912569313578777284750605965725458096929607",
836
+ "17635169227434142694714979150654436187903738366738972509867831826867283825221",
704
837
  "1"
705
838
  ]
706
839
  ],
707
840
  [
708
841
  [
709
- "7289543915982634578897897440956973302403422297539950338836810160596047457980",
710
- "15177295033774438197517772642364420015492974487860823338193520175227862903717",
842
+ "10971489037448711908698715978943908500318707562175731815741960924655210840831",
843
+ "6006427343343794957952233726619963086279381477900155964075102505701412817059",
711
844
  "1"
712
845
  ],
713
846
  [
714
- "5412509155867259433944542755241941469706034032614068890113478300647952353475",
715
- "16755045912589178729548422106539306191579601567866216267685082373250783779841",
847
+ "15106747726469907788692287944434907296109850836405367650663267344226048690859",
848
+ "20492702082677255463093066854699770210633096845859381878102473765397334244292",
716
849
  "1"
717
850
  ],
718
851
  [
719
- "844425885324371282218176954530597075058496766373014736097970493596574863875",
720
- "12323478340077628423886836431146436403221716179764806398442271274194718652143",
852
+ "20017671604137050517701389289600332952924272776091967565221423262198791114477",
853
+ "19092277823744726322414075820335182617528620489612060910384627313255069537857",
721
854
  "1"
722
855
  ],
723
856
  [
724
- "19468406721151512215981453048984639951787280312568894384216547824763527840472",
725
- "6512636337641737270183934024333064400224464644359645491020358650071524340464",
857
+ "521420364975417235554366424369539937652264103736140177007376087084617840969",
858
+ "3996914661098703435279657116324643068485300222550651293916442007463647760470",
726
859
  "1"
727
860
  ],
728
861
  [
729
- "8198878215192784492258585011520207242810327647198332623948351347768018051267",
730
- "8014960150646978739731831763393714179490854831922196242908407049327430863238",
862
+ "4679024209278631191232555253447082923762821738851347894762954616029136450469",
863
+ "8497347026541846312098745702841179850966624542794907236048342704145659678775",
731
864
  "1"
732
865
  ]
733
866
  ],
734
867
  [
735
868
  [
736
- "9107882721143487446664847981273782313316003453386555221878701631432129058401",
737
- "9441695541513726822451572070540177043748046411169636568582927338148104680158",
869
+ "6504013699913689711099075581237522738280971836923813934562267069952131008789",
870
+ "9335304366750096675257996749136859439347731736177301019673263812644758419624",
738
871
  "1"
739
872
  ],
740
873
  [
741
- "8987068930426301924419900826390508311526176863992306858982473479912439758010",
742
- "1725109031239210601724581840155988791039497876559382612372874257775877974323",
874
+ "18674691980838913091347677991332234920479452203295602521958600357998616141596",
875
+ "4741568400157063102689633599777211724821079787176561142252991434247861983373",
743
876
  "1"
744
877
  ],
745
878
  [
746
- "18516110346729610211387987894593386281257834088357741109524145966500785499183",
747
- "114078214476076549461901405178268623018026929846201249476869510133510589766",
879
+ "6081240166901015395566231760209678592881994305266889564610929100038948121840",
880
+ "6726099338457783260423971895907643672217936148382337363967495541886267184664",
748
881
  "1"
749
882
  ],
750
883
  [
751
- "15915940069177053049090451855582611051242699463952201407239272373068542013292",
752
- "9373936080407194259749015269175580128112032582312467763484971165406599176646",
884
+ "1518231630037540558074208692256894068220282655237665440528391362801123567400",
885
+ "6814959623000862963349418000763326032812413890585599160227546882616685479781",
753
886
  "1"
754
887
  ],
755
888
  [
756
- "4922802633190996456945600288106639549790810185209505074744770090776471062338",
757
- "8883001810279320778962047313612748029483858862205749774979015238684570049088",
889
+ "17691964860627566514162469663546469998385191762053312278765810284413361692706",
890
+ "8886638770454932775046812264172460584356331780532116653693013498914944507850",
758
891
  "1"
759
892
  ]
760
893
  ],
761
894
  [
762
895
  [
763
- "14718035764669896417897962215694711502145567157050183561348015124983050763912",
764
- "16468329864686708461615593125586840110548434159129257976547738477143616225069",
896
+ "6051337981942268387146348592741777699916830790184591013400952407193740242722",
897
+ "14813309083853385461981331205467429689964041093530055551198131882311452944165",
765
898
  "1"
766
899
  ],
767
900
  [
768
- "19316680422470456517825967239402234468963225932355881906076897312088976727808",
769
- "3793008941035953637072065313624049788550692955904011087840457148221740889857",
901
+ "13243916879266487104491184915617833718034439141755271499342847081003561471291",
902
+ "20559308417239116672012110806712907520758637467837138402161111223933628840592",
770
903
  "1"
771
904
  ],
772
905
  [
773
- "8994123619474927749524041243795236789619386871069943230512200348341409025802",
774
- "2898455184193535874162795400065700362364113037155462125222703939894764399559",
906
+ "19581439469161095403630005805154174170687505024117879919441181595776240034092",
907
+ "17149923765379212333833055145767060687040557826663126725983709990821216291941",
775
908
  "1"
776
909
  ],
777
910
  [
778
- "7006987736985681119096469806956612323700302986805047546691419062106874738669",
779
- "6578526693577992862738197741211972861837397562647850241473856881198749597774",
911
+ "8848229792169763857187638630433883807573443546037902935946980878173551942434",
912
+ "9076584903972238461379608530218901607367189390010139393438137978954314962294",
780
913
  "1"
781
914
  ],
782
915
  [
783
- "18253609658317686864081972526657430282945609846265497350129963610508303097865",
784
- "20602454323920106770928127673050173555696255204782817307960073152139829286712",
916
+ "2838594782505936821949168913265923356032509180068328675364337511551145041706",
917
+ "12082207822506113008552336146445599677710895859529470992436917935385155760011",
785
918
  "1"
786
919
  ]
787
920
  ],
788
921
  [
789
922
  [
790
- "18387700354891683161007139598833533459740755646851082725263944626765753998128",
791
- "8496770255291121655312305725645117658510206297162207504909146686627154245846",
923
+ "7221075042299165070640763584725863160347647659704278782330562384672809305162",
924
+ "13601198331885563117630840819920283945716376381432043240564878006092148603574",
792
925
  "1"
793
926
  ],
794
927
  [
795
- "3295351580633631545204707236418977224205703294426182202748223245617942752953",
796
- "11318533876720817956139762907441156918032396007060817178042936071438547629319",
928
+ "17966363662480886855360210401838893312981368660270687414500495451106355682632",
929
+ "9255647376958236127578779968319205385670535134228597865566167852255941456992",
797
930
  "1"
798
931
  ],
799
932
  [
800
- "9798692489110933308397734193670030418121117030189402149994776248649813971130",
801
- "7253879530870754821836349446054636336833607432103959373798000294248292966203",
933
+ "8203959912436866237932353632392355578980349384400645301966843912631449233592",
934
+ "20011411139499301504584228175724552542130947288854633651397978547089429982167",
802
935
  "1"
803
936
  ],
804
937
  [
805
- "21808645514001764351825515375665639285586999794992628373968527911077248645185",
806
- "2859748802987042398453158245958377568437550705999358391809538153774651114865",
938
+ "1820524505387064465309460998360793499775868154592043137422833944836520606454",
939
+ "1959603910351136409471920269505238383870634384371099582856753558856496902512",
807
940
  "1"
808
941
  ],
809
942
  [
810
- "4373537692781319117201803895634857716202697229097770645380222493663057011429",
811
- "21723556418902236605356947828522543021755681613733490227407492902239152334538",
943
+ "4198694051360120490653446337443734423586650228488283685090646499268901675490",
944
+ "21526524841382152147992421724785801038770676270240714297859552516739773492697",
812
945
  "1"
813
946
  ]
814
947
  ],
815
948
  [
816
949
  [
817
- "4147129560663007063799754603731275683761368247704376766576071776957227165800",
818
- "7032402220603422034618210155106646820962552774510253688945919060625670415308",
950
+ "11332498437023113295175458390938230450212523402749978995184951126111215368275",
951
+ "7016084735586326731105326496042171157633237979413962565940384222454876829020",
819
952
  "1"
820
953
  ],
821
954
  [
822
- "5241022678363371404039324538224070321660623527603509392150146296843642044363",
823
- "5281273397025328620822441453790518717375265972202147684745427714882287252791",
955
+ "5013383022618445727921740844767853050438275291216971327851792785650669011741",
956
+ "528618354489883480125467549183593651465882051681270315858578353218107644734",
824
957
  "1"
825
958
  ],
826
959
  [
827
- "8109626675067152219533782552336308649905522111608563670382254454484448073029",
828
- "4696661232179595878220108186097206302552300846640109174608389689072223809776",
960
+ "6932115924239435517832880685428272633342271017032662880345701095160428372300",
961
+ "5520601709801507363146277496110244143378961419982733100311341395981490633588",
829
962
  "1"
830
963
  ],
831
964
  [
832
- "13974026846148052806722306435446895222317781098029808723550029071117080027133",
833
- "14451415757463182353662034231421738047130904367363697865823311429455557043904",
965
+ "434079293392651414251114604226309649137438107252197032381696615267775897288",
966
+ "18623332313653972273799518879682220458729835518812577091590130632605360081933",
834
967
  "1"
835
968
  ],
836
969
  [
837
- "9490728148230530026163178051838213576627639298618884515939110001242292217290",
838
- "227687333556127166330064214209948378192130717415165040791158610964406937909",
970
+ "16981203870828204556408891045732712151034600645789784935821356391746701607849",
971
+ "10839961472824284602079430847341654099878245597092020402049973455392611362164",
839
972
  "1"
840
973
  ]
841
- ]
842
- ];
843
- var verificationKeys = {
844
- protocol: protocol,
845
- curve: curve,
846
- nPublic: nPublic,
847
- vk_alpha_1: vk_alpha_1,
848
- vk_beta_2: vk_beta_2,
849
- vk_gamma_2: vk_gamma_2,
850
- vk_delta_2: vk_delta_2,
851
- vk_alphabeta_12: vk_alphabeta_12,
852
- IC: IC
853
- };
854
-
855
- /**
856
- * Verifies whether a Semaphore proof is valid. Depending on the depth of the tree used to
857
- * generate the proof, a different verification key will be used.
858
- * @param proof The Semaphore proof.
859
- * @returns True if the proof is valid, false otherwise.
860
- */
861
- function verifyProof(proof) {
862
- return __awaiter(this, void 0, void 0, function () {
863
- var merkleTreeDepth, merkleTreeRoot, nullifier, message, scope, points, verificationKey;
864
- return __generator(this, function (_a) {
865
- requireDefined(proof, "proof");
866
- requireObject(proof, "proof");
867
- merkleTreeDepth = proof.merkleTreeDepth, merkleTreeRoot = proof.merkleTreeRoot, nullifier = proof.nullifier, message = proof.message, scope = proof.scope, points = proof.points;
868
- requireNumber(merkleTreeDepth, "proof.merkleTreeDepth");
869
- requireString(merkleTreeRoot, "proof.merkleTreeRoot");
870
- requireString(nullifier, "proof.nullifier");
871
- requireString(message, "proof.message");
872
- requireString(scope, "proof.scope");
873
- requireArray(points, "proof.points");
874
- // TODO: support all tree depths after trusted-setup.
875
- if (merkleTreeDepth < 1 || merkleTreeDepth > 12) {
876
- throw new TypeError("The tree depth must be a number between 1 and 12");
877
- }
878
- verificationKey = __assign(__assign({}, verificationKeys), { vk_delta_2: verificationKeys.vk_delta_2[merkleTreeDepth - 1], IC: verificationKeys.IC[merkleTreeDepth - 1] });
879
- return [2 /*return*/, groth16.verify(verificationKey, [merkleTreeRoot, nullifier, hash(message), hash(scope)], unpackGroth16Proof(points))];
880
- });
881
- });
974
+ ],
975
+ [
976
+ [
977
+ "10532694937633872732615221785339191399998813277853598590284977223084586265406",
978
+ "18569891906743239236657790847950300608514739578359676359176841830736581922673",
979
+ "1"
980
+ ],
981
+ [
982
+ "5204330292569275288250153279775499240677764904182920564782936399035494759139",
983
+ "14869136923170104943599081137392440247136712268832152014557322866069417673392",
984
+ "1"
985
+ ],
986
+ [
987
+ "16609139756845639786750046885223171804867949172280450359139781662901766868597",
988
+ "7367747621397764356413880321758620580129087430671669202576071458908338963767",
989
+ "1"
990
+ ],
991
+ [
992
+ "18157171842959734937470210968648189999811759058976098804831380331978049484161",
993
+ "14612065821098816890897211924691530301447930045836897440401478111363414764157",
994
+ "1"
995
+ ],
996
+ [
997
+ "3678851330338811698871212394774190592148694554830208940152772420325429207592",
998
+ "1261073646471879421850354957670569129175034189935008550219832398890385831603",
999
+ "1"
1000
+ ]
1001
+ ],
1002
+ [
1003
+ [
1004
+ "18128060449612109642142496525936963279825759724692188014181733764391545826501",
1005
+ "6412545369924963430376339636555328095118045874871394681127600419621347748574",
1006
+ "1"
1007
+ ],
1008
+ [
1009
+ "9178419128141821432265215706509797566711681420667049266964463482093364121974",
1010
+ "12757958736224258162889762688354106158996770313065275427510212926355720788806",
1011
+ "1"
1012
+ ],
1013
+ [
1014
+ "21697843782274732041256438596018216848529426578597975296740068185709056950695",
1015
+ "9641329027897013830146943496858364657344657408442613002988204006109548012670",
1016
+ "1"
1017
+ ],
1018
+ [
1019
+ "10157462635214395067310714425532743819094195406756516970796212542533337329791",
1020
+ "6756552332702121619038049584093175387814338143922613739401669728656840170909",
1021
+ "1"
1022
+ ],
1023
+ [
1024
+ "9276003791014657516094759987195269349958840151064358512535335441437526577719",
1025
+ "17177335596130235736675313878734353760926293469390853206840228086544227127243",
1026
+ "1"
1027
+ ]
1028
+ ],
1029
+ [
1030
+ [
1031
+ "4691701433964504850819405353426875432448611177084640879664399563684106977201",
1032
+ "6997026109056305304958456212770850719737661180940807196442278723629505898836",
1033
+ "1"
1034
+ ],
1035
+ [
1036
+ "21862540916562048400075167198394269266629631981308358022452061330955535980535",
1037
+ "20203136947717696850833432049217389834551585785220431602620838951128875924332",
1038
+ "1"
1039
+ ],
1040
+ [
1041
+ "6166688558584392552732686802822787347815166465668907688252438119180905848686",
1042
+ "1515830657197384709067854833370847128665474205967014377229527531272518040510",
1043
+ "1"
1044
+ ],
1045
+ [
1046
+ "9783110166666159719262248155776421656845594701278593694743917659000214566949",
1047
+ "14498343612651837182986000137068086166435021811504906980633109697812438152688",
1048
+ "1"
1049
+ ],
1050
+ [
1051
+ "7451534988011232583608528483663880320228268776552285912767998924492654022315",
1052
+ "14389118774297616531519885127100101489071211382178872997387065906551438715617",
1053
+ "1"
1054
+ ]
1055
+ ],
1056
+ [
1057
+ [
1058
+ "17586200399272141670685001491641162521294196727236050999778548238215046166017",
1059
+ "281329337697491075931159352771449215426528517554332825727307529327678211850",
1060
+ "1"
1061
+ ],
1062
+ [
1063
+ "13587768455979634277266588196077051473493752291227370910424884771755142551393",
1064
+ "12132714832736811067697324782216133875324337588127071061942622831539088199516",
1065
+ "1"
1066
+ ],
1067
+ [
1068
+ "5424242637034241045316293106740200282134858230716641545833281265555664814058",
1069
+ "4099977807866045222441365441679488428090978308192769063472099506097446172444",
1070
+ "1"
1071
+ ],
1072
+ [
1073
+ "20991094374514370732056452708323057419772785522538068181419368097559064487764",
1074
+ "17494034245166301533444525935585362973100718889755879021217726039762737332309",
1075
+ "1"
1076
+ ],
1077
+ [
1078
+ "21513377844056886482755561165035200163740875639723610667981589251852648290497",
1079
+ "9065101624205101464784359744884631484276281653365096468139033730232168384170",
1080
+ "1"
1081
+ ]
1082
+ ],
1083
+ [
1084
+ [
1085
+ "20984349344022619370458450579312578055808523135369866643465670885076660164806",
1086
+ "418264638272070574199167297855020670696708537402223370097894154915338824856",
1087
+ "1"
1088
+ ],
1089
+ [
1090
+ "21427513166561351336822904548010728579322568176247623689193394481261310743729",
1091
+ "17218242846472515735641714187716984107651753683015981795233490838798663005098",
1092
+ "1"
1093
+ ],
1094
+ [
1095
+ "21103921212558832170255972733170723908475938955264614598038505509464559335152",
1096
+ "10402439116707708662126524824676626448483957064152280120730850351913612702748",
1097
+ "1"
1098
+ ],
1099
+ [
1100
+ "17902409153345924357919108278878752639341210912451068626743802458423268435162",
1101
+ "17156991212231172773517848502387153524430619870630373199856683436943875771004",
1102
+ "1"
1103
+ ],
1104
+ [
1105
+ "10646416238055467241386416360395574804199761155307993872061057698215892822922",
1106
+ "9567771666871218298332873263950533751702773388778384953522740303362056866931",
1107
+ "1"
1108
+ ]
1109
+ ],
1110
+ [
1111
+ [
1112
+ "271501919920560807144690888833558109667061334163559001274202634455325808979",
1113
+ "14794481401072540343622539363544947515055760970979041148841701973173121160867",
1114
+ "1"
1115
+ ],
1116
+ [
1117
+ "16241413887148836912852878034655069636111245133456457252704664072852738020971",
1118
+ "4616891037946851677520624578755099324972320662835976914889099357030429177473",
1119
+ "1"
1120
+ ],
1121
+ [
1122
+ "3608927726708508538381205233592212299638621918906539441231152707366248326730",
1123
+ "20453218571243012416227036764366636460616051978680116597236464784651135817662",
1124
+ "1"
1125
+ ],
1126
+ [
1127
+ "21663166035926867176571290287267617498655213253914511123571589436615865760399",
1128
+ "6820544505512911561421102139415733480016159315919965296282806777526762552747",
1129
+ "1"
1130
+ ],
1131
+ [
1132
+ "1241495087165602740391581058509323079765010896996258108944819093246488858318",
1133
+ "8124857698166498408579282540958166224847900470279217858870563626568969324640",
1134
+ "1"
1135
+ ]
1136
+ ],
1137
+ [
1138
+ [
1139
+ "12006824962639473646619675695320713559632292589665720351249509600690404062910",
1140
+ "13276706600670868735848192943347104623934461144298261448190397129714774342173",
1141
+ "1"
1142
+ ],
1143
+ [
1144
+ "18264760419082021650494509547780257751527429714087988777838583561869870161497",
1145
+ "16206621246021864196868319303736926716510401444517967423381020552156354105325",
1146
+ "1"
1147
+ ],
1148
+ [
1149
+ "1711726122386296242553570383485323505029934793448519517467561601648909492476",
1150
+ "424608816752490157168394436055547341686841853472229245627510525503910492101",
1151
+ "1"
1152
+ ],
1153
+ [
1154
+ "15415617655332841541287596609058338190575210759281068404604554729079985521497",
1155
+ "18478290351885872204755929772605378173281926792205081562405194750294909414375",
1156
+ "1"
1157
+ ],
1158
+ [
1159
+ "1332104917854036528393448566746555920300729960761914526841432630705030394652",
1160
+ "4875500610885916981959937005615629475085341806101091219174051361012752723259",
1161
+ "1"
1162
+ ]
1163
+ ],
1164
+ [
1165
+ [
1166
+ "1105636691459466684354861615642532458695547504319491829198944901848354002466",
1167
+ "12426506081436950451531584361567271522327297423292681691257507245865800741808",
1168
+ "1"
1169
+ ],
1170
+ [
1171
+ "21744454903360799020170340278186587365704908765309976031542813238813825084489",
1172
+ "11372248299010487313898881702904101518095247949018830132141430386679279269802",
1173
+ "1"
1174
+ ],
1175
+ [
1176
+ "21355163712164844869530150285034119671090568151924216195709912115114996041497",
1177
+ "5914269246724008463378274526282819036767424774567321843447592335886063108576",
1178
+ "1"
1179
+ ],
1180
+ [
1181
+ "11757178117438262829005662514573037965023628709384135799022098340275235227691",
1182
+ "12324099857879926506512664547633107100872133202763933183968148074461422444945",
1183
+ "1"
1184
+ ],
1185
+ [
1186
+ "19030167447913285073203707487614824348154933215474799593455300093917690498309",
1187
+ "10756138991756861027792433599825283466492898786698456971350016301834120358130",
1188
+ "1"
1189
+ ]
1190
+ ],
1191
+ [
1192
+ [
1193
+ "5818698629865247565077962768609742022241069606093835632689725123770908238374",
1194
+ "10032230959981143208283946841992758493223859540652919348005062379046462012203",
1195
+ "1"
1196
+ ],
1197
+ [
1198
+ "11522228664628777947230879504212386210128576797203829606594158165912469543023",
1199
+ "13272285677937114294437486001063514791939240537126238704993220742500063989359",
1200
+ "1"
1201
+ ],
1202
+ [
1203
+ "8471655692275117723910962427858752915984310638982095612617085072826817856111",
1204
+ "4389133967757502017802977428616053155133503096651056259096018766643340643444",
1205
+ "1"
1206
+ ],
1207
+ [
1208
+ "14833683426056097377459837308704611274315245609945506612281500340707955071545",
1209
+ "21735047966739217600224642583481593664121921255631091231639049365846545339271",
1210
+ "1"
1211
+ ],
1212
+ [
1213
+ "7278464060898751306868720821317869528105334779561787036194323452374165351865",
1214
+ "6039871164511288641970658426390882746101314533737081850970345002118723705339",
1215
+ "1"
1216
+ ]
1217
+ ],
1218
+ [
1219
+ [
1220
+ "3562081668776383619644089086241623016377051210290983257053604147762967187048",
1221
+ "4553365292908760204444921066083280974740968313355524357160308575327815731986",
1222
+ "1"
1223
+ ],
1224
+ [
1225
+ "9612674806513362915023578944934656419542782185316845654919222232866782079973",
1226
+ "2856039308549766546769489569358317466998141815061340660074603482372423614916",
1227
+ "1"
1228
+ ],
1229
+ [
1230
+ "17144423089194150938664044057037571466137059216126551322826296560818480520188",
1231
+ "7777587218396926909905079292812226413674978129026320051535300425275288555883",
1232
+ "1"
1233
+ ],
1234
+ [
1235
+ "13348600530906896077492067999286804922009589548263122827764204432718850414877",
1236
+ "3504452333162729816257605356258771813994176063517472700088677353335099652978",
1237
+ "1"
1238
+ ],
1239
+ [
1240
+ "9271993074172346116417190887626439840621996383820554885726881799780298924983",
1241
+ "19415901227000992567609415633317148788461729474913900357094507534384428975572",
1242
+ "1"
1243
+ ]
1244
+ ],
1245
+ [
1246
+ [
1247
+ "7693170882539863875701602528545342311434468852163389086171388853464572270633",
1248
+ "3908303967241020812745991584454294385640133430208468916543029049706292930305",
1249
+ "1"
1250
+ ],
1251
+ [
1252
+ "14200361022064175872846252914915938901018673724842857113422899538373627654493",
1253
+ "1887985090111673428008310095306101841985601166058324952496388205310462613383",
1254
+ "1"
1255
+ ],
1256
+ [
1257
+ "11573157656525163647952907768764423420183350046483835223957092582860133547451",
1258
+ "9173604865670358445639146193904526160076171763657483567287015999631297551260",
1259
+ "1"
1260
+ ],
1261
+ [
1262
+ "8178722693917751358075016256308930447648179998714325218415150487090497217243",
1263
+ "16479808796736995387921450370830080669813035631409450618705788666753274143975",
1264
+ "1"
1265
+ ],
1266
+ [
1267
+ "20533543720941262967922843401527010251494136604304116450329194230919992456714",
1268
+ "21738708027542248258448002258354036928076950567990414271901435012481250510866",
1269
+ "1"
1270
+ ]
1271
+ ],
1272
+ [
1273
+ [
1274
+ "705729203963801077445366659807159942042515811344776106038944684242779323077",
1275
+ "8198640129213076396347058165827729949570109420499123900233622693161948493955",
1276
+ "1"
1277
+ ],
1278
+ [
1279
+ "17567949859381263201697894705370978555666635560577878390586549308344241574720",
1280
+ "16953629262080155066207979848352607491010984453917718285923448228568338552102",
1281
+ "1"
1282
+ ],
1283
+ [
1284
+ "16571340903058171078202337397668804978258511905425857983395617262853832093164",
1285
+ "8200869898550007995855767338315600003217265793696813934354774140864404387075",
1286
+ "1"
1287
+ ],
1288
+ [
1289
+ "19245130308508431368191001431651810775716975255435369252757393063712397235401",
1290
+ "19295429264588775090334360243373041256684104838925789132682844828445374541241",
1291
+ "1"
1292
+ ],
1293
+ [
1294
+ "8244640034562580123950327146088236084020067479873470678893810764954021793820",
1295
+ "6071779329882466654134795663117452253106971568263743258793999061311754781283",
1296
+ "1"
1297
+ ]
1298
+ ],
1299
+ [
1300
+ [
1301
+ "12211353780794522017482442205152184029453185156252615419956272689806996867522",
1302
+ "11858951133579915446931127734829983281450719684822534749146423795831786572024",
1303
+ "1"
1304
+ ],
1305
+ [
1306
+ "18699083494838544659449334875917956720534604312394484877250282743052866694",
1307
+ "749778821409550859537528691118971534871459292764959826137658158363222566834",
1308
+ "1"
1309
+ ],
1310
+ [
1311
+ "2909597392070263345393422292436111503720531353687130181723707126400751447693",
1312
+ "12217177777420376281128847110380606163261839348068116179245513037333903388087",
1313
+ "1"
1314
+ ],
1315
+ [
1316
+ "6920254660239140919505113388774145966103232605095540610909080767264160069300",
1317
+ "9696367212878183305057911542364374139977595200010754215085255727487778572962",
1318
+ "1"
1319
+ ],
1320
+ [
1321
+ "14968323162826489282828176469636555044919206060463682988985750923782404039777",
1322
+ "11757071201913114247059598621424329188966752420483410843397919162379753756933",
1323
+ "1"
1324
+ ]
1325
+ ],
1326
+ [
1327
+ [
1328
+ "13128279467779141267539556181844646897000953259054467200148815485804849945589",
1329
+ "19182542610668848202527767345596590904881280203255613775118909904478382941801",
1330
+ "1"
1331
+ ],
1332
+ [
1333
+ "12622787765544530515623619382100437898246101834816376149292007743211956407286",
1334
+ "12570391550772615838335361042568121892906867634448929202232001812492234390257",
1335
+ "1"
1336
+ ],
1337
+ [
1338
+ "5735316164124731332271878247418185434228086026647700113833855177940542823181",
1339
+ "9649474108395394754402030685603045386825744478341882098839846461266003368756",
1340
+ "1"
1341
+ ],
1342
+ [
1343
+ "16190069071551003451113144390700917484497316557096684922619605534369669949534",
1344
+ "10681321343942329435795471710031949263678373347092770298132700842902513672840",
1345
+ "1"
1346
+ ],
1347
+ [
1348
+ "13863872929961730606993556753801300020729351590807975827100825368353540990573",
1349
+ "11931534405924761866343686993715271905704590108489876499851774273982957911423",
1350
+ "1"
1351
+ ]
1352
+ ],
1353
+ [
1354
+ [
1355
+ "454088003829163771011170852736324196796734198039551149147118112028488218145",
1356
+ "19539522144446103612355666512646927077463791742130426065863787086655625062176",
1357
+ "1"
1358
+ ],
1359
+ [
1360
+ "9677517649080056520842169551325292586844311652869297540972831144430102239541",
1361
+ "12171721941568335982623293519100425613310698565606469058956892831634461540059",
1362
+ "1"
1363
+ ],
1364
+ [
1365
+ "15037699242073552386046516617138931456404909452736126928849871092088157606104",
1366
+ "2403475304123870051310189713205959145472986292698418380091083485671020127630",
1367
+ "1"
1368
+ ],
1369
+ [
1370
+ "127899593359332180821632671011918317356219506177015610133494845926153175595",
1371
+ "18684733307620435559282273679266280240730732702398400109727422417551972403102",
1372
+ "1"
1373
+ ],
1374
+ [
1375
+ "17130978638728591547347686801647449269492555647218567636544356715497286682290",
1376
+ "14514080855160049012448903996874963632870196574887173768510902774625324658544",
1377
+ "1"
1378
+ ]
1379
+ ],
1380
+ [
1381
+ [
1382
+ "5855924544364003112712450030145237149424995112678688873039358008205969147611",
1383
+ "15570549396870292677660853760591267003520405786863190676970087082855555878636",
1384
+ "1"
1385
+ ],
1386
+ [
1387
+ "14821240964410715386910463283745689087244285662861027299124772223732179089302",
1388
+ "15446473065604291444037235422131957717379131935322344411928007251149202158658",
1389
+ "1"
1390
+ ],
1391
+ [
1392
+ "586582749011680966506460208877749670972200690716863059163322868400282852300",
1393
+ "6765443750336920009167305874738739551390685770965140484130502003990191861016",
1394
+ "1"
1395
+ ],
1396
+ [
1397
+ "11516588183751421185156362409787679404091107770536300994982153030408504091807",
1398
+ "9422281521245157165519221572217222566067379888854607677340273485846988818889",
1399
+ "1"
1400
+ ],
1401
+ [
1402
+ "11972785834549950434085949313031360662160524117252689786653411157712853588295",
1403
+ "1251548247225430075659521219630231228104532865302157324337575228144557232422",
1404
+ "1"
1405
+ ]
1406
+ ],
1407
+ [
1408
+ [
1409
+ "6083168185688688297667869638715177381772180226443830560342282797830104869062",
1410
+ "926194281246578915103720926341497520082595828680525575284123365838007044551",
1411
+ "1"
1412
+ ],
1413
+ [
1414
+ "9409122852531801098754556536729028548924539102103420345160677794564194221020",
1415
+ "20542245913396046089533736519215869670909083018889617904362139603473474391693",
1416
+ "1"
1417
+ ],
1418
+ [
1419
+ "16873198639240289433836743385124757917190871707428690095953534423420502659893",
1420
+ "6588241760722454601615602907791715854928448488066342428651422663075975107816",
1421
+ "1"
1422
+ ],
1423
+ [
1424
+ "19842357292988471204463611705572234531158701273234975255676630503476698710155",
1425
+ "14693625717448698302951456188963654748379774732579848481403435079923870603157",
1426
+ "1"
1427
+ ],
1428
+ [
1429
+ "20241432824683494982737262054148903653340519392174437358036298330854555784611",
1430
+ "5945081237575571782036580504962786649821981413555607621373828735238630355652",
1431
+ "1"
1432
+ ]
1433
+ ],
1434
+ [
1435
+ [
1436
+ "20768578042859563979294333002563065924476840206018011719077318477769915880402",
1437
+ "2001786654254515377677955109354751436919751171611935922531378122392365944293",
1438
+ "1"
1439
+ ],
1440
+ [
1441
+ "2298051095199584549599791615579815921675635758326996304424561508720678758962",
1442
+ "15610877986863106190281569495837881819071964316157027243989237288310023404773",
1443
+ "1"
1444
+ ],
1445
+ [
1446
+ "21503958051574416294837474683907975773972588915544597427974161349505807601206",
1447
+ "16176536100016079147853297185775543699660096471098091832015791823791903209774",
1448
+ "1"
1449
+ ],
1450
+ [
1451
+ "3606739889472294515277184850587920470749374877850756839089044653095424769194",
1452
+ "14664144387169595605857061033949425545099119522415523292224065111113602111904",
1453
+ "1"
1454
+ ],
1455
+ [
1456
+ "19699387660834749955063410769084991520255142011324093146157127237115274380578",
1457
+ "4331670811250121546993058308579590495468093227852181043972677680581964769228",
1458
+ "1"
1459
+ ]
1460
+ ],
1461
+ [
1462
+ [
1463
+ "10631178625335401501457304969878852001559776191683447428857609753454937038299",
1464
+ "11675745006421997275450756626998030285194831397590498324078767720340123952646",
1465
+ "1"
1466
+ ],
1467
+ [
1468
+ "1759441622054752159360583922123536313476013806215300533220440946452846159126",
1469
+ "3059329356920789196856680267147718801714171797250645043538678427768342056591",
1470
+ "1"
1471
+ ],
1472
+ [
1473
+ "1809413652255811383678263677090386586529134039718623375196604927184100692799",
1474
+ "7533217575609552382385270158875791232330359159976337796303987871112517604844",
1475
+ "1"
1476
+ ],
1477
+ [
1478
+ "7704646641054955393597890923317433079643657350033170553840404545002600772539",
1479
+ "19522826015127415513569513500635678903639248861485847260009074714535026926155",
1480
+ "1"
1481
+ ],
1482
+ [
1483
+ "9396801995941988552875859512580723873116085524385365053682345361229348266222",
1484
+ "8122885501816310710455960482459104382732335722838233409931476783790044860185",
1485
+ "1"
1486
+ ]
1487
+ ],
1488
+ [
1489
+ [
1490
+ "16304360708182088008313907877667665892976553429106710412375369419780233976442",
1491
+ "10460941404478613816427928998514834125407907547113907613807191273719986187223",
1492
+ "1"
1493
+ ],
1494
+ [
1495
+ "20051043271541513424021087402997604909963063035826832503174487686321968961776",
1496
+ "13432165841378395910455231038520827433713426813680931204822379789609795102053",
1497
+ "1"
1498
+ ],
1499
+ [
1500
+ "18762866968227660024720719389346562423430884054824643430326826128394380607310",
1501
+ "17713599719831815773421839749444223685540274101601039260510841144941870261910",
1502
+ "1"
1503
+ ],
1504
+ [
1505
+ "1883157762896148563929088253054113240995256206097667755269496270918239318411",
1506
+ "10985354533025938485092599481185428202087973711120611094551172933738810516920",
1507
+ "1"
1508
+ ],
1509
+ [
1510
+ "670487064764400248463858966885752477833093767820377805346079091001272760417",
1511
+ "8502840196732756246718058003393498205431869135787193347957619883686320532648",
1512
+ "1"
1513
+ ]
1514
+ ]
1515
+ ];
1516
+ var verificationKeys = {
1517
+ protocol: protocol,
1518
+ curve: curve,
1519
+ nPublic: nPublic,
1520
+ vk_alpha_1: vk_alpha_1,
1521
+ vk_beta_2: vk_beta_2,
1522
+ vk_gamma_2: vk_gamma_2,
1523
+ vk_delta_2: vk_delta_2,
1524
+ vk_alphabeta_12: vk_alphabeta_12,
1525
+ IC: IC
1526
+ };
1527
+
1528
+ /**
1529
+ * Verifies whether a Semaphore proof is valid. Depending on the depth of the tree used to
1530
+ * generate the proof, a different verification key will be used.
1531
+ * @param proof The Semaphore proof.
1532
+ * @returns True if the proof is valid, false otherwise.
1533
+ */
1534
+ async function verifyProof(proof) {
1535
+ requireDefined(proof, "proof");
1536
+ requireObject(proof, "proof");
1537
+ const { merkleTreeDepth, merkleTreeRoot, nullifier, message, scope, points } = proof;
1538
+ requireNumber(merkleTreeDepth, "proof.merkleTreeDepth");
1539
+ requireString(merkleTreeRoot, "proof.merkleTreeRoot");
1540
+ requireString(nullifier, "proof.nullifier");
1541
+ requireString(message, "proof.message");
1542
+ requireString(scope, "proof.scope");
1543
+ requireArray(points, "proof.points");
1544
+ if (merkleTreeDepth < MIN_DEPTH || merkleTreeDepth > MAX_DEPTH) {
1545
+ throw new TypeError(`The tree depth must be a number between ${MIN_DEPTH} and ${MAX_DEPTH}`);
1546
+ }
1547
+ const verificationKey = {
1548
+ ...verificationKeys,
1549
+ vk_delta_2: verificationKeys.vk_delta_2[merkleTreeDepth - 1],
1550
+ IC: verificationKeys.IC[merkleTreeDepth - 1]
1551
+ };
1552
+ return groth16.verify(verificationKey, [merkleTreeRoot, nullifier, hash(message), hash(scope)], unpackGroth16Proof(points));
882
1553
  }
883
1554
 
884
1555
  export { generateProof, verifyProof };