gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-wallet-webex] branch master updated: test with fixed


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] branch master updated: test with fixed data to diagnose emscripten problem
Date: Thu, 09 Mar 2017 17:34:23 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-webex.

The following commit(s) were added to refs/heads/master by this push:
     new f16f20c  test with fixed data to diagnose emscripten problem
f16f20c is described below

commit f16f20cabd582ba37da968d9987aeab476b5078a
Author: Florian Dold <address@hidden>
AuthorDate: Thu Mar 9 17:34:06 2017 +0100

    test with fixed data to diagnose emscripten problem
---
 src/emscriptif-test.ts | 18 ++++++++++++++++++
 src/emscriptif.ts      |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/src/emscriptif-test.ts b/src/emscriptif-test.ts
index ddafa32..ba83a97 100644
--- a/src/emscriptif-test.ts
+++ b/src/emscriptif-test.ts
@@ -13,9 +13,27 @@ 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();
+});
+
+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 sigStr = 
"7V6XY4QGC1406GPMT305MZQ1HDCR7R0S5BP02GTGDQFPSXB6YD2YDN5ZS7NJQCNP61Y39MRHXNXQ1Z15JY4CJY4CPDA6CKQ3313WG38";
+  let priv = native.EddsaPrivateKey.fromCrock(privStr);
+  t.assert(privStr == priv.toCrock())
+  let pub = priv.getPublicKey();
+  let sig = native.EddsaSignature.fromCrock(sigStr);
+  t.assert(sigStr == sig.toCrock())
+  let sig2 = native.eddsaSign(purpose, priv);
+  t.assert(sig.toCrock() == sig2.toCrock());
   t.assert(native.eddsaVerify(native.SignaturePurpose.TEST, purpose, sig, 
pub));
   t.pass();
 });
diff --git a/src/emscriptif.ts b/src/emscriptif.ts
index cf519a3..aeb645c 100644
--- a/src/emscriptif.ts
+++ b/src/emscriptif.ts
@@ -1159,6 +1159,9 @@ export class EddsaSignature extends PackedArenaObject {
   size() {
     return 64;
   }
+  static fromCrock(s: string): EddsaSignature {
+    return fromCrock(s, this);
+  }
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]