diff options
-rw-r--r-- | docs/examples/multi-single.c | 2 | ||||
-rw-r--r-- | lib/sha256.c | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index c30447492..2c64d2375 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -40,7 +40,7 @@ /* Portable sleep for platforms other than Windows. */ #define WAITMS(x) \ struct timeval wait = { 0, (x) * 1000 }; \ - (void)select(0, NULL, NULL, NULL, &wait); + (void)select(0, NULL, NULL, NULL, &wait) #endif /* diff --git a/lib/sha256.c b/lib/sha256.c index c64ee0936..d91511791 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -344,11 +344,14 @@ static int sha256_compress(struct sha256_state *md, } /* Compress */ -#define RND(a,b,c,d,e,f,g,h,i) \ - unsigned long t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ - unsigned long t1 = Sigma0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; +#define RND(a,b,c,d,e,f,g,h,i) \ + do { \ + unsigned long t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ + unsigned long t1 = Sigma0(a) + Maj(a, b, c); \ + d += t0; \ + h = t0 + t1; \ + } while(0) + for(i = 0; i < 64; ++i) { unsigned long t; RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], i); |