aboutsummaryrefslogtreecommitdiff
path: root/lib/isc/sha2.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isc/sha2.c')
-rw-r--r--lib/isc/sha2.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/isc/sha2.c b/lib/isc/sha2.c
index 22f1d47655a4..f72e164c3d99 100644
--- a/lib/isc/sha2.c
+++ b/lib/isc/sha2.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2005-2007, 2009-2011 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sha2.c,v 1.13.332.4 2010-01-15 23:47:34 tbox Exp $ */
+/* $Id: sha2.c,v 1.13.332.6 2011-03-12 04:57:28 tbox Exp $ */
/* $FreeBSD$ */
/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
@@ -570,6 +570,9 @@ void isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) {
/* Clean up */
a = b = c = d = e = f = g = h = T1 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1);
}
#else /* ISC_SHA2_UNROLL_TRANSFORM */
@@ -651,6 +654,9 @@ isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) {
/* Clean up */
a = b = c = d = e = f = g = h = T1 = T2 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1); POST(T2);
}
#endif /* ISC_SHA2_UNROLL_TRANSFORM */
@@ -692,6 +698,8 @@ isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) {
context->bitcount += len << 3;
/* Clean up: */
usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
return;
}
}
@@ -710,6 +718,8 @@ isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) {
}
/* Clean up: */
usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
}
void
@@ -780,6 +790,7 @@ isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) {
/* Clean up state data: */
memset(context, 0, sizeof(context));
usedspace = 0;
+ POST(usedspace);
}
char *
@@ -917,6 +928,9 @@ void isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) {
/* Clean up */
a = b = c = d = e = f = g = h = T1 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1);
}
#else /* ISC_SHA2_UNROLL_TRANSFORM */
@@ -996,6 +1010,9 @@ isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) {
/* Clean up */
a = b = c = d = e = f = g = h = T1 = T2 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1); POST(T2);
}
#endif /* ISC_SHA2_UNROLL_TRANSFORM */
@@ -1037,6 +1054,8 @@ isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) {
ADDINC128(context->bitcount, len << 3);
/* Clean up: */
usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
return;
}
}
@@ -1055,6 +1074,8 @@ isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) {
}
/* Clean up: */
usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
}
void isc_sha512_last(isc_sha512_t *context) {