}
#define cRED "\033[1;31m"
+#define cDRED "\033[0;31m"
#define cGREEN "\033[1;32m"
+#define cDGREEN "\033[0;32m"
#define cNORM "\033[m"
#define TEST_ASSERT(e) {if ((test = (e))) \
printf(cRED "Test FAILED\n" cNORM); \
/* preload cbc cipher for omac set key */
EVP_add_cipher(cipher_gost_grasshopper_cbc());
T(EVP_DigestInit_ex(ctx, grasshopper_omac(), NULL));
- if (EVP_MD_CTX_size(ctx) != 8) {
+ if (EVP_MD_CTX_size(ctx) != sizeof(mac)) {
/* strip const out of EVP_MD_CTX_md() to
* overwrite output size, as test vector is 8 bytes */
- T(EVP_MD_meth_set_result_size((EVP_MD *)EVP_MD_CTX_md(ctx), 8));
+ printf("Resize result size from %d to %zu\n", EVP_MD_CTX_size(ctx), sizeof(mac));
+ T(EVP_MD_meth_set_result_size((EVP_MD *)EVP_MD_CTX_md(ctx), sizeof(mac)));
}
T(EVP_MD_meth_get_ctrl(EVP_MD_CTX_md(ctx))(ctx, EVP_MD_CTRL_SET_KEY, sizeof(K), (void *)K));
T(EVP_DigestUpdate(ctx, P, sizeof(P)));
ret |= test_omac();
if (ret)
- printf(cRED "= Some tests FAILED!\n" cNORM);
+ printf(cDRED "= Some tests FAILED!\n" cNORM);
else
- printf(cGREEN "= All tests passed!\n" cNORM);
+ printf(cDGREEN "= All tests passed!\n" cNORM);
return ret;
}