Permalink
Browse files

Whirlpool: use exact-width fields in context struct

Although uint8_t seems to suffice, this gives rise to field alignment issues when playing together with the Haskell module.
  • Loading branch information...
1 parent 74d142c commit 7b1d40a7cf9435e45c90a24129ddf8bafdf4c85d Stijn van Drongelen committed Aug 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 cbits/whirlpool_nessie.h
@@ -31,8 +31,8 @@ typedef unsigned __int64 uint64_t;
typedef struct NESSIEstruct {
uint8_t bitLength[LENGTHBYTES]; /* global number of hashed bits (256-bit counter) */
uint8_t buffer[WBLOCKBYTES]; /* buffer of data to hash */
- int bufferBits; /* current number of bits on the buffer */
- int bufferPos; /* current (possibly incomplete) byte slot on the buffer */
+ uint32_t bufferBits; /* current number of bits on the buffer */
+ uint32_t bufferPos; /* current (possibly incomplete) byte slot on the buffer */
uint64_t hash[DIGESTBYTES/8]; /* the hashing state */
} NESSIEstruct;

0 comments on commit 7b1d40a

Please sign in to comment.