10 #include <boost/test/unit_test.hpp>
20 "\x9c\x52\x4a\xdb\xcf\x56\x11\x12\x2b\x29\x12\x5e\x5d\x35\xd2\xd2"
21 "\x22\x81\xaa\xb5\x33\xf0\x08\x32\xd5\x56\xb1\xf9\xea\xe5\x1d\x7d";
22 const
char R1ArrayHex[] = "7D1DE5EAF9B156D53208F033B5AA8122D2d2355d5e12292b121156cfdb4a529c";
27 "\x70\x32\x1d\x7c\x47\xa5\x6b\x40\x26\x7e\x0a\xc3\xa6\x9c\xb6\xbf"
28 "\x13\x30\x47\xa3\x19\x2d\xda\x71\x49\x13\x72\xf0\xb4\xca\x81\xd7";
33 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
34 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
39 "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
40 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
45 "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
46 "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff";
52 std::stringstream Stream;
54 for (
unsigned int i = 0; i < width; ++i)
56 Stream<<std::setw(2)<<std::setfill(
'0')<<(
unsigned int)A[width-i-1];
127 for (
int i = 255; i >= 0; --i) {
129 *(TmpL.
begin() + (i>>3)) |= 1<<(7-(i&7));
130 BOOST_CHECK_LT(LastL, TmpL);
142 for (
int i = 159; i >= 0; --i) {
144 *(TmpS.
begin() + (i>>3)) |= 1<<(7-(i&7));
145 BOOST_CHECK_LT(LastS, TmpS);
156 BOOST_CHECK_LT(
uint256S(
"2000000000000000000000000000000000000000000000000000000000000001"),
157 uint256S(
"1000000000000000000000000000000000000000000000000000000000000002"));
287 #if defined(__clang__)
288 # pragma clang diagnostic push
289 # pragma clang diagnostic ignored "-Wself-assign-overloaded"
300 #if defined(__clang__)
301 # pragma clang diagnostic pop
308 std::string s_12{
"0000000000000000000000000000000000000000000000000000000000000012"};
335 uint256 one =
uint256S(
"0000000000000000000000000000000000000000000000000000000000000001");
arith_uint256 UintToArith256(const uint256 &a)
uint256 ArithToUint256(const arith_uint256 &a)
Double ended buffer combining vector and stream-like interfaces.
256-bit unsigned big integer.
constexpr unsigned char * end()
static constexpr unsigned int size()
std::string ToString() const
void SetHexDeprecated(std::string_view str)
Unlike FromHex this accepts any invalid input, thus it is fragile and deprecated.
constexpr unsigned char * begin()
std::string GetHex() const
static std::optional< uint160 > FromHex(std::string_view str)
static const uint256 ZERO
static std::optional< uint256 > FromHex(std::string_view str)
BOOST_AUTO_TEST_SUITE(cuckoocache_tests)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
size_t GetSerializeSize(const T &t)
uint256 uint256S(std::string_view str)
const unsigned char ZeroArray[]
const unsigned char R1Array[]
uint160 uint160S(std::string_view str)
BOOST_AUTO_TEST_CASE(basics)
const unsigned char OneArray[]
const unsigned char R2Array[]
static std::string ArrayToString(const unsigned char A[], unsigned int width)
const unsigned char MaxArray[]