diff --git a/src/test/cuckoocache_tests.cpp b/src/test/cuckoocache_tests.cpp --- a/src/test/cuckoocache_tests.cpp +++ b/src/test/cuckoocache_tests.cpp @@ -60,10 +60,7 @@ uint32_t n_insert = static_cast(load * (bytes / sizeof(uint256))); hashes.resize(n_insert); for (uint32_t i = 0; i < n_insert; ++i) { - uint32_t *ptr = (uint32_t *)hashes[i].begin(); - for (uint8_t j = 0; j < 8; ++j) { - *(ptr++) = InsecureRand32(); - } + hashes[i] = InsecureRand256(); } /** * We make a copy of the hashes because future optimizations of the @@ -137,10 +134,7 @@ uint32_t n_insert = static_cast(load * (bytes / sizeof(uint256))); hashes.resize(n_insert); for (uint32_t i = 0; i < n_insert; ++i) { - uint32_t *ptr = (uint32_t *)hashes[i].begin(); - for (uint8_t j = 0; j < 8; ++j) { - *(ptr++) = InsecureRand32(); - } + hashes[i] = InsecureRand256(); } /** * We make a copy of the hashes because future optimizations of the @@ -208,10 +202,7 @@ uint32_t n_insert = static_cast(load * (bytes / sizeof(uint256))); hashes.resize(n_insert); for (uint32_t i = 0; i < n_insert; ++i) { - uint32_t *ptr = (uint32_t *)hashes[i].begin(); - for (uint8_t j = 0; j < 8; ++j) { - *(ptr++) = InsecureRand32(); - } + hashes[i] = InsecureRand256(); } /** * We make a copy of the hashes because future optimizations of the @@ -326,10 +317,7 @@ inserts.resize(n_insert); reads.reserve(n_insert / 2); for (uint32_t i = 0; i < n_insert; ++i) { - uint32_t *ptr = (uint32_t *)inserts[i].begin(); - for (uint8_t j = 0; j < 8; ++j) { - *(ptr++) = InsecureRand32(); - } + inserts[i] = InsecureRand256(); } for (uint32_t i = 0; i < n_insert / 4; ++i) { reads.push_back(inserts[i]);