aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-09-14 14:37:17 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-09-14 14:37:17 +0800
commitb68d2820825b3e90302d452fed9f28bfed9668fe (patch)
treedde435ac75fd88a492fcac3947b612627d5dc675 /test
parent11557e8e6001d28afdca1b5aa78b075e0c8defc3 (diff)
downloaddexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.tar
dexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.tar.gz
dexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.tar.bz2
dexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.tar.lz
dexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.tar.xz
dexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.tar.zst
dexon-bls-b68d2820825b3e90302d452fed9f28bfed9668fe.zip
bls_if stack version
Diffstat (limited to 'test')
-rw-r--r--test/bls_if_test.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/bls_if_test.cpp b/test/bls_if_test.cpp
index 6c6e549..c2dc0a9 100644
--- a/test/bls_if_test.cpp
+++ b/test/bls_if_test.cpp
@@ -7,7 +7,6 @@ CYBOZU_TEST_AUTO(bls_if)
blsSecretKey *sec;
blsPublicKey *pub;
blsSign *sign;
-// blsId *id;
const char *msg = "this is a pen";
const size_t msgSize = strlen(msg);
@@ -30,3 +29,24 @@ CYBOZU_TEST_AUTO(bls_if)
blsPublicKeyDestroy(pub);
blsSecretKeyDestroy(sec);
}
+
+CYBOZU_TEST_AUTO(bls_if_use_stack)
+{
+ blsSecretKey sec;
+ blsPublicKey pub;
+ blsSign sign;
+ const char *msg = "this is a pen";
+ const size_t msgSize = strlen(msg);
+
+ blsInit();
+ blsSecretKeyInit(&sec);
+ blsSecretKeyPut(&sec);
+
+ blsSecretKeyGetPublicKey(&sec, &pub);
+ blsPublicKeyPut(&pub);
+
+ blsSecretKeySign(&sec, &sign, msg, msgSize);
+ blsSignPut(&sign);
+
+ printf("verify %d\n", blsSignVerify(&sign, &pub, msg, msgSize));
+}