Lines Matching refs:bytes
89 PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw) in php_random_bytes() argument
93 if (php_win32_get_random_bytes(bytes, size) == FAILURE) { in php_random_bytes()
100 arc4random_buf(bytes, size); in php_random_bytes()
119 n = syscall(SYS_getrandom, bytes + read_bytes, amount_to_read, 0); in php_random_bytes()
121 n = getrandom(bytes + read_bytes, amount_to_read, 0); in php_random_bytes()
142 __msan_unpoison(bytes + read_bytes, n); in php_random_bytes()
179 n = read(fd, bytes + read_bytes, size - read_bytes); in php_random_bytes()
203 zend_string *bytes; in PHP_FUNCTION() local
214 bytes = zend_string_alloc(size, 0); in PHP_FUNCTION()
216 if (php_random_bytes_throw(ZSTR_VAL(bytes), size) == FAILURE) { in PHP_FUNCTION()
217 zend_string_release_ex(bytes, 0); in PHP_FUNCTION()
221 ZSTR_VAL(bytes)[size] = '\0'; in PHP_FUNCTION() local
223 RETURN_STR(bytes); in PHP_FUNCTION()