DEFINE_RUN_ONCE_STATIC(do_ossl_drbg_init)
{
+ int st = 1;
+
ossl_drbg.lock = CRYPTO_THREAD_lock_new();
- return ossl_drbg.lock != NULL;
+ st &= ossl_drbg.lock != NULL;
+ st &= RAND_DRBG_set(&ossl_drbg, NID_aes_128_ctr, 0) == 1;
+ return st;
}
void rand_drbg_cleanup(void)
/* Should never happen */
n = 16;
}
- for (i = 0; i < 16; i++)
+ for (i = 0; i < n; i++)
cctx->V[i] ^= in[i + cctx->keylen];
}