memcpy(ctr->V, ctr->K + 24, 8);
}
- if (drbg->flags & RAND_DRBG_FLAG_CTR_USE_DF) {
+ if ((drbg->flags & RAND_DRBG_FLAG_CTR_NO_DF) == 0) {
/* If no input reuse existing derived value */
if (in1 != NULL || nonce != NULL || in2 != NULL)
ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len);
if (adin != NULL && adinlen != 0) {
ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0);
/* This means we reuse derived value */
- if (drbg->flags & RAND_DRBG_FLAG_CTR_USE_DF) {
+ if ((drbg->flags & RAND_DRBG_FLAG_CTR_NO_DF) == 0) {
adin = NULL;
adinlen = 1;
}
drbg->strength = keylen * 8;
drbg->seedlen = keylen + 16;
- if (drbg->flags & RAND_DRBG_FLAG_CTR_USE_DF) {
+ if ((drbg->flags & RAND_DRBG_FLAG_CTR_NO_DF) == 0) {
/* df initialisation */
static unsigned char df_key[32] = {
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
*/
if (RAND_get_rand_method() == RAND_OpenSSL()) {
s->drbg =
- RAND_DRBG_new(RAND_DRBG_NID, RAND_DRBG_FLAG_CTR_USE_DF,
- RAND_DRBG_get0_public());
+ RAND_DRBG_new(RAND_DRBG_NID, 0, RAND_DRBG_get0_public());
if (s->drbg == NULL
|| RAND_DRBG_instantiate(s->drbg,
(const unsigned char *) SSL_version_str,
pr##_pr_returnedbits, sizeof(pr##_pr_returnedbits) \
}
-#define make_drbg_test_data_df(nid, pr, p) \
- make_drbg_test_data(nid, RAND_DRBG_FLAG_CTR_USE_DF, pr, p)
+#define make_drbg_test_data_use_df(nid, pr, p) \
+ make_drbg_test_data(nid, 0, pr, p)
+
+#define make_drbg_test_data_no_df(nid, pr, p) \
+ make_drbg_test_data(nid, RAND_DRBG_FLAG_CTR_NO_DF, pr, p)
static DRBG_SELFTEST_DATA drbg_test[] = {
- make_drbg_test_data (NID_aes_128_ctr, 0, aes_128_no_df, 0),
- make_drbg_test_data (NID_aes_192_ctr, 0, aes_192_no_df, 0),
- make_drbg_test_data (NID_aes_256_ctr, 0, aes_256_no_df, 1),
- make_drbg_test_data_df(NID_aes_128_ctr, aes_128_use_df, 0),
- make_drbg_test_data_df(NID_aes_192_ctr, aes_192_use_df, 0),
- make_drbg_test_data_df(NID_aes_256_ctr, aes_256_use_df, 1),
+ make_drbg_test_data_no_df (NID_aes_128_ctr, aes_128_no_df, 0),
+ make_drbg_test_data_no_df (NID_aes_192_ctr, aes_192_no_df, 0),
+ make_drbg_test_data_no_df (NID_aes_256_ctr, aes_256_no_df, 1),
+ make_drbg_test_data_use_df(NID_aes_128_ctr, aes_128_use_df, 0),
+ make_drbg_test_data_use_df(NID_aes_192_ctr, aes_192_use_df, 0),
+ make_drbg_test_data_use_df(NID_aes_256_ctr, aes_256_use_df, 1),
};
static int app_data_index;