]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
gosthash2012: Enable building with SIMD implementation
authorVitaly Chikunov <vt@altlinux.org>
Fri, 31 Jan 2020 23:57:15 +0000 (02:57 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sun, 2 Feb 2020 18:05:29 +0000 (21:05 +0300)
Also, add compile time notice message to show which implementation is
selected.

gosthash2012.h
gosthash2012_ref.h
gosthash2012_sse2.h

index 4d57e14f2f34c6cd4fc2ad84524a9b50404269e5..5b1cd9f1f5c61677d31156447543f0fd49cd0c75 100644 (file)
 
 #include <string.h>
 
-#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
index 6d43d9e0ca906fd7ac4d011a127cef3554b3f2c7..25f0ed85542b31ac9354b193f6d9ea6d5459ad56 100644 (file)
@@ -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]; \
index 6401beb9584a1ff2b6e51afd84c12bc807f7a3f3..f45dab18e241adfc86abf7c02275cb17a25d38ea 100644 (file)
@@ -12,6 +12,8 @@
 # error "GOST R 34.11-2012: SSE2 not enabled"
 #endif
 
+# pragma message "Use SIMD implementation"
+
 #include <mmintrin.h>
 #include <emmintrin.h>