From: Vitaly Chikunov Date: Fri, 31 Jan 2020 23:57:15 +0000 (+0300) Subject: gosthash2012: Enable building with SIMD implementation X-Git-Tag: v3.0.0~213 X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=openssl-gost%2Fengine.git;a=commitdiff_plain;h=88a44b67c76ce938f124e22e6a882780a98731fb gosthash2012: Enable building with SIMD implementation Also, add compile time notice message to show which implementation is selected. --- 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