From bebfeaf26ed928639dad8e2deacbd8d31c8dcda2 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Thu, 12 Dec 2024 08:16:20 +0100 Subject: [PATCH] skip gxhash on AES missing Fixes GH #304 --- CMakeLists.txt | 6 +++++- README.md | 2 +- main.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c475cd68..9c93f857 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -520,6 +520,10 @@ else() set(T1HA_SRC t1ha/t1ha0.c t1ha/t1ha1.c t1ha/t1ha2.c) endif(AES_FOUND AND (PROCESSOR_FAMILY STREQUAL "Intel")) +if(AES_FOUND) + set(GX_SRC gxhash.c) +endif(AES_FOUND) + if(SHA_FOUND) # todo: arm, power set(SHA_SRC SHA-Intrinsics/sha1-x86.c SHA-Intrinsics/sha256-x86.c) @@ -696,7 +700,7 @@ add_library( beamsplitter.cpp discohash_512.cpp xxhash.c - gxhash.c + ${GX_SRC} metrohash/metrohash64.cpp metrohash/metrohash128.cpp cmetrohash64.c diff --git a/README.md b/README.md index dc2052e4..bef0a890 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ SMhasher | [k-hashv64](doc/k-hashv64.txt) | 9251.05 | 51.72 | 251.83 (2) |1279 | | | [komihash](doc/komihash.txt) | 12179.74 | 33.23 | 224.80 (2) |1323 | | | [polymur](doc/polymur.txt) | 9913.53 | 41.68 | 232.56 (3) |1128 | | -| [gxhash64](doc/gxhash64.txt) | 48919.73 | 36.61 | 236.98 (3) | | | +| [gxhash64](doc/gxhash64.txt) | 48919.73 | 36.61 | 236.98 (3) | | AES only | The sortable table variants: diff --git a/main.cpp b/main.cpp index 00e8d664..5e8ecba0 100644 --- a/main.cpp +++ b/main.cpp @@ -676,7 +676,9 @@ HashInfo g_hashes[] = { farmhash64_c_test, 64, FARM64_VERIF, "farmhash64_c", "farmhash64_with_seed (C99)", GOOD, {} }, { farmhash128_c_test, 128, FARM128_VERIF,"farmhash128_c", "farmhash128_with_seed (C99)", GOOD, {} }, #endif -{ gxhash64_test, 64, 0x9189E456, "gxhash64", "gxHash, 64-bit", GOOD, {} }, +#ifdef HAVE_AESNI +{ gxhash64_test, 64, 0x9189E456, "gxhash64", "gxHash, 64-bit, AES-only", GOOD, {} }, +#endif { xxHash64_test, 64, 0x024B7CF4, "xxHash64", "xxHash, 64-bit", GOOD, {} }, #if 0 { xxhash256_test, 64, 0x024B7CF4, "xxhash256", "xxhash256, 64-bit unportable", GOOD, {} },