From df364f1b0034a920ced4b5e159db1cd9f7b41a78 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Thu, 20 May 2004 21:20:19 +0000 Subject: [PATCH] Stress collector/padding function. --- crypto/sha/sha512t.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/crypto/sha/sha512t.c b/crypto/sha/sha512t.c index 8d2c760c51..603fcefcbe 100644 --- a/crypto/sha/sha512t.c +++ b/crypto/sha/sha512t.c @@ -68,6 +68,15 @@ int main () int i; SHA512_CTX ctx; +#ifdef OPENSSL_IA32_SSE2 + { extern int OPENSSL_ia32cap; + char *env; + + if (env=getenv("OPENSSL_ia32cap")) + OPENSSL_ia32cap = strtol (env,NULL,0); + } +#endif + fprintf(stdout,"Testing SHA-512 "); SHA512("abc",3,md); @@ -92,10 +101,17 @@ int main () fprintf(stdout,"."); fflush(stdout); SHA512_Init(&ctx); - for (i=0;i<1000000;i+=64) + for (i=0;i<1000000;i+=288) SHA512_Update(&ctx, "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" + "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa" "aaaaaaaa""aaaaaaaa""aaaaaaaa""aaaaaaaa", - (1000000-i)<64?1000000-i:64); + (1000000-i)<288?1000000-i:288); SHA512_Final(md,&ctx); if (memcmp(md,app_c3,sizeof(app_c3))) -- 2.25.1