From 52869ffa6f7f996ddab5fd8f51a8d64279a6ff2c Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 8 Nov 2015 17:29:49 +0300 Subject: [PATCH] Renoved MD5 MT-test --- projects/Win/vc14/unit-prerequisites.vcxproj | 2 - projects/source.test-common.mk | 3 +- tests/CMakeLists.txt | 3 +- tests/hashing/hash_func.h | 33 -- tests/hashing/md5.cpp | 380 ------------------ tests/hashing/md5.h | 78 ---- tests/unit/map2/map_defs.h | 55 --- tests/unit/map2/map_find_string.h | 2 - .../map2/map_find_string_feldmanhashmap.cpp | 1 - tests/unit/map2/map_insdel_item_string.h | 2 - .../map_insdel_item_string_feldmanhashmap.cpp | 1 - tests/unit/map2/map_type_feldman_hashmap.h | 29 -- tests/unit/set2/set_defs.h | 53 --- tests/unit/set2/set_insdel_string.h | 2 - .../set2/set_insdel_string_feldmanhashset.cpp | 1 - tests/unit/set2/set_type_feldman_hashset.h | 25 -- 16 files changed, 2 insertions(+), 668 deletions(-) delete mode 100644 tests/hashing/md5.cpp delete mode 100644 tests/hashing/md5.h diff --git a/projects/Win/vc14/unit-prerequisites.vcxproj b/projects/Win/vc14/unit-prerequisites.vcxproj index 6668940f..d91f90d2 100644 --- a/projects/Win/vc14/unit-prerequisites.vcxproj +++ b/projects/Win/vc14/unit-prerequisites.vcxproj @@ -494,7 +494,6 @@ - @@ -515,7 +514,6 @@ Level2 Level2 - diff --git a/projects/source.test-common.mk b/projects/source.test-common.mk index b478e740..5b845ae0 100644 --- a/projects/source.test-common.mk +++ b/projects/source.test-common.mk @@ -4,7 +4,6 @@ CDS_TESTCOMMON_SOURCES := \ tests/cppunit/thread.cpp \ tests/unit/michael_alloc.cpp \ tests/unit/ellen_bintree_update_desc_pool.cpp \ - tests/hashing/city.cpp \ - tests/hashing/md5.cpp + tests/hashing/city.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2769e19f..edec3790 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,8 +6,7 @@ set(SOURCES cppunit/test_main.cpp cppunit/thread.cpp unit/michael_alloc.cpp unit/ellen_bintree_update_desc_pool.cpp - hashing/city.cpp - hashing/md5.cpp) + hashing/city.cpp) add_library(${TEST_COMMON} OBJECT ${SOURCES}) diff --git a/tests/hashing/hash_func.h b/tests/hashing/hash_func.h index 0cb77168..abbc7802 100644 --- a/tests/hashing/hash_func.h +++ b/tests/hashing/hash_func.h @@ -5,45 +5,12 @@ #include -#include "hashing/md5.h" #if CDS_BUILD_BITS == 64 # include "hashing/city.h" #endif namespace hashing { - template - class hasher { - typedef Hasher hasher_type; - hasher_type m_hasher; - public: - struct hash_type { - uint8_t h[hasher_type::HashBytes]; - }; - - hash_type operator()( void const * pBuf, size_t len ) - { - m_hasher.reset(); - m_hasher.add(pBuf, len); - hash_type result; - m_hasher.getHash( result.h ); - return result; - } - - hash_type operator()( std::string const& s ) - { - return operator()( reinterpret_cast(s.c_str()), s.length()); - } - - template - hash_type operator()( T const& s ) - { - return operator()( reinterpret_cast(&s), sizeof(s)); - } - }; - - typedef hasher md5; - #if CDS_BUILD_BITS == 64 class city32 { public: diff --git a/tests/hashing/md5.cpp b/tests/hashing/md5.cpp deleted file mode 100644 index 27433195..00000000 --- a/tests/hashing/md5.cpp +++ /dev/null @@ -1,380 +0,0 @@ -// ////////////////////////////////////////////////////////// -// md5.cpp -// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// - -#include "md5.h" - -#ifndef _MSC_VER -#include -#endif - - -/// same as reset() -MD5::MD5() -{ - reset(); -} - - -/// restart -void MD5::reset() -{ - m_numBytes = 0; - m_bufferSize = 0; - - // according to RFC 1321 - m_hash[0] = 0x67452301; - m_hash[1] = 0xefcdab89; - m_hash[2] = 0x98badcfe; - m_hash[3] = 0x10325476; -} - - -namespace -{ - // mix functions for processBlock() - inline uint32_t f1(uint32_t b, uint32_t c, uint32_t d) - { - return d ^ (b & (c ^ d)); // original: f = (b & c) | ((~b) & d); - } - - inline uint32_t f2(uint32_t b, uint32_t c, uint32_t d) - { - return c ^ (d & (b ^ c)); // original: f = (b & d) | (c & (~d)); - } - - inline uint32_t f3(uint32_t b, uint32_t c, uint32_t d) - { - return b ^ c ^ d; - } - - inline uint32_t f4(uint32_t b, uint32_t c, uint32_t d) - { - return c ^ (b | ~d); - } - - inline uint32_t rotate(uint32_t a, uint32_t c) - { - return (a << c) | (a >> (32 - c)); - } - -#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN) - inline uint32_t swap(uint32_t x) - { -#if defined(__GNUC__) || defined(__clang__) - return __builtin_bswap32(x); -#endif -#ifdef MSC_VER - return _byteswap_ulong(x); -#endif - - return (x >> 24) | - ((x >> 8) & 0x0000FF00) | - ((x << 8) & 0x00FF0000) | - (x << 24); - } -#endif -} - - -/// process 64 bytes -void MD5::processBlock(const void* data) -{ - // get last hash - uint32_t a = m_hash[0]; - uint32_t b = m_hash[1]; - uint32_t c = m_hash[2]; - uint32_t d = m_hash[3]; - - // data represented as 16x 32-bit words - const uint32_t* words = (uint32_t*) data; - - // computations are little endian, swap data if necessary -#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN) -#define LITTLEENDIAN(x) swap(x) -#else -#define LITTLEENDIAN(x) (x) -#endif - - // first round - uint32_t word0 = LITTLEENDIAN(words[ 0]); - a = rotate(a + f1(b,c,d) + word0 + 0xd76aa478, 7) + b; - uint32_t word1 = LITTLEENDIAN(words[ 1]); - d = rotate(d + f1(a,b,c) + word1 + 0xe8c7b756, 12) + a; - uint32_t word2 = LITTLEENDIAN(words[ 2]); - c = rotate(c + f1(d,a,b) + word2 + 0x242070db, 17) + d; - uint32_t word3 = LITTLEENDIAN(words[ 3]); - b = rotate(b + f1(c,d,a) + word3 + 0xc1bdceee, 22) + c; - - uint32_t word4 = LITTLEENDIAN(words[ 4]); - a = rotate(a + f1(b,c,d) + word4 + 0xf57c0faf, 7) + b; - uint32_t word5 = LITTLEENDIAN(words[ 5]); - d = rotate(d + f1(a,b,c) + word5 + 0x4787c62a, 12) + a; - uint32_t word6 = LITTLEENDIAN(words[ 6]); - c = rotate(c + f1(d,a,b) + word6 + 0xa8304613, 17) + d; - uint32_t word7 = LITTLEENDIAN(words[ 7]); - b = rotate(b + f1(c,d,a) + word7 + 0xfd469501, 22) + c; - - uint32_t word8 = LITTLEENDIAN(words[ 8]); - a = rotate(a + f1(b,c,d) + word8 + 0x698098d8, 7) + b; - uint32_t word9 = LITTLEENDIAN(words[ 9]); - d = rotate(d + f1(a,b,c) + word9 + 0x8b44f7af, 12) + a; - uint32_t word10 = LITTLEENDIAN(words[10]); - c = rotate(c + f1(d,a,b) + word10 + 0xffff5bb1, 17) + d; - uint32_t word11 = LITTLEENDIAN(words[11]); - b = rotate(b + f1(c,d,a) + word11 + 0x895cd7be, 22) + c; - - uint32_t word12 = LITTLEENDIAN(words[12]); - a = rotate(a + f1(b,c,d) + word12 + 0x6b901122, 7) + b; - uint32_t word13 = LITTLEENDIAN(words[13]); - d = rotate(d + f1(a,b,c) + word13 + 0xfd987193, 12) + a; - uint32_t word14 = LITTLEENDIAN(words[14]); - c = rotate(c + f1(d,a,b) + word14 + 0xa679438e, 17) + d; - uint32_t word15 = LITTLEENDIAN(words[15]); - b = rotate(b + f1(c,d,a) + word15 + 0x49b40821, 22) + c; - - // second round - a = rotate(a + f2(b,c,d) + word1 + 0xf61e2562, 5) + b; - d = rotate(d + f2(a,b,c) + word6 + 0xc040b340, 9) + a; - c = rotate(c + f2(d,a,b) + word11 + 0x265e5a51, 14) + d; - b = rotate(b + f2(c,d,a) + word0 + 0xe9b6c7aa, 20) + c; - - a = rotate(a + f2(b,c,d) + word5 + 0xd62f105d, 5) + b; - d = rotate(d + f2(a,b,c) + word10 + 0x02441453, 9) + a; - c = rotate(c + f2(d,a,b) + word15 + 0xd8a1e681, 14) + d; - b = rotate(b + f2(c,d,a) + word4 + 0xe7d3fbc8, 20) + c; - - a = rotate(a + f2(b,c,d) + word9 + 0x21e1cde6, 5) + b; - d = rotate(d + f2(a,b,c) + word14 + 0xc33707d6, 9) + a; - c = rotate(c + f2(d,a,b) + word3 + 0xf4d50d87, 14) + d; - b = rotate(b + f2(c,d,a) + word8 + 0x455a14ed, 20) + c; - - a = rotate(a + f2(b,c,d) + word13 + 0xa9e3e905, 5) + b; - d = rotate(d + f2(a,b,c) + word2 + 0xfcefa3f8, 9) + a; - c = rotate(c + f2(d,a,b) + word7 + 0x676f02d9, 14) + d; - b = rotate(b + f2(c,d,a) + word12 + 0x8d2a4c8a, 20) + c; - - // third round - a = rotate(a + f3(b,c,d) + word5 + 0xfffa3942, 4) + b; - d = rotate(d + f3(a,b,c) + word8 + 0x8771f681, 11) + a; - c = rotate(c + f3(d,a,b) + word11 + 0x6d9d6122, 16) + d; - b = rotate(b + f3(c,d,a) + word14 + 0xfde5380c, 23) + c; - - a = rotate(a + f3(b,c,d) + word1 + 0xa4beea44, 4) + b; - d = rotate(d + f3(a,b,c) + word4 + 0x4bdecfa9, 11) + a; - c = rotate(c + f3(d,a,b) + word7 + 0xf6bb4b60, 16) + d; - b = rotate(b + f3(c,d,a) + word10 + 0xbebfbc70, 23) + c; - - a = rotate(a + f3(b,c,d) + word13 + 0x289b7ec6, 4) + b; - d = rotate(d + f3(a,b,c) + word0 + 0xeaa127fa, 11) + a; - c = rotate(c + f3(d,a,b) + word3 + 0xd4ef3085, 16) + d; - b = rotate(b + f3(c,d,a) + word6 + 0x04881d05, 23) + c; - - a = rotate(a + f3(b,c,d) + word9 + 0xd9d4d039, 4) + b; - d = rotate(d + f3(a,b,c) + word12 + 0xe6db99e5, 11) + a; - c = rotate(c + f3(d,a,b) + word15 + 0x1fa27cf8, 16) + d; - b = rotate(b + f3(c,d,a) + word2 + 0xc4ac5665, 23) + c; - - // fourth round - a = rotate(a + f4(b,c,d) + word0 + 0xf4292244, 6) + b; - d = rotate(d + f4(a,b,c) + word7 + 0x432aff97, 10) + a; - c = rotate(c + f4(d,a,b) + word14 + 0xab9423a7, 15) + d; - b = rotate(b + f4(c,d,a) + word5 + 0xfc93a039, 21) + c; - - a = rotate(a + f4(b,c,d) + word12 + 0x655b59c3, 6) + b; - d = rotate(d + f4(a,b,c) + word3 + 0x8f0ccc92, 10) + a; - c = rotate(c + f4(d,a,b) + word10 + 0xffeff47d, 15) + d; - b = rotate(b + f4(c,d,a) + word1 + 0x85845dd1, 21) + c; - - a = rotate(a + f4(b,c,d) + word8 + 0x6fa87e4f, 6) + b; - d = rotate(d + f4(a,b,c) + word15 + 0xfe2ce6e0, 10) + a; - c = rotate(c + f4(d,a,b) + word6 + 0xa3014314, 15) + d; - b = rotate(b + f4(c,d,a) + word13 + 0x4e0811a1, 21) + c; - - a = rotate(a + f4(b,c,d) + word4 + 0xf7537e82, 6) + b; - d = rotate(d + f4(a,b,c) + word11 + 0xbd3af235, 10) + a; - c = rotate(c + f4(d,a,b) + word2 + 0x2ad7d2bb, 15) + d; - b = rotate(b + f4(c,d,a) + word9 + 0xeb86d391, 21) + c; - - // update hash - m_hash[0] += a; - m_hash[1] += b; - m_hash[2] += c; - m_hash[3] += d; -} - - -/// add arbitrary number of bytes -void MD5::add(const void* data, size_t numBytes) -{ - const uint8_t* current = (const uint8_t*) data; - - if (m_bufferSize > 0) - { - while (numBytes > 0 && m_bufferSize < BlockSize) - { - m_buffer[m_bufferSize++] = *current++; - numBytes--; - } - } - - // full buffer - if (m_bufferSize == BlockSize) - { - processBlock(m_buffer); - m_numBytes += BlockSize; - m_bufferSize = 0; - } - - // no more data ? - if (numBytes == 0) - return; - - // process full blocks - while (numBytes >= BlockSize) - { - processBlock(current); - current += BlockSize; - m_numBytes += BlockSize; - numBytes -= BlockSize; - } - - // keep remaining bytes in buffer - while (numBytes > 0) - { - m_buffer[m_bufferSize++] = *current++; - numBytes--; - } -} - - -/// process final block, less than 64 bytes -void MD5::processBuffer() -{ - // the input bytes are considered as bits strings, where the first bit is the most significant bit of the byte - - // - append "1" bit to message - // - append "0" bits until message length in bit mod 512 is 448 - // - append length as 64 bit integer - - // number of bits - size_t paddedLength = m_bufferSize * 8; - - // plus one bit set to 1 (always appended) - paddedLength++; - - // number of bits must be (numBits % 512) = 448 - size_t lower11Bits = paddedLength & 511; - if (lower11Bits <= 448) - paddedLength += 448 - lower11Bits; - else - paddedLength += 512 + 448 - lower11Bits; - // convert from bits to bytes - paddedLength /= 8; - - // only needed if additional data flows over into a second block - unsigned char extra[BlockSize]; - - // append a "1" bit, 128 => binary 10000000 - if (m_bufferSize < BlockSize) - m_buffer[m_bufferSize] = 128; - else - extra[0] = 128; - - size_t i; - for (i = m_bufferSize + 1; i < BlockSize; i++) - m_buffer[i] = 0; - for (; i < paddedLength; i++) - extra[i - BlockSize] = 0; - - // add message length in bits as 64 bit number - uint64_t msgBits = 8 * (m_numBytes + m_bufferSize); - // find right position - unsigned char* addLength; - if (paddedLength < BlockSize) - addLength = m_buffer + paddedLength; - else - addLength = extra + paddedLength - BlockSize; - - // must be little endian - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; msgBits >>= 8; - *addLength++ = msgBits & 0xFF; - - // process blocks - processBlock(m_buffer); - // flowed over into a second block ? - if (paddedLength > BlockSize) - processBlock(extra); -} - - -/// return latest hash as 32 hex characters -std::string MD5::getHash() -{ - // compute hash (as raw bytes) - unsigned char rawHash[HashBytes]; - getHash(rawHash); - - // convert to hex string - std::string result; - result.reserve(2 * HashBytes); - for (int i = 0; i < HashBytes; i++) - { - static const char dec2hex[16+1] = "0123456789abcdef"; - result += dec2hex[(rawHash[i] >> 4) & 15]; - result += dec2hex[ rawHash[i] & 15]; - } - - return result; -} - - -/// return latest hash as bytes -void MD5::getHash(unsigned char buffer[MD5::HashBytes]) -{ - // save old hash if buffer is partially filled - uint32_t oldHash[HashValues]; - for (int i = 0; i < HashValues; i++) - oldHash[i] = m_hash[i]; - - // process remaining bytes - processBuffer(); - - unsigned char* current = buffer; - for (int i = 0; i < HashValues; i++) - { - *current++ = m_hash[i] & 0xFF; - *current++ = (m_hash[i] >> 8) & 0xFF; - *current++ = (m_hash[i] >> 16) & 0xFF; - *current++ = (m_hash[i] >> 24) & 0xFF; - - // restore old hash - m_hash[i] = oldHash[i]; - } -} - - -/// compute MD5 of a memory block -std::string MD5::operator()(const void* data, size_t numBytes) -{ - reset(); - add(data, numBytes); - return getHash(); -} - - -/// compute MD5 of a string, excluding final zero -std::string MD5::operator()(const std::string& text) -{ - reset(); - add(text.c_str(), text.size()); - return getHash(); -} diff --git a/tests/hashing/md5.h b/tests/hashing/md5.h deleted file mode 100644 index f53e2d9e..00000000 --- a/tests/hashing/md5.h +++ /dev/null @@ -1,78 +0,0 @@ -// ////////////////////////////////////////////////////////// -// md5.h -// Copyright (c) 2014 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// - -#pragma once - -//#include "hash.h" -#include - -// define fixed size integer types -#ifdef _MSC_VER -// Windows -typedef unsigned __int8 uint8_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -#else -// GCC -#include -#endif - - -/// compute MD5 hash -/** Usage: - MD5 md5; - std::string myHash = md5("Hello World"); // std::string - std::string myHash2 = md5("How are you", 11); // arbitrary data, 11 bytes - - // or in a streaming fashion: - - MD5 md5; - while (more data available) - md5.add(pointer to fresh data, number of new bytes); - std::string myHash3 = md5.getHash(); - */ -class MD5 //: public Hash -{ -public: - /// split into 64 byte blocks (=> 512 bits), hash is 16 bytes long - enum { BlockSize = 512 / 8, HashBytes = 16 }; - - /// same as reset() - MD5(); - - /// compute MD5 of a memory block - std::string operator()(const void* data, size_t numBytes); - /// compute MD5 of a string, excluding final zero - std::string operator()(const std::string& text); - - /// add arbitrary number of bytes - void add(const void* data, size_t numBytes); - - /// return latest hash as 32 hex characters - std::string getHash(); - /// return latest hash as bytes - void getHash(unsigned char buffer[HashBytes]); - - /// restart - void reset(); - -private: - /// process 64 bytes - void processBlock(const void* data); - /// process everything left in the internal buffer - void processBuffer(); - - /// size of processed data in bytes - uint64_t m_numBytes; - /// valid bytes in m_buffer - size_t m_bufferSize; - /// bytes not processed yet - uint8_t m_buffer[BlockSize]; - - enum { HashValues = HashBytes / 4 }; - /// hash, stored as integers - uint32_t m_hash[HashValues]; -}; diff --git a/tests/unit/map2/map_defs.h b/tests/unit/map2/map_defs.h index 3c398160..6d7bdf43 100644 --- a/tests/unit/map2/map_defs.h +++ b/tests/unit/map2/map_defs.h @@ -834,59 +834,6 @@ CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_stdhash_stat) \ CDSUNIT_TEST_FeldmanHashMap_stdhash_RCU_Signal -// MD5 - -#undef CDSUNIT_DECLARE_FeldmanHashMap_md5 -#undef CDSUNIT_DECLARE_FeldmanHashMap_md5_RCU_Signal -#undef CDSUNIT_TEST_FeldmanHashMap_md5 -#undef CDSUNIT_TEST_FeldmanHashMap_md5_RCU_Signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashMap_md5_RCU_Signal \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_shb_md5_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_sht_md5_stat) \ - -# define CDSUNIT_TEST_FeldmanHashMap_md5_RCU_Signal \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_md5) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_shb_md5_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_md5) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_sht_md5_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashMap_md5_RCU_Signal -# define CDSUNIT_TEST_FeldmanHashMap_md5_RCU_Signal -#endif - - -#define CDSUNIT_DECLARE_FeldmanHashMap_md5 \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_hp_md5_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_dhp_md5_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpi_md5_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpb_md5_stat) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_md5) \ - TEST_CASE(tag_FeldmanHashMap, FeldmanHashMap_rcu_gpt_md5_stat) \ - CDSUNIT_DECLARE_FeldmanHashMap_md5_RCU_Signal - -#define CDSUNIT_TEST_FeldmanHashMap_md5 \ - CPPUNIT_TEST(FeldmanHashMap_hp_md5) \ - CPPUNIT_TEST(FeldmanHashMap_hp_md5_stat) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_md5) \ - CPPUNIT_TEST(FeldmanHashMap_dhp_md5_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_md5) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpi_md5_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_md5) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpb_md5_stat) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_md5) \ - CPPUNIT_TEST(FeldmanHashMap_rcu_gpt_md5_stat) \ - CDSUNIT_TEST_FeldmanHashMap_md5_RCU_Signal - - // CityHash - only for 64bit #undef CDSUNIT_DECLARE_FeldmanHashMap_city128_RCU_Signal @@ -1013,12 +960,10 @@ #define CDSUNIT_DECLARE_FeldmanHashMap \ CDSUNIT_DECLARE_FeldmanHashMap_fixed \ CDSUNIT_DECLARE_FeldmanHashMap_stdhash \ - CDSUNIT_DECLARE_FeldmanHashMap_md5 \ CDSUNIT_DECLARE_FeldmanHashMap_city \ #define CDSUNIT_TEST_FeldmanHashMap \ CDSUNIT_TEST_FeldmanHashMap_fixed \ CDSUNIT_TEST_FeldmanHashMap_stdhash \ - CDSUNIT_TEST_FeldmanHashMap_md5 \ CDSUNIT_TEST_FeldmanHashMap_city diff --git a/tests/unit/map2/map_find_string.h b/tests/unit/map2/map_find_string.h index ad328bbb..0edfdb06 100644 --- a/tests/unit/map2/map_find_string.h +++ b/tests/unit/map2/map_find_string.h @@ -216,7 +216,6 @@ namespace map2 { CDSUNIT_DECLARE_SkipListMap_nogc CDSUNIT_DECLARE_EllenBinTreeMap CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_md5 CDSUNIT_DECLARE_FeldmanHashMap_city CDSUNIT_DECLARE_StripedMap CDSUNIT_DECLARE_RefinableMap @@ -233,7 +232,6 @@ namespace map2 { CDSUNIT_TEST_SkipListMap_nogc CDSUNIT_TEST_EllenBinTreeMap CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_md5 CDSUNIT_TEST_FeldmanHashMap_city CDSUNIT_TEST_CuckooMap CDSUNIT_TEST_StripedMap diff --git a/tests/unit/map2/map_find_string_feldmanhashmap.cpp b/tests/unit/map2/map_find_string_feldmanhashmap.cpp index 26a90600..35a52ac9 100644 --- a/tests/unit/map2/map_find_string_feldmanhashmap.cpp +++ b/tests/unit/map2/map_find_string_feldmanhashmap.cpp @@ -8,6 +8,5 @@ #include "map2/map_defs.h" namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_md5 CDSUNIT_DECLARE_FeldmanHashMap_city } // namespace map2 diff --git a/tests/unit/map2/map_insdel_item_string.h b/tests/unit/map2/map_insdel_item_string.h index 2dfcbaf0..fe29e3bd 100644 --- a/tests/unit/map2/map_insdel_item_string.h +++ b/tests/unit/map2/map_insdel_item_string.h @@ -257,7 +257,6 @@ namespace map2 { CDSUNIT_DECLARE_SkipListMap CDSUNIT_DECLARE_EllenBinTreeMap CDSUNIT_DECLARE_BronsonAVLTreeMap - CDSUNIT_DECLARE_FeldmanHashMap_md5 CDSUNIT_DECLARE_FeldmanHashMap_city CDSUNIT_DECLARE_StripedMap CDSUNIT_DECLARE_RefinableMap @@ -270,7 +269,6 @@ namespace map2 { CDSUNIT_TEST_SkipListMap CDSUNIT_TEST_EllenBinTreeMap CDSUNIT_TEST_BronsonAVLTreeMap - CDSUNIT_TEST_FeldmanHashMap_md5 CDSUNIT_TEST_FeldmanHashMap_city CDSUNIT_TEST_CuckooMap CDSUNIT_TEST_StripedMap diff --git a/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp b/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp index 4039ae0a..9a947bed 100644 --- a/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp +++ b/tests/unit/map2/map_insdel_item_string_feldmanhashmap.cpp @@ -8,6 +8,5 @@ #include "map2/map_defs.h" namespace map2 { - CDSUNIT_DECLARE_FeldmanHashMap_md5 CDSUNIT_DECLARE_FeldmanHashMap_city } // namespace map2 diff --git a/tests/unit/map2/map_type_feldman_hashmap.h b/tests/unit/map2/map_type_feldman_hashmap.h index d23cb3b2..6d6dd475 100644 --- a/tests/unit/map2/map_type_feldman_hashmap.h +++ b/tests/unit/map2/map_type_feldman_hashmap.h @@ -69,35 +69,6 @@ namespace map2 { typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_rcu_sht_stdhash_stat; #endif - //MD5 - struct traits_FeldmanHashMap_md5 : public cc::feldman_hashmap::traits - { - typedef ::hashing::md5 hash; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_hp_md5; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_dhp_md5; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_rcu_gpi_md5; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_rcu_gpb_md5; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_rcu_gpt_md5; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_rcu_shb_md5; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_md5 > FeldmanHashMap_rcu_sht_md5; -#endif - - struct traits_FeldmanHashMap_md5_stat : public traits_FeldmanHashMap_md5 - { - typedef cc::feldman_hashmap::stat<> stat; - }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_hp_md5_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_dhp_md5_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_rcu_gpi_md5_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_rcu_gpb_md5_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_rcu_gpt_md5_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_rcu_shb_md5_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_md5_stat > FeldmanHashMap_rcu_sht_md5_stat; -#endif - // CityHash #if CDS_BUILD_BITS == 64 struct traits_FeldmanHashMap_city64 : public cc::feldman_hashmap::traits diff --git a/tests/unit/set2/set_defs.h b/tests/unit/set2/set_defs.h index f9e07cf2..addee6e1 100644 --- a/tests/unit/set2/set_defs.h +++ b/tests/unit/set2/set_defs.h @@ -720,57 +720,6 @@ CDSUNIT_TEST_FeldmanHashSet_stdhash_RCU_signal -// MD5 -#undef CDSUNIT_DECLARE_FeldmanHashSet_md5 -#undef CDSUNIT_DECLARE_FeldmanHashSet_md5_RCU_signal -#undef CDSUNIT_TEST_FeldmanHashSet_md5 -#undef CDSUNIT_TEST_FeldmanHashSet_md5_RCU_signal - -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED -# define CDSUNIT_DECLARE_FeldmanHashSet_md5_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_md5_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_md5_stat) \ - -# define CDSUNIT_TEST_FeldmanHashSet_md5_RCU_signal \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_shb_md5_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_sht_md5_stat) \ - -#else -# define CDSUNIT_DECLARE_FeldmanHashSet_md5_RCU_signal -# define CDSUNIT_TEST_FeldmanHashSet_md5_RCU_signal -#endif - -#define CDSUNIT_DECLARE_FeldmanHashSet_md5 \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_hp_md5_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_dhp_md5_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpi_md5_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpb_md5_stat) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_md5) \ - TEST_CASE(tag_FeldmanHashSet, FeldmanHashSet_rcu_gpt_md5_stat) \ - CDSUNIT_DECLARE_FeldmanHashSet_md5_RCU_signal - -#define CDSUNIT_TEST_FeldmanHashSet_md5 \ - CPPUNIT_TEST(FeldmanHashSet_hp_md5) \ - CPPUNIT_TEST(FeldmanHashSet_hp_md5_stat) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_md5) \ - CPPUNIT_TEST(FeldmanHashSet_dhp_md5_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_md5) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpi_md5_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_md5) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpb_md5_stat) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_md5) \ - CPPUNIT_TEST(FeldmanHashSet_rcu_gpt_md5_stat) \ - CDSUNIT_TEST_FeldmanHashSet_md5_RCU_signal - - // CityHash -only for 64bit #undef CDSUNIT_DECLARE_FeldmanHashSet_city #undef CDSUNIT_DECLARE_FeldmanHashSet_city_RCU_signal @@ -863,11 +812,9 @@ #define CDSUNIT_DECLARE_FeldmanHashSet \ CDSUNIT_DECLARE_FeldmanHashSet_fixed \ CDSUNIT_DECLARE_FeldmanHashSet_stdhash \ - CDSUNIT_DECLARE_FeldmanHashSet_md5 \ CDSUNIT_DECLARE_FeldmanHashSet_city #define CDSUNIT_TEST_FeldmanHashSet \ CDSUNIT_TEST_FeldmanHashSet_fixed \ CDSUNIT_TEST_FeldmanHashSet_stdhash \ - CDSUNIT_TEST_FeldmanHashSet_md5 \ CDSUNIT_TEST_FeldmanHashSet_city diff --git a/tests/unit/set2/set_insdel_string.h b/tests/unit/set2/set_insdel_string.h index 36ae9565..3872ca18 100644 --- a/tests/unit/set2/set_insdel_string.h +++ b/tests/unit/set2/set_insdel_string.h @@ -518,7 +518,6 @@ namespace set2 { CDSUNIT_DECLARE_SkipListSet CDSUNIT_DECLARE_EllenBinTreeSet CDSUNIT_DECLARE_FeldmanHashSet_stdhash - CDSUNIT_DECLARE_FeldmanHashSet_md5 CDSUNIT_DECLARE_FeldmanHashSet_city CDSUNIT_DECLARE_StdSet @@ -527,7 +526,6 @@ namespace set2 { CDSUNIT_TEST_SplitList CDSUNIT_TEST_SkipListSet CDSUNIT_TEST_FeldmanHashSet_stdhash - CDSUNIT_TEST_FeldmanHashSet_md5 CDSUNIT_TEST_FeldmanHashSet_city CDSUNIT_TEST_EllenBinTreeSet CDSUNIT_TEST_StripedSet diff --git a/tests/unit/set2/set_insdel_string_feldmanhashset.cpp b/tests/unit/set2/set_insdel_string_feldmanhashset.cpp index 306d8f2b..2cd9edbd 100644 --- a/tests/unit/set2/set_insdel_string_feldmanhashset.cpp +++ b/tests/unit/set2/set_insdel_string_feldmanhashset.cpp @@ -9,6 +9,5 @@ namespace set2 { CDSUNIT_DECLARE_FeldmanHashSet_stdhash - CDSUNIT_DECLARE_FeldmanHashSet_md5 CDSUNIT_DECLARE_FeldmanHashSet_city } // namespace set2 diff --git a/tests/unit/set2/set_type_feldman_hashset.h b/tests/unit/set2/set_type_feldman_hashset.h index 5b82c754..2b2b9d57 100644 --- a/tests/unit/set2/set_type_feldman_hashset.h +++ b/tests/unit/set2/set_type_feldman_hashset.h @@ -152,31 +152,6 @@ namespace set2 { typedef FeldmanHashSet< rcu_sht, key_val>, traits_FeldmanHashSet_stat > FeldmanHashSet_rcu_sht_stdhash_stat; #endif - //MD5 - typedef FeldmanHashSet< cds::gc::HP, key_val<::hashing::md5>, default_traits > FeldmanHashSet_hp_md5; - typedef FeldmanHashSet< cds::gc::DHP, key_val<::hashing::md5>, default_traits > FeldmanHashSet_dhp_md5; - typedef FeldmanHashSet< rcu_gpi, key_val<::hashing::md5>, default_traits > FeldmanHashSet_rcu_gpi_md5; - typedef FeldmanHashSet< rcu_gpb, key_val<::hashing::md5>, default_traits > FeldmanHashSet_rcu_gpb_md5; - typedef FeldmanHashSet< rcu_gpt, key_val<::hashing::md5>, default_traits > FeldmanHashSet_rcu_gpt_md5; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val<::hashing::md5>, default_traits > FeldmanHashSet_rcu_shb_md5; - typedef FeldmanHashSet< rcu_sht, key_val<::hashing::md5>, default_traits > FeldmanHashSet_rcu_sht_md5; -#endif - - struct traits_FeldmanHashSet_md5_stat : public default_traits - { - typedef cc::feldman_hashset::stat<> stat; - }; - typedef FeldmanHashSet< cds::gc::HP, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_hp_md5_stat; - typedef FeldmanHashSet< cds::gc::DHP, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_dhp_md5_stat; - typedef FeldmanHashSet< rcu_gpi, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_rcu_gpi_md5_stat; - typedef FeldmanHashSet< rcu_gpb, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_rcu_gpb_md5_stat; - typedef FeldmanHashSet< rcu_gpt, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_rcu_gpt_md5_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashSet< rcu_shb, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_rcu_shb_md5_stat; - typedef FeldmanHashSet< rcu_sht, key_val<::hashing::md5>, traits_FeldmanHashSet_md5_stat > FeldmanHashSet_rcu_sht_md5_stat; -#endif - // CityHash #if CDS_BUILD_BITS == 64 struct traits_FeldmanHashSet_city64 : public default_traits -- 2.34.1