diff options
-rw-r--r-- | src/hmac256.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hmac256.c b/src/hmac256.c index 8a318af9..d8c059ba 100644 --- a/src/hmac256.c +++ b/src/hmac256.c @@ -271,10 +271,12 @@ finalize (hmac256_context_t hd) /* Store the digest into hd->buf. */ p = hd->buf; #ifdef WORDS_BIGENDIAN -#define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0) +#define X(a) do { *p++ = hd->h##a; *p++ = hd->h##a >> 8; \ + *p++ = hd->h##a >> 16; *p++ = hd->h##a >> 24; } while(0) #else /* little endian */ #define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \ *p++ = hd->h##a >> 8; *p++ = hd->h##a; } while(0) + #endif X(0); X(1); |