Home
last modified time | relevance | path

Searched refs:seed (Results 1 – 25 of 37) sorted by last modified time

12

/php-src/ext/random/
H A Dengine_xoshiro256starstar.c30 static inline uint64_t splitmix64(uint64_t *seed) in splitmix64() argument
34 r = (*seed += 0x9e3779b97f4a7c15ULL); in splitmix64()
93 …_random_xoshiro256starstar_seed64(php_random_status_state_xoshiro256starstar *state, uint64_t seed) in php_random_xoshiro256starstar_seed64() argument
97 s[0] = splitmix64(&seed); in php_random_xoshiro256starstar_seed64()
98 s[1] = splitmix64(&seed); in php_random_xoshiro256starstar_seed64()
99 s[2] = splitmix64(&seed); in php_random_xoshiro256starstar_seed64()
100 s[3] = splitmix64(&seed); in php_random_xoshiro256starstar_seed64()
H A Dengine_combinedlcg.c38 PHPAPI void php_random_combinedlcg_seed64(php_random_status_state_combinedlcg *state, uint64_t seed) in php_random_combinedlcg_seed64() argument
40 state->state[0] = seed & 0xffffffffU; in php_random_combinedlcg_seed64()
41 state->state[1] = seed >> 32; in php_random_combinedlcg_seed64()
115 uint64_t seed = 0; in php_random_combinedlcg_seed_default() local
117 if (php_random_bytes_silent(&seed, sizeof(seed)) == FAILURE) { in php_random_combinedlcg_seed_default()
118 seed = php_random_generate_fallback_seed(); in php_random_combinedlcg_seed_default()
121 php_random_combinedlcg_seed64(state, seed); in php_random_combinedlcg_seed_default()
H A Dengine_mt19937.c128 PHPAPI inline void php_random_mt19937_seed32(php_random_status_state_mt19937 *state, uint32_t seed) in php_random_mt19937_seed32() argument
136 state->state[0] = seed; in php_random_mt19937_seed32()
242 uint32_t seed = 0; in php_random_mt19937_seed_default() local
244 if (php_random_bytes_silent(&seed, sizeof(seed)) == FAILURE) { in php_random_mt19937_seed_default()
245 seed = (uint32_t)php_random_generate_fallback_seed(); in php_random_mt19937_seed_default()
248 php_random_mt19937_seed32(state, seed); in php_random_mt19937_seed_default()
257 zend_long seed, mode = MT_RAND_MT19937; in PHP_METHOD() local
262 Z_PARAM_LONG_OR_NULL(seed, seed_is_null); in PHP_METHOD()
281 if (php_random_bytes_throw(&seed, sizeof(seed)) == FAILURE) { in PHP_METHOD()
287 php_random_mt19937_seed32(state, seed); in PHP_METHOD()
H A Dengine_pcgoneseq128xslrr64.c38 …oneseq128xslrr64_seed128(php_random_status_state_pcgoneseq128xslrr64 *s, php_random_uint128_t seed) in php_random_pcgoneseq128xslrr64_seed128() argument
42 s->state = php_random_uint128_add(s->state, seed); in php_random_pcgoneseq128xslrr64_seed128()
H A Drandom.c408 PHPAPI void php_mt_srand(uint32_t seed) argument
410 php_random_mt19937_seed32(php_random_default_status(), seed);
450 PHPAPI void php_srand(zend_long seed) argument
452 php_mt_srand((uint32_t) seed);
475 zend_long seed = 0; local
482 Z_PARAM_LONG_OR_NULL(seed, seed_is_null)
498 php_random_mt19937_seed32(state, (uint64_t) seed);
H A Dphp_random.h56 PHPAPI void php_mt_srand(uint32_t seed);
67 PHPAPI void php_srand(zend_long seed);
180 PHPAPI void php_random_combinedlcg_seed64(php_random_status_state_combinedlcg *state, uint64_t seed
183 PHPAPI void php_random_mt19937_seed32(php_random_status_state_mt19937 *state, uint32_t seed);
186 …neseq128xslrr64_seed128(php_random_status_state_pcgoneseq128xslrr64 *s, php_random_uint128_t seed);
189 …random_xoshiro256starstar_seed64(php_random_status_state_xoshiro256starstar *state, uint64_t seed);
H A Drandom_arginfo.h8 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, seed, IS_LONG, 1, "null")
36 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, seed, IS_LONG, 1, "null")
53 ZEND_ARG_TYPE_MASK(0, seed, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, "null")
H A Drandom.stub.php20 function mt_srand(?int $seed = null, int $mode = MT_RAND_MT19937): void {} argument
23 function srand(?int $seed = null, int $mode = MT_RAND_MT19937): void {} argument
47 public function __construct(int|null $seed = null, int $mode = MT_RAND_MT19937) {} argument
63 public function __construct(string|int|null $seed = null) {} argument
85 public function __construct(string|int|null $seed = null) {} argument
/php-src/ext/gmp/
H A Dgmp.c1743 unsigned long int seed = 0; in gmp_init_random() local
1744 if (php_random_bytes_silent(&seed, sizeof(seed)) == FAILURE) { in gmp_init_random()
1745 seed = (unsigned long int)php_random_generate_fallback_seed(); in gmp_init_random()
1747 gmp_randseed_ui(GMPG(rand_state), seed); in gmp_init_random()
1756 zval *seed; in ZEND_FUNCTION() local
1759 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &seed) == FAILURE) { in ZEND_FUNCTION()
1765 if (Z_TYPE_P(seed) == IS_LONG && Z_LVAL_P(seed) >= 0) { in ZEND_FUNCTION()
1766 gmp_randseed_ui(GMPG(rand_state), Z_LVAL_P(seed)); in ZEND_FUNCTION()
1771 FETCH_GMP_ZVAL(gmpnum_seed, seed, temp_a, 1); in ZEND_FUNCTION()
H A Dgmp_arginfo.h133 ZEND_ARG_OBJ_TYPE_MASK(0, seed, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL)
H A Dgmp.stub.php156 function gmp_random_seed(GMP|int|string $seed): void {} argument
/php-src/sapi/fuzzer/
H A DREADME.md37 Some fuzzers have a seed corpus in `sapi/fuzzer/corpus`. You can use it as follows:
/php-src/
H A DUPGRADING.INTERNALS178 - The seed member of a php_random_algo has been removed. As a replacement
181 Mt19937 ignored the upper half of the seed parameter of the generic
/php-src/ext/session/
H A Dsession.c2874 php_random_uint128_t seed; in PHP_GINIT_FUNCTION() local
2875 if (php_random_bytes_silent(&seed, sizeof(seed)) == FAILURE) { in PHP_GINIT_FUNCTION()
2876 seed = php_random_uint128_constant( in PHP_GINIT_FUNCTION()
2881 php_random_pcgoneseq128xslrr64_seed128(ps_globals->random.state, seed); in PHP_GINIT_FUNCTION()
/php-src/ext/sodium/
H A Dlibsodium_arginfo.h144 ZEND_ARG_TYPE_INFO(0, seed, IS_STRING, 0)
H A Dlibsodium.c595 unsigned char *seed; in PHP_FUNCTION() local
600 &seed, &seed_len) == FAILURE) { in PHP_FUNCTION()
613 seed) != 0) { in PHP_FUNCTION()
915 unsigned char *seed; in PHP_FUNCTION() local
920 &seed, &seed_len) == FAILURE) { in PHP_FUNCTION()
933 seed) != 0) { in PHP_FUNCTION()
2687 unsigned char *seed; in PHP_FUNCTION() local
2692 &seed, &seed_len) == FAILURE) { in PHP_FUNCTION()
2706 seed, crypto_kx_SEEDBYTES, NULL, 0); in PHP_FUNCTION()
/php-src/ext/standard/
H A Duniqid.c76 double seed; in PHP_FUNCTION() local
78 seed = php_combined_lcg() * 10; in PHP_FUNCTION()
80 seed = ((double) bytes / UINT32_MAX) * 10.0; in PHP_FUNCTION()
82 uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, seed); in PHP_FUNCTION()
/php-src/ext/fileinfo/tests/
H A Dmagic私はガラスを食べられます11099 >36 lelong x \b, seed %#x
H A Dmagic11099 >36 lelong x \b, seed %#x
/php-src/ext/hash/tests/
H A Dhash_file_basic1.phpt46 echo "murmur3a: " . hash_file('murmur3a', $file, false, ['seed' => 1234]). "\n";
48 echo "murmur3c: " . hash_file('murmur3c', $file, false, ['seed' => 1234]). "\n";
50 echo "murmur3f: " . hash_file('murmur3f', $file, false, ['seed' => 1234]). "\n";
H A Dxxhash_secret.phpt19 $ctx = hash_init($a, options: ["seed" => 24, "secret" => $secret]);
50 string(67) "xxh3: Only one of seed or secret is to be passed for initialization"
54 string(69) "xxh128: Only one of seed or secret is to be passed for initialization"
/php-src/ext/hash/xxhash/
H A Dxxhash.h1090 XXH64_hash_t seed; member
2125 xxh_u32 v3 = seed + 0; in XXH32_endian_align()
2152 XXH32_reset(&state, seed); in XXH32()
2195 state.v[2] = seed + 0; in XXH32_reset()
2611 state.v[2] = seed + 0; in XXH64_reset()
3505 seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32; in XXH3_len_4to8_64b()
4539 if (seed == 0) in XXH3_hashLong_64b_withSeed_internal()
4729 statePtr->seed = seed; in XXH3_reset_internal()
4763 if ((seed != statePtr->seed) || (statePtr->extSecret != NULL)) in XXH3_64bits_reset_withSeed()
5046 seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32; in XXH3_len_4to8_128b()
[all …]
/php-src/ext/hash/
H A Dhash_xxhash.c46 zval *seed = zend_hash_str_find_deref(args, "seed", sizeof("seed") - 1); in PHP_XXH32Init() local
49 if (seed && IS_LONG == Z_TYPE_P(seed)) { in PHP_XXH32Init()
50 XXH32_reset(&ctx->s, (XXH32_hash_t)Z_LVAL_P(seed)); in PHP_XXH32Init()
110 zval *seed = zend_hash_str_find_deref(args, "seed", sizeof("seed") - 1); in PHP_XXH64Init() local
113 if (seed && IS_LONG == Z_TYPE_P(seed)) { in PHP_XXH64Init()
114 XXH64_reset(&ctx->s, (XXH64_hash_t)Z_LVAL_P(seed)); in PHP_XXH64Init()
/php-src/ext/random/tests/02_engine/
H A Dxoshiro256starstar_seed.phpt2 Random: Engine: Xoshiro256StarStar: The seed parameter must work as expected
8 echo "Random integer seed", PHP_EOL;
12 echo "Random string seed", PHP_EOL;
24 echo "Invalid string seed length", PHP_EOL;
32 echo "Null seed", PHP_EOL;
40 echo "Valid string seed", PHP_EOL;
53 Random integer seed
56 Random string seed
63 Invalid string seed length
67 Null seed
[all …]
/php-src/ext/sodium/tests/
H A Dcrypto_sign.phpt30 $seed = str_repeat('x', SODIUM_CRYPTO_SIGN_SEEDBYTES);
31 $alice_kp = sodium_crypto_sign_seed_keypair($seed);
38 "since they are derived from a fixed seed";

Completed in 415 milliseconds

12