Lines Matching full:rng

47 #include <crypto/internal/rng.h>
83 * implement a high-resolution time stamp, the RNG code's runtime test
204 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_cleanup() local
206 spin_lock(&rng->jent_lock); in jent_kcapi_cleanup()
208 if (rng->sdesc) { in jent_kcapi_cleanup()
209 shash_desc_zero(rng->sdesc); in jent_kcapi_cleanup()
210 kfree(rng->sdesc); in jent_kcapi_cleanup()
212 rng->sdesc = NULL; in jent_kcapi_cleanup()
214 if (rng->tfm) in jent_kcapi_cleanup()
215 crypto_free_shash(rng->tfm); in jent_kcapi_cleanup()
216 rng->tfm = NULL; in jent_kcapi_cleanup()
218 if (rng->entropy_collector) in jent_kcapi_cleanup()
219 jent_entropy_collector_free(rng->entropy_collector); in jent_kcapi_cleanup()
220 rng->entropy_collector = NULL; in jent_kcapi_cleanup()
221 spin_unlock(&rng->jent_lock); in jent_kcapi_cleanup()
226 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_init() local
231 spin_lock_init(&rng->jent_lock); in jent_kcapi_init()
239 rng->tfm = hash; in jent_kcapi_init()
250 rng->sdesc = sdesc; in jent_kcapi_init()
252 rng->entropy_collector = in jent_kcapi_init()
255 if (!rng->entropy_collector) { in jent_kcapi_init()
260 spin_lock_init(&rng->jent_lock); in jent_kcapi_init()
272 struct jitterentropy *rng = crypto_rng_ctx(tfm); in jent_kcapi_random() local
275 spin_lock(&rng->jent_lock); in jent_kcapi_random()
277 ret = jent_read_entropy(rng->entropy_collector, rdata, dlen); in jent_kcapi_random()
288 panic("Jitter RNG permanent health test failure\n"); in jent_kcapi_random()
290 pr_err("Jitter RNG permanent health test failure\n"); in jent_kcapi_random()
294 pr_warn_ratelimited("Reset Jitter RNG due to intermittent health test failure\n"); in jent_kcapi_random()
301 spin_unlock(&rng->jent_lock); in jent_kcapi_random()