| /linux/drivers/firmware/efi/libstub/ |
| H A 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 …]
|
| /linux/lib/ |
| H A D | xxhash.c | 79 static uint32_t xxh32_round(uint32_t seed, const uint32_t input) in xxh32_round() argument 81 seed += input * PRIME32_2; in xxh32_round() 82 seed = xxh_rotl32(seed, 13); in xxh32_round() 83 seed *= PRIME32_1; in xxh32_round() 84 return seed; in xxh32_round() 87 uint32_t xxh32(const void *input, const size_t len, const uint32_t seed) in xxh32() argument 95 uint32_t v1 = seed + PRIME32_1 + PRIME32_2; in xxh32() 96 uint32_t v2 = seed + PRIME32_2; in xxh32() 97 uint32_t v3 = seed + 0; in xxh32() 98 uint32_t v4 = seed - PRIME32_1; in xxh32() [all …]
|
| /linux/drivers/crypto/allwinner/sun8i-ss/ |
| H A 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/kernel/trace/ |
| H A D | trace_benchmark.c | 43 u64 seed; in trace_do_benchmark() local 123 seed = avg; in trace_do_benchmark() 125 last_seed = seed; in trace_do_benchmark() 126 seed = stddev; in trace_do_benchmark() 129 seed = div64_u64(seed, last_seed); in trace_do_benchmark() 130 seed += last_seed; in trace_do_benchmark() 131 do_div(seed, 2); in trace_do_benchmark() 132 } while (i++ < 10 && last_seed != seed); in trace_do_benchmark() 134 std = seed; in trace_do_benchmark()
|
| /linux/scripts/basic/ |
| H A D | Makefile | 7 # randstruct: the seed is needed before building the gcc-plugin or 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/include/linux/ |
| H A 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() 162 void xxh64_reset(struct xxh64_state *state, uint64_t seed);
|
| H A 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()
|
| H A D | rhashtable-types.h | 40 typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed); 41 typedef u32 (*rht_obj_hashfn_t)(const void *data, u32 len, u32 seed);
|
| /linux/drivers/firmware/efi/ |
| H A D | efi.c | 747 struct linux_efi_random_seed *seed; in efi_config_parse_tables() local 750 seed = early_memremap(efi_rng_seed, sizeof(*seed)); in efi_config_parse_tables() 751 if (seed != NULL) { in efi_config_parse_tables() 752 size = min_t(u32, seed->size, SZ_1K); // sanity check in efi_config_parse_tables() 753 early_memunmap(seed, sizeof(*seed)); in efi_config_parse_tables() 758 seed = early_memremap(efi_rng_seed, in efi_config_parse_tables() 759 sizeof(*seed) + size); in efi_config_parse_tables() 760 if (seed != NULL) { in efi_config_parse_tables() 761 add_bootloader_randomness(seed->bits, size); in efi_config_parse_tables() 762 memzero_explicit(seed->bits, size); in efi_config_parse_tables() [all …]
|
| /linux/arch/x86/tools/ |
| H A 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/drivers/crypto/allwinner/sun4i-ss/ |
| H A 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/arch/powerpc/mm/nohash/ |
| H A 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/arch/s390/boot/ |
| H A 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/arch/riscv/kernel/pi/ |
| H A D | archrandom_early.c | 21 unsigned long seed = 0; in get_kaslr_seed_zkr() local 26 if (!csr_seed_long(&seed)) in get_kaslr_seed_zkr() 29 return seed; in get_kaslr_seed_zkr()
|
| /linux/drivers/char/hw_random/ |
| H A D | hisi-rng.c | 38 u32 seed; in hisi_rng_init() local 41 get_random_bytes(&seed, sizeof(seed)); in hisi_rng_init() 43 writel_relaxed(seed, hrng->base + RNG_SEED); in hisi_rng_init()
|
| /linux/drivers/mtd/tests/ |
| H A D | nandbiterrs.c | 49 static unsigned seed; variable 50 module_param(seed, uint, S_IRUGO); 51 MODULE_PARM_DESC(seed, "Random seed"); 162 if (rbuffer[i] != hash(i+seed)) { in verify_page() 164 i, hash(i+seed), rbuffer[i]); in verify_page() 209 wbuffer[i] = hash(i+seed); in incremental_errors_test() 272 wbuffer[i] = hash(i+seed); in overwrite_test()
|
| /linux/tools/testing/selftests/powerpc/ptrace/ |
| H A D | ptrace-gpr.c | 119 unsigned long seed; in ptrace_gpr() local 123 seed = getpid() ^ time(NULL); in ptrace_gpr() 124 printf("srand(%lu)\n", seed); in ptrace_gpr() 125 srand(seed); in ptrace_gpr()
|
| /linux/include/net/ |
| H A D | ipv6_frag.h | 41 static inline u32 ip6frag_key_hashfn(const void *data, u32 len, u32 seed) in ip6frag_key_hashfn() argument 44 sizeof(struct frag_v6_compare_key) / sizeof(u32), seed); in ip6frag_key_hashfn() 47 static inline u32 ip6frag_obj_hashfn(const void *data, u32 len, u32 seed) in ip6frag_obj_hashfn() argument 52 sizeof(struct frag_v6_compare_key) / sizeof(u32), seed); in ip6frag_obj_hashfn()
|
| /linux/tools/testing/selftests/kvm/lib/ |
| H A D | test_util.c | 33 struct guest_random_state new_guest_random_state(u32 seed) in new_guest_random_state() argument 35 struct guest_random_state s = {.seed = seed}; in new_guest_random_state() 41 state->seed = (u64)state->seed * 48271 % ((u32)(1 << 31) - 1); in guest_random_u32() 42 return state->seed; in guest_random_u32()
|
| /linux/tools/perf/bench/ |
| H A D | mem-functions.c | 45 static unsigned int seed; 88 unsigned int seed; 297 p.seed = seed; in bench_mem_common() 513 unsigned int seed; in do_mmap() 527 if (data->seed) in do_mmap() 528 srand(data->seed); 536 fn(dst, p->size, p->page_shift, p->seed); 566 if (p->seed) 567 data[i].seed 43 static unsigned int seed; global() variable 85 unsigned int seed; global() member [all...] |
| /linux/net/netfilter/ |
| H A D | nft_set_hash.c | 45 static inline u32 nft_rhash_key(const void *data, u32 len, u32 seed) in nft_rhash_key() argument 49 return jhash(arg->key, len, seed); in nft_rhash_key() 52 static inline u32 nft_rhash_obj(const void *data, u32 len, u32 seed) in nft_rhash_obj() argument 56 return jhash(nft_set_ext_key(&he->ext), len, seed); in nft_rhash_obj() 588 u32 seed; member 609 hash = jhash(key, set->klen, priv->seed); in nft_hash_lookup() 630 hash = jhash_1word(*key, priv->seed); in nft_hash_get() 632 hash = jhash(key, set->klen, priv->seed); in nft_hash_get() 654 hash = jhash_1word(k1, priv->seed); in nft_hash_lookup_fast() 673 hash = jhash_1word(k1, priv->seed); in nft_jhash() [all …]
|
| /linux/scripts/ |
| H A D | Makefile.randstruct | 12 += -frandomize-layout-seed-file=$(objtree)/scripts/basic/randstruct.seed
|
| /linux/drivers/nvdimm/ |
| H A D | claim.c | 61 struct device *seed = NULL; in is_idle() local 64 seed = nd_region->btt_seed; in is_idle() 66 seed = nd_region->pfn_seed; in is_idle() 68 seed = nd_region->dax_seed; in is_idle() 70 if (seed == dev || ndns || dev->driver) in is_idle()
|
| /linux/scripts/gcc-plugins/ |
| H A D | randomize_layout_plugin.c | 135 static void raninit(ranctx *x, u64 *seed) { in raninit() argument 138 x->a = seed[0]; in raninit() 139 x->b = seed[1]; in raninit() 140 x->c = seed[2]; in raninit() 141 x->d = seed[3]; in raninit() 245 u64 seed[4]; in shuffle() local 264 seed[i] = shuffle_seed[i]; in shuffle() 265 seed[i] ^= name_hash(structname); in shuffle() 268 raninit(&prng_state, (u64 *)&seed); in shuffle()
|
| /linux/tools/testing/radix-tree/ |
| H A D | main.c | 288 unsigned int seed = time(NULL); in main() local 294 seed = strtoul(optarg, NULL, 0); in main() 299 printf("random seed %u\n", seed); in main() 300 srand(seed); in main()
|