@semaphore-protocol/proof 3.15.1 → 4.0.0-alpha

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.
@@ -0,0 +1,522 @@
1
+ {
2
+ "protocol": "groth16",
3
+ "curve": "bn128",
4
+ "nPublic": 4,
5
+ "vk_alpha_1": [
6
+ "20491192805390485299153009773594534940189261866228447918068658471970481763042",
7
+ "9383485363053290200918347156157836566562967994039712273449902621266178545958",
8
+ "1"
9
+ ],
10
+ "vk_beta_2": [
11
+ [
12
+ "6375614351688725206403948262868962793625744043794305715222011528459656738731",
13
+ "4252822878758300859123897981450591353533073413197771768651442665752259397132"
14
+ ],
15
+ [
16
+ "10505242626370262277552901082094356697409835680220590971873171140371331206856",
17
+ "21847035105528745403288232691147584728191162732299865338377159692350059136679"
18
+ ],
19
+ ["1", "0"]
20
+ ],
21
+ "vk_gamma_2": [
22
+ [
23
+ "10857046999023057135944570762232829481370756359578518086990519993285655852781",
24
+ "11559732032986387107991004021392285783925812861821192530917403151452391805634"
25
+ ],
26
+ [
27
+ "8495653923123431417604973247489272438418190587263600148770280649306958101930",
28
+ "4082367875863433681332203403145435568316851327593401208105741076214120093531"
29
+ ],
30
+ ["1", "0"]
31
+ ],
32
+ "vk_delta_2": [
33
+ [
34
+ [
35
+ "16293410697967515504861065986355060225819302510590370360517024529684437085892",
36
+ "563562783592406106461234396505774794044312891062077216951605541624542949349"
37
+ ],
38
+ [
39
+ "10971164449179097832515056670594147898894418081309026322805549037082528587660",
40
+ "718666295291146285397081607986058864287612968465033527894198098928522749430"
41
+ ],
42
+ ["1", "0"]
43
+ ],
44
+ [
45
+ [
46
+ "8087990171976409378525016197066789089596692733769545253942804888352233244331",
47
+ "6925326031648378844726759441690273332175949886518827719224741736678266471462"
48
+ ],
49
+ [
50
+ "15618724583521291135890928658458637081479213437530496494788106479523123480134",
51
+ "10115242383701466910539784663900956956505212347433548599529944880163612117847"
52
+ ],
53
+ ["1", "0"]
54
+ ],
55
+ [
56
+ [
57
+ "7699563868952902688273782470023919811229667532027732585467624469008534197561",
58
+ "7699900854308622607636895140107457213471038801393300399043779958706267744510"
59
+ ],
60
+ [
61
+ "15390497513810955087868026868634948499789494261604405008298272598684585331879",
62
+ "8605006500231713390564760089884965869867818332514275728271802101761117177706"
63
+ ],
64
+ ["1", "0"]
65
+ ],
66
+ [
67
+ [
68
+ "2561989864654045354260435368824127763249975523256535586391379695256700207392",
69
+ "9243647856126339588200227750973237380809101852206502177952556679680468734813"
70
+ ],
71
+ [
72
+ "18264861452415533737686303596832882667852638121244187636443702248458018416929",
73
+ "1308059969166897152269078839315249187046718124106168932020710683189419160756"
74
+ ],
75
+ ["1", "0"]
76
+ ],
77
+ [
78
+ [
79
+ "21307904757295729894500052152251151076177124351059746872940558537429181679313",
80
+ "12554869896570109663558999106053541183136083706372178136870048170147558661370"
81
+ ],
82
+ [
83
+ "11194665041440536766843756304212299788817698936187605770131686430625103172681",
84
+ "13447792161027167738515744919555311619301071111923271126707713963292614473975"
85
+ ],
86
+ ["1", "0"]
87
+ ],
88
+ [
89
+ [
90
+ "11706947284665470438085734275890584651957983546291282232304205898476084974953",
91
+ "6841243505372324564043525805425666596605335849634400049689614462868641599622"
92
+ ],
93
+ [
94
+ "2674642993002069213220912300725195098434544703961492590713058622848310061455",
95
+ "8134420958061302592465696766566203845441024351721660066575866529624350946525"
96
+ ],
97
+ ["1", "0"]
98
+ ],
99
+ [
100
+ [
101
+ "14347453588631116202352669855016330076170847581618919999243717038742915487177",
102
+ "16222168105567777760688113388791710300819703656136395550799888633073848798053"
103
+ ],
104
+ [
105
+ "5558376366205739247464101507558623934779699722049069497418188353860561540238",
106
+ "1551977748690015855031859376084014992267998166583511614295554470740621685494"
107
+ ],
108
+ ["1", "0"]
109
+ ],
110
+ [
111
+ [
112
+ "13742810756711208866393269789950822956196651488331544225304557369739035583007",
113
+ "8039261311473792027408130340265108867783988336829815266149766357424909552805"
114
+ ],
115
+ [
116
+ "1426283383724925735279168010737048062664480092231550167387716017170422478271",
117
+ "5732605965679620193714116075516176231919315490749768120227762344555213912038"
118
+ ],
119
+ ["1", "0"]
120
+ ],
121
+ [
122
+ [
123
+ "4869230832458710492613139050501069397194236257402947715710705773326736170245",
124
+ "12816421563768297608770270654146762017343826741755988834647936785087288245221"
125
+ ],
126
+ [
127
+ "11073344652802336528382437239976464979745376329678013840706100925574578891663",
128
+ "18301439700961740613282752163964601039402055729651579152511810295028351855917"
129
+ ],
130
+ ["1", "0"]
131
+ ],
132
+ [
133
+ [
134
+ "11544253490899949675932185200523769178642714850738952025947643180461452257027",
135
+ "10621957863293158040009666146187340406300006617270113507997717497098731431645"
136
+ ],
137
+ [
138
+ "49583159539136224825737189586941489049516773623689603831917260806184061698",
139
+ "19367886286197174023585178612664391272570357530876044259219178006444442279835"
140
+ ],
141
+ ["1", "0"]
142
+ ],
143
+ [
144
+ [
145
+ "20152340858374022568747410447956756883573367358669429548835673215400335225747",
146
+ "6919690594446594824660388293695365136302375315018989420609208580270256193473"
147
+ ],
148
+ [
149
+ "16509772385894559653132866836382733797078280267167499296517180188027714772070",
150
+ "11674218038035204128186342498577020603218612593894174060137243207689886423596"
151
+ ],
152
+ ["1", "0"]
153
+ ],
154
+ [
155
+ [
156
+ "21672319732433045166991956534762990382763080837755725716637027617201056105221",
157
+ "3246325158773052647788911340476235648870186305670446321333841273770228016262"
158
+ ],
159
+ [
160
+ "5332470123606111842725808071294486759248878958039162159296029608796276205941",
161
+ "1097625536358560225015844871776096852794298581720514105921271391131873344240"
162
+ ],
163
+ ["1", "0"]
164
+ ]
165
+ ],
166
+ "vk_alphabeta_12": [
167
+ [
168
+ [
169
+ "2029413683389138792403550203267699914886160938906632433982220835551125967885",
170
+ "21072700047562757817161031222997517981543347628379360635925549008442030252106"
171
+ ],
172
+ [
173
+ "5940354580057074848093997050200682056184807770593307860589430076672439820312",
174
+ "12156638873931618554171829126792193045421052652279363021382169897324752428276"
175
+ ],
176
+ [
177
+ "7898200236362823042373859371574133993780991612861777490112507062703164551277",
178
+ "7074218545237549455313236346927434013100842096812539264420499035217050630853"
179
+ ]
180
+ ],
181
+ [
182
+ [
183
+ "7077479683546002997211712695946002074877511277312570035766170199895071832130",
184
+ "10093483419865920389913245021038182291233451549023025229112148274109565435465"
185
+ ],
186
+ [
187
+ "4595479056700221319381530156280926371456704509942304414423590385166031118820",
188
+ "19831328484489333784475432780421641293929726139240675179672856274388269393268"
189
+ ],
190
+ [
191
+ "11934129596455521040620786944827826205713621633706285934057045369193958244500",
192
+ "8037395052364110730298837004334506829870972346962140206007064471173334027475"
193
+ ]
194
+ ]
195
+ ],
196
+ "IC": [
197
+ [
198
+ [
199
+ "16397970494781113622140409380710514277504568512202481522431528914560031562762",
200
+ "15987991045804318696151558137607070651882190737142560406194591976742796145195",
201
+ "1"
202
+ ],
203
+ [
204
+ "19175554796060272870947844726785784415291967441071791144616572094703752022787",
205
+ "14708716857471570462880683190724447733812118518043273649838616424043548023127",
206
+ "1"
207
+ ],
208
+ [
209
+ "5109703116431086866657790821388182053265093586387384935734011036204399393630",
210
+ "1612476077210311180626421664389270104678910550524363357381847966959374674423",
211
+ "1"
212
+ ],
213
+ [
214
+ "16028984344157742576452936855797086856968817024956118691418341585143424903639",
215
+ "6905323418829609143361434077039383502192920586565275784934386988372483556465",
216
+ "1"
217
+ ],
218
+ [
219
+ "5037234187699234788733084505200789125332575456459095878140727750253994537245",
220
+ "5152780378461098676484401284161685966625077837157208907964141131514955942959",
221
+ "1"
222
+ ]
223
+ ],
224
+ [
225
+ [
226
+ "19573269191775350978579562905764743103417752180580176229566975904395505694207",
227
+ "2381522187377974692257359562587606852360557473353020907100590706767276986457",
228
+ "1"
229
+ ],
230
+ [
231
+ "3570865353993345507636525265023758855364727230473021611280650482974485897542",
232
+ "3026650225811133060402545160946181194870257210933662802529138266788423022235",
233
+ "1"
234
+ ],
235
+ [
236
+ "10948020004642082805202152014062303498984706484599503419636897666877701726029",
237
+ "16425328653566008388486740080892552688012772956429074139489785673820307770702",
238
+ "1"
239
+ ],
240
+ [
241
+ "20638502839000044414864636985783149953889799151008745227055624454042471377832",
242
+ "977321369609271151576827768083353705509746900519279122286818202637470656742",
243
+ "1"
244
+ ],
245
+ [
246
+ "18662986393280647182646025762677321210586855801774577114215804961111542726195",
247
+ "9182414327249389553719378979750943052880001176853490206379257023646169811116",
248
+ "1"
249
+ ]
250
+ ],
251
+ [
252
+ [
253
+ "1172653041469601107707030355715854571110526375194334139771259673595104816259",
254
+ "139822645729727942447876327389754883087551266970976361358585992124005959663",
255
+ "1"
256
+ ],
257
+ [
258
+ "807568760006422352594797418374693945705914727214443753238278163089338607471",
259
+ "19362805143026565781098954744725161233661862485826387437200176803022106919133",
260
+ "1"
261
+ ],
262
+ [
263
+ "9457043262004277983171082100772969689099515860060732671699192102623198243288",
264
+ "19229090298682361289811638032020124933114889462217199961448135904896325661193",
265
+ "1"
266
+ ],
267
+ [
268
+ "18883326163102164343877677909116984239805709949130729675634413304023108763212",
269
+ "2795333364660917174391473381893559091159208514832297547909172862364581446206",
270
+ "1"
271
+ ],
272
+ [
273
+ "18012979848063967305324818138773222084850070233834350625943804711450349870116",
274
+ "11425098272720529401115253745902976848228234025625773037823969253767737500443",
275
+ "1"
276
+ ]
277
+ ],
278
+ [
279
+ [
280
+ "5735580005765404165535708760854311053102182143614810924129912232734875728422",
281
+ "12547270286864340931439010083179993915942911007015778927394042746771813715897",
282
+ "1"
283
+ ],
284
+ [
285
+ "17861179987982979247789643870162154315308943006677455616368767345181299723498",
286
+ "12520843301982976970226379882714814545061255956743392202788539428471921045815",
287
+ "1"
288
+ ],
289
+ [
290
+ "709419095293140562723620898844593712074413125125086760533949250121053456086",
291
+ "20254885558410038279405227446341995510955697359900050994091569463713580982280",
292
+ "1"
293
+ ],
294
+ [
295
+ "8876829807505794597615690202974184696287415186921508358861381955321520402876",
296
+ "9692396410060123455009190221005078571838194435772371581970098240972280778466",
297
+ "1"
298
+ ],
299
+ [
300
+ "11541729643712807778212647011796800767186857085220105751644556558522744760878",
301
+ "7117533920695574619512162711113223946930183977424569115798612426749467545080",
302
+ "1"
303
+ ]
304
+ ],
305
+ [
306
+ [
307
+ "7022760843802757109079393624924627417630030139055381384837279305453559861026",
308
+ "14368180091281110030022253036601349874026580767275461373222397498585380849175",
309
+ "1"
310
+ ],
311
+ [
312
+ "20362090815079102760789516334841889611927869342884580401494938701237909313479",
313
+ "11683916255585393494577805363227207275174890005674166623110857790951330330248",
314
+ "1"
315
+ ],
316
+ [
317
+ "21680925564107543632769644144771629045807478787600735681275069556336841549441",
318
+ "1554686039880869088226596836931999292372497423378849142389700108361111176287",
319
+ "1"
320
+ ],
321
+ [
322
+ "9553151402225656007352139561853210183786116738154807824913092141416366824324",
323
+ "21774504332021003611111291017295441063483107704370481606906960187337904118400",
324
+ "1"
325
+ ],
326
+ [
327
+ "3472743162059388238264946309663113383560193397376658519781344886918012396958",
328
+ "21850707327192737842691835772722844106916466129654852946865863108319178245521",
329
+ "1"
330
+ ]
331
+ ],
332
+ [
333
+ [
334
+ "14007544454490183581525584522132854274412440955138184221862170710084681738226",
335
+ "9427297140302346741340407818949601657384670126565058224960470754064287232598",
336
+ "1"
337
+ ],
338
+ [
339
+ "9424279417196769259939653963004219272435595656090601392111859177294419276463",
340
+ "5159704841441138198509282351301933053602549958584575945916187562678590534936",
341
+ "1"
342
+ ],
343
+ [
344
+ "5934282708091541939003757621608766449985810436411564642900129758520734711260",
345
+ "6572936900512215029112509161886160866328777917297795430264727434969553346474",
346
+ "1"
347
+ ],
348
+ [
349
+ "17332317297867087005634642159909283377570778576256008720318658354552654813365",
350
+ "20469716791176463599463762213563135543375669917658488173798369718370224346075",
351
+ "1"
352
+ ],
353
+ [
354
+ "11895216520141526042182770992519307655836464153974170586288146149131884093776",
355
+ "2345310584279491449819095573562431881564998414485162753036518957549727207513",
356
+ "1"
357
+ ]
358
+ ],
359
+ [
360
+ [
361
+ "15084362489402846752495176069529022447007294106313236924068931072406922960482",
362
+ "17446301099629553693162731281967866078816607293341610477850995414321505446665",
363
+ "1"
364
+ ],
365
+ [
366
+ "15416633712259927998995598381829216728913683600537032862643171407716059372732",
367
+ "6910124994917236999728700744617337824847623550680442113266553962793201270115",
368
+ "1"
369
+ ],
370
+ [
371
+ "3240338086312503075747637551773566329150860621223080774242357236897458479365",
372
+ "9706162939164863315053907226494918827393300584078535638283184502242772542378",
373
+ "1"
374
+ ],
375
+ [
376
+ "3821371825593696440611637099905775310839636477646533943959149234595561019388",
377
+ "12220054708690507765048929995921680127285008492320123722886943219569231705313",
378
+ "1"
379
+ ],
380
+ [
381
+ "16484014909498227505527128570845947338361237083477117662394990633734193572570",
382
+ "15639273550026538537711009501005182488432976272250651065072907504931158455474",
383
+ "1"
384
+ ]
385
+ ],
386
+ [
387
+ [
388
+ "7289543915982634578897897440956973302403422297539950338836810160596047457980",
389
+ "15177295033774438197517772642364420015492974487860823338193520175227862903717",
390
+ "1"
391
+ ],
392
+ [
393
+ "5412509155867259433944542755241941469706034032614068890113478300647952353475",
394
+ "16755045912589178729548422106539306191579601567866216267685082373250783779841",
395
+ "1"
396
+ ],
397
+ [
398
+ "844425885324371282218176954530597075058496766373014736097970493596574863875",
399
+ "12323478340077628423886836431146436403221716179764806398442271274194718652143",
400
+ "1"
401
+ ],
402
+ [
403
+ "19468406721151512215981453048984639951787280312568894384216547824763527840472",
404
+ "6512636337641737270183934024333064400224464644359645491020358650071524340464",
405
+ "1"
406
+ ],
407
+ [
408
+ "8198878215192784492258585011520207242810327647198332623948351347768018051267",
409
+ "8014960150646978739731831763393714179490854831922196242908407049327430863238",
410
+ "1"
411
+ ]
412
+ ],
413
+ [
414
+ [
415
+ "9107882721143487446664847981273782313316003453386555221878701631432129058401",
416
+ "9441695541513726822451572070540177043748046411169636568582927338148104680158",
417
+ "1"
418
+ ],
419
+ [
420
+ "8987068930426301924419900826390508311526176863992306858982473479912439758010",
421
+ "1725109031239210601724581840155988791039497876559382612372874257775877974323",
422
+ "1"
423
+ ],
424
+ [
425
+ "18516110346729610211387987894593386281257834088357741109524145966500785499183",
426
+ "114078214476076549461901405178268623018026929846201249476869510133510589766",
427
+ "1"
428
+ ],
429
+ [
430
+ "15915940069177053049090451855582611051242699463952201407239272373068542013292",
431
+ "9373936080407194259749015269175580128112032582312467763484971165406599176646",
432
+ "1"
433
+ ],
434
+ [
435
+ "4922802633190996456945600288106639549790810185209505074744770090776471062338",
436
+ "8883001810279320778962047313612748029483858862205749774979015238684570049088",
437
+ "1"
438
+ ]
439
+ ],
440
+ [
441
+ [
442
+ "14718035764669896417897962215694711502145567157050183561348015124983050763912",
443
+ "16468329864686708461615593125586840110548434159129257976547738477143616225069",
444
+ "1"
445
+ ],
446
+ [
447
+ "19316680422470456517825967239402234468963225932355881906076897312088976727808",
448
+ "3793008941035953637072065313624049788550692955904011087840457148221740889857",
449
+ "1"
450
+ ],
451
+ [
452
+ "8994123619474927749524041243795236789619386871069943230512200348341409025802",
453
+ "2898455184193535874162795400065700362364113037155462125222703939894764399559",
454
+ "1"
455
+ ],
456
+ [
457
+ "7006987736985681119096469806956612323700302986805047546691419062106874738669",
458
+ "6578526693577992862738197741211972861837397562647850241473856881198749597774",
459
+ "1"
460
+ ],
461
+ [
462
+ "18253609658317686864081972526657430282945609846265497350129963610508303097865",
463
+ "20602454323920106770928127673050173555696255204782817307960073152139829286712",
464
+ "1"
465
+ ]
466
+ ],
467
+ [
468
+ [
469
+ "18387700354891683161007139598833533459740755646851082725263944626765753998128",
470
+ "8496770255291121655312305725645117658510206297162207504909146686627154245846",
471
+ "1"
472
+ ],
473
+ [
474
+ "3295351580633631545204707236418977224205703294426182202748223245617942752953",
475
+ "11318533876720817956139762907441156918032396007060817178042936071438547629319",
476
+ "1"
477
+ ],
478
+ [
479
+ "9798692489110933308397734193670030418121117030189402149994776248649813971130",
480
+ "7253879530870754821836349446054636336833607432103959373798000294248292966203",
481
+ "1"
482
+ ],
483
+ [
484
+ "21808645514001764351825515375665639285586999794992628373968527911077248645185",
485
+ "2859748802987042398453158245958377568437550705999358391809538153774651114865",
486
+ "1"
487
+ ],
488
+ [
489
+ "4373537692781319117201803895634857716202697229097770645380222493663057011429",
490
+ "21723556418902236605356947828522543021755681613733490227407492902239152334538",
491
+ "1"
492
+ ]
493
+ ],
494
+ [
495
+ [
496
+ "4147129560663007063799754603731275683761368247704376766576071776957227165800",
497
+ "7032402220603422034618210155106646820962552774510253688945919060625670415308",
498
+ "1"
499
+ ],
500
+ [
501
+ "5241022678363371404039324538224070321660623527603509392150146296843642044363",
502
+ "5281273397025328620822441453790518717375265972202147684745427714882287252791",
503
+ "1"
504
+ ],
505
+ [
506
+ "8109626675067152219533782552336308649905522111608563670382254454484448073029",
507
+ "4696661232179595878220108186097206302552300846640109174608389689072223809776",
508
+ "1"
509
+ ],
510
+ [
511
+ "13974026846148052806722306435446895222317781098029808723550029071117080027133",
512
+ "14451415757463182353662034231421738047130904367363697865823311429455557043904",
513
+ "1"
514
+ ],
515
+ [
516
+ "9490728148230530026163178051838213576627639298618884515939110001242292217290",
517
+ "227687333556127166330064214209948378192130717415165040791158610964406937909",
518
+ "1"
519
+ ]
520
+ ]
521
+ ]
522
+ }
@@ -0,0 +1,36 @@
1
+ import { verify } from "@zk-kit/groth16"
2
+ import { SemaphoreProof } from "./types"
3
+ import unpackProof from "./unpack-proof"
4
+ import verificationKeys from "./verification-keys.json"
5
+ import hash from "./hash"
6
+
7
+ /**
8
+ * Verifies a Semaphore proof.
9
+ * @param fullProof The SnarkJS Semaphore proof.
10
+ * @param treeDepth The depth of the tree.
11
+ * @returns True if the proof is valid, false otherwise.
12
+ */
13
+ export default async function verifyProof({
14
+ merkleTreeDepth,
15
+ merkleTreeRoot,
16
+ nullifier,
17
+ message,
18
+ scope,
19
+ proof
20
+ }: SemaphoreProof): Promise<boolean> {
21
+ // TODO: support all tree depths after trusted-setup.
22
+ if (merkleTreeDepth < 1 || merkleTreeDepth > 12) {
23
+ throw new TypeError("The tree depth must be a number between 1 and 12")
24
+ }
25
+
26
+ const verificationKey = {
27
+ ...verificationKeys,
28
+ vk_delta_2: verificationKeys.vk_delta_2[merkleTreeDepth - 1],
29
+ IC: verificationKeys.IC[merkleTreeDepth - 1]
30
+ }
31
+
32
+ return verify(verificationKey, {
33
+ publicSignals: [merkleTreeRoot, nullifier, hash(message), hash(scope)],
34
+ proof: unpackProof(proof)
35
+ })
36
+ }
@@ -1,8 +0,0 @@
1
- import { BytesLike, Hexable } from "@ethersproject/bytes";
2
- /**
3
- * Given the identity nullifier and the external nullifier, it calculates nullifier hash.
4
- * @param identityNullifier The identity nullifier.
5
- * @param externalNullifier The external nullifier.
6
- * @returns The nullifier hash.
7
- */
8
- export default function calculateNullifierHash(identityNullifier: number | bigint | string, externalNullifier: BytesLike | Hexable | number | bigint): bigint;
@@ -1,15 +0,0 @@
1
- import { BytesLike, Hexable } from "@ethersproject/bytes";
2
- import { Group } from "@semaphore-protocol/group";
3
- import type { Identity } from "@semaphore-protocol/identity";
4
- import { MerkleProof } from "@zk-kit/incremental-merkle-tree";
5
- import { SemaphoreProof, SnarkArtifacts } from "./types";
6
- /**
7
- * Generates a Semaphore proof.
8
- * @param identity The Semaphore identity.
9
- * @param groupOrMerkleProof The Semaphore group or its Merkle proof.
10
- * @param externalNullifier The external nullifier.
11
- * @param signal The Semaphore signal.
12
- * @param snarkArtifacts The SNARK artifacts.
13
- * @returns The Semaphore proof ready to be verified.
14
- */
15
- export default function generateProof({ trapdoor, nullifier, commitment }: Identity, groupOrMerkleProof: Group | MerkleProof, externalNullifier: BytesLike | Hexable | number | bigint, signal: BytesLike | Hexable | number | bigint, snarkArtifacts?: SnarkArtifacts): Promise<SemaphoreProof>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { SemaphoreProof } from "./types";
2
- /**
3
- * Verifies a Semaphore proof.
4
- * @param fullProof The SnarkJS Semaphore proof.
5
- * @param treeDepth The Merkle tree depth.
6
- * @returns True if the proof is valid, false otherwise.
7
- */
8
- export default function verifyProof({ merkleTreeRoot, nullifierHash, externalNullifier, signal, proof }: SemaphoreProof, treeDepth: number): Promise<boolean>;
@@ -1,16 +0,0 @@
1
- import { BytesLike, Hexable } from "@ethersproject/bytes"
2
- import { poseidon2 } from "poseidon-lite"
3
- import hash from "./hash"
4
-
5
- /**
6
- * Given the identity nullifier and the external nullifier, it calculates nullifier hash.
7
- * @param identityNullifier The identity nullifier.
8
- * @param externalNullifier The external nullifier.
9
- * @returns The nullifier hash.
10
- */
11
- export default function calculateNullifierHash(
12
- identityNullifier: number | bigint | string,
13
- externalNullifier: BytesLike | Hexable | number | bigint
14
- ): bigint {
15
- return poseidon2([hash(externalNullifier), identityNullifier])
16
- }