aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-12-02 22:27:42 +0100
committerFlorian Dold <florian@dold.me>2020-12-02 22:27:42 +0100
commitca140d99054364191d7209ae0d1de92cf185356e (patch)
treec86c6263f83fe1a4691cca2c5a6d85a544a1f17b
parent1ad064a2a5194dba3c512f244bf4e809c8ce5518 (diff)
add old test vector
-rw-r--r--packages/taler-wallet-core/src/crypto/talerCrypto-test.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts b/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts
index a8db6c44e..a9fa61035 100644
--- a/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts
+++ b/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts
@@ -285,4 +285,40 @@ test("taler-exchange-tvg blind signing (post-regression)", (t) => {
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);
}); \ No newline at end of file