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

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