shithub: blake2

Download patch

ref: 105d4e49c62847ae033757e953572471bbfdb8c6
parent: 5f615da00088e28419e39a66c79464db00688195
author: Samuel Neves <sneves@dei.uc.pt>
date: Fri May 29 08:40:07 EDT 2015

fix flags on architectures with < 32-bit int

--- a/ref/blake2b-ref.c
+++ b/ref/blake2b-ref.c
@@ -45,13 +45,13 @@
 
 static inline int blake2b_set_lastnode( blake2b_state *S )
 {
-  S->f[1] = ~0ULL;
+  S->f[1] = -1;
   return 0;
 }
 
 static inline int blake2b_clear_lastnode( blake2b_state *S )
 {
-  S->f[1] = 0ULL;
+  S->f[1] = 0;
   return 0;
 }
 
@@ -60,7 +60,7 @@
 {
   if( S->last_node ) blake2b_set_lastnode( S );
 
-  S->f[0] = ~0ULL;
+  S->f[0] = -1;
   return 0;
 }
 
@@ -68,7 +68,7 @@
 {
   if( S->last_node ) blake2b_clear_lastnode( S );
 
-  S->f[0] = 0ULL;
+  S->f[0] = 0;
   return 0;
 }
 
--- a/ref/blake2s-ref.c
+++ b/ref/blake2s-ref.c
@@ -40,13 +40,13 @@
 
 static inline int blake2s_set_lastnode( blake2s_state *S )
 {
-  S->f[1] = ~0U;
+  S->f[1] = -1;
   return 0;
 }
 
 static inline int blake2s_clear_lastnode( blake2s_state *S )
 {
-  S->f[1] = 0U;
+  S->f[1] = 0;
   return 0;
 }
 
@@ -55,7 +55,7 @@
 {
   if( S->last_node ) blake2s_set_lastnode( S );
 
-  S->f[0] = ~0U;
+  S->f[0] = -1;
   return 0;
 }
 
@@ -63,7 +63,7 @@
 {
   if( S->last_node ) blake2s_clear_lastnode( S );
 
-  S->f[0] = 0U;
+  S->f[0] = 0;
   return 0;
 }
 
--- a/sse/blake2b.c
+++ b/sse/blake2b.c
@@ -65,13 +65,13 @@
 /* Some helper functions, not necessarily useful */
 static inline int blake2b_set_lastnode( blake2b_state *S )
 {
-  S->f[1] = ~0ULL;
+  S->f[1] = -1;
   return 0;
 }
 
 static inline int blake2b_clear_lastnode( blake2b_state *S )
 {
-  S->f[1] = 0ULL;
+  S->f[1] = 0;
   return 0;
 }
 
@@ -79,7 +79,7 @@
 {
   if( S->last_node ) blake2b_set_lastnode( S );
 
-  S->f[0] = ~0ULL;
+  S->f[0] = -1;
   return 0;
 }
 
@@ -87,7 +87,7 @@
 {
   if( S->last_node ) blake2b_clear_lastnode( S );
 
-  S->f[0] = 0ULL;
+  S->f[0] = 0;
   return 0;
 }
 
--- a/sse/blake2s.c
+++ b/sse/blake2s.c
@@ -61,13 +61,13 @@
 /* Some helper functions, not necessarily useful */
 static inline int blake2s_set_lastnode( blake2s_state *S )
 {
-  S->f[1] = ~0U;
+  S->f[1] = -1;
   return 0;
 }
 
 static inline int blake2s_clear_lastnode( blake2s_state *S )
 {
-  S->f[1] = 0U;
+  S->f[1] = 0;
   return 0;
 }
 
@@ -75,7 +75,7 @@
 {
   if( S->last_node ) blake2s_set_lastnode( S );
 
-  S->f[0] = ~0U;
+  S->f[0] = -1;
   return 0;
 }
 
@@ -83,7 +83,7 @@
 {
   if( S->last_node ) blake2s_clear_lastnode( S );
 
-  S->f[0] = 0U;
+  S->f[0] = 0;
   return 0;
 }
 
--