Lines Matching refs:rpool
278 utils->rand(utils->rpool, (char *)&randnum, sizeof (randnum)); in sasl_mkchal()
407 int sasl_randcreate(sasl_rand_t **rpool) in sasl_randcreate() argument
410 (*rpool)=sasl_sun_ALLOC(sizeof(sasl_rand_t)); in sasl_randcreate()
412 (*rpool)=sasl_ALLOC(sizeof(sasl_rand_t)); in sasl_randcreate()
414 if ((*rpool) == NULL) return SASL_NOMEM; in sasl_randcreate()
417 (*rpool)->initialized = 0; in sasl_randcreate()
422 void sasl_randfree(sasl_rand_t **rpool) in sasl_randfree() argument
425 sasl_sun_FREE(*rpool); in sasl_randfree()
427 sasl_FREE(*rpool); in sasl_randfree()
431 void sasl_randseed (sasl_rand_t *rpool, const char *seed, unsigned len) in sasl_randseed() argument
438 if (rpool == NULL) return; in sasl_randseed()
440 rpool->initialized = 1; in sasl_randseed()
446 rpool->pool[lup/2] = (seed[lup] << 8) + seed[lup + 1]; in sasl_randseed()
449 static void randinit(sasl_rand_t *rpool) in randinit() argument
451 assert(rpool); in randinit()
453 if (!rpool->initialized) { in randinit()
454 getranddata(rpool->pool); in randinit()
455 rpool->initialized = 1; in randinit()
460 unsigned int *foo = (unsigned int *)rpool->pool; in randinit()
469 void sasl_rand (sasl_rand_t *rpool, char *buf, unsigned len) in sasl_rand() argument
473 if (!rpool || !buf) return; in sasl_rand()
476 randinit(rpool); in sasl_rand()
484 buf[lup] = (char) (jrand48(rpool->pool) >> 8); in sasl_rand()
494 void sasl_churn (sasl_rand_t *rpool, const char *data, unsigned len) in sasl_churn() argument
499 if (!rpool || !data) return; in sasl_churn()
502 randinit(rpool); in sasl_churn()
505 rpool->pool[lup % RPOOL_SIZE] ^= data[lup]; in sasl_churn()