Hi, I am submitting a patch for sys/crypto/sha2.c...
I guess we want to include variables s0 and s1 in the clean-up statement at the end of SHA256Transform() and SHA512Transform(). These variables are used by the macros ROUND256() and ROUND512(), as well as the message block expansion section of functions SHA256Transform() and SHA512Transform(). Does this look OK? - Michael Index: sha2.c =================================================================== RCS file: /cvs/src/sys/crypto/sha2.c,v retrieving revision 1.8 diff -u -p -r1.8 sha2.c --- sha2.c 11 Jan 2011 15:42:05 -0000 1.8 +++ sha2.c 9 Dec 2012 08:11:11 -0000 @@ -360,7 +360,7 @@ SHA256Transform(SHA2_CTX *context, const context->state.st32[7] += h; /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; + a = b = c = d = e = f = g = h = T1 = s0 = s1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ @@ -438,7 +438,7 @@ SHA256Transform(SHA2_CTX *context, const context->state.st32[7] += h; /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; + a = b = c = d = e = f = g = h = T1 = T2 = s0 = s1 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ @@ -646,7 +646,7 @@ SHA512Transform(SHA2_CTX *context, const context->state.st64[7] += h; /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; + a = b = c = d = e = f = g = h = T1 = s0 = s1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ @@ -724,7 +724,7 @@ SHA512Transform(SHA2_CTX *context, const context->state.st64[7] += h; /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; + a = b = c = d = e = f = g = h = T1 = T2 = s0 = s1 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */