From b02d8bff51ff3ee683f8b7ea2cf694f539814610 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 7 Sep 2016 05:41:47 +0900 Subject: add test for bls_if.h --- test/bls_if_test.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/bls_if_test.cpp diff --git a/test/bls_if_test.cpp b/test/bls_if_test.cpp new file mode 100644 index 0000000..6c6e549 --- /dev/null +++ b/test/bls_if_test.cpp @@ -0,0 +1,32 @@ +#include +#include +#include + +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); + + blsInit(); + sec = blsSecretKeyCreate(); + blsSecretKeyInit(sec); + blsSecretKeyPut(sec); + + pub = blsPublicKeyCreate(); + blsSecretKeyGetPublicKey(sec, pub); + blsPublicKeyPut(pub); + + sign = blsSignCreate(); + blsSecretKeySign(sec, sign, msg, msgSize); + blsSignPut(sign); + + printf("verify %d\n", blsSignVerify(sign, pub, msg, msgSize)); + + blsSignDestroy(sign); + blsPublicKeyDestroy(pub); + blsSecretKeyDestroy(sec); +} -- cgit v1.2.3