Lines Matching refs:nbytes
477 size_t nbytes, int min, int rsvd);
479 size_t nbytes, int fips);
520 int nbytes) in _mix_pool_bytes() argument
538 while (nbytes--) { in _mix_pool_bytes()
567 int nbytes) in __mix_pool_bytes() argument
569 trace_mix_pool_bytes_nolock(r->name, nbytes, _RET_IP_); in __mix_pool_bytes()
570 _mix_pool_bytes(r, in, nbytes); in __mix_pool_bytes()
574 int nbytes) in mix_pool_bytes() argument
578 trace_mix_pool_bytes(r->name, nbytes, _RET_IP_); in mix_pool_bytes()
580 _mix_pool_bytes(r, in, nbytes); in mix_pool_bytes()
939 static ssize_t extract_crng_user(void __user *buf, size_t nbytes) in extract_crng_user() argument
943 int large_request = (nbytes > 256); in extract_crng_user()
945 while (nbytes) { in extract_crng_user()
956 i = min_t(int, nbytes, CHACHA20_BLOCK_SIZE); in extract_crng_user()
962 nbytes -= i; in extract_crng_user()
1221 static void _xfer_secondary_pool(struct entropy_store *r, size_t nbytes);
1222 static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes) in xfer_secondary_pool() argument
1225 r->entropy_count >= (nbytes << (ENTROPY_SHIFT + 3)) || in xfer_secondary_pool()
1238 _xfer_secondary_pool(r, nbytes); in xfer_secondary_pool()
1241 static void _xfer_secondary_pool(struct entropy_store *r, size_t nbytes) in _xfer_secondary_pool() argument
1247 int bytes = nbytes; in _xfer_secondary_pool()
1254 trace_xfer_secondary_pool(r->name, bytes * 8, nbytes * 8, in _xfer_secondary_pool()
1282 static size_t account(struct entropy_store *r, size_t nbytes, int min, in account() argument
1293 ibytes = nbytes; in account()
1391 size_t nbytes, int fips) in _extract_entropy() argument
1397 while (nbytes) { in _extract_entropy()
1407 i = min_t(int, nbytes, EXTRACT_SIZE); in _extract_entropy()
1409 nbytes -= i; in _extract_entropy()
1430 size_t nbytes, int min, int reserved) in extract_entropy() argument
1451 trace_extract_entropy(r->name, nbytes, ENTROPY_BITS(r), _RET_IP_); in extract_entropy()
1452 xfer_secondary_pool(r, nbytes); in extract_entropy()
1453 nbytes = account(r, nbytes, min, reserved); in extract_entropy()
1455 return _extract_entropy(r, buf, nbytes, fips_enabled); in extract_entropy()
1463 size_t nbytes) in extract_entropy_user() argument
1467 int large_request = (nbytes > 256); in extract_entropy_user()
1469 trace_extract_entropy_user(r->name, nbytes, ENTROPY_BITS(r), _RET_IP_); in extract_entropy_user()
1470 xfer_secondary_pool(r, nbytes); in extract_entropy_user()
1471 nbytes = account(r, nbytes, 0, 0); in extract_entropy_user()
1473 while (nbytes) { in extract_entropy_user()
1484 i = min_t(int, nbytes, EXTRACT_SIZE); in extract_entropy_user()
1490 nbytes -= i; in extract_entropy_user()
1508 void get_random_bytes(void *buf, int nbytes) in get_random_bytes() argument
1517 trace_get_random_bytes(nbytes, _RET_IP_); in get_random_bytes()
1519 while (nbytes >= CHACHA20_BLOCK_SIZE) { in get_random_bytes()
1522 nbytes -= CHACHA20_BLOCK_SIZE; in get_random_bytes()
1525 if (nbytes > 0) { in get_random_bytes()
1527 memcpy(buf, tmp, nbytes); in get_random_bytes()
1528 crng_backtrack_protect(tmp, nbytes); in get_random_bytes()
1603 void get_random_bytes_arch(void *buf, int nbytes) in get_random_bytes_arch() argument
1607 trace_get_random_bytes_arch(nbytes, _RET_IP_); in get_random_bytes_arch()
1608 while (nbytes) { in get_random_bytes_arch()
1610 int chunk = min(nbytes, (int)sizeof(unsigned long)); in get_random_bytes_arch()
1617 nbytes -= chunk; in get_random_bytes_arch()
1620 if (nbytes) in get_random_bytes_arch()
1621 get_random_bytes(p, nbytes); in get_random_bytes_arch()
1709 _random_read(int nonblock, char __user *buf, size_t nbytes) in _random_read() argument
1713 if (nbytes == 0) in _random_read()
1716 nbytes = min_t(size_t, nbytes, SEC_XFER_SIZE); in _random_read()
1718 n = extract_entropy_user(&blocking_pool, buf, nbytes); in _random_read()
1721 trace_random_read(n*8, (nbytes-n)*8, in _random_read()
1740 random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) in random_read() argument
1742 return _random_read(file->f_flags & O_NONBLOCK, buf, nbytes); in random_read()
1746 urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) in urandom_read() argument
1756 current->comm, nbytes); in urandom_read()
1761 nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3)); in urandom_read()
1762 ret = extract_crng_user(buf, nbytes); in urandom_read()
1763 trace_urandom_read(8 * nbytes, 0, ENTROPY_BITS(&input_pool)); in urandom_read()