From 3bc864f110d6f432ad3b416e5eb128e445683a0b Mon Sep 17 00:00:00 2001 From: arnaucube Date: Fri, 28 Jun 2019 10:50:49 +0200 Subject: [PATCH] update poseidon with blake2b --- circuits/poseidon.circom | 203 ++++++++++++------------- package-lock.json | 315 +++++++++++++-------------------------- package.json | 1 + src/poseidon.js | 7 +- test/poseidoncircuit.js | 27 +++- 5 files changed, 238 insertions(+), 315 deletions(-) diff --git a/circuits/poseidon.circom b/circuits/poseidon.circom index b90f886..dad6806 100644 --- a/circuits/poseidon.circom +++ b/circuits/poseidon.circom @@ -41,119 +41,120 @@ template Mix(t, M) { template Poseidon(nInputs, t, nRoundsF, nRoundsP) { var C = [ - 1354025385229961744769229343273868518314335569873439558835166239576773343708, - 14378844218625331047742339561309620904043097700980163591187076404481144585564, - 19370813333785034372560258124535206525278124675105547990205946542330734467847, - 19339919977375282793227987561727366424934767905100680591050582380667086628202, - 8422275364316831706903446151602338206948363474119622730702497535467809432414, - 7433947928146794739292515659214608949964639549664630885486968546133071892830, - 20753350951496713264979200428833003140825588922450200809553577914404143341040, - 21437018888080559864996889038552602698883513894753499324572098534369350747880, - 6815447461573214810645016226370803316854141900901895816072622961504507953749, - 11746901014017411226283657362310634990885933032228701131899561585228216986615, - 13428722985713722660261823704226749286675766756093697029778643398137361221114, - 10894749142018158588533110743373157663019829222177356873395009880383491602356, - 13720066349319517776784660327982201297420012713976744204318378121767771862484, - 4665971664531891307640113589671067488692829783046247264698659233443166028412, - 5364541878673041196937884015923978656299860601766012213141306792903990539664, - 1747411112078838632103476037026417344408680910500491241306123941341644055714, - 1835035066071759522152578007305026433897204459772540871869487151042238374039, - 21055637025200882290106914253232617255445210101773537879323245961051751183138, - 19215142378199333594641095299020637309879189505235993967243075316794127016728, - 5264915734761449905856538116909638235466879053604660991987579054616980096262, - 10045917614023673044141331581538797960977704806582630277050701175565262856382, - 7789533631025313780520004400945166898631872921910178131342071973345076732672, - 19972498130123740615813398456152565371201412297339860820234719562997192378694, - 14216077977931104808041453382683965630500368477063603536695472115075869912121, - 2555981910568472028679439033700033287358333564454149464965229699417319912931, - 11735111941739477522347883122573591136355121750109794306409399099068977659499, - 16957890207070910233505303498878270130436461648242792271152604513138986611609, - 358520143235124107055243451716507147499373646513864848163778795927281509793, - 6389190271835493841487214043252929516390267871881261173336690351147926750010, - 12939611907106878137030264379019786496625916664142697309441198804098015086205, - 456696638239570875759108333278090964360604015255503302016190396687826618227, - 20569764931577491771523222445135914903999292206008007769649255123342890660989, - 3341317247281280728261320226215152668194921091152837358683334635401182164637, - 11821224368797169892747612081573458772211068320533296007836648033607696236615, - 2185176387193659864764608304330502180888068591409305411859725028056771843945, - 17161758741114551704796078639849789476380746803787101178795737276111464575519, - 11889888355183092530573415929875444766831739308191993115663429638848547668798, - 19503084309842095729857399025417533485089330284851492085544757107759925099089, - 20280152151768521735424910115623976684589382048161526796204268413029416266256, - 17607351334578006856860845064970248988416315904757246948622629528628773644114, - 20769468546336672951384440602623018830493119282829911435465737079851020547355, - 1546429204704408801701093430086546742691081844046642451323347737810191940866, - 11200569249561318620053458114013886527484999499632128671282997438827107108229, - 20198213289062010915914579158889968647687156198219713083074315178786791524034, - 12911209060630719799682705729835581341676468319742562559036843993017369855977, - 18925188847138989248835676768641716482476141553833902070405850166412140133887, - 20376466983584239909415025821007315251422803039634139484663713769887712746966, - 5250536177612235431141386983455571232984126980327432803966957255414592397060, - 344847263093423485167610155050688875010578621416939967999896518937961396680, - 19870333728541576497318505013425518731999037041271340888970559590767369935385, - 20604512495859902382577228682521142736989261702707317046150335692410020156250, - 18293964088694556689667514948280720605277532123251572448395882397578643211622, - 21211253784206079547762943120791531326787601501123474236198383850531142559075, - 17247914781304154940895909185506123510423535554247372833321968000513811053190, - 16432189025237084563810000088202867449333673799705533820685782829379758927490, - 7204783063529242442830743239980168374343946353418800547956909848044774363774, - 2108268032972510691814120801033692084861951866306906253604497017452204030001, - 13483247063999686990721729188827693318708500027762095503921527692630827328070, - 18194665574704709729868916970580318177272365766028499528691737819467051567534, - 9275639092314761435364537152118796424056864859607619908791935597976913759411, - 12700165678727983685032332532042155014245610964583614362270316386368455898604, - 19127554193875137546212792134421555344854604853165878912238751527694270097310, - 16817455471920423226570476063669349525676437756352144502692679769377074040335, - 17331185397945904160678487303485263376032543419657328137924881433628614769955, - 11605569208043267134285833752214422326246425655661043119023566733685555142420 + 14397397413755236225575615486459253198602422701513067526754101844196324375522, + 10405129301473404666785234951972711717481302463898292859783056520670200613128, + 5179144822360023508491245509308555580251733042407187134628755730783052214509, + 9132640374240188374542843306219594180154739721841249568925550236430986592615, + 20360807315276763881209958738450444293273549928693737723235350358403012458514, + 17933600965499023212689924809448543050840131883187652471064418452962948061619, + 3636213416533737411392076250708419981662897009810345015164671602334517041153, + 2008540005368330234524962342006691994500273283000229509835662097352946198608, + 16018407964853379535338740313053768402596521780991140819786560130595652651567, + 20653139667070586705378398435856186172195806027708437373983929336015162186471, + 17887713874711369695406927657694993484804203950786446055999405564652412116765, + 4852706232225925756777361208698488277369799648067343227630786518486608711772, + 8969172011633935669771678412400911310465619639756845342775631896478908389850, + 20570199545627577691240476121888846460936245025392381957866134167601058684375, + 16442329894745639881165035015179028112772410105963688121820543219662832524136, + 20060625627350485876280451423010593928172611031611836167979515653463693899374, + 16637282689940520290130302519163090147511023430395200895953984829546679599107, + 15599196921909732993082127725908821049411366914683565306060493533569088698214, + 16894591341213863947423904025624185991098788054337051624251730868231322135455, + 1197934381747032348421303489683932612752526046745577259575778515005162320212, + 6172482022646932735745595886795230725225293469762393889050804649558459236626, + 21004037394166516054140386756510609698837211370585899203851827276330669555417, + 15262034989144652068456967541137853724140836132717012646544737680069032573006, + 15017690682054366744270630371095785995296470601172793770224691982518041139766, + 15159744167842240513848638419303545693472533086570469712794583342699782519832, + 11178069035565459212220861899558526502477231302924961773582350246646450941231, + 21154888769130549957415912997229564077486639529994598560737238811887296922114, + 20162517328110570500010831422938033120419484532231241180224283481905744633719, + 2777362604871784250419758188173029886707024739806641263170345377816177052018, + 15732290486829619144634131656503993123618032247178179298922551820261215487562, + 6024433414579583476444635447152826813568595303270846875177844482142230009826, + 17677827682004946431939402157761289497221048154630238117709539216286149983245, + 10716307389353583413755237303156291454109852751296156900963208377067748518748, + 14925386988604173087143546225719076187055229908444910452781922028996524347508, + 8940878636401797005293482068100797531020505636124892198091491586778667442523, + 18911747154199663060505302806894425160044925686870165583944475880789706164410, + 8821532432394939099312235292271438180996556457308429936910969094255825456935, + 20632576502437623790366878538516326728436616723089049415538037018093616927643, + 71447649211767888770311304010816315780740050029903404046389165015534756512, + 2781996465394730190470582631099299305677291329609718650018200531245670229393, + 12441376330954323535872906380510501637773629931719508864016287320488688345525, + 2558302139544901035700544058046419714227464650146159803703499681139469546006, + 10087036781939179132584550273563255199577525914374285705149349445480649057058, + 4267692623754666261749551533667592242661271409704769363166965280715887854739, + 4945579503584457514844595640661884835097077318604083061152997449742124905548, + 17742335354489274412669987990603079185096280484072783973732137326144230832311, + 6266270088302506215402996795500854910256503071464802875821837403486057988208, + 2716062168542520412498610856550519519760063668165561277991771577403400784706, + 19118392018538203167410421493487769944462015419023083813301166096764262134232, + 9386595745626044000666050847309903206827901310677406022353307960932745699524, + 9121640807890366356465620448383131419933298563527245687958865317869840082266, + 3078975275808111706229899605611544294904276390490742680006005661017864583210, + 7157404299437167354719786626667769956233708887934477609633504801472827442743, + 14056248655941725362944552761799461694550787028230120190862133165195793034373, + 14124396743304355958915937804966111851843703158171757752158388556919187839849, + 11851254356749068692552943732920045260402277343008629727465773766468466181076, + 9799099446406796696742256539758943483211846559715874347178722060519817626047, + 10156146186214948683880719664738535455146137901666656566575307300522957959544, + 19908645952733301583346063785055921934459499091029406575311417879963332475861, + 11766105336238068471342414351862472329437473380853789942065610694000443387471, + 11002137593249972174092192767251572171769044073555430468487809799220351297047, + 284136377911685911941431040940403846843630064858778505937392780738953624163, + 19448733709802908339787967270452055364068697565906862913410983275341804035680, + 14423660424692802524250720264041003098290275890428483723270346403986712981505, + 10635360132728137321700090133109897687122647659471659996419791842933639708516 ]; var M = [ [ - 12037235000515189726428793905458162231976011685774991261061889278958802340039, - 15885254491685089152627111704751054604879027605518712546805347341940526552948, - 12220682901774309471330657931458552366575439534877271150866614914170639536810, - 11195096069395318710866553226959674457987772316145705151894647995087349332576, - 598000700605575401177173118514166571064818339748567530524299773749024042768, - 1430722853270801285936618367966028727146977818314178365893636191280860605092 + 19167410339349846567561662441069598364702008768579734801591448511131028229281, + 14183033936038168803360723133013092560869148726790180682363054735190196956789, + 9067734253445064890734144122526450279189023719890032859456830213166173619761, + 16378664841697311562845443097199265623838619398287411428110917414833007677155, + 12968540216479938138647596899147650021419273189336843725176422194136033835172, + 3636162562566338420490575570584278737093584021456168183289112789616069756675 ],[ - 2478807512283787086755520696277192042388812450777005645736937700857950416751, - 2233078558675693495109307103888903813217767160310116996267068037131890781382, - 18876120310576321787684235034151243856925703159922712959767164734820803570163, - 16850806847813838898693870637445284830832219430572133120914449039176718036761, - 1333036876405396107763619427367607232034082504897380383847654332653606615427, - 8024813862822108072341428765418554797098705487914663416123759888639403831315 + 17034139127218860091985397764514160131253018178110701196935786874261236172431, + 2799255644797227968811798608332314218966179365168250111693473252876996230317, + 2482058150180648511543788012634934806465808146786082148795902594096349483974, + 16563522740626180338295201738437974404892092704059676533096069531044355099628, + 10468644849657689537028565510142839489302836569811003546969773105463051947124, + 3328913364598498171733622353010907641674136720305714432354138807013088636408 ],[ - 6500095533434910955474026763873910167129305339747639394388586826716085593160, - 8370208895752773828195461153114215021863221486187756770286440396339432061839, - 9303960191058819387902927958335344077259478983903385066838134730814638010892, - 12233235273183315334651707749232602313616943260130930740801007863528547113209, - 9140649423847813564210562288927015604065254723368331178903734405333716165919, - 1715897011776785698388835993891828784112980527691698420841641796168725014542 + 18985203040268814769637347880759846911264240088034262814847924884273017355969, + 8652975463545710606098548415650457376967119951977109072274595329619335974180, + 970943815872417895015626519859542525373809485973005165410533315057253476903, + 19406667490568134101658669326517700199745817783746545889094238643063688871948, + 17049854690034965250221386317058877242629221002521630573756355118745574274967, + 4964394613021008685803675656098849539153699842663541444414978877928878266244 ],[ - 19092640119254952117901733765506685707486610088248205883870061221436629780176, - 3099417239661426161523333446616746096617346084970490427773391639810420659748, - 4498351799178816410443394768364090919370619407529999860500200773846156676605, - 17766546613911504681964882079687098358108049762069064124348111606619240189874, - 19735199036142202254810745273503942799136628866093225336283966579447096889407, - 18618071352177331467649099054615438672487187348128402045695624605978242597928 + 19025623051770008118343718096455821045904242602531062247152770448380880817517, + 9077319817220936628089890431129759976815127354480867310384708941479362824016, + 4770370314098695913091200576539533727214143013236894216582648993741910829490, + 4298564056297802123194408918029088169104276109138370115401819933600955259473, + 6905514380186323693285869145872115273350947784558995755916362330070690839131, + 4783343257810358393326889022942241108539824540285247795235499223017138301952 ],[ - 13282641901514824677915134398195165361567825236648422290753355584311135817423, - 842963276112770184096507757019973399127531993386626262873928307889423235104, - 5724939764407712239242783736588389538981693110806985476155198757555171230777, - 3015568820237516884743892014063659856564948150197038824747891972506031149123, - 8926202997251578932273751544826990276848999132609774201265891812369804099098, - 13523975980414815337318802343464374889255493007711857898760066111901192774093 + 16205238342129310687768799056463408647672389183328001070715567975181364448609, + 8303849270045876854140023508764676765932043944545416856530551331270859502246, + 20218246699596954048529384569730026273241102596326201163062133863539137060414, + 1712845821388089905746651754894206522004527237615042226559791118162382909269, + 13001155522144542028910638547179410124467185319212645031214919884423841839406, + 16037892369576300958623292723740289861626299352695838577330319504984091062115 ],[ - 13163705634211158833717167498904899472888572514300041636511944020589976373689, - 6705743158328622712684686369234272301477431173971663001146157949982901448493, - 5341285785102635724684809992160578025785996331334612975598752577556138916495, - 2365134732811643517126128253974711531515283135672252986518431351700239265326, - 11812366860142870031000585328436207067560705932658624313008187741187899702321, - 11192751017231920972897699839932659451476356148115786649719660565307185769796 + 15162889384227198851506890526431746552868519326873025085114621698588781611738, + 13272957914179340594010910867091459756043436017766464331915862093201960540910, + 9416416589114508529880440146952102328470363729880726115521103179442988482948, + 8035240799672199706102747147502951589635001418759394863664434079699838251138, + 21642389080762222565487157652540372010968704000567605990102641816691459811717, + 20261355950827657195644012399234591122288573679402601053407151083849785332516 ] ]; + signal input inputs[nInputs]; signal output out; diff --git a/package-lock.json b/package-lock.json index ba65d21..ff29322 100644 --- a/package-lock.json +++ b/package-lock.json @@ -175,9 +175,12 @@ "integrity": "sha512-9dULc9jsKmXl0Aeunug8wbF+58n+hQoFjqClN7WeZwGLh0XJUWyJJ9Ee+Ep+Ql/J9fRsTVaeThp8MhiCCrY0Jg==" }, "bindings": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } }, "bl": { "version": "1.2.2", @@ -198,6 +201,23 @@ "nan": "^2.2.1" } }, + "blake2b": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/blake2b/-/blake2b-2.1.3.tgz", + "integrity": "sha512-pkDss4xFVbMb4270aCyGD3qLv92314Et+FsKzilCLxDz5DuZ2/1g3w4nmBbu6nKApPspnjG7JcwTjGZnduB1yg==", + "requires": { + "blake2b-wasm": "^1.1.0", + "nanoassert": "^1.0.0" + } + }, + "blake2b-wasm": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/blake2b-wasm/-/blake2b-wasm-1.1.7.tgz", + "integrity": "sha512-oFIHvXhlz/DUgF0kq5B1CqxIDjIJwh9iDeUUGQUcvgiGz7Wdw03McEO7CfLBy7QKGdsydcMCgO9jFNBAFCtFcA==", + "requires": { + "nanoassert": "^1.0.0" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -1250,6 +1270,11 @@ "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "finalhandler": { "version": "1.1.1", "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", @@ -1538,7 +1563,6 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, - "optional": true, "requires": { "mime-types": "~2.1.18", "negotiator": "0.6.1" @@ -1579,15 +1603,13 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true, - "optional": true + "dev": true }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true, - "optional": true + "dev": true }, "asn1": { "version": "0.2.4", @@ -1603,7 +1625,6 @@ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, - "optional": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", @@ -2395,7 +2416,6 @@ "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, - "optional": true, "requires": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" @@ -2429,7 +2449,6 @@ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", "dev": true, - "optional": true, "requires": { "bytes": "3.0.0", "content-type": "~1.0.4", @@ -2448,7 +2467,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "optional": true, "requires": { "ms": "2.0.0" } @@ -2514,7 +2532,6 @@ "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, - "optional": true, "requires": { "bn.js": "^4.1.0", "randombytes": "^2.0.1" @@ -2593,7 +2610,6 @@ "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "dev": true, - "optional": true, "requires": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" @@ -2603,8 +2619,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true, - "optional": true + "dev": true }, "buffer-crc32": { "version": "0.2.13", @@ -2617,8 +2632,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true, - "optional": true + "dev": true }, "buffer-from": { "version": "1.1.1", @@ -2630,8 +2644,7 @@ "version": "0.0.5", "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", - "dev": true, - "optional": true + "dev": true }, "buffer-xor": { "version": "1.0.3", @@ -2649,8 +2662,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "dev": true, - "optional": true + "dev": true }, "bytewise": { "version": "1.1.0", @@ -2799,7 +2811,6 @@ "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "dev": true, - "optional": true, "requires": { "graceful-readlink": ">= 1.0.0" } @@ -2825,15 +2836,13 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", - "dev": true, - "optional": true + "dev": true }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "dev": true, - "optional": true + "dev": true }, "convert-source-map": { "version": "1.6.0", @@ -2848,22 +2857,19 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", - "dev": true, - "optional": true + "dev": true }, "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true, - "optional": true + "dev": true }, "cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true, - "optional": true + "dev": true }, "core-js": { "version": "2.5.7", @@ -2882,7 +2888,6 @@ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dev": true, - "optional": true, "requires": { "object-assign": "^4", "vary": "^1" @@ -2984,8 +2989,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true, - "optional": true + "dev": true }, "decompress": { "version": "4.2.0", @@ -3018,7 +3022,6 @@ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, - "optional": true, "requires": { "mimic-response": "^1.0.0" } @@ -3028,7 +3031,6 @@ "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "dev": true, - "optional": true, "requires": { "file-type": "^5.2.0", "is-stream": "^1.1.0", @@ -3169,8 +3171,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "optional": true + "dev": true }, "des.js": { "version": "1.0.0", @@ -3187,8 +3188,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true, - "optional": true + "dev": true }, "detect-indent": { "version": "4.0.0", @@ -3232,8 +3232,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true, - "optional": true + "dev": true }, "ecc-jsbn": { "version": "0.1.2", @@ -3249,8 +3248,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true, - "optional": true + "dev": true }, "electron-to-chromium": { "version": "1.3.84", @@ -3277,8 +3275,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true, - "optional": true + "dev": true }, "encoding": { "version": "0.1.12", @@ -3368,8 +3365,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true, - "optional": true + "dev": true }, "escape-string-regexp": { "version": "1.0.5", @@ -3387,8 +3383,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true, - "optional": true + "dev": true }, "eth-block-tracker": { "version": "3.0.1", @@ -3473,7 +3468,6 @@ "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", "dev": true, - "optional": true, "requires": { "bn.js": "^4.11.6", "elliptic": "^6.4.0", @@ -3557,7 +3551,7 @@ "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", "dev": true, "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#8431eab7b3384e65e8126a4602520b78031666fb", "ethereumjs-util": "^5.1.1" } }, @@ -3855,7 +3849,6 @@ "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", "dev": true, - "optional": true, "requires": { "bn.js": "4.11.6", "number-to-bn": "1.7.0" @@ -3865,8 +3858,7 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true, - "optional": true + "dev": true } } }, @@ -3884,8 +3876,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=", - "dev": true, - "optional": true + "dev": true }, "events": { "version": "3.0.0", @@ -3908,7 +3899,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", "dev": true, - "optional": true, "requires": { "accepts": "~1.3.5", "array-flatten": "1.1.1", @@ -3947,7 +3937,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "optional": true, "requires": { "ms": "2.0.0" } @@ -3956,8 +3945,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true, - "optional": true + "dev": true } } }, @@ -4029,15 +4017,13 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", - "dev": true, - "optional": true + "dev": true }, "finalhandler": { "version": "1.1.1", "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, - "optional": true, "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -4053,7 +4039,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "optional": true, "requires": { "ms": "2.0.0" } @@ -4062,8 +4047,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true, - "optional": true + "dev": true } } }, @@ -4107,29 +4091,25 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "dev": true, - "optional": true + "dev": true }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true, - "optional": true + "dev": true }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true, - "optional": true + "dev": true }, "fs-extra": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, - "optional": true, "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0" @@ -4158,7 +4138,6 @@ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, - "optional": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -4188,8 +4167,7 @@ "version": "3.0.0", "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true, - "optional": true + "dev": true }, "getpass": { "version": "0.1.7", @@ -4234,7 +4212,6 @@ "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", "dev": true, - "optional": true, "requires": { "decompress-response": "^3.2.0", "duplexer3": "^0.1.4", @@ -4261,8 +4238,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true, - "optional": true + "dev": true }, "har-schema": { "version": "2.0.0", @@ -4302,8 +4278,7 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", - "dev": true, - "optional": true + "dev": true }, "has-symbols": { "version": "1.0.0", @@ -4316,7 +4291,6 @@ "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "dev": true, - "optional": true, "requires": { "has-symbol-support-x": "^1.4.1" } @@ -4391,7 +4365,6 @@ "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, - "optional": true, "requires": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -4403,8 +4376,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", - "dev": true, - "optional": true + "dev": true }, "http-signature": { "version": "1.2.0", @@ -4430,8 +4402,7 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true, - "optional": true + "dev": true }, "immediate": { "version": "3.2.3", @@ -4472,8 +4443,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=", - "dev": true, - "optional": true + "dev": true }, "is-arrayish": { "version": "0.2.1", @@ -4549,15 +4519,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", - "dev": true, - "optional": true + "dev": true }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true, - "optional": true + "dev": true }, "is-regex": { "version": "1.0.4", @@ -4572,8 +4540,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true, - "optional": true + "dev": true }, "is-stream": { "version": "1.1.0", @@ -4619,7 +4586,6 @@ "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, - "optional": true, "requires": { "has-to-string-tag-x": "^1.2.0", "is-object": "^1.0.1" @@ -5001,8 +4967,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true, - "optional": true + "dev": true }, "lru-cache": { "version": "3.2.0", @@ -5053,8 +5018,7 @@ "version": "0.3.0", "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true, - "optional": true + "dev": true }, "memdown": { "version": "1.4.1", @@ -5091,8 +5055,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true, - "optional": true + "dev": true }, "merkle-patricia-tree": { "version": "2.3.1", @@ -5152,8 +5115,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true, - "optional": true + "dev": true }, "miller-rabin": { "version": "4.0.1", @@ -5170,8 +5132,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true, - "optional": true + "dev": true }, "mime-db": { "version": "1.37.0", @@ -5192,8 +5153,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "optional": true + "dev": true }, "min-document": { "version": "2.19.0", @@ -5291,15 +5251,13 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", - "dev": true, - "optional": true + "dev": true }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", - "dev": true, - "optional": true + "dev": true }, "node-fetch": { "version": "2.1.2", @@ -5330,7 +5288,6 @@ "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", "dev": true, - "optional": true, "requires": { "bn.js": "4.11.6", "strip-hex-prefix": "1.0.0" @@ -5340,8 +5297,7 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true, - "optional": true + "dev": true } } }, @@ -5374,7 +5330,6 @@ "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", "dev": true, - "optional": true, "requires": { "http-https": "^1.0.0" } @@ -5384,7 +5339,6 @@ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", "dev": true, - "optional": true, "requires": { "ee-first": "1.1.1" } @@ -5422,22 +5376,19 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", - "dev": true, - "optional": true + "dev": true }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true, - "optional": true + "dev": true }, "p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", "dev": true, - "optional": true, "requires": { "p-finally": "^1.0.0" } @@ -5447,7 +5398,6 @@ "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, - "optional": true, "requires": { "asn1.js": "^4.0.0", "browserify-aes": "^1.0.0", @@ -5479,8 +5429,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", - "dev": true, - "optional": true + "dev": true }, "path-exists": { "version": "2.1.0", @@ -5506,8 +5455,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true, - "optional": true + "dev": true }, "path-type": { "version": "1.1.0", @@ -5579,8 +5527,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true, - "optional": true + "dev": true }, "private": { "version": "0.1.8", @@ -5615,7 +5562,6 @@ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", "dev": true, - "optional": true, "requires": { "forwarded": "~0.1.2", "ipaddr.js": "1.8.0" @@ -5729,7 +5675,6 @@ "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "dev": true, - "optional": true, "requires": { "decode-uri-component": "^0.2.0", "object-assign": "^4.1.0", @@ -5760,22 +5705,19 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=", - "dev": true, - "optional": true + "dev": true }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", - "dev": true, - "optional": true + "dev": true }, "raw-body": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", "dev": true, - "optional": true, "requires": { "bytes": "3.0.0", "http-errors": "1.6.3", @@ -6092,7 +6034,6 @@ "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "dev": true, - "optional": true, "requires": { "debug": "2.6.9", "depd": "~1.1.2", @@ -6114,7 +6055,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "optional": true, "requires": { "ms": "2.0.0" } @@ -6123,8 +6063,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true, - "optional": true + "dev": true } } }, @@ -6133,7 +6072,6 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "dev": true, - "optional": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -6146,7 +6084,6 @@ "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "dev": true, - "optional": true, "requires": { "body-parser": "^1.16.0", "cors": "^2.8.1", @@ -6178,8 +6115,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true, - "optional": true + "dev": true }, "sha.js": { "version": "2.4.11", @@ -6204,15 +6140,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "dev": true, - "optional": true + "dev": true }, "simple-get": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", "dev": true, - "optional": true, "requires": { "decompress-response": "^3.3.0", "once": "^1.3.1", @@ -6312,8 +6246,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "optional": true + "dev": true }, "stream-to-pull-stream": { "version": "1.7.2", @@ -6337,8 +6270,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true, - "optional": true + "dev": true }, "string-width": { "version": "1.0.2", @@ -6479,7 +6411,6 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", "dev": true, - "optional": true, "requires": { "bl": "^1.0.0", "buffer-alloc": "^1.2.0", @@ -6518,7 +6449,6 @@ "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", "dev": true, - "optional": true, "requires": { "any-promise": "^1.0.0" } @@ -6528,7 +6458,6 @@ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "dev": true, - "optional": true, "requires": { "thenify": ">= 3.1.0 < 4" } @@ -6553,8 +6482,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "dev": true, - "optional": true + "dev": true }, "tmp": { "version": "0.0.33", @@ -6569,8 +6497,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", - "dev": true, - "optional": true + "dev": true }, "to-fast-properties": { "version": "1.0.3", @@ -6634,7 +6561,6 @@ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "dev": true, - "optional": true, "requires": { "media-typer": "0.3.0", "mime-types": "~2.1.18" @@ -6680,8 +6606,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", - "dev": true, - "optional": true + "dev": true }, "unbzip2-stream": { "version": "1.3.1", @@ -6726,8 +6651,7 @@ "version": "1.8.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true, - "optional": true + "dev": true }, "unorm": { "version": "1.4.1", @@ -6739,8 +6663,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true, - "optional": true + "dev": true }, "uri-js": { "version": "4.2.2", @@ -6756,7 +6679,6 @@ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "dev": true, - "optional": true, "requires": { "prepend-http": "^1.0.1" } @@ -6765,15 +6687,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", - "dev": true, - "optional": true + "dev": true }, "url-to-options": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", - "dev": true, - "optional": true + "dev": true }, "utf8": { "version": "3.0.0", @@ -6792,8 +6712,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true, - "optional": true + "dev": true }, "uuid": { "version": "3.3.2", @@ -6815,8 +6734,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true, - "optional": true + "dev": true }, "verror": { "version": "1.10.0", @@ -6862,7 +6780,6 @@ "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.35.tgz", "integrity": "sha512-ayGavbgVk4KL9Y88Uv411fBJ0SVgVfKhKEBweKYzmP0zOqneMzWt6YsyD1n6kRvjAbqA0AfUPEOKyMNjcx2tjw==", "dev": true, - "optional": true, "requires": { "web3-core-helpers": "1.0.0-beta.35", "web3-core-method": "1.0.0-beta.35", @@ -6875,7 +6792,6 @@ "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.35.tgz", "integrity": "sha512-APOu3sEsamyqWt//8o4yq9KF25/uqGm+pQShson/sC4gKzmfJB07fLo2ond0X30E8fIqAPeVCotPXQxGciGUmA==", "dev": true, - "optional": true, "requires": { "underscore": "1.8.3", "web3-eth-iban": "1.0.0-beta.35", @@ -6887,7 +6803,6 @@ "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.35.tgz", "integrity": "sha512-jidImCide8q0GpfsO4L73qoHrbkeWgwU3uOH5DKtJtv0ccmG086knNMRgryb/o9ZgetDWLmDEsJnHjBSoIwcbA==", "dev": true, - "optional": true, "requires": { "underscore": "1.8.3", "web3-core-helpers": "1.0.0-beta.35", @@ -6901,7 +6816,6 @@ "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.35.tgz", "integrity": "sha512-GvqXqKq07OmHuVi5uNRg6k79a1/CI0ViCC+EtNv4CORHtDRmYEt5Bvdv6z6FJEiaaQkD0lKbFwNhLxutx7HItw==", "dev": true, - "optional": true, "requires": { "any-promise": "1.3.0", "eventemitter3": "1.1.1" @@ -6912,7 +6826,6 @@ "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.35.tgz", "integrity": "sha512-S+zW2h17ZZQU9oe3yaCJE0E7aJS4C3Kf4kGPDv+nXjW0gKhQQhgVhw1Doq/aYQGqNSWJp7f1VHkz5gQWwg6RRg==", "dev": true, - "optional": true, "requires": { "underscore": "1.8.3", "web3-core-helpers": "1.0.0-beta.35", @@ -6926,7 +6839,6 @@ "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.35.tgz", "integrity": "sha512-gXzLrWvcGkGiWq1y33Z4Y80XI8XMrwowiQJkrPSjQ81K5PBKquOGwcMffLaKcwdmEy/NpsOXDeFo3eLE1Ghvvw==", "dev": true, - "optional": true, "requires": { "eventemitter3": "1.1.1", "underscore": "1.8.3", @@ -6959,7 +6871,6 @@ "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.35.tgz", "integrity": "sha512-KUDC+EtFFYG8z01ZleKrASdjj327/rtWHzEt6RWsEj7bBa0bGp9nEh+nqdZx/Sdgz1O8tnfFzJlrRcXpfr1vGg==", "dev": true, - "optional": true, "requires": { "bn.js": "4.11.6", "underscore": "1.8.3", @@ -6971,8 +6882,7 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true, - "optional": true + "dev": true } } }, @@ -7038,7 +6948,6 @@ "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.35.tgz", "integrity": "sha512-H5wkcNcAIc+h/WoDIKv7ZYmrM2Xqu3O7jBQl1IWo73EDVQji+AoB2i3J8tuwI1yZRInRwrfpI3Zuwuf54hXHmQ==", "dev": true, - "optional": true, "requires": { "bn.js": "4.11.6", "web3-utils": "1.0.0-beta.35" @@ -7048,8 +6957,7 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true, - "optional": true + "dev": true } } }, @@ -7058,7 +6966,6 @@ "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.35.tgz", "integrity": "sha512-AcM9nnlxu7ZRRxPvkrFB9eLxMM4A2cPfj2aCg21Wb2EpMnhR+b/O1cT33k7ApRowoMpM+T9M8vx2oPNwXfaCOQ==", "dev": true, - "optional": true, "requires": { "web3-core": "1.0.0-beta.35", "web3-core-helpers": "1.0.0-beta.35", @@ -7072,7 +6979,6 @@ "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.35.tgz", "integrity": "sha512-bbwaQ/KohGjIJ6HAKbZ6KrklCAaG6/B7hIbAbVLSFLxF+Yz9lmAgQYaDInpidpC/NLb3WOmcbRF+P77J4qMVIA==", "dev": true, - "optional": true, "requires": { "web3-core": "1.0.0-beta.35", "web3-core-method": "1.0.0-beta.35", @@ -7113,7 +7019,7 @@ "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", "dev": true, "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#8431eab7b3384e65e8126a4602520b78031666fb", "ethereumjs-util": "^5.1.1" } }, @@ -7159,7 +7065,6 @@ "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.35.tgz", "integrity": "sha512-DcIMFq52Fb08UpWyZ3ZlES6NsNqJnco4hBS/Ej6eOcASfuUayPI+GLkYVZsnF3cBYqlH+DOKuArcKSuIxK7jIA==", "dev": true, - "optional": true, "requires": { "web3-core-helpers": "1.0.0-beta.35", "xhr2-cookies": "1.1.0" @@ -7170,7 +7075,6 @@ "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.35.tgz", "integrity": "sha512-iB0FG0HcpUnayfa8pn4guqEQ4Y1nrroi/jffdtQgFkrNt0sD3fMSwwC0AbmECqj3tDLl0e1slBR0RENll+ZF0g==", "dev": true, - "optional": true, "requires": { "oboe": "2.1.3", "underscore": "1.8.3", @@ -7182,11 +7086,10 @@ "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.35.tgz", "integrity": "sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ==", "dev": true, - "optional": true, "requires": { "underscore": "1.8.3", "web3-core-helpers": "1.0.0-beta.35", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible" + "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" }, "dependencies": { "debug": { @@ -7194,7 +7097,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "optional": true, "requires": { "ms": "2.0.0" } @@ -7203,7 +7105,6 @@ "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", "from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible", "dev": true, - "optional": true, "requires": { "debug": "^2.2.0", "nan": "^2.3.3", @@ -7231,7 +7132,6 @@ "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.35.tgz", "integrity": "sha512-Dq6f0SOKj3BDFRgOPnE6ALbzBDCKVIW8mKWVf7tGVhTDHf+wQaWwQSC3aArFSqdExB75BPBPyDpuMTNszhljpA==", "dev": true, - "optional": true, "requires": { "bn.js": "4.11.6", "eth-lib": "0.1.27", @@ -7246,15 +7146,13 @@ "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true, - "optional": true + "dev": true }, "utf8": { "version": "2.1.1", "resolved": "http://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=", - "dev": true, - "optional": true + "dev": true } } }, @@ -7319,7 +7217,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "dev": true, - "optional": true, "requires": { "async-limiter": "~1.0.0", "safe-buffer": "~5.1.0", @@ -7343,7 +7240,6 @@ "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "dev": true, - "optional": true, "requires": { "buffer-to-arraybuffer": "^0.0.5", "object-assign": "^4.1.1", @@ -7359,7 +7255,6 @@ "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", "dev": true, - "optional": true, "requires": { "xhr-request": "^1.0.1" } @@ -7369,7 +7264,6 @@ "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", "dev": true, - "optional": true, "requires": { "cookiejar": "^2.1.1" } @@ -8504,6 +8398,11 @@ "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=" }, + "nanoassert": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz", + "integrity": "sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40=" + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -9907,7 +9806,7 @@ "requires": { "underscore": "1.8.3", "web3-core-helpers": "1.0.0-beta.36", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible" + "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" } }, "web3-shh": { diff --git a/package.json b/package.json index 21317bc..607083d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "license": "GPL-3.0", "dependencies": { "blake-hash": "^1.1.0", + "blake2b": "^2.1.3", "snarkjs": "0.1.11", "typedarray-to-buffer": "^3.1.5", "web3": "^1.0.0-beta.36" diff --git a/src/poseidon.js b/src/poseidon.js index 8043c95..0533154 100644 --- a/src/poseidon.js +++ b/src/poseidon.js @@ -1,6 +1,6 @@ const bn128 = require("snarkjs").bn128; const bigInt = require("snarkjs").bigInt; -const createBlakeHash = require("blake-hash"); +const blake2b = require('blake2b'); const assert = require("assert"); const F = bn128.Fr; @@ -11,11 +11,12 @@ const T = 6; function getPseudoRandom(seed, n) { const res = []; - let h = createBlakeHash("blake256").update(seed).digest(); + let input = Buffer.from(seed); + let h = blake2b(32).update(input).digest() while (res.length { + var output = new Uint8Array(32); + var input = Buffer.from('poseidon_constants'); + h = blake2b(output.length).update(input).digest('hex') + assert.equal('e57ba154fb2c47811dc1a2369b27e25a44915b4e4ece4eb8ec74850cb78e01b1', h); + }); +}); + describe("Poseidon Circuit test", function () { let circuit; @@ -20,7 +30,7 @@ describe("Poseidon Circuit test", function () { console.log("Poseidon constraints: " + circuit.nConstraints); }); - it("Should check constrain", async () => { + it("Should check constrain of hash([1, 2])", async () => { const w = circuit.calculateWitness({inputs: [1, 2]}); const res = w[circuit.getSignalIdx("main.out")]; @@ -28,12 +38,23 @@ describe("Poseidon Circuit test", function () { const hash = poseidon.createHash(6, 8, 57); const res2 = hash([1,2]); + assert.equal('12242166908188651009877250812424843524687801523336557272219921456462821518061', res2.toString()); + assert.equal(res.toString(), res2.toString()); + assert(circuit.checkWitness(w)); + }); - console.log(res.toString()); + it("Should check constrain of hash([3, 4])", async () => { + const w = circuit.calculateWitness({inputs: [3, 4]}); + + const res = w[circuit.getSignalIdx("main.out")]; + + const hash = poseidon.createHash(6, 8, 57); + + const res2 = hash([3, 4]); + assert.equal('17185195740979599334254027721507328033796809509313949281114643312710535000993', res2.toString()); assert.equal(res.toString(), res2.toString()); assert(circuit.checkWitness(w)); - }); });