Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/BLAKE2/BLAKE2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Neves <sneves@users.noreply.github.com>2018-07-11 15:05:17 +0300
committerGitHub <noreply@github.com>2018-07-11 15:05:17 +0300
commit320c325437539ae91091ce62efec1913cd8093c2 (patch)
tree07015d7fbdcfbdae23ab2ba925b7b1b0416cd603
parentca4c89314abff54e3806b44e4a08164f8204f09a (diff)
parent467c5446ac1cb7105f5b3e035761bdfc2193545c (diff)
Merge pull request #50 from mjvk/bitwise-cast
Bitwise cast
-rw-r--r--neon/blake2-impl.h4
-rw-r--r--ref/blake2-impl.h4
-rw-r--r--sse/blake2-impl.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/neon/blake2-impl.h b/neon/blake2-impl.h
index 5dff7fc..c1df82e 100644
--- a/neon/blake2-impl.h
+++ b/neon/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/ref/blake2-impl.h b/ref/blake2-impl.h
index 5dff7fc..c1df82e 100644
--- a/ref/blake2-impl.h
+++ b/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/sse/blake2-impl.h b/sse/blake2-impl.h
index 5dff7fc..c1df82e 100644
--- a/sse/blake2-impl.h
+++ b/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
}