PIVX Core  5.6.99
P2P Digital Currency
Functions | Variables
crypto_tests.cpp File Reference
#include "crypto/aes.h"
#include "crypto/rfc6979_hmac_sha256.h"
#include "crypto/chacha20.h"
#include "crypto/ripemd160.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "crypto/sha3.h"
#include "crypto/sha512.h"
#include "crypto/hmac_sha256.h"
#include "crypto/hmac_sha512.h"
#include "random.h"
#include "utilstrencodings.h"
#include "test/test_pivx.h"
#include <vector>
#include <boost/test/unit_test.hpp>
Include dependency graph for crypto_tests.cpp:

Go to the source code of this file.

Functions

template<typename Hasher , typename In , typename Out >
void TestVector (const Hasher &h, const In &in, const Out &out)
 
void TestSHA1 (const std::string &in, const std::string &hexout)
 
void TestSHA256 (const std::string &in, const std::string &hexout)
 
void TestSHA512 (const std::string &in, const std::string &hexout)
 
void TestRIPEMD160 (const std::string &in, const std::string &hexout)
 
void TestHMACSHA256 (const std::string &hexkey, const std::string &hexin, const std::string &hexout)
 
void TestHMACSHA512 (const std::string &hexkey, const std::string &hexin, const std::string &hexout)
 
void TestChaCha20 (const std::string &hex_message, const std::string &hexkey, uint64_t nonce, uint64_t seek, const std::string &hexout)
 
void TestAES128 (const std::string &hexkey, const std::string &hexin, const std::string &hexout)
 
void TestAES256 (const std::string &hexkey, const std::string &hexin, const std::string &hexout)
 
void TestAES128CBC (const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout)
 
void TestAES256CBC (const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout)
 
std::string LongTestString (void)
 
 BOOST_AUTO_TEST_CASE (ripemd160_testvectors)
 
 BOOST_AUTO_TEST_CASE (sha1_testvectors)
 
 BOOST_AUTO_TEST_CASE (sha256_testvectors)
 
 BOOST_AUTO_TEST_CASE (sha512_testvectors)
 
 BOOST_AUTO_TEST_CASE (hmac_sha256_testvectors)
 
 BOOST_AUTO_TEST_CASE (hmac_sha512_testvectors)
 
void TestRFC6979 (const std::string &hexkey, const std::string &hexmsg, const std::vector< std::string > &hexout)
 
 BOOST_AUTO_TEST_CASE (rfc6979_hmac_sha256)
 
 BOOST_AUTO_TEST_CASE (chacha20_testvector)
 
 BOOST_AUTO_TEST_CASE (countbits_tests)
 
 BOOST_AUTO_TEST_CASE (aes_testvectors)
 
 BOOST_AUTO_TEST_CASE (aes_cbc_testvectors)
 
 BOOST_AUTO_TEST_CASE (keccak_tests)
 
 BOOST_AUTO_TEST_CASE (sha3_256_tests)
 

Variables

const std::string test1 = LongTestString()
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/13]

BOOST_AUTO_TEST_CASE ( aes_cbc_testvectors  )

Definition at line 562 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/13]

BOOST_AUTO_TEST_CASE ( aes_testvectors  )

Definition at line 546 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/13]

BOOST_AUTO_TEST_CASE ( chacha20_testvector  )

Definition at line 482 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/13]

BOOST_AUTO_TEST_CASE ( countbits_tests  )

Definition at line 524 of file crypto_tests.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/13]

BOOST_AUTO_TEST_CASE ( hmac_sha256_testvectors  )

Definition at line 328 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/13]

BOOST_AUTO_TEST_CASE ( hmac_sha512_testvectors  )

Definition at line 381 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/13]

BOOST_AUTO_TEST_CASE ( keccak_tests  )

Definition at line 635 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/13]

BOOST_AUTO_TEST_CASE ( rfc6979_hmac_sha256  )

Definition at line 464 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/13]

BOOST_AUTO_TEST_CASE ( ripemd160_testvectors  )

Definition at line 237 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/13]

BOOST_AUTO_TEST_CASE ( sha1_testvectors  )

Definition at line 253 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/13]

BOOST_AUTO_TEST_CASE ( sha256_testvectors  )

Definition at line 269 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/13]

BOOST_AUTO_TEST_CASE ( sha3_256_tests  )

Definition at line 655 of file crypto_tests.cpp.

◆ BOOST_AUTO_TEST_CASE() [13/13]

BOOST_AUTO_TEST_CASE ( sha512_testvectors  )

Definition at line 291 of file crypto_tests.cpp.

Here is the call graph for this function:

◆ LongTestString()

std::string LongTestString ( void  )

Definition at line 223 of file crypto_tests.cpp.

◆ TestAES128()

void TestAES128 ( const std::string &  hexkey,
const std::string &  hexin,
const std::string &  hexout 
)

Definition at line 102 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestAES128CBC()

void TestAES128CBC ( const std::string &  hexkey,
const std::string &  hexiv,
bool  pad,
const std::string &  hexin,
const std::string &  hexout 
)

Definition at line 141 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestAES256()

void TestAES256 ( const std::string &  hexkey,
const std::string &  hexin,
const std::string &  hexout 
)

Definition at line 122 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestAES256CBC()

void TestAES256CBC ( const std::string &  hexkey,
const std::string &  hexiv,
bool  pad,
const std::string &  hexin,
const std::string &  hexout 
)

Definition at line 182 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestChaCha20()

void TestChaCha20 ( const std::string &  hex_message,
const std::string &  hexkey,
uint64_t  nonce,
uint64_t  seek,
const std::string &  hexout 
)

Definition at line 70 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestHMACSHA256()

void TestHMACSHA256 ( const std::string &  hexkey,
const std::string &  hexin,
const std::string &  hexout 
)

Definition at line 60 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestHMACSHA512()

void TestHMACSHA512 ( const std::string &  hexkey,
const std::string &  hexin,
const std::string &  hexout 
)

Definition at line 65 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestRFC6979()

void TestRFC6979 ( const std::string &  hexkey,
const std::string &  hexmsg,
const std::vector< std::string > &  hexout 
)

Definition at line 449 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestRIPEMD160()

void TestRIPEMD160 ( const std::string &  in,
const std::string &  hexout 
)

Definition at line 58 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestSHA1()

void TestSHA1 ( const std::string &  in,
const std::string &  hexout 
)

Definition at line 55 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestSHA256()

void TestSHA256 ( const std::string &  in,
const std::string &  hexout 
)

Definition at line 56 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestSHA512()

void TestSHA512 ( const std::string &  in,
const std::string &  hexout 
)

Definition at line 57 of file crypto_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestVector()

template<typename Hasher , typename In , typename Out >
void TestVector ( const Hasher &  h,
const In &  in,
const Out &  out 
)

Definition at line 27 of file crypto_tests.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ test1

const std::string test1 = LongTestString()

Definition at line 235 of file crypto_tests.cpp.