Add a return value to hasher_t.reset()

This commit is contained in:
Martin Willi
2012-07-16 14:55:06 +02:00
parent 87dd205b61
commit e3b2e900e6
12 changed files with 91 additions and 68 deletions
+3 -1
View File
@@ -175,7 +175,7 @@ static void SHA1Final(private_sha1_hasher_t *this, u_int8_t *digest)
}
}
METHOD(hasher_t, reset, void,
METHOD(hasher_t, reset, bool,
private_sha1_hasher_t *this)
{
this->state[0] = 0x67452301;
@@ -185,6 +185,8 @@ METHOD(hasher_t, reset, void,
this->state[4] = 0xC3D2E1F0;
this->count[0] = 0;
this->count[1] = 0;
return TRUE;
}
METHOD(hasher_t, get_hash, bool,
+5 -1
View File
@@ -100,7 +100,11 @@ METHOD(prf_t, set_key, bool,
int i, rounds;
u_int32_t *iv = (u_int32_t*)key.ptr;
this->hasher->public.hasher_interface.reset(&this->hasher->public.hasher_interface);
if (!this->hasher->public.hasher_interface.reset(
&this->hasher->public.hasher_interface))
{
return FALSE;
}
rounds = min(key.len/sizeof(u_int32_t), sizeof(this->hasher->state));
for (i = 0; i < rounds; i++)
{