From 0ad5a52c9adf18fbd24ff8f66e191979806656ae Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 5 Sep 2003 20:29:39 +0000 Subject: [PATCH] use memset instead of assignment to clear memory --- tiger.cpp | 2 +- whrlpool.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tiger.cpp b/tiger.cpp index 50dfb462..d5e0718b 100644 --- a/tiger.cpp +++ b/tiger.cpp @@ -87,7 +87,7 @@ void Tiger::Transform (word64 *digest, const word64 *X) digest[1] = b - digest[1]; digest[2] = c + digest[2]; - Y[0] = Y[1] = Y[2] = Y[3] = Y[4] = Y[5] = Y[6] = Y[7] = 0; + memset(Y, 0, sizeof(Y)); } NAMESPACE_END diff --git a/whrlpool.cpp b/whrlpool.cpp index f2462f2c..7f3195b2 100644 --- a/whrlpool.cpp +++ b/whrlpool.cpp @@ -64,8 +64,7 @@ void Whirlpool_TestInstantiations() void Whirlpool::InitState(HashWordType *state) { - state[0] = state[1] = state[2] = state[3] = - state[4] = state[5] = state[6] = state[7] = 0; + memset(state, 0, 8*sizeof(state[0])); } void Whirlpool::TruncatedFinal(byte *hash, unsigned int size)