diff options
author | Andy Polyakov <appro@openssl.org> | 2004-05-20 21:20:19 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2004-05-20 21:20:19 +0000 |
commit | df364f1b0034a920ced4b5e159db1cd9f7b41a78 (patch) | |
tree | 8bb7cf3a277068b899a2e188d2f27a70eb8dabb6 /crypto/sha | |
parent | bc767216d9c570812a2c5e1f6ef1cd34d346334c (diff) |
Stress collector/padding function.
Diffstat (limited to 'crypto/sha')
-rw-r--r-- | crypto/sha/sha512t.c | 20 |
1 files 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))) |