- if (!EVP_DigestUpdate(c, (unsigned char *)text, strlen(text))
- || !EVP_DigestFinal_ex(c, &(md[0]), NULL))
- goto err;
-
- if (memcmp(md, pad2, MDC2_DIGEST_LENGTH) != 0) {
- for (i = 0; i < MDC2_DIGEST_LENGTH; i++)
- printf("%02X", md[i]);
- printf(" <- generated\n");
- for (i = 0; i < MDC2_DIGEST_LENGTH; i++)
- printf("%02X", pad2[i]);
- printf(" <- correct\n");
- } else {
- printf("pad2 - ok\n");
- ret = 0;
- }
+ if (!TEST_true(EVP_DigestUpdate(c, (unsigned char *)text, tlen))
+ || !TEST_true(EVP_DigestFinal_ex(c, &(md[0]), NULL))
+ || !TEST_mem_eq(md, MDC2_DIGEST_LENGTH, pad2, MDC2_DIGEST_LENGTH))
+ goto end;