X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=test%2Fdrbgtest.c;h=1aef1fe41a78fb97a297c35764980f2417e3ba2d;hb=0fb2815b873304d145ed00283454fc9f3bd35e6b;hp=c285c75229d4ea6dda9a2e87d850bead70b4a3b3;hpb=2bb1b5ddd12c23bbfa7fb60ee3296612ca943fef;p=openssl.git diff --git a/test/drbgtest.c b/test/drbgtest.c index c285c75229..1aef1fe41a 100644 --- a/test/drbgtest.c +++ b/test/drbgtest.c @@ -901,46 +901,6 @@ static int test_multi_thread(void) } #endif -#ifdef OPENSSL_RAND_SEED_NONE -/* - * Calculates the minimum buffer length which needs to be - * provided to RAND_seed() in order to successfully - * instantiate the DRBG. - * - * Copied from rand_drbg_seedlen() in rand_drbg.c - */ -static size_t rand_drbg_seedlen(RAND_DRBG *drbg) -{ - /* - * If no os entropy source is available then RAND_seed(buffer, bufsize) - * is expected to succeed if and only if the buffer length satisfies - * the following requirements, which follow from the calculations - * in RAND_DRBG_instantiate(). - */ - size_t min_entropy = drbg->strength; - size_t min_entropylen = drbg->min_entropylen; - - /* - * Extra entropy for the random nonce in the absence of a - * get_nonce callback, see comment in RAND_DRBG_instantiate(). - */ - if (drbg->min_noncelen > 0 && drbg->get_nonce == NULL) { - min_entropy += drbg->strength / 2; - min_entropylen += drbg->min_noncelen; - } - - /* - * Convert entropy requirement from bits to bytes - * (dividing by 8 without rounding upwards, because - * all entropy requirements are divisible by 8). - */ - min_entropy >>= 3; - - /* Return a value that satisfies both requirements */ - return min_entropy > min_entropylen ? min_entropy : min_entropylen; -} -#endif /*OPENSSL_RAND_SEED_NONE*/ - /* * Test that instantiation with RAND_seed() works as expected *