Home | History | Annotate | Download | only in kern

Lines Matching defs:cprng

59 #include <sys/cprng.h>
100 /* Well-known CPRNG instances */
114 * Create CPRNG instances at two IPLs: IPL_SOFTSERIAL for
193 struct cprng_strong *cprng;
195 cprng = kmem_alloc(sizeof(*cprng), KM_SLEEP);
196 cprng->cs_iplcookie = makeiplcookie(ipl);
197 cprng->cs_percpu = percpu_create(sizeof(struct cprng_cpu),
200 return cprng;
204 cprng_strong_destroy(struct cprng_strong *cprng)
207 percpu_free(cprng->cs_percpu, sizeof(struct cprng_cpu));
208 kmem_free(cprng, sizeof(*cprng));
269 cprng_strong_reseed(struct cprng_strong *cprng, unsigned epoch,
285 percpu_putref(cprng->cs_percpu);
287 *ccp = percpu_getref(cprng->cs_percpu);
288 *sp = splraiseipl(cprng->cs_iplcookie);
299 cprng_strong(struct cprng_strong *cprng, void *buf, size_t len, int flags)
320 cc = percpu_getref(cprng->cs_percpu);
321 s = splraiseipl(cprng->cs_iplcookie);
326 cprng_strong_reseed(cprng, epoch, &cc, &s);
331 cprng_strong_reseed(cprng, epoch, &cc, &s);
339 percpu_putref(cprng->cs_percpu);