From 6fa4e1dbf2c83f9af154d7fd65f1304207dbc3b4 Mon Sep 17 00:00:00 2001 From: Leonid Evdokimov Date: Thu, 26 Sep 2024 17:47:41 +0300 Subject: [PATCH] NMHASH32: WIP-N+1 --- Hashes.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Hashes.cpp b/Hashes.cpp index 7ce4ba08..8b054318 100644 --- a/Hashes.cpp +++ b/Hashes.cpp @@ -1310,18 +1310,17 @@ void nmhash32_test ( const void * key, int len, uint32_t seed, void * out ) { memcpy(accX, &rand_str[11], sizeof(accX)); memcpy(accY, &rand_str[23], sizeof(accY)); - for (unsigned i = 0; i < COUNT_OF(accX); i++) - printf("0: %4d %08x\n", i, accX[i]); + for (unsigned i = 0; i < COUNT_OF(accX); i++) printf("0: %4d %08x\n", i, accX[i]); const size_t nbGroups = sizeof(NMH_ACC_INIT) / sizeof(*NMH_ACC_INIT); size_t i; for (i = 0; i < nbGroups * 2; ++i) { ((uint16_t*)accX)[i] *= ((uint16_t*)__NMH_M1_V)[i]; // ??? } + for (unsigned i = 0; i < COUNT_OF(accX); i++) printf("1: %4d %08x\n", i, accX[i]); for (i = 0; i < nbGroups; ++i) { accX[i] ^= accX[i] << 5 ^ accX[i] >> 13; // ??? } - for (unsigned i = 0; i < COUNT_OF(accX); i++) - printf("2: %4d %08x\n", i, accX[i]); + for (unsigned i = 0; i < COUNT_OF(accX); i++) printf("2: %4d %08x\n", i, accX[i]); sumhash32(accX, sizeof(accX), 0, &oh); printf("sumhash32(accX) = %x\n", oh); sumhash32(accY, sizeof(accY), 0, &oh); printf("sumhash32(accY) = %x\n", oh);