diff options
Diffstat (limited to 'Source/lib/crypto/hashers')
-rw-r--r-- | Source/lib/crypto/hashers/md5_hasher.c | 9 | ||||
-rw-r--r-- | Source/lib/crypto/hashers/sha1_hasher.c | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/Source/lib/crypto/hashers/md5_hasher.c b/Source/lib/crypto/hashers/md5_hasher.c index cd883d92c..8d6361139 100644 --- a/Source/lib/crypto/hashers/md5_hasher.c +++ b/Source/lib/crypto/hashers/md5_hasher.c @@ -25,10 +25,11 @@ * for more details. */ +#include <string.h> + #include "md5_hasher.h" #include <definitions.h> -#include <utils/allocator.h> #define BLOCK_SIZE_MD5 16 @@ -334,7 +335,7 @@ static void allocate_hash(private_md5_hasher_t *this, chunk_t chunk, chunk_t *ha MD5Update(this, chunk.ptr, chunk.len); if (hash != NULL) { - allocated_hash.ptr = allocator_alloc(BLOCK_SIZE_MD5); + allocated_hash.ptr = malloc(BLOCK_SIZE_MD5); allocated_hash.len = BLOCK_SIZE_MD5; MD5Final(this, allocated_hash.ptr); @@ -370,7 +371,7 @@ static void reset(private_md5_hasher_t *this) */ static void destroy(private_md5_hasher_t *this) { - allocator_free(this); + free(this); } /* @@ -378,7 +379,7 @@ static void destroy(private_md5_hasher_t *this) */ md5_hasher_t *md5_hasher_create() { - private_md5_hasher_t *this = allocator_alloc_thing(private_md5_hasher_t); + private_md5_hasher_t *this = malloc_thing(private_md5_hasher_t); this->public.hasher_interface.get_hash = (void (*) (hasher_t*, chunk_t, u_int8_t*))get_hash; this->public.hasher_interface.allocate_hash = (void (*) (hasher_t*, chunk_t, chunk_t*))allocate_hash; diff --git a/Source/lib/crypto/hashers/sha1_hasher.c b/Source/lib/crypto/hashers/sha1_hasher.c index 2fa659f74..b66e75ada 100644 --- a/Source/lib/crypto/hashers/sha1_hasher.c +++ b/Source/lib/crypto/hashers/sha1_hasher.c @@ -23,10 +23,11 @@ * for more details. */ +#include <string.h> + #include "sha1_hasher.h" #include <definitions.h> -#include <utils/allocator.h> #define BLOCK_SIZE_SHA1 20 @@ -208,7 +209,7 @@ static void allocate_hash(private_sha1_hasher_t *this, chunk_t chunk, chunk_t *h SHA1Update(this, chunk.ptr, chunk.len); if (hash != NULL) { - allocated_hash.ptr = allocator_alloc(BLOCK_SIZE_SHA1); + allocated_hash.ptr = malloc(BLOCK_SIZE_SHA1); allocated_hash.len = BLOCK_SIZE_SHA1; SHA1Final(this, allocated_hash.ptr); @@ -244,7 +245,7 @@ static void reset(private_sha1_hasher_t *this) */ static void destroy(private_sha1_hasher_t *this) { - allocator_free(this); + free(this); } @@ -253,7 +254,7 @@ static void destroy(private_sha1_hasher_t *this) */ sha1_hasher_t *sha1_hasher_create() { - private_sha1_hasher_t *this = allocator_alloc_thing(private_sha1_hasher_t); + private_sha1_hasher_t *this = malloc_thing(private_sha1_hasher_t); this->public.hasher_interface.get_hash = (void (*) (hasher_t*, chunk_t, u_int8_t*))get_hash; this->public.hasher_interface.allocate_hash = (void (*) (hasher_t*, chunk_t, chunk_t*))allocate_hash; |