diff options
Diffstat (limited to 'test/bls_if_test.cpp')
-rw-r--r-- | test/bls_if_test.cpp | 22 |
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)); +} |