Stress collector/padding function.

This commit is contained in:
Andy Polyakov 2004-05-20 21:20:19 +00:00
parent bc767216d9
commit df364f1b00

View File

@ -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)))