Lines Matching refs:p
290 static void BN_POOL_init(BN_POOL *p) in BN_POOL_init() argument
292 p->head = p->current = p->tail = NULL; in BN_POOL_init()
293 p->used = p->size = 0; in BN_POOL_init()
296 static void BN_POOL_finish(BN_POOL *p) in BN_POOL_finish() argument
301 while (p->head) { in BN_POOL_finish()
302 for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++) in BN_POOL_finish()
305 p->current = p->head->next; in BN_POOL_finish()
306 OPENSSL_free(p->head); in BN_POOL_finish()
307 p->head = p->current; in BN_POOL_finish()
312 static BIGNUM *BN_POOL_get(BN_POOL *p, int flag) in BN_POOL_get() argument
318 if (p->used == p->size) { in BN_POOL_get()
328 item->prev = p->tail; in BN_POOL_get()
331 if (p->head == NULL) in BN_POOL_get()
332 p->head = p->current = p->tail = item; in BN_POOL_get()
334 p->tail->next = item; in BN_POOL_get()
335 p->tail = item; in BN_POOL_get()
336 p->current = item; in BN_POOL_get()
338 p->size += BN_CTX_POOL_SIZE; in BN_POOL_get()
339 p->used++; in BN_POOL_get()
344 if (!p->used) in BN_POOL_get()
345 p->current = p->head; in BN_POOL_get()
346 else if ((p->used % BN_CTX_POOL_SIZE) == 0) in BN_POOL_get()
347 p->current = p->current->next; in BN_POOL_get()
348 return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE); in BN_POOL_get()
351 static void BN_POOL_release(BN_POOL *p, unsigned int num) in BN_POOL_release() argument
353 unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; in BN_POOL_release()
355 p->used -= num; in BN_POOL_release()
357 bn_check_top(p->current->vals + offset); in BN_POOL_release()
360 p->current = p->current->prev; in BN_POOL_release()