rv = fips_drbg_ctr_init(dctx);
if (rv == -2)
rv = fips_drbg_hmac_init(dctx);
+ if (rv == -2)
+ rv = fips_drbg_ec_init(dctx);
if (rv <= 0)
{
dctx->status = DRBG_STATUS_READY;
- dctx->reseed_counter = 1;
+ if (!(dctx->flags & DRBG_CUSTOM_RESEED))
+ dctx->reseed_counter = 1;
end:
goto end;
dctx->status = DRBG_STATUS_READY;
- dctx->reseed_counter = 1;
+ if (!(dctx->flags & DRBG_CUSTOM_RESEED))
+ dctx->reseed_counter = 1;
end:
if (entropy && dctx->cleanup_entropy)
goto end;
}
- if (dctx->reseed_counter >= dctx->reseed_interval)
+ if (dctx->flags & DRBG_CUSTOM_RESEED)
+ dctx->generate(dctx, NULL, outlen, NULL, 0);
+ else if (dctx->reseed_counter >= dctx->reseed_interval)
dctx->status = DRBG_STATUS_RESEED;
if (dctx->status == DRBG_STATUS_RESEED || prediction_resistance)
dctx->status = DRBG_STATUS_ERROR;
goto end;
}
- if (dctx->reseed_counter >= dctx->reseed_interval)
- dctx->status = DRBG_STATUS_RESEED;
- else
- dctx->reseed_counter++;
+ if (!(dctx->flags & DRBG_CUSTOM_RESEED))
+ {
+ if (dctx->reseed_counter >= dctx->reseed_interval)
+ dctx->status = DRBG_STATUS_RESEED;
+ else
+ dctx->reseed_counter++;
+ }
end:
if (r)