diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2016-09-07 04:41:47 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2016-09-07 04:41:47 +0800 |
commit | b02d8bff51ff3ee683f8b7ea2cf694f539814610 (patch) | |
tree | bda7f65c444d5194638e649a2ab8d9651ae23bca /test | |
parent | 120b575604e6fb8a84188a5ce6cb138ffd295f5c (diff) | |
download | dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.tar dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.tar.gz dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.tar.bz2 dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.tar.lz dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.tar.xz dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.tar.zst dexon-bls-b02d8bff51ff3ee683f8b7ea2cf694f539814610.zip |
add test for bls_if.h
Diffstat (limited to 'test')
-rw-r--r-- | test/bls_if_test.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
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 <cybozu/test.hpp> +#include <bls_if.h> +#include <string.h> + +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); +} |