1 /* 2 +----------------------------------------------------------------------+ 3 | Copyright (c) The PHP Group | 4 +----------------------------------------------------------------------+ 5 | This source file is subject to version 3.01 of the PHP license, | 6 | that is bundled with this package in the file LICENSE, and is | 7 | available through the world-wide-web at the following url: | 8 | https://www.php.net/license/3_01.txt | 9 | If you did not receive a copy of the PHP license and are unable to | 10 | obtain it through the world-wide-web, please send a note to | 11 | license@php.net so we can mail you a copy immediately. | 12 +----------------------------------------------------------------------+ 13 | Authors: Arnaud Le Blanc <arnaud.lb@gmail.com> | 14 | Tim Düsterhus <timwolla@php.net> | 15 +----------------------------------------------------------------------+ 16 */ 17 18 #ifndef PHP_RANDOM_ZEND_UTILS_H 19 # define PHP_RANDOM_ZEND_UTILS_H 20 21 # include "php.h" 22 # include "php_random.h" 23 # include "zend.h" 24 25 typedef struct _php_random_bytes_insecure_state_for_zend { 26 bool initialized; 27 php_random_status_state_xoshiro256starstar xoshiro256starstar_state; 28 } php_random_bytes_insecure_state_for_zend; 29 30 ZEND_STATIC_ASSERT(sizeof(zend_random_bytes_insecure_state) >= sizeof(php_random_bytes_insecure_state_for_zend), ""); 31 32 ZEND_ATTRIBUTE_NONNULL PHPAPI void php_random_bytes_insecure_for_zend( 33 zend_random_bytes_insecure_state *state, void *bytes, size_t size); 34 35 #endif /* PHP_RANDOM_ZEND_UTILS_H */ 36