FIPSerr(FIPS_F_FIPS_DRBG_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
+
if (type == 0)
+ {
+ memset(dctx, 0, sizeof(DRBG_CTX));
+ dctx->type = 0;
+ dctx->status = DRBG_STATUS_UNINITIALISED;
return dctx;
+ }
if (FIPS_drbg_init(dctx, type, flags) <= 0)
{
}
int FIPS_drbg_generate(DRBG_CTX *dctx, unsigned char *out, size_t outlen,
- int strength, int prediction_resistance,
+ int prediction_resistance,
const unsigned char *adin, size_t adinlen)
{
int r = 0;
return 0;
}
- if (strength > dctx->strength)
+ if (adinlen > dctx->max_adin)
{
- r = FIPS_R_INSUFFICIENT_SECURITY_STRENGTH;
+ r = FIPS_R_ADDITIONAL_INPUT_TOO_LONG;
goto end;
}