shithub: blake2

Download patch

ref: b6525c7fa15dbf6713e0597727827d191a31a26a
parent: 105d4e49c62847ae033757e953572471bbfdb8c6
author: Samuel Neves <sneves@dei.uc.pt>
date: Thu Jun 11 17:58:15 EDT 2015

Remove unnecessary alignment directives

--- a/ref/blake2.h
+++ b/ref/blake2.h
@@ -17,12 +17,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#if defined(_MSC_VER)
-#define ALIGN(x) __declspec(align(x))
-#else
-#define ALIGN(x) __attribute__((aligned(x)))
-#endif
-
 #if defined(__cplusplus)
 extern "C" {
 #endif
@@ -61,7 +55,7 @@
     uint8_t  personal[BLAKE2S_PERSONALBYTES];  // 32
   } blake2s_param;
 
-  ALIGN( 64 ) typedef struct __blake2s_state
+  typedef struct __blake2s_state
   {
     uint32_t h[8];
     uint32_t t[2];
@@ -69,7 +63,7 @@
     uint8_t  buf[2 * BLAKE2S_BLOCKBYTES];
     size_t   buflen;
     uint8_t  last_node;
-  } blake2s_state ;
+  } blake2s_state;
 
   typedef struct __blake2b_param
   {
@@ -86,7 +80,7 @@
     uint8_t  personal[BLAKE2B_PERSONALBYTES];  // 64
   } blake2b_param;
 
-  ALIGN( 64 ) typedef struct __blake2b_state
+  typedef struct __blake2b_state
   {
     uint64_t h[8];
     uint64_t t[2];
--- a/sse/blake2.h
+++ b/sse/blake2.h
@@ -17,12 +17,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#if defined(_MSC_VER)
-#define ALIGN(x) __declspec(align(x))
-#else
-#define ALIGN(x) __attribute__ ((__aligned__(x)))
-#endif
-
 #if defined(__cplusplus)
 extern "C" {
 #endif
@@ -61,7 +55,7 @@
     uint8_t  personal[BLAKE2S_PERSONALBYTES];  // 32
   } blake2s_param;
 
-  ALIGN( 64 ) typedef struct __blake2s_state
+  typedef struct __blake2s_state
   {
     uint32_t h[8];
     uint32_t t[2];
@@ -86,7 +80,7 @@
     uint8_t  personal[BLAKE2B_PERSONALBYTES];  // 64
   } blake2b_param;
 
-  ALIGN( 64 ) typedef struct __blake2b_state
+  typedef struct __blake2b_state
   {
     uint64_t h[8];
     uint64_t t[2];
@@ -96,7 +90,7 @@
     uint8_t  last_node;
   } blake2b_state;
 
-  ALIGN( 64 ) typedef struct __blake2sp_state
+  typedef struct __blake2sp_state
   {
     blake2s_state S[8][1];
     blake2s_state R[1];
@@ -104,7 +98,7 @@
     size_t  buflen;
   } blake2sp_state;
 
-  ALIGN( 64 ) typedef struct __blake2bp_state
+  typedef struct __blake2bp_state
   {
     blake2b_state S[4][1];
     blake2b_state R[1];
--- a/sse/blake2b-round.h
+++ b/sse/blake2b-round.h
@@ -14,9 +14,6 @@
 #ifndef __BLAKE2B_ROUND_H__
 #define __BLAKE2B_ROUND_H__
 
-#define LOAD(p)  _mm_load_si128( (const __m128i *)(p) )
-#define STORE(p,r) _mm_store_si128((__m128i *)(p), r)
-
 #define LOADU(p)  _mm_loadu_si128( (const __m128i *)(p) )
 #define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r)
 
--- a/sse/blake2b.c
+++ b/sse/blake2b.c
@@ -37,7 +37,7 @@
 
 #include "blake2b-round.h"
 
-ALIGN( 64 ) static const uint64_t blake2b_IV[8] =
+static const uint64_t blake2b_IV[8] =
 {
   0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL,
   0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL,
--- a/sse/blake2s-round.h
+++ b/sse/blake2s-round.h
@@ -14,9 +14,6 @@
 #ifndef __BLAKE2S_ROUND_H__
 #define __BLAKE2S_ROUND_H__
 
-#define LOAD(p)  _mm_load_si128( (const __m128i *)(p) )
-#define STORE(p,r) _mm_store_si128((__m128i *)(p), r)
-
 #define LOADU(p)  _mm_loadu_si128( (const __m128i *)(p) )
 #define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r)
 
--- a/sse/blake2s.c
+++ b/sse/blake2s.c
@@ -37,7 +37,7 @@
 
 #include "blake2s-round.h"
 
-ALIGN( 64 ) static const uint32_t blake2s_IV[8] =
+static const uint32_t blake2s_IV[8] =
 {
   0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
   0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
--