Add a return value to hasher_t.get_hash()

This commit is contained in:
Martin Willi
2012-07-16 14:55:06 +02:00
parent ce73fc19db
commit 8bd6a30af1
23 changed files with 174 additions and 89 deletions
+8 -4
View File
@@ -460,7 +460,7 @@ METHOD(hasher_t, reset512, void,
this->sha_bufCnt = 0;
}
METHOD(hasher_t, get_hash224, void,
METHOD(hasher_t, get_hash224, bool,
private_sha256_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
{
sha256_write(this, chunk.ptr, chunk.len);
@@ -470,9 +470,10 @@ METHOD(hasher_t, get_hash224, void,
memcpy(buffer, this->sha_out, HASH_SIZE_SHA224);
reset224(this);
}
return TRUE;
}
METHOD(hasher_t, get_hash256, void,
METHOD(hasher_t, get_hash256, bool,
private_sha256_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
{
sha256_write(this, chunk.ptr, chunk.len);
@@ -482,9 +483,10 @@ METHOD(hasher_t, get_hash256, void,
memcpy(buffer, this->sha_out, HASH_SIZE_SHA256);
reset256(this);
}
return TRUE;
}
METHOD(hasher_t, get_hash384, void,
METHOD(hasher_t, get_hash384, bool,
private_sha512_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
{
sha512_write(this, chunk.ptr, chunk.len);
@@ -494,9 +496,10 @@ METHOD(hasher_t, get_hash384, void,
memcpy(buffer, this->sha_out, HASH_SIZE_SHA384);
reset384(this);
}
return TRUE;
}
METHOD(hasher_t, get_hash512, void,
METHOD(hasher_t, get_hash512, bool,
private_sha512_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
{
sha512_write(this, chunk.ptr, chunk.len);
@@ -506,6 +509,7 @@ METHOD(hasher_t, get_hash512, void,
memcpy(buffer, this->sha_out, HASH_SIZE_SHA512);
reset512(this);
}
return TRUE;
}
METHOD(hasher_t, allocate_hash224, void,