diff --git a/test/fp_test.cpp b/test/fp_test.cpp index 5a478fe..f883b24 100644 --- a/test/fp_test.cpp +++ b/test/fp_test.cpp @@ -8,7 +8,7 @@ #include #include #ifdef MCL_DONT_USE_OPENSSL -#include +#include #else #include #endif @@ -725,11 +725,15 @@ void setHashOfTest() "", "abc", "111111111111111111111111111111111111", }; for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(msgTbl); i++) { + size_t bitSize = Fp::getBitSize(); #ifdef MCL_DONT_USE_OPENSSL - cybozu::Sha1 sha1; - std::string digest = sha1.digest(msgTbl[i]); + std::string digest; + if (bitSize <= 256) { + digest = cybozu::Sha256(msgTbl[i].c_str(), msgTbl[i].size()).get(); + } else { + digest = cybozu::Sha512(msgTbl[i].c_str(), msgTbl[i].size()).get(); + } #else - size_t bitSize = Fp::getBitSize(); cybozu::crypto::Hash::Name name; if (bitSize <= 256) { name = cybozu::crypto::Hash::N_SHA256;