From af9f9548d6c6fb5dad335c8bcdb66156a70ab2e8 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Thu, 21 Feb 2019 17:16:00 +0530 Subject: [PATCH] Update reference blake2 implementation with upstream --- cbits/blake2/ref/blake2-impl.h | 4 ++-- cbits/blake2/ref/blake2s-ref.c | 2 +- cbits/blake2/sse/blake2-impl.h | 4 ++-- cryptonite.externals | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cbits/blake2/ref/blake2-impl.h b/cbits/blake2/ref/blake2-impl.h index 5dff7fc..c1df82e 100644 --- a/cbits/blake2/ref/blake2-impl.h +++ b/cbits/blake2/ref/blake2-impl.h @@ -72,8 +72,8 @@ static BLAKE2_INLINE uint16_t load16( const void *src ) return w; #else const uint8_t *p = ( const uint8_t * )src; - return (( uint16_t )( p[0] ) << 0) | - (( uint16_t )( p[1] ) << 8) ; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); #endif } diff --git a/cbits/blake2/ref/blake2s-ref.c b/cbits/blake2/ref/blake2s-ref.c index fbf4265..c8b035f 100644 --- a/cbits/blake2/ref/blake2s-ref.c +++ b/cbits/blake2/ref/blake2s-ref.c @@ -294,7 +294,7 @@ int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void #if defined(SUPERCOP) int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) { - return blake2s( out, BLAKE2S_OUTBYTES in, inlen, NULL, 0 ); + return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); } #endif diff --git a/cbits/blake2/sse/blake2-impl.h b/cbits/blake2/sse/blake2-impl.h index 5dff7fc..c1df82e 100644 --- a/cbits/blake2/sse/blake2-impl.h +++ b/cbits/blake2/sse/blake2-impl.h @@ -72,8 +72,8 @@ static BLAKE2_INLINE uint16_t load16( const void *src ) return w; #else const uint8_t *p = ( const uint8_t * )src; - return (( uint16_t )( p[0] ) << 0) | - (( uint16_t )( p[1] ) << 8) ; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); #endif } diff --git a/cryptonite.externals b/cryptonite.externals index 55c81d2..abf5d81 100644 --- a/cryptonite.externals +++ b/cryptonite.externals @@ -1 +1 @@ -cbits/blake2,7728c30896d3fa0c3b4df52c2bd5a1e36f8f1287,https://github.com/blake2/blake2 +cbits/blake2,320c325437539ae91091ce62efec1913cd8093c2,https://github.com/blake2/blake2