From d35b364f3125e7ebe38392134f068b79b2c80e53 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 13 Jun 2015 17:31:49 +0200 Subject: [PATCH] Blake2b: fix flags on architectures with < 32-bit int --- src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c index 2610477d..12e55c7b 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +++ b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c @@ -46,14 +46,14 @@ static const uint8_t blake2b_sigma[12][16] = /* LCOV_EXCL_START */ static inline int blake2b_set_lastnode( blake2b_state *S ) { - S->f[1] = ~0ULL; + S->f[1] = -1; return 0; } /* LCOV_EXCL_STOP */ #if 0 static inline int blake2b_clear_lastnode( blake2b_state *S ) { - S->f[1] = 0ULL; + S->f[1] = 0; return 0; } #endif @@ -62,7 +62,7 @@ static inline int blake2b_set_lastblock( blake2b_state *S ) { if( S->last_node ) blake2b_set_lastnode( S ); - S->f[0] = ~0ULL; + S->f[0] = -1; return 0; } #if 0 @@ -70,7 +70,7 @@ static inline int blake2b_clear_lastblock( blake2b_state *S ) { if( S->last_node ) blake2b_clear_lastnode( S ); - S->f[0] = 0ULL; + S->f[0] = 0; return 0; } #endif