diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-03-09 18:24:44 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-03-09 18:24:44 +0100 |
commit | 7d1ef658c589d5f4420ce66714da7ff854c8b901 (patch) | |
tree | aab59f919b5652bf31b3ca034c55de1b76b0642b | |
parent | 0466ed0e3b104b9465af0b9b08b50edf850298c2 (diff) |
rsa encode/decode test
-rw-r--r-- | src/emscriptif-test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/emscriptif-test.ts b/src/emscriptif-test.ts index a7860794a..f0baa2b20 100644 --- a/src/emscriptif-test.ts +++ b/src/emscriptif-test.ts @@ -37,3 +37,13 @@ test("signing-fixed-data", (t: TestLib) => { t.assert(native.eddsaVerify(native.SignaturePurpose.TEST, purpose, sig, pub)); t.pass(); }); + +const denomPubStr1 = "51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30G9R64VK6HHS6MW42DSN8MVKJGHK6WR3CGT18MWMCDSM75138E1K8S0MADSQ68W34DHH6MW4CHA270W4CG9J6GW48DHG8MVK4E9S7523GEA56H0K4E1Q891KCCSG752KGC1M88VMCDSQ6D23CHHG8H33AGHG6MSK8GT26CRKAC1M64V3JCJ56CVKCC228MWMCHA26MS30H1J8MVKEDHJ70TMADHK892KJC1H60TKJDHM710KGGT584T38H9K851KCDHG60W30HJ28CT4CC1G8CR3JGJ28H236DJ28H330H9S890M2D9S8S14AGA369344GA36S248CHS70RKEDSS6MWKGDJ26D136GT465348CSS8S232CHM6GS34C9N8CS3GD9H60W36H1R8MSK2GSQ8MSM6C9R70SKCHHN6MW3ACJ28N0K2CA58RS3GCA26MV42G9P891KAG9Q8N0KGD9M850KEHJ16S130CA27124AE1G852KJCHR6S1KGDSJ8RTKED1S8RR3CCHP68W4CH9Q6GT34GT18GS36EA46N24AGSP6933GCHM60VMAE1S8GV3EHHN74W3GC1J651KEH9N8MSK0CSG6S2KEEA460R32C1M8D144GSR6RWKEC218S0KEGJ4611KEEA36CSKJC2564TM4CSJ6H230E1N74TM8C1P61342CSG60WKCGHH64VK2G9S8CRKAHHK88W30HJ388R3CH1Q6X2K2DHK8GSM4D1Q74WM4HA461146H9S6D33JDJ26D234C9Q6923ECSS60RM6CT46CSKCH1M6S13EH9J8S33GCSN4CMGM81051JJ08SG64R30C1H4CMGM81054520A8A00"; + +test("rsa-encode", (t: TestLib) => { + const pubHashStr = "JM63YM5X7X547164QJ3MGJZ4WDD47GEQR5DW5SH35G4JFZXEJBHE5JBNZM5K8XN5C4BRW25BE6GSVAYBF790G2BZZ13VW91D41S4DS0" + let denomPub = native.RsaPublicKey.fromCrock(denomPubStr1); + let pubHash = denomPub.encode().hash(); + t.assert(pubHashStr == pubHash.toCrock()); + t.pass(); +}); |