diff --git a/circuits/verification_keys.go b/circuits/verification_keys.go index 3676596..dc9f731 100644 --- a/circuits/verification_keys.go +++ b/circuits/verification_keys.go @@ -8,5 +8,5 @@ const ( // KYCBySignatureVerificationKey is verification key to verify kycBysSignature circuit KYCBySignatureVerificationKey types.VerificationKeyJSON = `{"protocol":"groth16","curve":"bn128","nPublic":26,"vk_alfa_1":["20491192805390485299153009773594534940189261866228447918068658471970481763042","9383485363053290200918347156157836566562967994039712273449902621266178545958","1"],"vk_beta_2":[["6375614351688725206403948262868962793625744043794305715222011528459656738731","4252822878758300859123897981450591353533073413197771768651442665752259397132"],["10505242626370262277552901082094356697409835680220590971873171140371331206856","21847035105528745403288232691147584728191162732299865338377159692350059136679"],["1","0"]],"vk_gamma_2":[["10857046999023057135944570762232829481370756359578518086990519993285655852781","11559732032986387107991004021392285783925812861821192530917403151452391805634"],["8495653923123431417604973247489272438418190587263600148770280649306958101930","4082367875863433681332203403145435568316851327593401208105741076214120093531"],["1","0"]],"vk_delta_2":[["19128064920055492247805374985983083930165378749179480909913816724406615335296","19288160050156725733802379244448689099841958569866762821564854312784709506393"],["17428331044619925399916395861726985657968925788307219189262474327320267761426","2419828576521667459164020710642577668561374285085862557553780257161628012160"],["1","0"]],"vk_alphabeta_12":[[["2029413683389138792403550203267699914886160938906632433982220835551125967885","21072700047562757817161031222997517981543347628379360635925549008442030252106"],["5940354580057074848093997050200682056184807770593307860589430076672439820312","12156638873931618554171829126792193045421052652279363021382169897324752428276"],["7898200236362823042373859371574133993780991612861777490112507062703164551277","7074218545237549455313236346927434013100842096812539264420499035217050630853"]],[["7077479683546002997211712695946002074877511277312570035766170199895071832130","10093483419865920389913245021038182291233451549023025229112148274109565435465"],["4595479056700221319381530156280926371456704509942304414423590385166031118820","19831328484489333784475432780421641293929726139240675179672856274388269393268"],["11934129596455521040620786944827826205713621633706285934057045369193958244500","8037395052364110730298837004334506829870972346962140206007064471173334027475"]]],"IC":[["939914628341458097516560836826640061417412666479488218276452351605045261272","15618548428001333556505887616624363833376841092682878676319870665446762679381","1"],["19702481984208948066905921949401701892622081248277421181828805140556810527961","591249296144528568644572307700485352989887758126147542074984634824580349790","1"],["21597213372011691592118423761747260467136980646123047205544845233948785583454","5196511894272462787215205652324772860730227888212475230176185917563588975089","1"],["19947365043590033317698858174466422267665557198488278124968639335975352349566","6888103996945586203623646000310666601467283622375764292824085463872350533111","1"],["929770654496063678443820024355937299267629214892684305904187689767724951073","6221018702137222207323223468439959521912038660689132882244771195851036027436","1"],["15310074104932801501644246260897669637226023081793799067952914365167212169682","5879166969760669151358319200626715484518003603727122733880632094958992877599","1"],["17971643265209741168572406785554242786918944839698650229434685581374741153049","3868842795321072870819307332638694135310027298425990065378780298275327376227","1"],["495745971801346882197336692718840760523647268109405134318265470241548603318","21130030807975271815094195118605945442199078822769333781275642658294010578431","1"],["15761017688632999952168047278435514149120694920182536586342231270126590704103","21392966441954723879763377537982650705338045410646499550683341262986076462497","1"],["14761637176340383428252649965810248295683877890169419113056281631580002773413","6731526493847224925576121390364151881861699044372365347469588873402831839941","1"],["15851835685574472775862827117616441786754152565801802145266865670177972669062","15874065945662487959415069605527499236937033588760848794428995176829519629867","1"],["17373726396273537796870417619744542499830071779785286088433182026540191523591","9161378079365747151628520286205749938233800006194631547321283555989284857225","1"],["13312905596080705851601635638064751396651919659332733234631412807907395745857","1260373832423040695616485404682224203278851493376258227901013628705543689541","1"],["6131427624040614882789546287840649427398137387259427267973401956189842853429","3972267586492425100185156855077534857818312507309978391302972105444087606453","1"],["21198228523344347205296190384150182495468439418409269811101629880033140307176","15096741571751104933099141427282568324191338977008173304759099173470273098928","1"],["3222590932508072780326303585610580402925045277262286309448642463994919513778","16639917920181277326312669550618803226863219580774101180998300717248211138561","1"],["2087448661411056266461299935931047190539985050070525918870157796554208345315","7856861375719716246409097742827048670200813977983835009772546370489019665395","1"],["19937371855088628377463856848053459016326089130102447720252506729674313901644","8472010261302839748150687516534356087779781288686922969203004672254591955186","1"],["554270891896844532066866172748318370009985132578090355693920520674291649645","10699156451760641087986249338477737746414757627181053986536524135969186196189","1"],["5465061226051267980642510344843071304798020617742311187173887598903006967820","11893193670297230058362002712839315440501820807975395434613315133500764621711","1"],["14641687371361924497352317469887183845134509606912861194557692030600273165435","17270925897527243275922678840690882543817991761890068516463770595105142817757","1"],["17297740399105498043635452523970204725442613466771891216931543851047613222062","11970135855505351357087071704234862227389490581222449923825910728832852829134","1"],["13963696747816354569374969450817020976298346550369939668146041309950121851602","3334597054598802667360397783523455682253476471939428640736044957691532983596","1"],["16921733156938179995722747086695678352508229050490088523030962286491935657587","19580663880552112182040173817092822585729774224638798300122624436719055011580","1"],["3332736485186613668142732636026375877311430630177998823651523088195510999347","8443620575343412122110287749388130100175803277925508709171151849001928250366","1"],["11005060412361570098083562497542120757858345364067259480244409487317856148376","20901994404640877101828132182462220444734163309092115188931910219812283716947","1"],["1367787598278437985643819431598330931335252418212065257020911130676301915360","7732341683215070702836276408170949477995243447094745409006552425064825017753","1"]]}` // AuthenticationVerificationKey is verification key to verify auth circuit - AuthenticationVerificationKey types.VerificationKeyJSON = `{"protocol":"groth16","curve":"bn128","nPublic":3,"vk_alfa_1":["20491192805390485299153009773594534940189261866228447918068658471970481763042","9383485363053290200918347156157836566562967994039712273449902621266178545958","1"],"vk_beta_2":[["6375614351688725206403948262868962793625744043794305715222011528459656738731","4252822878758300859123897981450591353533073413197771768651442665752259397132"],["10505242626370262277552901082094356697409835680220590971873171140371331206856","21847035105528745403288232691147584728191162732299865338377159692350059136679"],["1","0"]],"vk_gamma_2":[["10857046999023057135944570762232829481370756359578518086990519993285655852781","11559732032986387107991004021392285783925812861821192530917403151452391805634"],["8495653923123431417604973247489272438418190587263600148770280649306958101930","4082367875863433681332203403145435568316851327593401208105741076214120093531"],["1","0"]],"vk_delta_2":[["11726549366266579313577241235776675291310937629666282346503382426421759634401","17742294914510992667987111694071879473380829123429930847665566559625774744389"],["21107272869006459520856251551791701639627504488237133256189033368541686449811","21390751765804937775828136063497075487285747181408466422560240561552548140855"],["1","0"]],"vk_alphabeta_12":[[["2029413683389138792403550203267699914886160938906632433982220835551125967885","21072700047562757817161031222997517981543347628379360635925549008442030252106"],["5940354580057074848093997050200682056184807770593307860589430076672439820312","12156638873931618554171829126792193045421052652279363021382169897324752428276"],["7898200236362823042373859371574133993780991612861777490112507062703164551277","7074218545237549455313236346927434013100842096812539264420499035217050630853"]],[["7077479683546002997211712695946002074877511277312570035766170199895071832130","10093483419865920389913245021038182291233451549023025229112148274109565435465"],["4595479056700221319381530156280926371456704509942304414423590385166031118820","19831328484489333784475432780421641293929726139240675179672856274388269393268"],["11934129596455521040620786944827826205713621633706285934057045369193958244500","8037395052364110730298837004334506829870972346962140206007064471173334027475"]]],"IC":[["19297919417399184394532324181597658329834075232866100019152812814859397268431","14699022357013157061045807542966925633990406674376276222050022522196639447960","1"],["6388362365563994994798769018624399476157773300166350845180279774476505983730","1217648947419151894183447372833203907938938673770764619682641601131531973167","1"],["3126272743831125875461477201504235660379019590657876897422768240259895227533","2925084377602205004508382849819352668757030527242022365611757402467366851533","1"],["17387847174228245327715232848798152616407267392716933941868769226711928740481","1096675226219651075629157873641324617572268342063247490094549328342254389311","1"]]}` + AuthenticationVerificationKey types.VerificationKeyJSON = `{"protocol":"groth16","curve":"bn128","nPublic":3,"vk_alfa_1":["20491192805390485299153009773594534940189261866228447918068658471970481763042","9383485363053290200918347156157836566562967994039712273449902621266178545958","1"],"vk_beta_2":[["6375614351688725206403948262868962793625744043794305715222011528459656738731","4252822878758300859123897981450591353533073413197771768651442665752259397132"],["10505242626370262277552901082094356697409835680220590971873171140371331206856","21847035105528745403288232691147584728191162732299865338377159692350059136679"],["1","0"]],"vk_gamma_2":[["10857046999023057135944570762232829481370756359578518086990519993285655852781","11559732032986387107991004021392285783925812861821192530917403151452391805634"],["8495653923123431417604973247489272438418190587263600148770280649306958101930","4082367875863433681332203403145435568316851327593401208105741076214120093531"],["1","0"]],"vk_delta_2":[["16387671798576480847932379819368843257678774489163367102047295322423178277439","15478621310993617330780932378621004627680344811935882106064140147879135785043"],["4146651263272097482536403796145548707747481190068871240594136126762097388871","11898970623369189142377715638481376908544077570871221847177598703669075982080"],["1","0"]],"vk_alphabeta_12":[[["2029413683389138792403550203267699914886160938906632433982220835551125967885","21072700047562757817161031222997517981543347628379360635925549008442030252106"],["5940354580057074848093997050200682056184807770593307860589430076672439820312","12156638873931618554171829126792193045421052652279363021382169897324752428276"],["7898200236362823042373859371574133993780991612861777490112507062703164551277","7074218545237549455313236346927434013100842096812539264420499035217050630853"]],[["7077479683546002997211712695946002074877511277312570035766170199895071832130","10093483419865920389913245021038182291233451549023025229112148274109565435465"],["4595479056700221319381530156280926371456704509942304414423590385166031118820","19831328484489333784475432780421641293929726139240675179672856274388269393268"],["11934129596455521040620786944827826205713621633706285934057045369193958244500","8037395052364110730298837004334506829870972346962140206007064471173334027475"]]],"IC":[["19297919417399184394532324181597658329834075232866100019152812814859397268431","14699022357013157061045807542966925633990406674376276222050022522196639447960","1"],["6388362365563994994798769018624399476157773300166350845180279774476505983730","1217648947419151894183447372833203907938938673770764619682641601131531973167","1"],["3126272743831125875461477201504235660379019590657876897422768240259895227533","2925084377602205004508382849819352668757030527242022365611757402467366851533","1"],["17387847174228245327715232848798152616407267392716933941868769226711928740481","1096675226219651075629157873641324617572268342063247490094549328342254389311","1"]]}` ) diff --git a/communication/auth/service_test.go b/communication/auth/service_test.go index cebfa7c..bb7c8aa 100644 --- a/communication/auth/service_test.go +++ b/communication/auth/service_test.go @@ -203,32 +203,32 @@ func TestVerifyMessageWithAuthProof(t *testing.T) { zkpProof.ProofData = &types.ProofData{ A: []string{ - "8286889681087188684411199510889276918687181609540093440568310458198317956303", - "20120810686068956496055592376395897424117861934161580256832624025185006492545", + "18936271973117240691705559585769592974936923569213179030272017872877809039923", + "18422345941126925346404589344471685526481812474926428421192486541362664918772", "1"}, B: [][]string{ { - "8781021494687726640921078755116610543888920881180197598360798979078295904948", - "19202155147447713148677957576892776380573753514701598304555554559013661311518", + "21330507917605771112737495332384182754017872671331663255035774134477307177657", + "11462448334617588029347704885403867272225695665465848309095217964693916030466", }, { - "15726655173394887666308034684678118482468533753607200826879522418086507576197", - "16663572050292231627606042532825469225281493999513959929720171494729819874292", + "6840720762741964372185603768831031763412571244452731103935719626324813065968", + "21706573949504402596589372160652940106962129670251783730794239678073827564253", }, { "1", "0", }}, C: []string{ - "9723779257940517259310236863517792034982122114581325631102251752415874164616", - "3242951480985471018890459433562773969741463856458716743271162635077379852479", + "17548802242159422756497011319050257549779839182737330954154562317224853077096", + "16720285840459139191823107762843332365012723866736056448880671648502165007589", "1", }, } zkpProof.PubSignals = []string{ - "371135506535866236563870411357090963344408827476607986362864968105378316288", + "360506537017543098982364518145035624387547643177965411252793105868750389248", "12345", - "16751774198505232045539489584666775489135471631443877047826295522719290880931", + "12051733342209181702880711377819237050140862582923079913097401558944144010618", } message.Data.Scope = []interface{}{zkpProof} @@ -237,8 +237,8 @@ func TestVerifyMessageWithAuthProof(t *testing.T) { token, err := ExtractMetadata(&message) assert.Nil(t, err) - assert.Equal(t, "16751774198505232045539489584666775489135471631443877047826295522719290880931", token.State) - assert.Equal(t, "11A2HgCZ1pUcY8HoNDMjNWEBQXZdUnL3YVnVCUvR5s", token.ID) + assert.Equal(t, "12051733342209181702880711377819237050140862582923079913097401558944144010618", token.State) + assert.Equal(t, "116KTvTKY7cQHDf2yUTkuuUTSfLmsrGYzHhUSFrrXu", token.ID) state, err := token.VerifyState(context.Background(), os.Getenv("RPC_URL"), "0x09872d45c8109FC85478827967B6fEa0f59C05c2") assert.Nil(t, err) diff --git a/communication/packer/plain_test.go b/communication/packer/plain_test.go index a7b33b9..04a8785 100644 --- a/communication/packer/plain_test.go +++ b/communication/packer/plain_test.go @@ -37,7 +37,7 @@ func TestPlainMessagePacker_Pack(t *testing.T) { func TestPlainMessagePacker_Unpack(t *testing.T) { packer := PlainMessagePacker{} - msgBytes := []byte(`{"type":"https://iden3-communication.io/authorization-response/v1","data":{"scope":[{"type":"zeroknowledge","circuit_id":"auth","pub_signals":["371135506535866236563870411357090963344408827476607986362864968105378316288","12345","16751774198505232045539489584666775489135471631443877047826295522719290880931"],"proof_data":{"pi_a":["8286889681087188684411199510889276918687181609540093440568310458198317956303","20120810686068956496055592376395897424117861934161580256832624025185006492545","1"],"pi_b":[["8781021494687726640921078755116610543888920881180197598360798979078295904948","19202155147447713148677957576892776380573753514701598304555554559013661311518"],["15726655173394887666308034684678118482468533753607200826879522418086507576197","16663572050292231627606042532825469225281493999513959929720171494729819874292"],["1","0"]],"pi_c":["9723779257940517259310236863517792034982122114581325631102251752415874164616","3242951480985471018890459433562773969741463856458716743271162635077379852479","1"],"protocol":"groth16"}}]}}`) + msgBytes := []byte(`{"type":"https://iden3-communication.io/authorization-response/v1","data":{"scope":[{"type":"zeroknowledge","circuit_id":"auth","pub_signals":["360506537017543098982364518145035624387547643177965411252793105868750389248","12345","12051733342209181702880711377819237050140862582923079913097401558944144010618"],"proof_data":{"pi_a":["18936271973117240691705559585769592974936923569213179030272017872877809039923","18422345941126925346404589344471685526481812474926428421192486541362664918772","1"],"pi_b":[["21330507917605771112737495332384182754017872671331663255035774134477307177657","11462448334617588029347704885403867272225695665465848309095217964693916030466"],["6840720762741964372185603768831031763412571244452731103935719626324813065968","21706573949504402596589372160652940106962129670251783730794239678073827564253"],["1","0"]],"pi_c":["17548802242159422756497011319050257549779839182737330954154562317224853077096","16720285840459139191823107762843332365012723866736056448880671648502165007589","1"],"protocol":"groth16"}}]}}`) message, err := packer.Unpack(msgBytes) assert.Nil(t, err) assert.Equal(t, auth.AuthorizationResponseMessageType, message.GetType()) @@ -47,7 +47,7 @@ func TestPlainMessagePacker_Unpack(t *testing.T) { token, err := auth.ExtractMetadata(message) assert.Nil(t, err) - assert.Equal(t, "11A2HgCZ1pUcY8HoNDMjNWEBQXZdUnL3YVnVCUvR5s", token.ID) + assert.Equal(t, "116KTvTKY7cQHDf2yUTkuuUTSfLmsrGYzHhUSFrrXu", token.ID) } func TestPlainMessagePacker_PackAuthorizationResponse(t *testing.T) { diff --git a/proofs/zeroknowledge/proof_test.go b/proofs/zeroknowledge/proof_test.go index f66d15d..3747f0b 100644 --- a/proofs/zeroknowledge/proof_test.go +++ b/proofs/zeroknowledge/proof_test.go @@ -76,32 +76,32 @@ func TestVerifyAuthProof(t *testing.T) { proofMessage.ProofData = &types.ProofData{ A: []string{ - "8286889681087188684411199510889276918687181609540093440568310458198317956303", - "20120810686068956496055592376395897424117861934161580256832624025185006492545", + "18936271973117240691705559585769592974936923569213179030272017872877809039923", + "18422345941126925346404589344471685526481812474926428421192486541362664918772", "1"}, B: [][]string{ { - "8781021494687726640921078755116610543888920881180197598360798979078295904948", - "19202155147447713148677957576892776380573753514701598304555554559013661311518", + "21330507917605771112737495332384182754017872671331663255035774134477307177657", + "11462448334617588029347704885403867272225695665465848309095217964693916030466", }, { - "15726655173394887666308034684678118482468533753607200826879522418086507576197", - "16663572050292231627606042532825469225281493999513959929720171494729819874292", + "6840720762741964372185603768831031763412571244452731103935719626324813065968", + "21706573949504402596589372160652940106962129670251783730794239678073827564253", }, { "1", "0", }}, C: []string{ - "9723779257940517259310236863517792034982122114581325631102251752415874164616", - "3242951480985471018890459433562773969741463856458716743271162635077379852479", + "17548802242159422756497011319050257549779839182737330954154562317224853077096", + "16720285840459139191823107762843332365012723866736056448880671648502165007589", "1", }, } proofMessage.PubSignals = []string{ - "371135506535866236563870411357090963344408827476607986362864968105378316288", + "360506537017543098982364518145035624387547643177965411252793105868750389248", "12345", - "16751774198505232045539489584666775489135471631443877047826295522719290880931", + "12051733342209181702880711377819237050140862582923079913097401558944144010618", } proofMessage.Type = "zeroknowledge"