]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gosthash2012.h
gosthash2012: Change some byte (pointers) to union uint512_u
[openssl-gost/engine.git] / gosthash2012.h
index 021b7d4cee8effd71fe790ebc161a7ccdda27789..4d57e14f2f34c6cd4fc2ad84524a9b50404269e5 100644 (file)
 # include "gosthash2012_ref.h"
 #endif
 
+# if defined(__GNUC__) || defined(__clang__)
+#  define RESTRICT __restrict__
+# else
+#  define RESTRICT
+# endif
+
 #ifdef _MSC_VER
 # define ALIGN(x) __declspec(align(x))
 #else
 ALIGN(16)
 typedef union uint512_u {
     unsigned long long QWORD[8];
+    unsigned char B[64];
 } uint512_u;
 
 #include "gosthash2012_const.h"
 #include "gosthash2012_precalc.h"
 
 /* GOST R 34.11-2012 hash context */
-ALIGN(16)
 typedef struct gost2012_hash_ctx {
-    ALIGN(16) unsigned char buffer[64];
-    union uint512_u hash;
+    union uint512_u buffer;
     union uint512_u h;
     union uint512_u N;
     union uint512_u Sigma;