Changeset View
Changeset View
Standalone View
Standalone View
src/test/crypto_tests.cpp
// Copyright (c) 2014-2016 The Bitcoin Core developers | // Copyright (c) 2014-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "crypto/aes.h" | #include <crypto/aes.h> | ||||
#include "crypto/chacha20.h" | #include <crypto/chacha20.h> | ||||
#include "crypto/hmac_sha256.h" | #include <crypto/hmac_sha256.h> | ||||
#include "crypto/hmac_sha512.h" | #include <crypto/hmac_sha512.h> | ||||
#include "crypto/ripemd160.h" | #include <crypto/ripemd160.h> | ||||
#include "crypto/sha1.h" | #include <crypto/sha1.h> | ||||
#include "crypto/sha256.h" | #include <crypto/sha256.h> | ||||
#include "crypto/sha512.h" | #include <crypto/sha512.h> | ||||
#include "random.h" | |||||
#include "test/test_bitcoin.h" | |||||
#include "utilstrencodings.h" | |||||
#include <vector> | #include <random.h> | ||||
#include <utilstrencodings.h> | |||||
#include <test/test_bitcoin.h> | |||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <openssl/aes.h> | #include <openssl/aes.h> | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
#include <vector> | |||||
BOOST_FIXTURE_TEST_SUITE(crypto_tests, BasicTestingSetup) | BOOST_FIXTURE_TEST_SUITE(crypto_tests, BasicTestingSetup) | ||||
template <typename Hasher, typename In, typename Out> | template <typename Hasher, typename In, typename Out> | ||||
void TestVector(const Hasher &h, const In &in, const Out &out) { | void TestVector(const Hasher &h, const In &in, const Out &out) { | ||||
Out hash; | Out hash; | ||||
BOOST_CHECK(out.size() == h.OUTPUT_SIZE); | BOOST_CHECK(out.size() == h.OUTPUT_SIZE); | ||||
hash.resize(out.size()); | hash.resize(out.size()); | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 618 Lines • Show Last 20 Lines |