Home
last modified time | relevance | path

Searched refs:seed (Results 1 – 25 of 156) sorted by relevance

1234567

/linux/lib/
A Dxxhash.c96 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()
112 uint32_t v3 = seed + 0; in xxh32()
129 h32 = seed + PRIME32_5; in xxh32()
182 uint64_t v3 = seed + 0; in xxh64()
204 h64 = seed + PRIME64_5; in xxh64()
249 state.v2 = seed + PRIME32_2; in xxh32_reset()
250 state.v3 = seed + 0; in xxh32_reset()
[all …]
A Dtest_hash.c28 xorshift(u32 seed) in xorshift() argument
30 seed ^= seed << 13; in xorshift()
31 seed ^= seed >> 17; in xorshift()
32 seed ^= seed << 5; in xorshift()
33 return seed; in xorshift()
49 fill_buf(char *buf, size_t len, u32 seed) in fill_buf() argument
54 seed = xorshift(seed); in fill_buf()
55 buf[i] = mod255(seed); in fill_buf()
/linux/drivers/crypto/allwinner/sun8i-ce/
A Dsun8i-ce-prng.c29 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/drivers/crypto/allwinner/sun8i-ss/
A Dsun8i-ss-prng.c17 int sun8i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, in sun8i_ss_prng_seed() argument
22 if (ctx->seed && ctx->slen != slen) { in sun8i_ss_prng_seed()
23 kfree_sensitive(ctx->seed); in sun8i_ss_prng_seed()
25 ctx->seed = NULL; in sun8i_ss_prng_seed()
27 if (!ctx->seed) in sun8i_ss_prng_seed()
28 ctx->seed = kmalloc(slen, GFP_KERNEL | GFP_DMA); in sun8i_ss_prng_seed()
29 if (!ctx->seed) in sun8i_ss_prng_seed()
32 memcpy(ctx->seed, seed, slen); in sun8i_ss_prng_seed()
50 kfree_sensitive(ctx->seed); in sun8i_ss_prng_exit()
51 ctx->seed = NULL; in sun8i_ss_prng_exit()
[all …]
/linux/arch/s390/crypto/
A Darch_random.c88 u8 seed[ARCH_PRNG_SEED_SIZE]; in arch_rng_refill_buffer() local
91 cpacf_trng(NULL, 0, seed, sizeof(seed)); in arch_rng_refill_buffer()
95 &prng_wa, NULL, 0, seed, sizeof(seed)); in arch_rng_refill_buffer()
155 u8 seed[32]; in refill_rndlong_buf() local
158 cpacf_trng(NULL, 0, seed, sizeof(seed)); in refill_rndlong_buf()
162 &prng_ws, NULL, 0, seed, sizeof(seed)); in refill_rndlong_buf()
A Dprng.c261 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()
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()
462 ret = generate_entropy(seed, seedlen); in prng_sha512_reseed()
463 if (ret != sizeof(seed)) in prng_sha512_reseed()
[all …]
/linux/drivers/firmware/efi/libstub/
A Drandom.c71 struct linux_efi_random_seed *seed = NULL; in efi_random_get_seed() local
79 sizeof(*seed) + EFI_RANDOM_SEED_SIZE, in efi_random_get_seed()
80 (void **)&seed); in efi_random_get_seed()
85 EFI_RANDOM_SEED_SIZE, seed->bits); in efi_random_get_seed()
93 EFI_RANDOM_SEED_SIZE, seed->bits); in efi_random_get_seed()
98 seed->size = EFI_RANDOM_SEED_SIZE; in efi_random_get_seed()
99 status = efi_bs_call(install_configuration_table, &rng_table_guid, seed); in efi_random_get_seed()
106 efi_bs_call(free_pool, seed); in efi_random_get_seed()
/linux/kernel/trace/
A Dtrace_benchmark.c43 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/include/linux/
A Dxxhash.h95 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);
A Dprandom.h16 void prandom_seed(u32 seed);
112 static inline void prandom_seed_state(struct rnd_state *state, u64 seed) in prandom_seed_state() argument
114 u32 i = ((seed >> 32) ^ (seed << 10) ^ seed) & 0xffffffffUL; in prandom_seed_state()
124 static inline u32 next_pseudo_random32(u32 seed) in next_pseudo_random32() argument
126 return seed * 1664525 + 1013904223; in next_pseudo_random32()
/linux/drivers/firmware/efi/
A Defi.c594 seed = early_memremap(efi_rng_seed, sizeof(*seed)); in efi_config_parse_tables()
595 if (seed != NULL) { in efi_config_parse_tables()
597 early_memunmap(seed, sizeof(*seed)); in efi_config_parse_tables()
607 early_memunmap(seed, sizeof(*seed) + size); in efi_config_parse_tables()
1008 seed = memremap(efi_rng_seed, sizeof(*seed), MEMREMAP_WB); in update_efi_random_seed()
1009 if (seed != NULL) { in update_efi_random_seed()
1011 memunmap(seed); in update_efi_random_seed()
1016 seed = memremap(efi_rng_seed, sizeof(*seed) + size, in update_efi_random_seed()
1018 if (seed != NULL) { in update_efi_random_seed()
1020 get_random_bytes(seed->bits, seed->size); in update_efi_random_seed()
[all …]
/linux/arch/arm64/kernel/
A Dkaslr.c67 u64 seed, offset, mask, module_range; in kaslr_early_init() local
93 seed = get_kaslr_seed(fdt); in kaslr_early_init()
110 seed ^= raw; in kaslr_early_init()
112 if (!seed) { in kaslr_early_init()
128 offset = BIT(VA_BITS_MIN - 3) + (seed & mask); in kaslr_early_init()
131 memstart_offset_seed = seed >> 48; in kaslr_early_init()
174 module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21; in kaslr_early_init()
/linux/drivers/crypto/
A Dexynos-rng.c98 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/arch/x86/tools/
A Dinsn_sanity.c33 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/
A Dsun4i-ss-prng.c4 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/crypto/
A Dxxhash_generic.c13 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()
A Dansi_cprng.c365 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,
A Drng.c31 int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) in crypto_rng_reset() argument
37 if (!seed && slen) { in crypto_rng_reset()
45 seed = buf; in crypto_rng_reset()
49 err = crypto_rng_alg(tfm)->seed(tfm, seed, slen); in crypto_rng_reset()
/linux/arch/s390/boot/
A Dkaslr.c57 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/powerpc/mm/nohash/
A Dkaslr_booke.c294 u64 seed; in kaslr_choose_location() local
303 seed = get_tb() << 32; in kaslr_choose_location()
304 seed ^= get_tb(); in kaslr_choose_location()
305 random = rotate_xor(random, &seed, sizeof(seed)); in kaslr_choose_location()
310 seed = get_kaslr_seed(dt_ptr); in kaslr_choose_location()
311 if (seed) in kaslr_choose_location()
312 random = rotate_xor(random, &seed, sizeof(seed)); in kaslr_choose_location()
/linux/drivers/base/power/
A Dtrace.c139 static unsigned int hash_string(unsigned int seed, const char *data, unsigned int mod) in hash_string() argument
143 seed = (seed << 16) + (seed << 6) - seed + c; in hash_string()
145 return seed % mod; in hash_string()
/linux/drivers/crypto/hisilicon/trng/
A Dtrng.c67 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,
/linux/Documentation/networking/device_drivers/appletalk/
A Dcops.rst66 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/drivers/mtd/tests/
A Dnandbiterrs.c49 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/drivers/char/hw_random/
A Dhisi-rng.c38 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()

Completed in 39 milliseconds

1234567