/src/php-src/ext/random/php_random_csprng.h
Line | Count | Source (jump to first uncovered line) |
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: Tim Düsterhus <timwolla@php.net> | |
14 | | | Go Kudo <zeriyoshi@php.net> | |
15 | | +----------------------------------------------------------------------+ |
16 | | */ |
17 | | |
18 | | #ifndef PHP_RANDOM_CSPRNG_H |
19 | | # define PHP_RANDOM_CSPRNG_H |
20 | | |
21 | | # include "php.h" |
22 | | |
23 | | ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_bytes(void *bytes, size_t size, bool should_throw); |
24 | | ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_bytes_ex(void *bytes, size_t size, char *errstr, size_t errstr_size); |
25 | | |
26 | | ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_int(zend_long min, zend_long max, zend_long *result, bool should_throw); |
27 | | |
28 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_bytes_throw(void *bytes, size_t size) |
29 | 15 | { |
30 | 15 | return php_random_bytes(bytes, size, true); |
31 | 15 | } 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 | 29 | 5 | { | 30 | 5 | return php_random_bytes(bytes, size, true); | 31 | 5 | } |
engine_pcgoneseq128xslrr64.c:php_random_bytes_throw Line | Count | Source | 29 | 5 | { | 30 | 5 | return php_random_bytes(bytes, size, true); | 31 | 5 | } |
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 | 29 | 5 | { | 30 | 5 | return php_random_bytes(bytes, size, true); | 31 | 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 |
32 | | |
33 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_bytes_silent(void *bytes, size_t size) |
34 | 19 | { |
35 | 19 | return php_random_bytes(bytes, size, false); |
36 | 19 | } 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 | 34 | 19 | { | 35 | 19 | return php_random_bytes(bytes, size, false); | 36 | 19 | } |
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 |
37 | | |
38 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_int_throw(zend_long min, zend_long max, zend_long *result) |
39 | 42 | { |
40 | 42 | return php_random_int(min, max, result, true); |
41 | 42 | } 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 | 39 | 42 | { | 40 | 42 | return php_random_int(min, max, result, true); | 41 | 42 | } |
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 |
42 | | |
43 | | ZEND_ATTRIBUTE_NONNULL static inline zend_result php_random_int_silent(zend_long min, zend_long max, zend_long *result) |
44 | 0 | { |
45 | 0 | return php_random_int(min, max, result, false); |
46 | 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 |
47 | | |
48 | | PHPAPI void php_random_csprng_shutdown(void); |
49 | | |
50 | | #endif /* PHP_RANDOM_CSPRNG_H */ |