From 88a44b67c76ce938f124e22e6a882780a98731fb Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Sat, 1 Feb 2020 02:57:15 +0300 Subject: [PATCH] gosthash2012: Enable building with SIMD implementation Also, add compile time notice message to show which implementation is selected. --- gosthash2012.h | 9 +++------ gosthash2012_ref.h | 2 ++ gosthash2012_sse2.h | 2 ++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gosthash2012.h b/gosthash2012.h index 4d57e14..5b1cd9f 100644 --- a/gosthash2012.h +++ b/gosthash2012.h @@ -10,12 +10,8 @@ #include -#ifdef OPENSSL_IA32_SSE2 -# ifdef __MMX__ -# ifdef __SSE2__ -# define __GOST3411_HAS_SSE2__ -# endif -# endif +#ifdef __SSE2__ +# define __GOST3411_HAS_SSE2__ #endif #ifdef __GOST3411_HAS_SSE2__ @@ -27,6 +23,7 @@ #ifndef L_ENDIAN # define __GOST3411_BIG_ENDIAN__ #endif + #if defined __GOST3411_HAS_SSE2__ # include "gosthash2012_sse2.h" #else diff --git a/gosthash2012_ref.h b/gosthash2012_ref.h index 6d43d9e..25f0ed8 100644 --- a/gosthash2012_ref.h +++ b/gosthash2012_ref.h @@ -12,6 +12,8 @@ # error "GOST R 34.11-2012: portable implementation disabled in config.h" #endif +# pragma message "Use regular implementation" + #define X(x, y, z) { \ z->QWORD[0] = x->QWORD[0] ^ y->QWORD[0]; \ z->QWORD[1] = x->QWORD[1] ^ y->QWORD[1]; \ diff --git a/gosthash2012_sse2.h b/gosthash2012_sse2.h index 6401beb..f45dab1 100644 --- a/gosthash2012_sse2.h +++ b/gosthash2012_sse2.h @@ -12,6 +12,8 @@ # error "GOST R 34.11-2012: SSE2 not enabled" #endif +# pragma message "Use SIMD implementation" + #include #include -- 2.39.2