/linux-6.6.21/drivers/firmware/efi/libstub/ |
D | random.c | 70 struct linux_efi_random_seed *prev_seed, *seed = NULL; in efi_random_get_seed() local 106 struct_size(seed, bits, seed_size), in efi_random_get_seed() 107 (void **)&seed); in efi_random_get_seed() 115 EFI_RANDOM_SEED_SIZE, seed->bits); in efi_random_get_seed() 123 EFI_RANDOM_SEED_SIZE, seed->bits); in efi_random_get_seed() 131 &nv_seed_size, seed->bits + offset); in efi_random_get_seed() 148 memzero_explicit(seed->bits + offset, nv_seed_size); in efi_random_get_seed() 155 memcpy(seed->bits + offset, prev_seed->bits, prev_seed_size); in efi_random_get_seed() 159 seed->size = offset; in efi_random_get_seed() 160 status = efi_bs_call(install_configuration_table, &rng_table_guid, seed); in efi_random_get_seed() [all …]
|
D | zboot.c | 101 u32 seed = U32_MAX; in efi_zboot_entry() local 106 seed = 0; in efi_zboot_entry() 110 status = efi_get_random_bytes(sizeof(seed), (u8 *)&seed); in efi_zboot_entry() 122 seed, EFI_LOADER_CODE, 0, EFI_ALLOC_LIMIT); in efi_zboot_entry()
|
/linux-6.6.21/drivers/crypto/allwinner/sun8i-ss/ |
D | sun8i-ss-prng.c | 19 int sun8i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, in sun8i_ss_prng_seed() argument 24 if (ctx->seed && ctx->slen != slen) { in sun8i_ss_prng_seed() 25 kfree_sensitive(ctx->seed); in sun8i_ss_prng_seed() 27 ctx->seed = NULL; in sun8i_ss_prng_seed() 29 if (!ctx->seed) in sun8i_ss_prng_seed() 30 ctx->seed = kmalloc(slen, GFP_KERNEL); in sun8i_ss_prng_seed() 31 if (!ctx->seed) in sun8i_ss_prng_seed() 34 memcpy(ctx->seed, seed, slen); in sun8i_ss_prng_seed() 52 kfree_sensitive(ctx->seed); in sun8i_ss_prng_exit() 53 ctx->seed = NULL; in sun8i_ss_prng_exit() [all …]
|
/linux-6.6.21/drivers/crypto/allwinner/sun8i-ce/ |
D | sun8i-ce-prng.c | 29 kfree_sensitive(ctx->seed); in sun8i_ce_prng_exit() 30 ctx->seed = NULL; in sun8i_ce_prng_exit() 34 int sun8i_ce_prng_seed(struct crypto_rng *tfm, const u8 *seed, in sun8i_ce_prng_seed() argument 39 if (ctx->seed && ctx->slen != slen) { in sun8i_ce_prng_seed() 40 kfree_sensitive(ctx->seed); in sun8i_ce_prng_seed() 42 ctx->seed = NULL; in sun8i_ce_prng_seed() 44 if (!ctx->seed) in sun8i_ce_prng_seed() 45 ctx->seed = kmalloc(slen, GFP_KERNEL | GFP_DMA); in sun8i_ce_prng_seed() 46 if (!ctx->seed) in sun8i_ce_prng_seed() 49 memcpy(ctx->seed, seed, slen); in sun8i_ce_prng_seed() [all …]
|
/linux-6.6.21/lib/ |
D | xxhash.c | 94 static uint32_t xxh32_round(uint32_t seed, const uint32_t input) in xxh32_round() argument 96 seed += input * PRIME32_2; in xxh32_round() 97 seed = xxh_rotl32(seed, 13); in xxh32_round() 98 seed *= PRIME32_1; in xxh32_round() 99 return seed; in xxh32_round() 102 uint32_t xxh32(const void *input, const size_t len, const uint32_t seed) in xxh32() argument 110 uint32_t v1 = seed + PRIME32_1 + PRIME32_2; in xxh32() 111 uint32_t v2 = seed + PRIME32_2; in xxh32() 112 uint32_t v3 = seed + 0; in xxh32() 113 uint32_t v4 = seed - PRIME32_1; in xxh32() [all …]
|
D | test_hash.c | 26 xorshift(u32 seed) in xorshift() argument 28 seed ^= seed << 13; in xorshift() 29 seed ^= seed >> 17; in xorshift() 30 seed ^= seed << 5; in xorshift() 31 return seed; in xorshift() 46 static void fill_buf(char *buf, size_t len, u32 seed) in fill_buf() argument 51 seed = xorshift(seed); in fill_buf() 52 buf[i] = mod255(seed); in fill_buf()
|
D | random32.c | 131 u32 seed; member 141 u32 seed; member 248 static void prandom_state_selftest_seed(struct rnd_state *state, u32 seed) in prandom_state_selftest_seed() argument 251 state->s1 = __seed(LCG(seed), 2U); in prandom_state_selftest_seed() 265 prandom_state_selftest_seed(&state, test1[i].seed); in prandom_state_selftest() 280 prandom_state_selftest_seed(&state, test2[i].seed); in prandom_state_selftest()
|
/linux-6.6.21/scripts/basic/ |
D | Makefile | 9 gen-randstruct-seed := $(srctree)/scripts/gen-randstruct-seed.sh 12 $(CONFIG_SHELL) $(gen-randstruct-seed) \ 14 $(obj)/randstruct.seed: $(gen-randstruct-seed) FORCE 16 always-$(CONFIG_RANDSTRUCT) += randstruct.seed
|
/linux-6.6.21/kernel/trace/ |
D | trace_benchmark.c | 43 u64 seed; in trace_do_benchmark() local 124 seed = avg; in trace_do_benchmark() 126 last_seed = seed; in trace_do_benchmark() 127 seed = stddev; in trace_do_benchmark() 130 do_div(seed, last_seed); in trace_do_benchmark() 131 seed += last_seed; in trace_do_benchmark() 132 do_div(seed, 2); in trace_do_benchmark() 133 } while (i++ < 10 && last_seed != seed); in trace_do_benchmark() 135 std = seed; in trace_do_benchmark()
|
/linux-6.6.21/include/linux/ |
D | xxhash.h | 95 uint32_t xxh32(const void *input, size_t length, uint32_t seed); 108 uint64_t xxh64(const void *input, size_t length, uint64_t seed); 124 uint64_t seed) in xxhash() argument 127 return xxh64(input, length, seed); in xxhash() 129 return xxh32(input, length, seed); in xxhash() 178 void xxh32_reset(struct xxh32_state *state, uint32_t seed); 212 void xxh64_reset(struct xxh64_state *state, uint64_t seed);
|
D | prandom.h | 40 static inline void prandom_seed_state(struct rnd_state *state, u64 seed) in prandom_seed_state() argument 42 u32 i = ((seed >> 32) ^ (seed << 10) ^ seed) & 0xffffffffUL; in prandom_seed_state() 51 static inline u32 next_pseudo_random32(u32 seed) in next_pseudo_random32() argument 53 return seed * 1664525 + 1013904223; in next_pseudo_random32()
|
/linux-6.6.21/drivers/crypto/ |
D | exynos-rng.c | 98 const u8 *seed, unsigned int slen) in exynos_rng_set_seed() argument 112 val = seed[i] << 24; in exynos_rng_set_seed() 113 val |= seed[i + 1] << 16; in exynos_rng_set_seed() 114 val |= seed[i + 2] << 8; in exynos_rng_set_seed() 115 val |= seed[i + 3] << 0; in exynos_rng_set_seed() 178 u8 seed[EXYNOS_RNG_SEED_SIZE]; in exynos_rng_reseed() local 184 if (exynos_rng_get_random(rng, seed, sizeof(seed), &read)) in exynos_rng_reseed() 187 exynos_rng_set_seed(rng, seed, read); in exynos_rng_reseed() 225 static int exynos_rng_seed(struct crypto_rng *tfm, const u8 *seed, in exynos_rng_seed() argument 237 ret = exynos_rng_set_seed(ctx->rng, seed, slen); in exynos_rng_seed() [all …]
|
/linux-6.6.21/drivers/firmware/efi/ |
D | efi.c | 695 struct linux_efi_random_seed *seed; in efi_config_parse_tables() local 698 seed = early_memremap(efi_rng_seed, sizeof(*seed)); in efi_config_parse_tables() 699 if (seed != NULL) { in efi_config_parse_tables() 700 size = min_t(u32, seed->size, SZ_1K); // sanity check in efi_config_parse_tables() 701 early_memunmap(seed, sizeof(*seed)); in efi_config_parse_tables() 706 seed = early_memremap(efi_rng_seed, in efi_config_parse_tables() 707 sizeof(*seed) + size); in efi_config_parse_tables() 708 if (seed != NULL) { in efi_config_parse_tables() 709 add_bootloader_randomness(seed->bits, size); in efi_config_parse_tables() 710 memzero_explicit(seed->bits, size); in efi_config_parse_tables() [all …]
|
/linux-6.6.21/block/ |
D | t10-pi.c | 44 pi->ref_tag = cpu_to_be32(lower_32_bits(iter->seed)); in t10_pi_generate() 50 iter->seed++; in t10_pi_generate() 73 lower_32_bits(iter->seed)) { in t10_pi_verify() 77 iter->seed, be32_to_cpu(pi->ref_tag)); in t10_pi_verify() 91 (unsigned long long)iter->seed, in t10_pi_verify() 99 iter->seed++; in t10_pi_verify() 300 put_unaligned_be48(iter->seed, pi->ref_tag); in ext_pi_crc64_generate() 306 iter->seed++; in ext_pi_crc64_generate() 326 u64 ref, seed; in ext_pi_crc64_verify() local 334 seed = lower_48_bits(iter->seed); in ext_pi_crc64_verify() [all …]
|
/linux-6.6.21/arch/arm64/kernel/pi/ |
D | kaslr_early.c | 90 u64 seed; in kaslr_early_init() local 95 seed = get_kaslr_seed(fdt); in kaslr_early_init() 96 if (!seed) { in kaslr_early_init() 98 !__arm64_rndr((unsigned long *)&seed)) in kaslr_early_init() 109 return BIT(VA_BITS_MIN - 3) + (seed & GENMASK(VA_BITS_MIN - 3, 0)); in kaslr_early_init()
|
/linux-6.6.21/arch/s390/crypto/ |
D | prng.c | 261 static const u8 seed[] __initconst = { in prng_sha512_selftest() local 339 &ws, NULL, 0, seed, sizeof(seed)); in prng_sha512_selftest() 371 u8 seed[128 + 16]; in prng_sha512_instantiate() local 402 cpacf_trng(NULL, 0, seed, seedlen); in prng_sha512_instantiate() 411 ret = generate_entropy(seed, seedlen); in prng_sha512_instantiate() 417 store_tod_clock_ext((union tod_clock *)(seed + seedlen)); in prng_sha512_instantiate() 422 &prng_data->prnows, NULL, 0, seed, seedlen); in prng_sha512_instantiate() 423 memzero_explicit(seed, sizeof(seed)); in prng_sha512_instantiate() 452 u8 seed[64]; in prng_sha512_reseed() local 458 cpacf_trng(NULL, 0, seed, seedlen); in prng_sha512_reseed() [all …]
|
/linux-6.6.21/arch/x86/tools/ |
D | insn_sanity.c | 33 static unsigned int seed; /* Random seed */ variable 101 fprintf(fp, " $ %s -s 0x%x,%lu\n", prog, seed, nr_iter); in dump_stream() 113 if (read(fd, &seed, sizeof(seed)) != sizeof(seed)) in init_random_seed() 185 seed = (unsigned int)strtoul(optarg, &tmp, 0); in parse_args() 215 srand(seed); in parse_args() 262 seed); in main()
|
/linux-6.6.21/crypto/ |
D | xxhash_generic.c | 13 u64 seed; member 25 if (keylen != sizeof(tctx->seed)) in xxhash64_setkey() 27 tctx->seed = get_unaligned_le64(key); in xxhash64_setkey() 36 xxh64_reset(&dctx->xxhstate, tctx->seed); in xxhash64_init() 65 put_unaligned_le64(xxh64(data, length, tctx->seed), out); in xxhash64_digest()
|
D | ansi_cprng.c | 365 const u8 *seed, unsigned int slen) in cprng_reset() argument 368 const u8 *key = seed + DEFAULT_BLK_SZ; in cprng_reset() 377 reset_prng_context(prng, key, DEFAULT_PRNG_KSZ, seed, dt); in cprng_reset() 395 const u8 *seed, unsigned int slen) in fips_cprng_reset() argument 398 const u8 *key = seed + DEFAULT_BLK_SZ; in fips_cprng_reset() 407 if (!memcmp(seed, key, DEFAULT_PRNG_KSZ)) in fips_cprng_reset() 410 rc = cprng_reset(tfm, seed, slen); in fips_cprng_reset() 426 .seed = cprng_reset, 440 .seed = fips_cprng_reset,
|
/linux-6.6.21/drivers/crypto/allwinner/sun4i-ss/ |
D | sun4i-ss-prng.c | 4 int sun4i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, in sun4i_ss_prng_seed() argument 11 memcpy(algt->ss->seed, seed, slen); in sun4i_ss_prng_seed() 48 writel(ss->seed[i], ss->base + SS_KEY0 + i * 4); in sun4i_ss_prng_generate() 59 ss->seed[i] = v; in sun4i_ss_prng_generate()
|
/linux-6.6.21/drivers/base/power/ |
D | trace.c | 143 static unsigned int hash_string(unsigned int seed, const char *data, unsigned int mod) in hash_string() argument 147 seed = (seed << 16) + (seed << 6) - seed + c; in hash_string() 149 return seed % mod; in hash_string()
|
/linux-6.6.21/arch/s390/boot/ |
D | kaslr.c | 57 unsigned long seed, random; in get_random() local 63 seed = get_tod_clock_fast(); in get_random() 70 (u8 *) &seed, sizeof(seed)); in get_random() 76 *(unsigned long *) prng.parm_block ^= seed; in get_random() 83 random = seed; in get_random()
|
/linux-6.6.21/arch/powerpc/mm/nohash/ |
D | kaslr_booke.c | 288 u64 seed; in kaslr_choose_location() local 297 seed = get_tb() << 32; in kaslr_choose_location() 298 seed ^= get_tb(); in kaslr_choose_location() 299 random = rotate_xor(random, &seed, sizeof(seed)); in kaslr_choose_location() 304 seed = get_kaslr_seed(dt_ptr); in kaslr_choose_location() 305 if (seed) in kaslr_choose_location() 306 random = rotate_xor(random, &seed, sizeof(seed)); in kaslr_choose_location()
|
/linux-6.6.21/Documentation/networking/device_drivers/appletalk/ |
D | cops.rst | 66 dummy -seed -phase 2 -net 2000 -addr 2000.10 -zone "1033" 67 lt0 -seed -phase 1 -net 1000 -addr 1000.50 -zone "1033" 71 eth0 -seed -phase 2 -net 3000 -addr 3000.20 -zone "1033" 72 lt0 -seed -phase 1 -net 1000 -addr 1000.50 -zone "1033" 78 lt0 -seed -phase 1 -net 1000 -addr 1000.10 -zone "LocalTalk1" 79 lt1 -seed -phase 1 -net 2000 -addr 2000.20 -zone "LocalTalk2" 80 eth0 -seed -phase 2 -net 3000 -addr 3000.30 -zone "EtherTalk"
|
/linux-6.6.21/drivers/crypto/hisilicon/trng/ |
D | trng.c | 67 static void hisi_trng_set_seed(struct hisi_trng *trng, const u8 *seed) in hisi_trng_set_seed() argument 73 val = seed[i] << SEED_SHIFT_24; in hisi_trng_set_seed() 74 val |= seed[i + 1UL] << SEED_SHIFT_16; in hisi_trng_set_seed() 75 val |= seed[i + 2UL] << SEED_SHIFT_8; in hisi_trng_set_seed() 76 val |= seed[i + 3UL]; in hisi_trng_set_seed() 83 static int hisi_trng_seed(struct crypto_rng *tfm, const u8 *seed, in hisi_trng_seed() argument 98 hisi_trng_set_seed(trng, seed); in hisi_trng_seed() 216 .seed = hisi_trng_seed,
|