/src/php-src/ext/random/php_random_csprng.h
Line | Count | Source |
1 | | /* |
2 | | +----------------------------------------------------------------------+ |
3 | | | Copyright © The PHP Group and Contributors. | |
4 | | +----------------------------------------------------------------------+ |
5 | | | This source file is subject to the Modified BSD License that is | |
6 | | | bundled with this package in the file LICENSE, and is available | |
7 | | | through the World Wide Web at <https://www.php.net/license/>. | |
8 | | | | |
9 | | | SPDX-License-Identifier: BSD-3-Clause | |
10 | | +----------------------------------------------------------------------+ |
11 | | | Authors: Tim Düsterhus <timwolla@php.net> | |
12 | | | Go Kudo <zeriyoshi@php.net> | |
13 | | +----------------------------------------------------------------------+ |
14 | | */ |
15 | | |
16 | | #ifndef PHP_RANDOM_CSPRNG_H |
17 | | # define PHP_RANDOM_CSPRNG_H |
18 | | |
19 | | # include "php.h" |
20 | | |
21 | | ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_bytes(void *bytes, size_t size, bool should_throw); |
22 | | ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_bytes_ex(void *bytes, size_t size, char *errstr, size_t errstr_size); |
23 | | |
24 | | ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_int(zend_long min, zend_long max, zend_long *result, bool should_throw); |
25 | | |
26 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_bytes_throw(void *bytes, size_t size) |
27 | 9 | { |
28 | 9 | return php_random_bytes(bytes, size, true); |
29 | 9 | } Unexecuted instantiation: exif.c:php_random_bytes_throw Unexecuted instantiation: csprng.c:php_random_bytes_throw engine_mt19937.c:php_random_bytes_throw Line | Count | Source | 27 | 2 | { | 28 | | return php_random_bytes(bytes, size, true); | 29 | 2 | } |
engine_pcgoneseq128xslrr64.c:php_random_bytes_throw Line | Count | Source | 27 | 2 | { | 28 | | return php_random_bytes(bytes, size, true); | 29 | 2 | } |
Unexecuted instantiation: engine_secure.c:php_random_bytes_throw Unexecuted instantiation: engine_user.c:php_random_bytes_throw engine_xoshiro256starstar.c:php_random_bytes_throw Line | Count | Source | 27 | 5 | { | 28 | | return php_random_bytes(bytes, size, true); | 29 | 5 | } |
Unexecuted instantiation: gammasection.c:php_random_bytes_throw Unexecuted instantiation: random.c:php_random_bytes_throw Unexecuted instantiation: randomizer.c:php_random_bytes_throw Unexecuted instantiation: zend_utils.c:php_random_bytes_throw Unexecuted instantiation: php_reflection.c:php_random_bytes_throw Unexecuted instantiation: spl_directory.c:php_random_bytes_throw Unexecuted instantiation: spl_observer.c:php_random_bytes_throw Unexecuted instantiation: array.c:php_random_bytes_throw Unexecuted instantiation: basic_functions.c:php_random_bytes_throw Unexecuted instantiation: exec.c:php_random_bytes_throw Unexecuted instantiation: file.c:php_random_bytes_throw Unexecuted instantiation: filters.c:php_random_bytes_throw Unexecuted instantiation: ftp_fopen_wrapper.c:php_random_bytes_throw Unexecuted instantiation: head.c:php_random_bytes_throw Unexecuted instantiation: html.c:php_random_bytes_throw Unexecuted instantiation: http_fopen_wrapper.c:php_random_bytes_throw Unexecuted instantiation: link.c:php_random_bytes_throw Unexecuted instantiation: mail.c:php_random_bytes_throw Unexecuted instantiation: password.c:php_random_bytes_throw Unexecuted instantiation: php_fopen_wrapper.c:php_random_bytes_throw Unexecuted instantiation: streamsfuncs.c:php_random_bytes_throw Unexecuted instantiation: string.c:php_random_bytes_throw Unexecuted instantiation: strnatcmp.c:php_random_bytes_throw Unexecuted instantiation: uniqid.c:php_random_bytes_throw Unexecuted instantiation: url_scanner_ex.c:php_random_bytes_throw Unexecuted instantiation: var.c:php_random_bytes_throw Unexecuted instantiation: fopen_wrappers.c:php_random_bytes_throw Unexecuted instantiation: main.c:php_random_bytes_throw Unexecuted instantiation: php_open_temporary_file.c:php_random_bytes_throw Unexecuted instantiation: php_variables.c:php_random_bytes_throw Unexecuted instantiation: streams.c:php_random_bytes_throw Unexecuted instantiation: internal_functions_cli.c:php_random_bytes_throw |
30 | | |
31 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_bytes_silent(void *bytes, size_t size) |
32 | 15 | { |
33 | 15 | return php_random_bytes(bytes, size, false); |
34 | 15 | } Unexecuted instantiation: exif.c:php_random_bytes_silent Unexecuted instantiation: csprng.c:php_random_bytes_silent engine_mt19937.c:php_random_bytes_silent Line | Count | Source | 32 | 15 | { | 33 | | return php_random_bytes(bytes, size, false); | 34 | 15 | } |
Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:php_random_bytes_silent Unexecuted instantiation: engine_secure.c:php_random_bytes_silent Unexecuted instantiation: engine_user.c:php_random_bytes_silent Unexecuted instantiation: engine_xoshiro256starstar.c:php_random_bytes_silent Unexecuted instantiation: gammasection.c:php_random_bytes_silent Unexecuted instantiation: random.c:php_random_bytes_silent Unexecuted instantiation: randomizer.c:php_random_bytes_silent Unexecuted instantiation: zend_utils.c:php_random_bytes_silent Unexecuted instantiation: php_reflection.c:php_random_bytes_silent Unexecuted instantiation: spl_directory.c:php_random_bytes_silent Unexecuted instantiation: spl_observer.c:php_random_bytes_silent Unexecuted instantiation: array.c:php_random_bytes_silent Unexecuted instantiation: basic_functions.c:php_random_bytes_silent Unexecuted instantiation: exec.c:php_random_bytes_silent Unexecuted instantiation: file.c:php_random_bytes_silent Unexecuted instantiation: filters.c:php_random_bytes_silent Unexecuted instantiation: ftp_fopen_wrapper.c:php_random_bytes_silent Unexecuted instantiation: head.c:php_random_bytes_silent Unexecuted instantiation: html.c:php_random_bytes_silent Unexecuted instantiation: http_fopen_wrapper.c:php_random_bytes_silent Unexecuted instantiation: link.c:php_random_bytes_silent Unexecuted instantiation: mail.c:php_random_bytes_silent Unexecuted instantiation: password.c:php_random_bytes_silent Unexecuted instantiation: php_fopen_wrapper.c:php_random_bytes_silent Unexecuted instantiation: streamsfuncs.c:php_random_bytes_silent Unexecuted instantiation: string.c:php_random_bytes_silent Unexecuted instantiation: strnatcmp.c:php_random_bytes_silent Unexecuted instantiation: uniqid.c:php_random_bytes_silent Unexecuted instantiation: url_scanner_ex.c:php_random_bytes_silent Unexecuted instantiation: var.c:php_random_bytes_silent Unexecuted instantiation: fopen_wrappers.c:php_random_bytes_silent Unexecuted instantiation: main.c:php_random_bytes_silent Unexecuted instantiation: php_open_temporary_file.c:php_random_bytes_silent Unexecuted instantiation: php_variables.c:php_random_bytes_silent Unexecuted instantiation: streams.c:php_random_bytes_silent Unexecuted instantiation: internal_functions_cli.c:php_random_bytes_silent |
35 | | |
36 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_int_throw(zend_long min, zend_long max, zend_long *result) |
37 | 30 | { |
38 | 30 | return php_random_int(min, max, result, true); |
39 | 30 | } Unexecuted instantiation: exif.c:php_random_int_throw Unexecuted instantiation: csprng.c:php_random_int_throw Unexecuted instantiation: engine_mt19937.c:php_random_int_throw Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:php_random_int_throw Unexecuted instantiation: engine_secure.c:php_random_int_throw Unexecuted instantiation: engine_user.c:php_random_int_throw Unexecuted instantiation: engine_xoshiro256starstar.c:php_random_int_throw Unexecuted instantiation: gammasection.c:php_random_int_throw random.c:php_random_int_throw Line | Count | Source | 37 | 30 | { | 38 | | return php_random_int(min, max, result, true); | 39 | 30 | } |
Unexecuted instantiation: randomizer.c:php_random_int_throw Unexecuted instantiation: zend_utils.c:php_random_int_throw Unexecuted instantiation: php_reflection.c:php_random_int_throw Unexecuted instantiation: spl_directory.c:php_random_int_throw Unexecuted instantiation: spl_observer.c:php_random_int_throw Unexecuted instantiation: array.c:php_random_int_throw Unexecuted instantiation: basic_functions.c:php_random_int_throw Unexecuted instantiation: exec.c:php_random_int_throw Unexecuted instantiation: file.c:php_random_int_throw Unexecuted instantiation: filters.c:php_random_int_throw Unexecuted instantiation: ftp_fopen_wrapper.c:php_random_int_throw Unexecuted instantiation: head.c:php_random_int_throw Unexecuted instantiation: html.c:php_random_int_throw Unexecuted instantiation: http_fopen_wrapper.c:php_random_int_throw Unexecuted instantiation: link.c:php_random_int_throw Unexecuted instantiation: mail.c:php_random_int_throw Unexecuted instantiation: password.c:php_random_int_throw Unexecuted instantiation: php_fopen_wrapper.c:php_random_int_throw Unexecuted instantiation: streamsfuncs.c:php_random_int_throw Unexecuted instantiation: string.c:php_random_int_throw Unexecuted instantiation: strnatcmp.c:php_random_int_throw Unexecuted instantiation: uniqid.c:php_random_int_throw Unexecuted instantiation: url_scanner_ex.c:php_random_int_throw Unexecuted instantiation: var.c:php_random_int_throw Unexecuted instantiation: fopen_wrappers.c:php_random_int_throw Unexecuted instantiation: main.c:php_random_int_throw Unexecuted instantiation: php_open_temporary_file.c:php_random_int_throw Unexecuted instantiation: php_variables.c:php_random_int_throw Unexecuted instantiation: streams.c:php_random_int_throw Unexecuted instantiation: internal_functions_cli.c:php_random_int_throw |
40 | | |
41 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_int_silent(zend_long min, zend_long max, zend_long *result) |
42 | 0 | { |
43 | 0 | return php_random_int(min, max, result, false); |
44 | 0 | } Unexecuted instantiation: exif.c:php_random_int_silent Unexecuted instantiation: csprng.c:php_random_int_silent Unexecuted instantiation: engine_mt19937.c:php_random_int_silent Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:php_random_int_silent Unexecuted instantiation: engine_secure.c:php_random_int_silent Unexecuted instantiation: engine_user.c:php_random_int_silent Unexecuted instantiation: engine_xoshiro256starstar.c:php_random_int_silent Unexecuted instantiation: gammasection.c:php_random_int_silent Unexecuted instantiation: random.c:php_random_int_silent Unexecuted instantiation: randomizer.c:php_random_int_silent Unexecuted instantiation: zend_utils.c:php_random_int_silent Unexecuted instantiation: php_reflection.c:php_random_int_silent Unexecuted instantiation: spl_directory.c:php_random_int_silent Unexecuted instantiation: spl_observer.c:php_random_int_silent Unexecuted instantiation: array.c:php_random_int_silent Unexecuted instantiation: basic_functions.c:php_random_int_silent Unexecuted instantiation: exec.c:php_random_int_silent Unexecuted instantiation: file.c:php_random_int_silent Unexecuted instantiation: filters.c:php_random_int_silent Unexecuted instantiation: ftp_fopen_wrapper.c:php_random_int_silent Unexecuted instantiation: head.c:php_random_int_silent Unexecuted instantiation: html.c:php_random_int_silent Unexecuted instantiation: http_fopen_wrapper.c:php_random_int_silent Unexecuted instantiation: link.c:php_random_int_silent Unexecuted instantiation: mail.c:php_random_int_silent Unexecuted instantiation: password.c:php_random_int_silent Unexecuted instantiation: php_fopen_wrapper.c:php_random_int_silent Unexecuted instantiation: streamsfuncs.c:php_random_int_silent Unexecuted instantiation: string.c:php_random_int_silent Unexecuted instantiation: strnatcmp.c:php_random_int_silent Unexecuted instantiation: uniqid.c:php_random_int_silent Unexecuted instantiation: url_scanner_ex.c:php_random_int_silent Unexecuted instantiation: var.c:php_random_int_silent Unexecuted instantiation: fopen_wrappers.c:php_random_int_silent Unexecuted instantiation: main.c:php_random_int_silent Unexecuted instantiation: php_open_temporary_file.c:php_random_int_silent Unexecuted instantiation: php_variables.c:php_random_int_silent Unexecuted instantiation: streams.c:php_random_int_silent Unexecuted instantiation: internal_functions_cli.c:php_random_int_silent |
45 | | |
46 | | PHPAPI void php_random_csprng_shutdown(void); |
47 | | |
48 | | #endif /* PHP_RANDOM_CSPRNG_H */ |