diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2018-09-21 17:32:36 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2018-09-21 17:32:36 +0800 |
commit | 82f6151244d90a7734c54eea2af51819af9c90c8 (patch) | |
tree | f96b57014e59e8b140a86cef84e74f279a4e5046 | |
parent | e68b2a3fb07999ba000eccb1727c527763d56e9f (diff) | |
download | dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.tar dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.tar.gz dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.tar.bz2 dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.tar.lz dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.tar.xz dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.tar.zst dexon-bls-82f6151244d90a7734c54eea2af51819af9c90c8.zip |
fix for C++03
-rw-r--r-- | test/bls_test.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/bls_test.hpp b/test/bls_test.hpp index e0329da..3091b69 100644 --- a/test/bls_test.hpp +++ b/test/bls_test.hpp @@ -433,19 +433,20 @@ void verifyAggregateTest(int type) bls::PublicKey pubs[n]; bls::Signature sigs[n], sig; const size_t sizeofHash = 32; - std::vector<char[sizeofHash]> h(n); + struct Hash { char data[sizeofHash]; }; + std::vector<Hash> h(n); for (size_t i = 0; i < n; i++) { char msg[128]; CYBOZU_SNPRINTF(msg, sizeof(msg), "abc-%d", (int)i); const size_t msgSize = strlen(msg); #ifdef MCL_DONT_USE_OPENSSL - cybozu::Sha256(msg, msgSize).get(h[i]); + cybozu::Sha256(msg, msgSize).get(h[i].data); #else - cybozu::crypto::Hash::digest(h[i], cybozu::crypto::Hash::N_SHA256, msg, msgSize); + cybozu::crypto::Hash::digest(h[i].data, cybozu::crypto::Hash::N_SHA256, msg, msgSize); #endif secs[i].init(); secs[i].getPublicKey(pubs[i]); - secs[i].signHash(sigs[i], h[i], sizeofHash); + secs[i].signHash(sigs[i], h[i].data, sizeofHash); } sig = sigs[0]; for (size_t i = 1; i < n; i++) { @@ -454,7 +455,7 @@ void verifyAggregateTest(int type) CYBOZU_TEST_ASSERT(sig.verifyAggregatedHashes(pubs, h.data(), sizeofHash, n)); bls::Signature invalidSig = sigs[0] + sigs[1]; CYBOZU_TEST_ASSERT(!invalidSig.verifyAggregatedHashes(pubs, h.data(), sizeofHash, n)); - h[0][0]++; + h[0].data[0]++; if (type == MCL_BLS12_381) { /* CAUTION!!! |