diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-03-09 18:05:09 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-03-09 18:05:09 +0100 |
commit | 0466ed0e3b104b9465af0b9b08b50edf850298c2 (patch) | |
tree | 54d95fcdf20805a0c102e9c71baa501b822f9218 /src/emscriptif-test.ts | |
parent | f16f20cabd582ba37da968d9987aeab476b5078a (diff) | |
download | wallet-core-0466ed0e3b104b9465af0b9b08b50edf850298c2.tar.xz |
also test public key
Diffstat (limited to 'src/emscriptif-test.ts')
-rw-r--r-- | src/emscriptif-test.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emscriptif-test.ts b/src/emscriptif-test.ts index ba83a9707..a7860794a 100644 --- a/src/emscriptif-test.ts +++ b/src/emscriptif-test.ts @@ -13,11 +13,9 @@ test("string hashing", (t: TestLib) => { test("signing", (t: TestLib) => { let x = native.ByteArray.fromStringWithNull("hello taler"); let priv = native.EddsaPrivateKey.create(); - console.log("priv", priv.toCrock()) let pub = priv.getPublicKey(); let purpose = new native.EccSignaturePurpose(native.SignaturePurpose.TEST, x); let sig = native.eddsaSign(purpose, priv); - console.log("sig", sig.toCrock()) t.assert(native.eddsaVerify(native.SignaturePurpose.TEST, purpose, sig, pub)); t.pass(); }); @@ -26,10 +24,12 @@ test("signing-fixed-data", (t: TestLib) => { let x = native.ByteArray.fromStringWithNull("hello taler"); let purpose = new native.EccSignaturePurpose(native.SignaturePurpose.TEST, x); const privStr = "G9R8KRRCAFKPD0KW7PW48CC2T03VQ8K2AN9J6J6K2YW27J5MHN90"; + const pubStr = "YHCZB442FQFJ0ET20MWA8YJ53M61EZGJ6QKV1KTJZMRNXDY45WT0"; const sigStr = "7V6XY4QGC1406GPMT305MZQ1HDCR7R0S5BP02GTGDQFPSXB6YD2YDN5ZS7NJQCNP61Y39MRHXNXQ1Z15JY4CJY4CPDA6CKQ3313WG38"; let priv = native.EddsaPrivateKey.fromCrock(privStr); t.assert(privStr == priv.toCrock()) let pub = priv.getPublicKey(); + t.assert(pubStr == pub.toCrock()); let sig = native.EddsaSignature.fromCrock(sigStr); t.assert(sigStr == sig.toCrock()) let sig2 = native.eddsaSign(purpose, priv); |