From 1df36cb8415d9ba20b5551377d3f23ca846c74c9 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 27 Apr 2021 05:14:11 +0300 Subject: [PATCH] crypto: fix some warnings --- src/CMakeLists.txt | 7 +++++++ src/crypto/hash.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ab05c76..3f36b1d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -108,6 +108,13 @@ if(NOT MSVC AND NOT APPLE AND NOT CLANG) # TODO(unassigned): do we really need target_compile_options(common PRIVATE -fno-var-tracking-assignments) endif() +# disable specific warning in order not to touch original code by D. J. Bernstein +if(MSVC) + set_source_files_properties("crypto/chacha8_stream.c" PROPERTIES COMPILE_FLAGS "/wd4018") +else() + set_source_files_properties("crypto/chacha8_stream.c" PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-strict-prototypes") +endif() + add_library(crypto ${CRYPTO}) add_library(currency_core ${CURRENCY_CORE}) diff --git a/src/crypto/hash.c b/src/crypto/hash.c index e9d35a68..0d399f49 100644 --- a/src/crypto/hash.c +++ b/src/crypto/hash.c @@ -27,5 +27,5 @@ void cn_fast_hash_old(const void *data, size_t length, char *hash) void cn_fast_hash(const void *data, size_t length, char *hash) { - keccak(data, (int)length, hash, HASH_SIZE); + keccak(data, (int)length, (uint8_t*)hash, HASH_SIZE); }