diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-core/src/crypto/talerCrypto-test.ts | 528 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/crypto/talerCrypto.ts | 2 |
2 files changed, 1 insertions, 529 deletions
diff --git a/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts b/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts index 81dad2f8e..fb8d2a40f 100644 --- a/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts +++ b/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts @@ -122,41 +122,6 @@ test("taler-exchange-tvg eddsa_ecdh", (t) => { t.deepEqual(encodeCrock(myKm2), key_material); }); -test("taler-exchange-tvg blind signing", (t) => { - const messageHash = - "TT1R28D79EJEJ9PC35AQS35CCG85DSXSZ508MV2HS2FN4ME6AHESZX5WP485R8A75KG53FN6F1YNW95008663TKAPWB81420VG17BY8"; - const rsaPublicKey = - "040000Y62RSDDKZXTE7GDVA302ZZR0DY224RSDT6WDWR1XGT8E3YG80XV6TMT3ZCNP8XC84W0N6MSZ0EF8S3YB1JJ2AXY9JQZW3MCA0CG38ER4YE2RY4Q2666DEZSNKT29V6CKZVCDHXSAKY8W6RPEKEQ5YSBYQK23MRK3CQTNNJXQFDKEMRHEC5Y6RDHAC5RJCV8JJ8BF18VPKZ2Q7BB14YN1HJ22H8EZGW0RDGG9YPEWA9183BHEQ651PP81J514TJ9K8DH23AJ50SZFNS429HQ390VRP5E4MQ7RK7ZJXXTSZAQSRTC0QF28P23PD37C17QFQB0BBC54MB8MDH7RW104STG6VN0J22P39JP4EXPVGK5D9AX5W869MDQ6SRD42ZYK5H20227Q8CCWSQ6C3132WP0F0H04002"; - const bks = "7QD31RPJH0W306RJWBRG646Z2FTA1F89BKSXPDAG7YM0N5Z0B610"; - const bm = - "GA8PC6YH9VF5MW6P2DKTV0W0ZTQ24DZ9EAN5QH3SQXRH7SCZHFMM21ZY05F0BS7MFW8TSEP4SEB280BYP5ACHNQWGE10PCXDDMK7ECXJDPHJ224JBCV4KYNWG6NBR3SC9HK8FXVFX55GFBJFNQHNZGEB8DB0KN9MSVYFDXN45KPMSNY03FVX0JZ0R3YG9XQ8XVGB5SYZCF0QSHWH61MT0Q10CZD2V114BT64D3GD86EJ5S9WBMYG51SDN5CSKEJ734YAJ4HCEWW0RDN8GXA9ZMA18SKVW8T3TTBCPJRF2Y77JGQ08GF35SYGA2HWFV1HGVS8RCTER6GB9SZHRG4T7919H9C1KFAP50G2KSV6X42D6KNJANNSGKQH649TJ00YJQXPHPNFBSS198RY2C243D4B4W"; - const bs = - "5VW0MS5PRBA3W8TPATSTDA2YRFQM1Z7F2DWKQ8ATMZYYY768Q3STZ3HGNVYQ6JB5NKP80G5HGE58616FPA70SX9PTW7EN8EJ23E26FASBWZBP8E2RWQQ5E0F72B2PWRP5ZCA2J3AB3F6P86XK4PZYT64RF94MDGHY0GSDSSBH5YSFB3VM0KVXA52H2Y2G9S85AVCSD3BTMHQRF5BJJ8JE00T4GK70PSTVCGMRKRNA7DGW7GD2F35W55AXF7R2YJC8PAGNSJYWKC3PC75A5N8H69K299AK5PM3CDDHNS4BMRNGF7K49CR4ZBFRXDAWMB3X6T05Q4NKSG0F1KP5JA0XBMF2YJK7KEPRD1EWCHJE44T9YXBTK4W9CV77X7Z9P407ZC6YB3M2ARANZXHJKSM3XC33M"; - const sig = - "PFT6WQJGCM9DE6264DJS6RMG4XDMCDBJKZGSXAF3BEXWZ979Q13NETKK05S1YV91CX3Y034FSS86SSHZTTE8097RRESQP52EKFGTWJXKHZJEQJ49YHMBNQDHW4CFBJECNJSV2PMHWVGXV7HB84R6P0S3ES559HWQX01Q9MYDEGRNHKW87QR2BNSG951D5NQGAKEJ2SSJBE18S6WYAC24FAP8TT8ANECH5371J0DJY0YR0VWAFWVJDV8XQSFXWMJ80N3A80SPSHPYJY3WZZXW63WQ46WHYY56ZSNE5G1RZ5CR0XYV2ECKPM8R0FS58EV16WTRAM1ABBFVNAT3CAEFAZCWP3XHPVBQY5NZVTD5QS2Q8SKJQ2XB30E11CWDN9KTV5CBK4DN72EVG73F3W3BATAKHG"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - test("incremental hashing #1", (t) => { const n = 1024; const d = nacl.randomBytes(n); @@ -223,496 +188,3 @@ test("taler-exchange-tvg eddsa_ecdh #2", (t) => { t.deepEqual(encodeCrock(myKm2), key_material); }); -test("eddsa_ecdh regression #1 (wallet)", (t) => { - const myKm2 = keyExchangeEcdheEddsa( - decodeCrock("95P1ZRBAFZNXJ1DVZ3EANBM5KZ99AB5DNNY28CCVNWM902E9B7H0"), - decodeCrock("MWE4WM4D3FXRQ66X785CHX44XCN0ZDT2X3ND9CTFSVFW2GPKK2VG"), - ); - t.deepEqual( - encodeCrock(myKm2), - "5R9JBB5HBHC05XHXXFQVVN9ZKSXY955QZ2TP191793PCJ2SBAES3ZS3S4ZP2711XH81YN07WHCADX8B65V2DWEP1YS48SSXXRE03JKR", - ); -}); - -test("blinding regression (exchange log)", (t) => { - const messageHash = - "7T0M81R8NVB13SYYBDPY0XTP1ZMG091WM6YWFZE8E12DCDD41J242K75EH0KYQRMQJE278BCH8AYE7B89QZYGG9WBN8RHY8TVVDX9MR"; - const rsaPublicKey = - "020000XXM4C51WSNR83AYQG2D0HH5Y8D94R7WRZ7T6JG1TSMHF449TR0W4E2V68TZDWHWKW05T6Z132DEQ8K38EPHVSD77PJF8C9GSQ482JK2CAQ2PRYX1BQTY4Z1EYZ0Y6VXBY6D27RGCREM3G2X7FXMZJ1ADMVPPFYCSNJYWW2WP4NSVRJ5787K06AGD9F90RT7MKMPPQK0Q69PQHG2001"; - const bks = "VAXMY73TB736XCAM3PJR51E52KH2H3D20RGBWR59X25RRNBKV0N0"; - const bm = - "1BQH71QPF60K9TPE5TNNHDSEQ0N6AK9SEGXXXTW4HHWMR58PF8CEYN8C6NHZ8H19A3A7GRTJCGHHYJJPKX3RQ1SG2MDHWZFP98CDC8TTGZ3TN4FZG7J5MYEJ8239TV1BPQZSFEBYXE7ZJQEBEGW0SWJ6QHX2WM5JFS2ZDW1NXZ720JJVKD0MHE2Y0M3BGQE0SHVV5YMPZ6EME"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); -}); - - -test("taler-exchange-tvg blind signing (post-regression)", (t) => { - const messageHash = - "H9RYMXXSRMF2PH8ANYJ0FPW0NYV51120QNJ8HBVTFQ0EN6MVMYMZ5M3KQFDAVTN1S3YFZT42JJ4YS77DAWXHSEC72Q763E7QY0VT8TR"; - const rsaPublicKey = - "040000YFQZJJMK4EJKC9KHQWNMX4E9HHJQKXNFRGFTTW9AN72EJGY55EKCQJ34D8X1Y65DEE5N0D50E1NKFG51V2JJH3DKBZTRG4MJQP1647QDR5FRAM2848013FAW813CNT40EEN9JJM205XSMY525E2NZ9P9RQS1N7D1T05ZNEPXCKG2YPNF0SCNFSRJVJG0WS36BJJN9WH62H8MPBVHJQXXH5HN1FKDZ11GN0KCY9ZX1BRM3HTN66529MMB1MVCDFQKTBH18NZM430XHZFRHR3RQ5A82HNG8649VH686YHA1FNJJAHEZ1P1RCFY93GCJ31W2BJ56N2NYZJJ4CFNAP503D3VYE5HFWFB2XVMW7Q3XXM9KX0PGZMZBN2BRDKNCEYPXPQTYFSPFB1N36KJ7EHA40R8YQ04002"; - const bks = "D76VVVQ678V75M07K07MGN11Z3DPNFRTEEGPSSN3XMEJKQ6WM0F0"; - const bm = - "G9HCGGFNAPAQDCA41FA80VEQME90HDSQ4FZ7BV3A3RNYJS3C9BTM843E07FMH1V5M4Z8DHJQ8Q0BFH8RNBE08QQX1MB67D02ZRNVTJKGSKYMTPSQ4P5G4JJ36EVCQGSJ0GHG20XC93XJQC4JHJ1S0HN5X14VRMMTFXPHM5ZMNZZB2T21QY21CKHVBV907NH9P5XDYJXZQTV2XK8XNMQXT1Q3NCGEBVPQB2WF85SFSWZ0PS1ENHY5CGTKXE8K5NCAEAADQKGZCWJH2E2M7HW901CP863RV4PRA7HPHC29FWZ5EE8M3SKNY9V79K8CGK83WY6A97EAK98597FS10PTHFJD7NSCDM6EF9WAV70611GAQGDEDVAGZ7V48KWZ8FNC0WWRACBKZT0WPA3GPYMRZ9X8K8"; - const bs = - "PMTZ3MWWS4XKFV308HX4PR3NKTJF7TTGDXMR7V4VB42JZV58GT18SB1A1WXKJ7VTK9E92F4FWCEMMA9NTR9EQPJX7G91CBS3N7J9746BF301G8XSQ0M459RGKD5ZX95S5CAG56E61Y29X0HJWB9NC3MT19946NGVZ3027H0MMS5YPZ5HBBD6BJV7BW273YEBD6Q0BSY0WSE8YKG6B4F9KG295ZNTV0GV6TSDQPT4W32F4A1Z1KDVT83XHT68M0HWGSJ9J3MWR2205H2WKRRCAKX87HSWK1HSEZ1EQB5NE998P16MRX8KJWGZFM2ZHNEV20YREP1W4BKETD84JPT050QDS6VJRMNMK4MBF5BCCPCYC12H8F9WD4Z05F0WMMTH7P4Y5FG8QW3N0K732G9K2MS00R"; - const sig = - "SH9V61328M82B0VSSS760922R2Z79WYD6AZRVX0QYS6XYMBB9T8A228G41SK3VZCT826SC489TKMX7G4J6XP3P9VKYDPERP0QYZ0ZH1W4PGS9FARF3A8QHHHRAEQPJYWZM6NW1T7HXAWNK2R256YRJVF703XB0VJT0CJT8PT3ZBM73E584BH8PXNBJ14DZ8K4JGGNQN7WQC2HANX9G452GPVEC898KY6K1Y8D2P6KCHTBHFHVT35QM9NKNERR068QMSMT0FF546SGVFKBCA3SKHWYP94Y845RSR08KFV62DHXXM7EBD664Z7S7RCSD97DB7MHKZ3EXPYHHSF2FZW6NG14GJ25B1ZH51KAB9DKHWYR3S1XTCMXWGJT572EFCE9T90F5R54Z6RDXPJS7FDBWQ6TR"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet v0.13.0)", (t) => { - const messageHash = - "93AEW8G9BYPKCY169HWKVR618X323PPP876898FVXBX5VW0M8K6VT8ZPKATGQFD0DGJJHT920K3KGWSWC4JSR1VJZ97GBZDNGEJCKH8"; - const rsaPublicKey = - "040000ZGGYF6G19PWK6GZ5P3Z8MT00V0FP5AHNVFVTX1QNFK327J0KZHMMXP68F1DKAWD1JVH2Y1ANJNNH6GA6XEFGK5NF638692ZZ0TM2Y034EX0SWNFGJXQP1EXZ36QAC90F4YP72CYXD4BEXFJVPHZN4XKQPZFNFCZ434JYFVJP2MEVX0K13K8Q4KVWCT8GZBNCESXY847YKJNCSFK7YTGW454VHPSCNJRQXTBQK4TBV8GMPH0P2NMJAC8ZQGR6436R1HG6Y73Q8MFHV1BE8YJHFWCSH3C4Y3WF9V2Y3B7V83ZGCAK95JBHAYD1ANP1NJ0CE6Z9QQNTHD3PXTCPH6SJVK8FKWGSBDVCNXJ85RRT71DFT0QVV31KBGTK14N63G6S5PKPAJWJZ3Y995Q92MJGV5XNSV04002"; - const bks = "Z8SR97D48Y0GG4BRC9J48REEKQZAE2096CDA4CYZD0VSG17KWCE0"; - const bm = - "4Y96AZY2HTDEC1JAYH1GKDXTWYZRG12VJR6TAPHANHGW68YSFS74TD2BFH7GHETFKX54NXN0VT0KVZTX7E43A65SQDH3JC9J1ZB4R93RZ9E021RXPAXCQNPNXNQ09GFCZEHGFMWKRX55K5T1G00ZJX2JVAJ7GM62A1ZV193P3PVY7BXQE8NHHVKY2F67DDD7EXZEQECRTYAES74G36JG16JHTPPKPDVGMKM188VBR4ZR4R83K851PSC8NM6Y2SKRB79HVXHJBZG5RDQGJZKVXGB4RBC6NJRM8GPTFKGAG14K8W8WCCSPF2MS68N9P2FGXN713V1NVW1EBTNENJCM948YYRGYY5WYXSPB7ENRC7JC4HP06ERESWKMECFFPZ65J64HA908YA0XWMGDG8MPDN1M0R"; - const bs = - "0AFGA8NGZQY5W36RJTGRY74FAN3RTC6ZTKVMGZ3Q8PXW0V11CFFT66AR6EFBKWMV08TPSGWD81HHQQADWF1JBBPYBGSPVY8EY6YB8K05KT8N7EM50GV8WX2BS3JB0BYNH058B1HARZQ5Y6VD3RAGV86MX22MQ14EWW3ZHPTZET6T3GT9G9T00V0YWWKYM57BMDKN12TSD19V8Z2SDBP3KHP96ZR6XMYFPP57MRS7RWNNDSC3APBH8PQEX6ZFX71DKC63YR63XTYHJS3QSG1W5B71HMWTE8E46J7P9Y07T4NRCF22MNEKE6WT2Y7NFSCJNYGP10E07X4J4P3GRH0PAM5ZK621K055B1GKW50W2130KVN524NPFVEK247CHEBHHNGFZEANZ78GY7XM0CJNY5NV2M"; - const sig = - "FPS5TNDAZKDTENA3RGQFEEKZZCBCBYPDA9HKPDYFDD77GVC6GDPV20KPK89MHRT81S33XWF7ZDEJV6QHJK4JCR9FR4K2TF1BHXGAKANASVAJHGEEM1G5F807F1NB09VJ2CRGG33E4FVFM1G8M1FHHFGJYGNA65N3XKAP4RCJ9M3B69H2QWSQR3NX8QPAAQN0QWNJKZRHFSH1JNNTD0M49CDBQH6Q6KE8384EY4GB57FBMTC6HX760391PZK0WV3V01B2X10HJPHTZN7BDRCA6XDTHF58Y82NTG0TBFTC597C8V31S68KP2AJPQFEAZXEDJTQ4N3WPKRG5VGPKTC0VXVXJNNYA197CX6BE300QP14AQMBBB74VY7RGV6YMPKJ1KWH3P2ESWH1T4SQDM9YJQ7KY4"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - -test("gnunet-exchange-tvg blind signing (GNUnet v0.13.0, attempt 2)", (t) => { - const messageHash = - "NRSAGHSY3HVPXD22R41QCK8NK4FVA0TX44565RG944YSXKZ4A2WS38QXQGYC7KCQP3S2CEBD0B353YEQMCQHQCJ33C4CJV43P5XSDPR"; - const rsaPublicKey = - "040000Y6TRSZEM8HRBKMCYC4RF0FSS6GXTZ4FEB6QDBGXG1EBVCT6CMY3A9VR01W2YZKG6KS8603ZGBGNPSEB9Y5PGDF33JBGVCG7GFABV1WNXCHTVVE4FSZQJD9TTE06NQEVFJDJ2CPD5383ECCM3CDF7EFCT6EY2SHQ4CB6NNZZ64CZSY6M12BY0DE65YC7DMD22VRMKFQ1QZE5HYRJRASPJH4NNG08CKCABPQXYB44DF4Y2TTBKP21PY0BC84XQMMKSBE9XR190H54YH641X0326851C0MZR00C4W05F88VFBF2N246WNK8RWBYHDWK74W9J65JZFYHY1DNBZKCCS4K3A23BKV0H8Q8FV2EQXHGQGWXDKSGBQHMD0275EGA4ZRKZ6NK4S6GM0457ATPY26MS23XCX04002"; - const bks = "M027BA4SJHDDS3F4Z5VKHW76CDZ60ENVHE8T6HP4Y3B15M84FHMG"; - const bm = - "FSM0GCTX159NFEVGBS5WKDWWG56XJMG1A9E7S8GGDDF7ZK4EBXAR58YBBHQFN624Y4BHPHR2GWK11CK8D4CEJXJG7DDPJTWX396TY4VQ09S0KWJCG1QQMTY8QC0XYZ537RM809G0GV7GGTSHQC0EEDG6GW1FRFDXGBQ30K1DCGDR2KBP0MYKWQP8H8FB9DZPF8YAWJSJ6H38EP1NMRSK331AMWA5NJHNXNN55ZYQ12V5DZT833QDQM0RXFPE9GY8WR8HZ2QCJTT1HYQTPTS8JVXJJZTVVSRZVPYD4H0FHCTSDP2JE4HKSJQJB1TQ014P4PJDSXCJGJ7NR1363EVEFQDFGPYPG4RWQ97RM2ASG7ZCY4X06AHNEPRF9MK2GAQNFAWAE1HQT6KTJNMERJ1K607GTG"; - const bs = - "7CN29T7PBWMKYERHNWR3ES38EFQYMA8AY7AC0880NE06B8PC63XVSHNGT1PET474H79ZG2WJH049EHQSB65EZ2YN0RE4V5ETTR0WA7YECKAKVE99CTXMAF34NW1VW7F6H9QWYNPPMXNYM1ACWHCXMF678NYXJ6NFRMWXTRAE14DBE9SF30E1X1S28PHAZESQYWKS3DB0X8WY85TW1C3HFD52D92JTXC7MKDDT2AAJBGK7RQ35NDN74P2ZAZSE82M3FRZ5W6Y6YM0RD20JBZQJT5ZR6HXATEWPEYNWMQKGAH9XJ7TD53XXCSK6KG8DBGRY4GGSV776T1RDQZW8H0GTM4MDE5QMTQ4EKBW1CXZFMP47H4KCQQ60ESHRWPSPQP4CRK8BFYKZY6QSQKBZGRM6TGN7C"; - const sig = - "KP05FC1CFE9EMK84QGHBAT29G2NP7D1516YWZAR9TSTARMXTTB94AH30HFM4YXTGA76CDXQZ9FYRBXF43F8604A83HYSA8XYM5KRARBBAWSEQQ439JKJ8GNB35XHKGAXCFCVNDKA2W9EVE685WQREEWFBXCEBSVQ8NKG8JKE74F7GH932KVHVMCPSJ7B28WJ8EN2GSTZ9454PRJBXXG17H6SD35STRCK4APRNJQ7PKY78V4SGPK3CAW2ZWKC689Z4JC36H1RCMDJ2MEPBSC261D4ABMMHAS2DQZD0JRPQVGWHCAAVNFYFH0VSFQ13Y34AMKNMD0YFP5T0T33V2CZ5RNCRRKHNAFG6SD1X0XZ73GWZK6XDAYJH3NE3CE6W1FFPWJYRJFQZ79WJA8Q1B15ECZ4QR"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet v0.13.3)", (t) => { - const messageHash = - "KJ9NSRGA30Z7X59NM8XCFFRN6TW65V23QHPAT9VBNZ96CCDSTTZPJN3AJTTXXJABJ8088JQM1PRQYDXCEA26NPDGVT2VZHA69FT3VW0"; - const rsaPublicKey = - "040000ZCN8T8GYMN60SYZXP6DSAHJ2NXHPSA2PY0395WDFK37RGF0H8B73XT3G15JWSGCFF4ZT32YHPA84HQ298HNE544AJRGF7380G4VGGBFMTV6T1W4ZZA7M7QEGX3JZS648XJ6DYXR0Z5Z4Y3JHFF9CPJPJJSEE6SERVJVCBKPT9KVS3AY2T8VWBRN317GC1WQC35WA3QWP13VCDYCHPTZEW6DGM22HNRH63A1M34HBJJEPC69SK4SJCEAERS45DC72Q6TAR05F406AQWHJDQF47QC3SVHCP8EX2TW494A3ND0V8N25YDXKF7HWN3NNA43WE2S9GSE6DCX74XWTM7VKHP4508HASZZBG1Z4PBC0GTNQY7ZD8MW627GC1TRCCSNHNXQ4QR7K2QV4H8BCETVMCJGPJ904002"; - const bks = "B9W4W4DWVEVTZ8QZTW8RN2XQ92CVPGKS9GY2EN3FMR35Q67XEE80"; - const bm = - "V5N1AJGYYB6XWZDZSXANNNAA3HF2885FY8F9BQHC0R5ACR9JEZ6Y0F92FFQMXGNKG8RQAN731BA5WVDA0Y5XV2DTSX9SPBRPRDC4BQ27NWBDJQCCD29HVMJC5YH22CAYEGCGRD5VWJSV217CX6YQ7VSK1V8VW2RBZ1VRPG39Q6WNPNXZWYXNV1H5TB7BVS9ZRJNKEXAS2PH2H36ABFTTB6DJS0V7YC65HV5JTDFC9BRSDHY9YSVTWS8ZZ5YRYSC7WTRXPXJ6R9KE54FGW3HGWWE7ES0BY9S8GW6FE1QXC9K7P3C1G8JABFK4ZWTZ6VMBA1PRYY95H1NQHEZ9HK9M4AVND9FKFFAFAJMXDDMYDPE75T1TXB7Q7JRT9CAGQ9GB2XDASZM3N7EKJZRJKRT5GSE5K0"; - const bs = - "D4A41P0Q45F4FWTSDZNTDYXKH0BHEN7WWMER2309N3WW2G8AR81DY297G6D3DB1KFDFT10J0C0V000S61FXKARKHW5D6ZVP4VQZWA2J51NR57EN7J2X3K9ETD6YSTENCBJ4G7R4G3HWT01M5MNFNAM29GPM7MJ8SSY88G73TWPY2FJMYQQFQDYWXC99G46RXED7R6ZDYW63JPAMFV0P10D8F6F4DRAFCS5FQ5N7G0R5AKR2ZTXTXHGZWS876P4ZZNBW6695H659X8CR4NZ33W37RXY7ZAKVBX8QVNFGP533N5VDV8FM629655NHSX62D00ZX4BX63YF03GY8PC9D6T2ETD0HE3A67K614ZBNWDHVG91116GB3N3ERN7F9YCN6C8CBQX8EJ1PEA08D493RXAW9R"; - const sig = - "64K4F3Q5501TFHEMWND7A64FMPMHW4J49XM9D82YKN46EGK95KPPVS09DW9FPYKM80DR3TNPDYKCXHZZMYMX343RYYZT60PP6HJZTYFFJXMD01YYPW6K3XCS0E05EZ8ZZE1HXAASFSJDEXDRW6TXWSK2CSNPB110M7S86KS406S7D7F5MTJG3RHE8098EBCPCBQ5WE89BS44PD5A2REDPK72FYDC42EGZJNK1RMAPB6HPXW4PH4RN5ACMAXD95WRXMMN7JPQWV4S3BTBP27TFGXZXG6TS30395EC52KQZ1J67EYZ8YDMARGDZP7N4W82ZSSQ4KCN78JHF0CGBVPAFT56SY59WJX9EKH6G0D8M6HTJ1TYTFNW7XWAZPN7082DT8R0X7Z4224X7Z5JN3DYBTNWK4"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet v0.14.0)", (t) => { - const messageHash = - "Y2RGCYZJZ0GQW5VRHB8QMWBWAN1B7FTPCZMKXB9CEP9SDM4369E97W2G9JA2EFP002AQ2T4D33Z5MVQT3CJ3XC0FTSNZT53K864DS88"; - const rsaPublicKey = - "040000Y2TSH830TRWE2P3CFMGZ0GKD82C2KFDDAY9HV2PNSBH9VNQJ7RRVT67H77GVWCA01ATXJTQTB838BGEFTT0HDXH5SV0EYTKK4T3W7DZVHPMWBVK27BWJ5Z4N22J0GAG2QQB4T5QFNB29ZJGC65WDRTA287B7FSA1ZNS7DEKW640MTD1DSJ12T346YTGPXF5Q8FGP83GS1M4GVMMH782CNPZHNJ4SY0ANJ9PMA04K20CZNPM7PF8QYAYMBN43007F70SXQDRCM4MTH58BHPN49FW3K8XAB00K4GWFE0XDXFB0C3QZ6AJ26XHS1KHW1Z9XQKSZ83CN4E6T63PZNKN43YZBX7T9EKXEQK618SEJH7E692NQNY1BQHZ6V8SFXS8MPCWYHSPV5RA2RSVGAFM895JXCF04002"; - const bks = "YM36FHH7MZ7G41C2G9R3W7C853V7MX5FKJTX4W47Y76JZADVMEAG"; - const bm = - "M7D02AGB495HC2ZEKY81E3ABHCJ7S3C7AYZXFPCDWJW83FZVSCMNQNY4XWB71B3CXHZ8JTJXYNBBYXDK2RDA9XAR631VX4K92EWN2284QYCEZ70HWBEX09C062PSZVFBZCCT18E062Z073H2HQAJ4CWN9S1KC8X2QTYS2BFG4JBBM4BY20TTJQ7WZ5V8GGC38B9BYFRB6BCAXP83EFQBTC1WGRJ0SH6TDYH1FM3A9JQW6HXJPGP1VDQAST7TV7NNEEC12MDFN597QGPG0DSYNJGZ73PF78FRG901J2M2DPWFX2SV6BB05KGXDTG1J271FWRZ6MCS7FNZ9WB7AMFZAC4QDHSHR6667NX39PRHKSX5PNPCXR0QNJESGTG499QTJFRZMSXGCKHSC46Q3KJAEBBGZR"; - const bs = - "CSNDC0229WW52TVKN2N5Z0T4PQYBKMYHCYXGBWS8VTS5K55B80XATCSNEQGCC09TFTD6X8JSJ25QRSG3TYR0QXHNSGN3A7NYT9X8980WXV8N68RN5D1PA4WX20K5QBAH1H0ZVB9GBG4YQ1RYCF6NJV45H0QXJ0HG6XSD69DFGNM2DMWS41X13GTXPW39C0J0QKEH903XBXDPJYBC6F2Z5XENMRA306EY67WV96CFWSGBB34FGEK3WT8SRYJW51H44KXGHZP1VM81QJCVK4KM92YN6WZ10B0EHE3H3S5X0HJ4WZS1D4JTWVTPKKK2V7RNPH2320P73MJ1MMZJEGJBHMEBCGZ4STWZ6RDKWW49F6RC162Z0KXF2ENF8JR67J9PNPAYRG7J7VSYDSP948THQ8E1HC"; - const sig = - "QKBCP23687SRVZ719CZBD4DQTYDQ9HNAWTSZ6TNEHBDGVK5CECM67G07BC2K64999JA65J5BADKKNSE53RHCQMC9F6SJB8JT8N6SGJQEQW0EA054SS4NVB0F52RJRTHMK1KXSXQSFM9XDT5Q0ASNRWNB80HYF792ZRE6MMSST6A16CXA2745QXEVYSHCFFTY6GV3ZTW5CG0XJFC5VRM3YXB9QSF5Y92GDRQY294GWQNS4F035K7MWM5WTCRYNW8VZHW3R33GQ5D0JKDXTZXYPQG4AK7TTMJJAWZMQ8NZWWE5SNQ9E42RYQJQJEXHBRN8GZS04R6ZCGRK6PJEPEZ3W1FBH8HT02ZZ66BPS7CAJAA90RFCV1HDQFQ0PJCKD9GJ03WCYPQKV94NRFBWFM2ACP7TK4"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git ddbb4c740614d)", (t) => { - const messageHash = - "1ATSVTM3T954VJDAT9BBHT7Q4FGP8NWVF4SPCGSH9B1MR4J3FP5MZ73F4JRJHV96AKZD3GREC6G5BM2C7GZCG5YCAKZTX4B9J8EGQ0R"; - const rsaPublicKey = - "040000XA4AHKR3XCRMRSN9ZK019FK9FTHFV796G59T8FT6DARHT9PEBGF444AZD1YDCH0C1V0SK6JKCGBW22KYMBRJTKPA7GDY6SPHEQ3YKX22E0AM6TVFG8AQ3CCPED0N7PNJ19WQ2ND35MVRW9GDAF0GG0K0K2NC9JBMRF7GXM6E7C0TPHYFR4PFDGFK4R8SA3QDPZCCH0NXS6FQHRN593DVA638PTY38Y2TX0FNC9TDH40PBBPD2YP0DF6BXECA41A8Z0FD644BS3ABW2H7EHS49MXNCZMEXSNV8GBXGH3HW3YM5TPTVSC1T3PJ9GENVZGG5GK68K3DKH0EANHHXSV39K58AEMZ0AS3GW4ZEVSD2919SS5GFX0QVJM2NB39F9236BTCCFPT8VH6XNPT2B30YZJ9SN04002"; - const bks = "XR39EEEDN0KEPPJTN4W1K1SVR7WV0FYY6M2Y12R76729EE3QHHJ0"; - const bm = - "0B3DX0NZNMT4DY6K7KV6P9Z67TVS24NAJESF8A2X82A0A4AND4H8A3H0891TXDWW9SJRS4MZSMPQKY1MXR2F3D3YFQK3AYX1NG7FG6SMAZFQ03QBY5Y6ATR71YBNRDV7760W867B1RRGXP7FH7CNSQF7H1Y71ABWXH7PP9YMGHP8WVE0CSA9B9CFM504P788KSPFKATNNB3MNPVTE28VKHK49ZTQXWKK1SC3D3D3CXYSK8NGXFKKYZA56PRF3QCJ5N5V0Y7YV57NAZWM5RZPZNYQRWFRV892KA7ZJTYEYQSHH1ZYYYGVD7JEGB3YYXYY6039GQYF9WMJDWVWY9PNZ8JQTVBS2FSC5SGQBVP9G9CHDJRZNBTS007JW15X11KXR59AAV7AK5439B71YATY7KG3FC"; - const bs = - "AYCAF8GCK8DEY8MHHZ2YQ30TZX4YW667S00G958J2HEFY34C4GJER2P1VSMTA1G8EP794S7G1TGAEVT0TY5HHJ8VSB55N8PJFRYDRVAA71BYWCWQG7BVP3MCPEAX2YECQ5E1JK8HWCV5F4SZYFD15NMY20WZD2E8J2M5JYFKFV8YP4J9QTJMYD6H6TRY76C71FAKJ2DBE24VRG3PSAQACKPZK4W5QS4TH1BD84VT1BF7BNP2SC42W6PPT4Z1DBTDVJ8HPD6FW3TEF1EE46EJZ6AZKAZ8CJZ0B47RE2HX9711WXE6A9V863S68W23BPNK2XC220Z67SNPWGTD7CT6HR215JBJKDYCG38GBHJJYVTTTR3NCTW810GJP2HEHAZJH2E3R75Z9DN903EPGJV9XP1C5R"; - const sig = - "HKN1M9QY637NB8XNJ00B8ZXMFH22FG768F63Q6NWN12KPP6KJEANMKFN60QY4CNQE3DNPJR8TYM8A7D6TRKRZYE7EM2837R41R7KM0AMQHV3E9QPTH903TPWANFP4RMM7FSMMWX6F4KN8188VN1CG1P4FTT23J9S9J6AGBQXS2V7EBZ58ZQNNQ96J4873647P0TVM9VW43QVVCBJ3KMAT1E7BYCJT8B4Y5YGTSPHRGRY8G3Z93PP503MDTPT7HHX2VYD79HADV5TGF20RMXQSVXK7JNCA8KPWP8TNRGS59THA88R6W8H032BPADEJKRNZGPPEH8V03SZYDPXZ6MC99AE857Y1ZHW4RGE6GN6XS8MJMCVGVG03AJ6CVCBFV2F185Y1ZTFA3QTQKJEAHXYW9X7KR"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git 52968789d280)", (t) => { - const messageHash = - "9EDHM6NPM3J96NMDPGNRRJFQQ1DXQNN8HB3PGMMND9V7QYGW0SEZH2MBA36KX2BHDEPPN29BGP2N7X1CDEH6QFDRAFQP1HQ1JHHDGH8"; - const rsaPublicKey = - "040000X8SKF2D18C7702HAARRAB1QDF1YSKA8EKXHYJFYYN6BJJEPWW063FACXYTAQA7NANGRQRT9RC5SQ09K7D0TD3FM07CNY1NM0HGJ11AR5639NNC9AE6230Y5CJJSPPYKEAM6NNYQZF3NGY74XWVNX8JPA3F5S66YCE2FB1AFG026QWKRAHXSHG4Y4QPJ1S5X0AE5XM0312B9N9WDCFM87PAFD7BVMZ3F68VJFNQ9ERSEW9Q7XPVKP2FNV5DV5ZQADHR3BXW1H8DX1NXJC638TNT8797NB6H0YFHPHBN6J28ZZQW40MXSZY6PATP1W73NDJC60SNWRS3T2A802KTVQ7914RFVWD2FK5K5WSTJZN0XXV95EJPMK3YRX782NNEVV9H2WDY62KQS43KE1ASJ2JWZV7N04002"; - const bks = "HJA760YC8PCRF7GBJWER5J3SYRNJKF0527QM3JBE5J1BW61KBGK0"; - const bm = - "M7JXX0BQ2R4R8XRAAWFKW69VF7531QPQNMNSECRE0H63SVDBP1KG4W0CG33Q6DW654BHQVB535MG8GQEANV0JWKDHPZN03J1A32SW2CKVFTF7TVG9S0APC23WGD4NQ7NWYA9SNZVGNW0ZAKCZ26D3NGQ3HHPHNM0ZCS99W29QQTB1JW0QKGV399PX6FRJ1FAE920C2MMS0274NX2A2619FRBXZGME0FNT2SE0GF1CVS8F5CNPMR3WT2CA7PSCJX32F012SD837A9JJ2ADS1DAHY6D5WNE0QAPYG40PN0Z3ZS994AAPTB87AMDJHVYCKAGY51FA7PD5MP4V6NAD5TV1G61EB4DHFB8CYN1JEVFKG6PAVK28N0WDX6TTFQ8NS4Q8M36V6Z128VP94ASST3MPNAHG"; - const bs = - "6RPBZM7Z1ZZJ8PEP5ESPKNC5931B5N1J10FPXJ8VAEC44TKMRNACNXTSF9GPYPWG0556H0QYTNKEKXKTH63BY0B6F44QEHG37PTT8WFQ4Z9Y0W6RH86PS2E5PMQJGK8Q708WJEVNBMGZ8B63YZ4RQ0RPN1VWAVEK3JAMVC5E4HP39VJZQ58PDC403PYV0WARFD1V5A4HS2GRHQKP28E4FNQTVK657P8QDZ6ZT66TDV6VEDSS2H0PH0GKF6K9TB3982S2R78T1SDY3G2AB577PWZK22G9X8FJKACFARVV1PCGMECN4PXB6GGZDT7ZV20GHYZTF4V0PY8KSPF6H102WH6Y7P75V0RCV6SFHWTB2EV102K4SYPESNAVKB02NNS0BRMG1YPZHJXS0G1FKQ5W66HNEM"; - const sig = - "77NSZ9ACKJSN78MF5GP7ABBRVN00W0CVH9AMPT8RWE93SQ40JHVV93HRCCWAB65NKG8WC6DYN36DYTHX8FGA7ADQWAPS5EAYHSDHHFATQJ85RYNFFBGPGDTEPYNGA99JZPNHZYM51C3NKCGA9BCJP0MDCKNRPJ1560767MS7HVEKCKT3449T4STSPQ73HDA3QBEEQ8RNKYK23J759JCT116ZRZB9J3Y8BN3C35461M7FC3MJAS0ZF02AK34EM6Y7WQQSKMG423ENECKHAN4FVMKCZCAEG1RA45KHQ75A7W237MSCJFAJR05KZRKKDNK9BERHV9Q16NZ4FP9DFGMJTYDASG9XA6W4HHVAEG82MJGA81674YJ6NCGHY6JQ0YQ94E3X87K4B06W9CADS5H8DZN55M"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git 41000a00)", (t) => { - const messageHash = - "Y0X772RP6YA7TB7RP522Q4XXEEQW098NM0BYYCSC4T40RV9PQTFYV2WPZBX784VEEYV0NK1EWZTW31NB5WP3X47KQ8QNY2F7943K2C0"; - const rsaPublicKey = - "040000XT6GVM4B1SENCMNQHBDEX363Z2W6TSVDQ3JW28RSYQ6T6W2JR1EDKSBN490MG9WXKRMVV39JV0XRXQC9FDEYD7QJAFRFVY6TJCV5NN3016TX6YA6E6H63PK27CE2QEYFZPCEP8TTKA8SMNXD8KXTJB69XBXFZVBF2MCPJCN0PTRX97SX1CV94RFC0TDTCBAEPBXF7N2P025R8CDCYDFJWSKHCY7YRPP5N8B3GXSNS95TCEV47RS24TF2RZGKNRAB9MWG1TN30WRZ5WH8WEX3ERD5QQDXPCKFCPM08115X0R0H4NFB0KVQ126ERW6ZVR19DYTVBY1WNQ8D7B637FM5VWAKA4J4DTZVQEDEHB3PV405NB8Z6PCTW154P18G0FMGG3CE3GEM9FX644R6MZ54XPF7K04002"; - const bks = "RBNWGNW2KG4F1SHDVAG8DSPWKZT5X60A16B24JADG0J0T0ZE3SSG"; - const bm = - "256DXR8AXXZ3QEHKJ7YCD80WMKFMKT883K44T2ARGF2454NTN4YTG0V9K8RREY51ZQWNSQ4ZRY9Q1EBRSMJCEWQF18FCV02X29EERVMEVT2N27HGAK9TXSZVRTTC3G6W7YFAW3AXKGSY33S8DB9B23Y16V3J3W1JECVM186497Y1MT1X2S3K1MKE5PZYDAT37987C92HSTK0Q2EBBVJYKVEKXKCX2YWXNN8ATW9PE1NT3FHDYWKT88VMK2BNZA5D11BNFC4PZQBGJF8171Z2AR89NPPDAEYKHMHMN9NDJXV8XSKDB31ADPNV9EATWXRPK7GPPKP2QBHZYSHY95E0NW744V5Y2CY9T1772341EA36NS388VGQ2JJMENABCBW4J3JBNM4ABJ064J30BKRF28RPVG"; - const bs = - "21G2ZD0ES20ZMSS0SJAYE5N2YVAXDCASMA50E8QPXZ299GC8VP5AW6ZWQ9N4Q2TS333X6XFS0PWSB1BD434QYDDJ2J88AYDCF7GNY1YV0RQ5ZCCMX01SR523E82KP0YTAAMTY4PK1VBZJG6VTP4GD10G7AY0CHVZ5Y07Q11N5Z1KT7YMDX51ZPR5VK8DSNVRXDM9BNYWDE1RVABBG5NFV2QZ1XS2HY23VB260SAJCGS5DKQW73J973PBKAT0QRWSNTWB7RQJPJ41279FDSJW71B0R8XR87FMBWMYY0NB5FTQ5XMSY7Q6APCTNHT9QFM9J8XNJ6Y6GARQACQDB5BJG29KMQ3XNZMCYMAKQB6Z4K80NFJHV2YZ9G6PYP4XMSETQPWX8R26ZT2S49ZHWNRJ79D2YR"; - const sig = - "PFAKXZ50BFW6MFHYZ8A329FC9XA32RCYGW1JVG55DGZ840WTHQPGDSTBN0SQA0N939K0WM2X675NS7C7FPJ1K8AB48YTHGM06M07D6JPWEZQ07V0CD3BD6SHEJZYGABG6MFBZ5ZK7VJMX0G8SJRM2T0EYW852C1VCWJ1EW6W5VWVTMFJXN8PD4RSN2MN13NGQR0T31C8FG2XB17RDRM14F3X85B6RBT0M0A43192KS45JTKT25APMNEZG6SZXZKPE7KB0JAT4YESTG9KS7SJB0CW4A9KA45MC3HCJRPF094VZGNE7X4X6YJ4YA6FRH3VR2PX5R9YV6PZPNEHAHG8EEERBKWBX1DFCSHZ5QCJ41ZSVNZ1PY8DJWRY5ZBN62WG8NNGTX267WV39E8JVCDRP4GQAC"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git c0f407c9d)", (t) => { - const messageHash = - "CQXB3S7MJ2TH49NVPWY6KYJ0HT2DTNCPY6R3XCXA2KPBPYVYM9VTPX9K6KT35M361Q1228HNKEEV9TFQ5HC9HQBZTAMMX1RMM39KP5G"; - const rsaPublicKey = - "040000Y7S1X9TVB45Z26DDGDJQAS6T0R2SA5S636VESHSSKCMB953Z2KB036CK0V6D5WD2BKVVT9VAD5H0WT61QR54S33J9W1PPYFR88J4RK5K5TC0DRNV7R5KM8W2BFTPK60CS04AG9KBYB1T8SXEKXKKS7YVXPVGN46BHF2BC09647PJSTWBXZZ9WBH0RT8VVPE2KEYB3P9N50PPSFAD8NAG01NBMWQPZ84JWXKGZ20ZYCB6YA78ZNVSMPQS419084XTH2RCYP3GEMY47WNK1J4C53W9VKK92R6CPDD8GCDCPK0ZN3JK3M28XV40WGP43M3ZV3F8TZEX1Y3A4RFD5DHB452RXWDFPQVT94BWVNA38AHF1FABB6YK3NBT4P7ESBF06GCREDVDTN6NQ721JWAVRCZ3N704002"; - const bks = "D3QQXZT39B0ENYMESD8RF6AT4PSR5NREK2N56MQFDSZGMKAZYVN0"; - const bm = - "JAES15QSDZ137M788VM11TWP8CZMA1RBZ0SQM2EZBPJ65D76QEVAY632VMAY1K7MSWQ0ES9M77WSYWX7SRJJP2CGX5F3GSHF8VAJ46M5FY8KSHDYDKRK9080BAAEY24Z253YZ60Z70ESCS7A3C76NR184333ZF6JYD9AKW15D9C3TGYMKDXRSEA604S0WK4CXMVNBMBDBGYTAWDZ3SEAPNSG1390A1TH2D9QXACRR66BD2Q65BTPCHX6X0P1P283QYM0XPCC9GHWD80ZS7AK9EHDCQQZHQRC887DCQBK7CH646FKV3KZ51VAKMX547YCDGNAFXE3APED970K0SVWYDE84R0WC0MMTW4NKPDXDGHDD2D9D65YZQHMVRP3PDQ8Z3NQW07TJ785KARMB004DKF21C"; - const bs = - "9G624TT7V946QMMGC11D70CVWE79MKEE8HCW41BQN4V5VH75PM5DY4D17DW5H97VWHSAVKA49SS82T5DPFXNA1GQE3PZF8N4N3NQNV35C9GSPV4MFG50QNHEGY14K4F31FT74P6BH51JP9ZP02NFDEP1XW89S7RK1SHAZTDZ22AM67PF4KKXH1F70EN1A4PXJMMWJZSJY6S0HM34KE9DWWZYVSK0RDGFD2Q20K04VP3B5GT2M2VAR1KMJ6BFZSFE7Y9SM15S33H3M3ZDRJ2Q7S5QPMTB57J2S33GJJ80KDVHFYSJKYDPXC1M5HZBTQ43PVD3BTJE69D7CBQM47ZWY0HEMGSQJMJD6CSJN98A44B1HH09KKY9P2C56NR4AG78QBCCM23JKFZ0TZ8EQ671GFV27M"; - const sig = - "6XEFC32PJMJANZYDQXG82G6B41A3BT39RNBC9MYD8FR8Y6QWVCGD91ND62T9JESMP7F3QBNHYMCWQS7JRCSB0J3ZC0VPEYNCNPFYSC37H1C9BYTD4G1NG1RHXBF6PXGCTWM9K61GHWG2P9KA8TAZ9KNS0V3X6KVMV8BC85GMNGQQ5DYC6GA5732M7AENS6RHV1209PVRBVJ02VC4PE3K5MXJRRAMZG6HWXHRAREJ2NC8NCXMMJEXM4HBXPB6ETMSJT0CBVSMV12XN2STNFTM9PA2RP2N3Z5PCSK449SCZQ9ETJD9RFR00EA4TCB93513DB0C9F6KRCWVB9HJJHNWFWYKC5VMQRHA5GZRXC64FHDGFK4NTGQZJG9GH4GK08BPXH2Y3PR4R5YEWYDJRYNJX1EH5W"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git c90b5703c8)", (t) => { - const messageHash = - "GRYH1N6KBP6MP40QMBRJJBTJ1TH5X7CVZDDTB4B2MTY63FK42DFGVNVR41EKARK0S5REVWAZQX2C71KXFCEFBG853ETD53SHTK8NAT0"; - const rsaPublicKey = - "040000XW244EXHAN4QQS9QVVV67T3W7PFN619HDBGKMR37NVDYQ122BS5M2R8P1FEYJZ7N1AMR98K216JSASW3ZMN8FPWXTTABZPVBVSR1MQCE7AT6BG3NY5XFT9HNDN989VYH6389B0G31MR1G9BT38S8X5BQQVC5SCYRZN62WCYE7MFNTJDXBYVAZXK7XT60NS7554WSSAB0C2N53VK096FBNPJH50CD58B3D1VAGADESCSNPCGSQ4EBRNQBEJCC1XNNJWSE495S5FNTZV930H56G646HDADTDKZP797PQ7S59DY8TNDERA0M424YW4TPFQNMYSY639ARQ5H1YA4YRC0Y413DBTRMAXEM5GWAS848MJX306WPC917W11TS753T2GAP4Y1C474VTZTMSPT8CY2F55FS04002"; - const bks = "CFEEEMSBJN0EJJZVE1J81279Q28X39XHGFBCDT00C7C0PNQZWK3G"; - const bm = - "978AJ8MBGPJANHSPER978SYKGJ1A4ZXBY00DNXCP10SWGB5S5Z6HZH7TH3VA0HHC3F82XDB7TNWMNJ8GYM0T46SS6E7X8J05QT59FEQMGQERBG7ZCYXB85VZD5BN8QBWP49JB142P4PSNM6Q2M29AWEPK7AD5VV61C3KCQ14QQ25706B2G7NQ8EWAM8KXJ0Q8443H21VT48R63327G6P1Q3H4GVPVYMFXEPJ123KNFK6V2EDZVQM756TE0Y7E9M5ME7BEFZ2EXDJDRZXCQGFKWABCKCB9SED2BDRXJGT83MB8HYE1WS2F3JF67TQRFMKWCN0PYB44573FSP2EF0X06NM6P50KQZEDVFCNED29AY04K3X9RBN124TSCGM83ECZC701WZ00FF665FR6N7HZ788E8"; - const bs = - "E9AZ4D8HN5JB14BZCCR0MX9M27ZCDD7SXCWPZTSAXE6CKZX70900G8Y2YD9QJDVX4DM14YDSTVVN7KWVSMDC7W6MFHSQXZRT4G40WGRW8MD4J8NTTW0V21R9S1KNDPX9ANBKHWM4NPWZHEKT8T9G5VZRNPDDS2SWSM4A75VCY65ZRHKM6A31PTJGNDJYCSB3G0SPMV88WDM5X3MH6ZFW3YYBW6RJKZSYRDFYEESH2FH8S16SGAZRVN8MHCTC2ZAYN7XQ79NNK743PDSAZ7S2JMGHSTQMFV934FE341D9RSWXHZWK28JE383N9T003WPD8P0AQHGRVKQYVSDEYDVKMVR28F75KFBJGQZSFCZXK0WXM986CQMEEEH4R7E6NTGZ5BKCBYKBAMVWB03C60J73M1W24"; - const sig = - "0FK43KXRXAPQ4MKTVAJ6HMBFETRCFNBKPW27FV407VF2VNGPEMJ293T42GKZ99GQ3MEGMENKKCF9XVAT17ZMSK5HHFW27A97FBM1JZJ3YXAM7DN17QRTXVR4WDQ22NJKA13TA9VVWWDKZA846RXEEMT0QP34XKK7MCBMFC911QSY2DHJBRCQ6XGVDPD4FA06AFDCYCFJRDZCVW50DQKJD93FM546B9D2KF8YRR82NMH1CRTAY06XDRZ53W2KS2P9PBNPPWC2RD83KXETPQM0ZAS1YV7RPBK95EX9SGX2VVQEVHD2SR7RAA46GB6PYTB0MB93EE6XB2SNBCYNTC47SR74FGDN03ACQW1PSSF3VSMH4KN5QTJ4E1B9ZS1N6AVGWZ99V0HX82K9T4AR3CCJQPGXMC"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - -test("gnunet-exchange-tvg blind signing (GNUnet git f62e24a8)", (t) => { - const messageHash = - "AJXZQM1V429T10Z0T8AK84NNANM29QZERDPSAHJEEGMC8JWG39RJP7RS0S6Z51JKGMDRKR3VFD058N126QRGFPKZZ4QRTQQ9GDRRH98"; - const rsaPublicKey = - "040000WYSS9AGSVH9771Q0CJ47K5WFTQTDFX14WSY2BR2S14N255EHEHS7QH1Y4V20NFD218EMBYJCNAN399RRFHFCMP29X0YY70DRZ1J7P07ZFHSSNAN5R2G8D50F7ZPN98RJTBB5N22FGNCVHAGRND3T5F1W08Z8S0RY5EWEFG9VQVDW2QNV720H6FWQ97S3FVWMFDKJ2QMJCED592VFHSZ8FD2JR74GZMZFB7HGTJNF82XH8ER034WK66MQ8D9CHXY0481BZCX717F4N5PBMNBVJ2S1TVYHVGZFRKNMTEKK7MJ2V2K6X1Z4XMCH83NRDP1X2CF8QP7XPGY09H1P5QBCAWK8YSMETSNJ5A46E6BBPP6XKMT80TGTJ6860VW9KPTJMKYQJ49PDXXAGVX8FF98T4XS2K04002"; - const bks = "SJ603F6Y4E35CD0BA2ZA1MZEP55JXZQN9BS4VA8G4QZEBRKZVCYG"; - const bm = - "JC6VZVQPWGD0NEK0GTH133CTK81AX41PVV788EE5EMGDESPM2A3N3DK5E7QKG49HN0NYARR4MMEWBEA1MXQKX1RFGGNKJZ4F5W2QNTN6WGP8FHA0SWGPAAY8E90JGJ45ZGW4MYBWBGERC6ENP2HQC8X41YR3ZW38FYM1PBRT474S9P70923GF5P7XY60YW9W9GTZ9E52Y6KJM03970ACG4CAMA8P81JZF3FA5VBD2JQ9MJKNH990Y38WB2ZEA3EF85ES5RVB7ZNTG5DAEW9AX026E1VKXAFWAMQ7WMZ3HNC5PKBSM4WMKX329A382R529PCZPMNVZ7V81SVARY2FXH6412FFMM33C3M6YSYA09V3XE271KBDVCQK8VAHGN180BKE9PAJ8YCDG36WB4MHG5YJD8"; - const bs = - "GEYKYF6TND76TB9M56C3C02HF5C0H2FV618959NDNA72J2YWFWNEXRYP2TQ09DD0WHRNCVFH7BMWN1EKV58XNBXKDVH26SB3KJV0WCHJ0753N5R6YA5SKW9Y8BZZVS1RM432HSM5VXAQCBZR7D39WR2EP5NR3BWRSPTQXEBTM55TEXQYK7QXK9WKBXQN87ZM9GBQRNGG90XW890W9ZSBD4W7MP27H5CA8YNN3MRQQ9TR24PY4PX4YCKSZZXSRT21S4VC2XQJR6N33Z760XJGKGQ83BMKC3797T2C04TY0C94G3CCWV4SFHDH4BTKE1RQN0ERPE1MQJAVH766ZGGW1CK2V3AXKT3KEJHWMAS8CG09B3E31THHZJGWYJ9M7BR8VSMFAP34HR1JYV4K3155H85FY0"; - const sig = - "2QC0HWZNBXPN81JRNJK3MPRT3B4591Q77MZC7SNF24CCM076DZ93HZ8Y10GMM5G675PSM2RGPRA19WQRKR8KFN6CRJ2TZKAMRD93C6VQ1PNQWKN6RCE6XC3RAHNHWKTTVJZ7V377WJAGBT64ASAVQRFX3GT7NXSZ16S6Q2HVD163TQXFZE6MFR6TPQ2ZG9CV2690PFX5VQJ742KDNM5Z7J21147N502CZ2EYW3ZEQ4Z70CXD8VT06TX718Q0GF7FKCDAGJFG9DKA6NZ4J2S6YCXJFGTGJAACZGBC3ABJBVG7CHTHRHSDETSCKEZASKKT0MXMK5BP31MX1NEMWEJWZDEDY5G9JG6TDG2N1ZDAXNHRV7MEZ9XBQA1TPQBT9ANXWVGCECHPC10DN5G11MFXB66Y7R"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git v0.14.0 again)", (t) => { - const messageHash = - "0KPXQ02JNKX2B7XKTEQX0JBNCJPRCWGJNF8RK5ECDWBQETX44HCAESXHTRJ67S6AVQ43ZTKSJPDT09ZD3VR1K9JTWNJ5JYQMT78FQE8"; - const rsaPublicKey = - "040000ZTZ0RFMX7K1EE2WK284EMNBMCPA0RMDVHVZCQ4P9ZW0V9BAEFMM34WKQN1VJTQEYCEP5F14SEMZR3E55FZ6GN1T77WST9BCW0BF6Y6G7W55DWX1D3HW8Y9EE1CE9Q77M2HKBC01XW7HCMY79021H353XGEX5E746ZAPNZ5B6RWX8VSD2X5HYSJCA4A1K8NRTMD85CV26N39NPF64F0QCNEMTT937TCS2KEJZWPQ3JBHFGTJ3TMXA283QMW06PR6FHX26ECEV08NRRCK2ARDS5XQDB0N19CS7C1R6E0WQ83JPBCM66Z4F9Y44WMMGXFHJWQD15Z4X4SBRASFM54DRX9P38Q51QT41SEMSG17AND2FGJ1FFB1MNTNRJ6M8KZJBWVG8JCJK4XT70X8SDS896YXFVD04002"; - const bks = "T2GASPN0MFC86A629SRSN3DQ8WEMQM9PPW1GY3EX6Z0R6CMQRYEG"; - const bm = - "TNRCH0YSEPQQ2TNK8P0KCC2148TAHJ9ZET8ABNYQXS77TXY83AETEAX100TNE5TG9QXB6HEE7356Y89Y1ATC12Z9RZHEM11R2Q6KK64WN0J36TRJHCYBJ3ZTRBFVFX8894R9XGX86RQ6Y96RSNNFETF455PTF9NC60SPN5T3TNX0N889BG2A5Z19KY5WCMWQ4YA9FCZ07VKD8XKYCHX3XDC256NTCFEENMRM9G8R0VSSMH2BKK2GJ09J1JYGMEQS71DPDP5GYZ6A47FRC1WT5GT209RB9XYV6DM54E54WZCET1Z9ZHE06B89KXE83CGXDPYTNJ1SCFRCQ5Y6443JBCYE937B7XN65YAVZ8JWY08JFK61CP94P2285FAKHTFY96TAA025BGXA9K8A0QT7Q4ZT18"; - const bs = - "H2KWYFRQTSD85HGGVF856FW45VZXWGT945J8389TJEXHKVE27T93DB0AMW49ZM4WGD3C4E6Q3G0B542MA2D3ASP16KY29BHXJHB599V4WWVJSNPQ2HMZX0DH1H4E8NA9WZX60BTMRBPREWMQVMZTVJ2WHA11R0B2963P38BSGN0AE2DVE53VH2NATQNY5BPKJZ42X1TWFM0XFJ8GJ14PEY40Q2435DHBAD6CA86262X4K93E5FGDFDGXQ4CMGP72EGKJ1J568FD28PXR3JZK1RRKQTW2QJCVY9808ZFKVRTWWY520V7M2FXF5QG8P4A1G1HVQPNE5WZBB2GT1Y07YGHV697F3CQ8M2QSSBFNG136QZSE98PHDSTXA8WRMHEVVWV8D3KHR90Z54TYKBCH8SXC7W"; - const sig = - "C3RJ3W7MCN9D6X7NZ7PG65H375PWKKE3ETMQ0JGCSKXCACQBJVZWP3KR2R9M24771N70HVZGAQ76XGCTG7AGTH2GWJ4SCVA2FRPCD3MJVCNKZVFGQDT1DNVZPDKBCJ46WSKKAB75J4VXF4DW1D4A39RSN3SDCW7QWKQ7QD3QJKSK8ANM817C4FJ7HWYZ3D78MYYHAQGB0JV149C4Y6XV92N263HJVPP8RB8832P98FVENA9SNC6PXNQ4QAGADREBJ0HMQYF477SGC5DXWTX1HGZM1VRF9YDHG6BNQDGRBJ1J965P6F3720JBRM9C923BH9666ZZE40XZQSWCTFPV7EA0A231BJCRC79JX3ADQK826DP6BG1AK69Z5RBDW4J1098GDJEENK15DX6GPX712NSJ34"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); - - -test("gnunet-exchange-tvg blind signing (GNUnet git 39456ab7)", (t) => { - const messageHash = - "QKV41ZYSNAHMYXJAS2HGNPRJNW9GTRZM42SGNT0K9436ESQWDZHFD3XGY08C611VQQB44ACKVDTSF7GQJ8D2ZKDT2Q5BR1N98G24AF8"; - const rsaPublicKey = - "040000XACG6M4386HT4RJST513ZE489QSJSBC4X1FEAYEF7A9MCPJ2VQ6R4WQYWYA03FCAH6XA5N99APKFFMGEM6ER7HHEH2HZ3MZZ622WG09QYEMNYBJ5SV8MKTNWR1HF3M7KSK3GG2WVSRRA40CFN0PMWHG56RFZF46WBWB8KE6YVYWD7NDCRGHZ24J9ZHAESHFNBRGXG47459TRTR8X7D88NY5PRTJFJ3MKF0TET9975XVV6B2A05850YD1SQ7Z0VDM934VJ1N7DEBEDVE7MQSSNC8EW0RW3BNYC51R16DYP1CDHCY8T5ASRXA89R8AGZ1WQ4Y0HZTKHWK40Y0QEV6ASNT005M99TNS1DD9HDM15S98F9H1RF5B6QYCDPQ24F7WNJK5PNEQFDZJJBC6B5AQQQV9G104002"; - const bks = "SWB2XNW91AJSWVQGRBF04X803D4J2JXHZTH7EY6WZH7C4D2C0TA0"; - const bm = - "H54JFWTTAPW0BGD65N5VMW37P9CF7T296AAQ3K84EQ74CCJ1AP4TFRA8N8RJXX65T1ZNQ4TYSFVJ32VA1J5KPQ0FZ31D32B34B8KHPGMCMNRY79B2JEAN6P52JGA18SERYD9E8TEDNPM2V58PHBFJFBK4NQ2CBW0GVEG55VAYQM43F4M0HWABRC4S0KJ12WYK8GPC230QK8N1FGJCENTAAG5BY8FAZ2DBXWQ06XHQ93C0V04BG7QVKNGA33R5TC1XG82MJWH8RGX5V1HQTMFGA2BJ008C70T5XX47RY8P3YQ51NV0S77G3Y2AMFVYZRHV95AQACWZ7X6B9KWAB4ZCB98QC9XN1AKD7AEM37KCR87SB7HKHQA7PH4WMXKRT4N22C6Y3DZ9BRXYCYPSPX10T52TW"; - const bs = - "DZXJDQKZDG3VR0KGNE0AC9GRSG65QXKXXVXHVHVPZFYBDSYEPD8C4SD8QVFY7FRX1YRYZ5RKX1MXSYPSSPDY38Y2694CBBJXNSGYGJ1Z1XW6PJAZ8ATJZMMDHVMXBAY7C9YX44VFHDRXSS2DRXQ6XNNT7X344AFMD06QTFH9RD2XCKAA1DZN09V6VBWGP54E6QYC8QS9XY6ZRBRV631KVCQM39PN5YXSZPN9KH30KWJMD2D03KYPA2WJE5G89S24GBBP8SQ3F2XNPEACW4ACC1GSGRQCEGGTJFM1VVSNYZ44HMV7BMRDHT3W7AT49WS772AJEYBZFNDJMJAMQNZRW14MZHAANAEE2RDZ9BGYPHKXAWA7A8ZKEHZTFHFPTGQ9GW76H427C1S1X5GPJV498RTSAG"; - const sig = - "3NZN0YFM6C0A58WC3F3RAQVFBH6PZZQB1B7JY3V49378K38E2PH8EBJ8134VCCSP4T6R3YE1GX7HM3CMD4RQVWRVB646SFJDG4AWJA6JN2Q227RRB8BR852CCVBWQAG1MVVX20HJ5QB6FRS8DFKPE6YCSB4N5CGYTMHC3HW8DX9ARJGRBRJEWHK84PQCBWC6ZCGES3N1ESE8VTS0EXFB1CSY8XDPKRHA2EZTV01GQZDYKS8G4Z8852CJ809Y3WNSHECKTC8G3M2DFP3QABKZ7NTZTFPY4ZH93BJ9SEY2VFTCV5XWP9H5556ZQWQH06833D2WX26BH02Q7BCAJ72MPS1Q85EFEBVRDXCVYGK9PXP1Y0SYRGJAHBJ4F0NPV0Z8G7FMJHQPF5B48YF7AQMZ3BDPA0"; - - const myBm = rsaBlind( - decodeCrock(messageHash), - decodeCrock(bks), - decodeCrock(rsaPublicKey), - ); - t.deepEqual(encodeCrock(myBm), bm); - - const mySig = rsaUnblind( - decodeCrock(bs), - decodeCrock(rsaPublicKey), - decodeCrock(bks), - ); - t.deepEqual(encodeCrock(mySig), sig); - - const v = rsaVerify( - decodeCrock(messageHash), - decodeCrock(sig), - decodeCrock(rsaPublicKey), - ); - t.true(v); -}); diff --git a/packages/taler-wallet-core/src/crypto/talerCrypto.ts b/packages/taler-wallet-core/src/crypto/talerCrypto.ts index 3ce5491c1..8713fc965 100644 --- a/packages/taler-wallet-core/src/crypto/talerCrypto.ts +++ b/packages/taler-wallet-core/src/crypto/talerCrypto.ts @@ -219,7 +219,7 @@ function rsaBlindingKeyDerive( rsaPub: RsaPub, bks: Uint8Array, ): bigint.BigInteger { - const salt = stringToBytes("Blinding KDF extrator HMAC key"); + const salt = stringToBytes("Blinding KDF extractor HMAC key"); const info = stringToBytes("Blinding KDF"); return kdfMod(rsaPub.N, bks, salt, info); } |