int failures = 0;
TEST_CTX t;
- if (td->df != USE_DF)
+ if ((td->flags & USE_DF) == 0)
flags |= RAND_DRBG_FLAG_CTR_NO_DF;
+ if ((td->flags & USE_HMAC) != 0)
+ flags |= RAND_DRBG_FLAG_HMAC;
if (!TEST_ptr(drbg = RAND_DRBG_new(td->nid, flags, NULL)))
return 0;
int failures = 0;
TEST_CTX t;
- if (td->df != USE_DF)
+ if ((td->flags & USE_DF) == 0)
flags |= RAND_DRBG_FLAG_CTR_NO_DF;
+ if ((td->flags & USE_HMAC) != 0)
+ flags |= RAND_DRBG_FLAG_HMAC;
if (!TEST_ptr(drbg = RAND_DRBG_new(td->nid, flags, NULL)))
return 0;
int failures = 0;
TEST_CTX t;
- if (td->df != USE_DF)
+ if ((td->flags & USE_DF) == 0)
flags |= RAND_DRBG_FLAG_CTR_NO_DF;
+ if ((td->flags & USE_HMAC) != 0)
+ flags |= RAND_DRBG_FLAG_HMAC;
if (!TEST_ptr(drbg = RAND_DRBG_new(td->nid, flags, NULL)))
return 0;
return failures == 0;
}
-static int test_cavs_kats(int i)
+static int test_cavs_kats(const struct drbg_kat *test[], int i)
{
- const struct drbg_kat *td = drbg_test[i];
+ const struct drbg_kat *td = test[i];
int rv = 0;
switch (td->type) {
return rv;
}
+static int test_cavs_ctr(int i)
+{
+ return test_cavs_kats(drbg_ctr_test, i);
+}
+
+static int test_cavs_hmac(int i)
+{
+ return test_cavs_kats(drbg_hmac_test, i);
+}
+
+static int test_cavs_hash(int i)
+{
+ return test_cavs_kats(drbg_hash_test, i);
+}
+
int setup_tests(void)
{
app_data_index = RAND_DRBG_get_ex_new_index(0L, NULL, NULL, NULL, NULL);
- ADD_ALL_TESTS(test_cavs_kats, drbg_test_nelem);
+ ADD_ALL_TESTS(test_cavs_ctr, drbg_ctr_nelem);
+ ADD_ALL_TESTS(test_cavs_hmac, drbg_hmac_nelem);
+ ADD_ALL_TESTS(test_cavs_hash, drbg_hash_nelem);
+
return 1;
}