diff --git a/lib/md5.c b/lib/md5.c index 9b414aa..69240b3 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -221,6 +221,14 @@ process_partial_block: void * md5_buffer (const char *buffer, size_t len, void *resblock) { +#if 1 /* TODO: Determine list of platforms and break-even point. */ + if (len >= 1) + { + if (afalg_buffer (buffer, len, "md5", resblock, MD5_DIGEST_SIZE) == 0) + return resblock; + } +#endif + struct md5_ctx ctx; /* Initialize the computation context. */ diff --git a/lib/sha1.c b/lib/sha1.c index 847e452..29fe686 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -209,6 +209,14 @@ sha1_stream (FILE *stream, void *resblock) void * sha1_buffer (const char *buffer, size_t len, void *resblock) { +#if 1 /* TODO: Determine list of platforms and break-even point. */ + if (len >= 1) + { + if (afalg_buffer (buffer, len, "sha1", resblock, SHA1_DIGEST_SIZE) == 0) + return resblock; + } +#endif + struct sha1_ctx ctx; /* Initialize the computation context. */ diff --git a/lib/sha256.c b/lib/sha256.c index 5503c20..a4579e4 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -273,6 +273,15 @@ sha224_stream (FILE *stream, void *resblock) void * sha256_buffer (const char *buffer, size_t len, void *resblock) { +#if 1 /* TODO: Determine list of platforms and break-even point. */ + if (len >= 1) + { + if (afalg_buffer (buffer, len, "sha256", resblock, SHA256_DIGEST_SIZE) + == 0) + return resblock; + } +#endif + struct sha256_ctx ctx; /* Initialize the computation context. */ @@ -288,6 +297,15 @@ sha256_buffer (const char *buffer, size_t len, void *resblock) void * sha224_buffer (const char *buffer, size_t len, void *resblock) { +#if 1 /* TODO: Determine list of platforms and break-even point. */ + if (len >= 1) + { + if (afalg_buffer (buffer, len, "sha224", resblock, SHA224_DIGEST_SIZE) + == 0) + return resblock; + } +#endif + struct sha256_ctx ctx; /* Initialize the computation context. */ diff --git a/lib/sha512.c b/lib/sha512.c index af0776c..e58538a 100644 --- a/lib/sha512.c +++ b/lib/sha512.c @@ -281,6 +281,15 @@ sha384_stream (FILE *stream, void *resblock) void * sha512_buffer (const char *buffer, size_t len, void *resblock) { +#if 1 /* TODO: Determine list of platforms and break-even point. */ + if (len >= 1) + { + if (afalg_buffer (buffer, len, "sha512", resblock, SHA512_DIGEST_SIZE) + == 0) + return resblock; + } +#endif + struct sha512_ctx ctx; /* Initialize the computation context. */ @@ -296,6 +305,15 @@ sha512_buffer (const char *buffer, size_t len, void *resblock) void * sha384_buffer (const char *buffer, size_t len, void *resblock) { +#if 1 /* TODO: Determine list of platforms and break-even point. */ + if (len >= 1) + { + if (afalg_buffer (buffer, len, "sha384", resblock, SHA384_DIGEST_SIZE) + == 0) + return resblock; + } +#endif + struct sha512_ctx ctx; /* Initialize the computation context. */