if (thr == NULL) {
DWORD err = GetLastError();
BIO_printf(bio_err, "unable to CreateThread (%lu)", err);
- TerminateProcess(GetCurrentProcess(), err);
+ ExitProcess(err);
}
while (!schlock)
Sleep(0); /* scheduler spinlock */
unsigned char *buf = tempargs->buf;
unsigned char md2[MD2_DIGEST_LENGTH];
int count;
- for (count = 0; COND(c[D_MD2][testnum]); count++)
- EVP_Digest(buf, (unsigned long)lengths[testnum], &(md2[0]), NULL,
- EVP_md2(), NULL);
+ for (count = 0; COND(c[D_MD2][testnum]); count++) {
+ if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(md2[0]), NULL,
+ EVP_md2(), NULL))
+ return -1;
+ }
return count;
}
#endif
unsigned char *buf = tempargs->buf;
unsigned char mdc2[MDC2_DIGEST_LENGTH];
int count;
- for (count = 0; COND(c[D_MDC2][testnum]); count++)
- EVP_Digest(buf, (unsigned long)lengths[testnum], &(mdc2[0]), NULL,
- EVP_mdc2(), NULL);
+ for (count = 0; COND(c[D_MDC2][testnum]); count++) {
+ if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(mdc2[0]), NULL,
+ EVP_mdc2(), NULL))
+ return -1;
+ }
return count;
}
#endif
unsigned char *buf = tempargs->buf;
unsigned char md4[MD4_DIGEST_LENGTH];
int count;
- for (count = 0; COND(c[D_MD4][testnum]); count++)
- EVP_Digest(&(buf[0]), (unsigned long)lengths[testnum], &(md4[0]),
- NULL, EVP_md4(), NULL);
+ for (count = 0; COND(c[D_MD4][testnum]); count++) {
+ if (!EVP_Digest(&(buf[0]), (unsigned long)lengths[testnum], &(md4[0]),
+ NULL, EVP_md4(), NULL))
+ return -1;
+ }
return count;
}
#endif
unsigned char *buf = tempargs->buf;
unsigned char rmd160[RIPEMD160_DIGEST_LENGTH];
int count;
- for (count = 0; COND(c[D_RMD160][testnum]); count++)
- EVP_Digest(buf, (unsigned long)lengths[testnum], &(rmd160[0]), NULL,
- EVP_ripemd160(), NULL);
+ for (count = 0; COND(c[D_RMD160][testnum]); count++) {
+ if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(rmd160[0]),
+ NULL, EVP_ripemd160(), NULL))
+ return -1;
+ }
return count;
}
#endif
unsigned char md[EVP_MAX_MD_SIZE];
int count;
for (count = 0;
- COND(save_count * 4 * lengths[0] / lengths[testnum]); count++)
- EVP_Digest(buf, lengths[testnum], &(md[0]), NULL, evp_md, NULL);
-
+ COND(save_count * 4 * lengths[0] / lengths[testnum]); count++) {
+ if (!EVP_Digest(buf, lengths[testnum], &(md[0]), NULL, evp_md, NULL))
+ return -1;
+ }
return count;
}
static void print_result(int alg, int run_no, int count, double time_used)
{
+ if (count == -1) {
+ BIO_puts(bio_err, "EVP error!\n");
+ exit(1);
+ }
BIO_printf(bio_err,
mr ? "+R:%d:%s:%f\n"
: "%d %s's in %.2fs\n", count, names[alg], time_used);