Lines Matching refs:rng
116 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_init() local
119 rng->entropy_collector = jent_entropy_collector_alloc(1, 0); in jent_kcapi_init()
120 if (!rng->entropy_collector) in jent_kcapi_init()
123 spin_lock_init(&rng->jent_lock); in jent_kcapi_init()
129 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_cleanup() local
131 spin_lock(&rng->jent_lock); in jent_kcapi_cleanup()
132 if (rng->entropy_collector) in jent_kcapi_cleanup()
133 jent_entropy_collector_free(rng->entropy_collector); in jent_kcapi_cleanup()
134 rng->entropy_collector = NULL; in jent_kcapi_cleanup()
135 spin_unlock(&rng->jent_lock); in jent_kcapi_cleanup()
142 struct jitterentropy *rng = crypto_rng_ctx(tfm); in jent_kcapi_random() local
145 spin_lock(&rng->jent_lock); in jent_kcapi_random()
148 if (rng->reset_cnt > (1<<10)) { in jent_kcapi_random()
153 ret = jent_read_entropy(rng->entropy_collector, rdata, dlen); in jent_kcapi_random()
161 rng->reset_cnt++; in jent_kcapi_random()
165 rng->reset_cnt = 0; in jent_kcapi_random()
173 spin_unlock(&rng->jent_lock); in jent_kcapi_random()