X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fsec%2Fhash%2Fsha1.c;h=6f195a5bb0ff3d833c139e4b745ebd7678b6904b;hb=01d0d2312f50170e2208bbee3bc4f7052ca6f4a4;hp=d9dc5c860764cf5b3fc080263e320c4b40342db2;hpb=cbdcd1b3a571389f3c24295d2eb0a53bef08e7fa;p=bertos.git diff --git a/bertos/sec/hash/sha1.c b/bertos/sec/hash/sha1.c index d9dc5c86..6f195a5b 100644 --- a/bertos/sec/hash/sha1.c +++ b/bertos/sec/hash/sha1.c @@ -54,8 +54,8 @@ #include #include -#define SHA1_BLOCK_LEN 16 -#define SHA1_DIGEST_LEN 16 +#define SHA1_BLOCK_LEN 64 +#define SHA1_DIGEST_LEN 20 static void SHA1Transform(uint32_t state[5], const uint8_t buffer[64]); @@ -254,46 +254,3 @@ void SHA1_init(SHA1_Context* ctx) ctx->h.update = SHA1_update; ctx->h.final = SHA1_final; } - -#include - -void SHA1_benchmark(int numk) -{ - SHA1_Context context; - SHA1_init(&context); - - static uint8_t buf[512]; - memset(buf, 0x12, sizeof(buf)); - - ticks_t t = timer_clock(); - - for (int j=0;j<64;++j) { - SHA1_begin(&context.h); - for (int i=0; i