Home
last modified time | relevance | path

Searched refs:seed (Results 1 - 25 of 278) sorted by relevance

12345678910>>...12

/kernel/linux/linux-5.10/drivers/crypto/allwinner/sun8i-ss/
H 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 memzero_explicit(ctx->seed, ctx->slen); in sun8i_ss_prng_seed()
24 kfree(ctx->seed); in sun8i_ss_prng_seed()
26 ctx->seed = NULL; in sun8i_ss_prng_seed()
28 if (!ctx->seed) in sun8i_ss_prng_seed()
29 ctx->seed = kmalloc(slen, GFP_KERNEL | GFP_DMA); in sun8i_ss_prng_seed()
30 if (!ctx->seed) in sun8i_ss_prng_seed()
33 memcpy(ctx->seed, seed, sle in sun8i_ss_prng_seed()
[all...]
/kernel/linux/linux-5.10/drivers/crypto/allwinner/sun8i-ce/
H A Dsun8i-ce-prng.c29 memzero_explicit(ctx->seed, ctx->slen); in sun8i_ce_prng_exit()
30 kfree(ctx->seed); in sun8i_ce_prng_exit()
31 ctx->seed = NULL; in sun8i_ce_prng_exit()
35 int sun8i_ce_prng_seed(struct crypto_rng *tfm, const u8 *seed, in sun8i_ce_prng_seed() argument
40 if (ctx->seed && ctx->slen != slen) { in sun8i_ce_prng_seed()
41 memzero_explicit(ctx->seed, ctx->slen); in sun8i_ce_prng_seed()
42 kfree(ctx->seed); in sun8i_ce_prng_seed()
44 ctx->seed = NULL; in sun8i_ce_prng_seed()
46 if (!ctx->seed) in sun8i_ce_prng_seed()
47 ctx->seed in sun8i_ce_prng_seed()
[all...]
/kernel/linux/linux-6.6/drivers/firmware/efi/libstub/
H A Drandom.c53 * efi_random_get_seed() - provide random seed as configuration table
70 struct linux_efi_random_seed *prev_seed, *seed = NULL; in efi_random_get_seed() local
88 * Check whether a seed was provided by a prior boot stage. In that in efi_random_get_seed()
91 * Note that we should read the seed size with caution, in case the in efi_random_get_seed()
102 * allocation will survive a kexec reboot (although we refresh the seed in efi_random_get_seed()
106 struct_size(seed, bits, seed_size), in efi_random_get_seed()
107 (void **)&seed); in efi_random_get_seed()
109 efi_warn("Failed to allocate memory for RNG seed.\n"); in efi_random_get_seed()
115 EFI_RANDOM_SEED_SIZE, seed->bits); in efi_random_get_seed()
123 EFI_RANDOM_SEED_SIZE, seed in efi_random_get_seed()
[all...]
/kernel/linux/linux-6.6/drivers/crypto/allwinner/sun8i-ss/
H A Dsun8i-ss-prng.c19 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()
[all...]
/kernel/linux/linux-6.6/drivers/crypto/allwinner/sun8i-ce/
H 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, see in sun8i_ce_prng_seed()
[all...]
/kernel/linux/linux-5.10/lib/
H A Dxxhash.c94 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 in xxh32()
172 xxh64(const void *input, const size_t len, const uint64_t seed) xxh64() argument
242 xxh32_reset(struct xxh32_state *statePtr, const uint32_t seed) xxh32_reset() argument
256 xxh64_reset(struct xxh64_state *statePtr, const uint64_t seed) xxh64_reset() argument
[all...]
H 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 in fill_buf()
[all...]
/kernel/linux/linux-6.6/lib/
H A Dxxhash.c94 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 in xxh32()
172 xxh64(const void *input, const size_t len, const uint64_t seed) xxh64() argument
242 xxh32_reset(struct xxh32_state *statePtr, const uint32_t seed) xxh32_reset() argument
256 xxh64_reset(struct xxh64_state *statePtr, const uint64_t seed) xxh64_reset() argument
[all...]
H A Dtest_hash.c26 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 in fill_buf()
[all...]
/kernel/linux/linux-5.10/drivers/firmware/efi/libstub/
H A Drandom.c53 * efi_random_get_seed() - provide random seed as configuration table
70 struct linux_efi_random_seed *prev_seed, *seed = NULL; in efi_random_get_seed() local
80 * Check whether a seed was provided by a prior boot stage. In that in efi_random_get_seed()
83 * Note that we should read the seed size with caution, in case the in efi_random_get_seed()
94 * allocation will survive a kexec reboot (although we refresh the seed in efi_random_get_seed()
98 struct_size(seed, bits, seed_size), in efi_random_get_seed()
99 (void **)&seed); in efi_random_get_seed()
101 efi_warn("Failed to allocate memory for RNG seed.\n"); in efi_random_get_seed()
106 EFI_RANDOM_SEED_SIZE, seed->bits); in efi_random_get_seed()
114 EFI_RANDOM_SEED_SIZE, seed in efi_random_get_seed()
[all...]
/kernel/linux/linux-6.6/scripts/basic/
H A DMakefile7 # 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
/kernel/linux/linux-5.10/include/linux/
H A Dxxhash.h85 * xxh32() - calculate the 32-bit hash of the input with a given seed.
89 * @seed: The seed can be used to alter the result predictably.
95 uint32_t xxh32(const void *input, size_t length, uint32_t seed);
98 * xxh64() - calculate the 64-bit hash of the input with a given seed.
102 * @seed: The seed can be used to alter the result predictably.
108 uint64_t xxh64(const void *input, size_t length, uint64_t seed);
111 * xxhash() - calculate wordsize hash of the input with a given seed
114 * @seed
123 xxhash(const void *input, size_t length, uint64_t seed) xxhash() argument
[all...]
H A Dprandom.h17 void prandom_seed(u32 seed);
99 * prandom_seed_state - set seed for prandom_u32_state().
100 * @state: pointer to state structure to receive the seed.
101 * @seed: arbitrary 64-bit value to use as a seed.
103 static inline void prandom_seed_state(struct rnd_state *state, u64 seed) in prandom_seed_state() argument
105 u32 i = ((seed >> 32) ^ (seed << 10) ^ seed) & 0xffffffffUL; in prandom_seed_state()
115 static inline u32 next_pseudo_random32(u32 seed) in next_pseudo_random32() argument
[all...]
/kernel/linux/linux-6.6/include/linux/
H A Dxxhash.h85 * xxh32() - calculate the 32-bit hash of the input with a given seed.
89 * @seed: The seed can be used to alter the result predictably.
95 uint32_t xxh32(const void *input, size_t length, uint32_t seed);
98 * xxh64() - calculate the 64-bit hash of the input with a given seed.
102 * @seed: The seed can be used to alter the result predictably.
108 uint64_t xxh64(const void *input, size_t length, uint64_t seed);
111 * xxhash() - calculate wordsize hash of the input with a given seed
114 * @seed
123 xxhash(const void *input, size_t length, uint64_t seed) xxhash() argument
[all...]
H A Dprandom.h36 * prandom_seed_state - set seed for prandom_u32_state().
37 * @state: pointer to state structure to receive the seed.
38 * @seed: arbitrary 64-bit value to use as a seed.
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 * 166452 in next_pseudo_random32()
[all...]
/kernel/linux/linux-5.10/kernel/trace/
H A Dtrace_benchmark.c43 u64 seed; in trace_do_benchmark() local
116 * as our seed to find the std. in trace_do_benchmark()
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()
[all...]
/kernel/linux/linux-6.6/kernel/trace/
H A Dtrace_benchmark.c43 u64 seed; in trace_do_benchmark() local
116 * as our seed to find the std. in trace_do_benchmark()
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()
[all...]
/kernel/linux/linux-5.10/arch/arm64/kernel/
H A Dkaslr.c44 prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len); in get_kaslr_seed()
85 u64 seed, offset, mask, module_range; in kaslr_early_init() local
110 * Retrieve (and wipe) the seed from the FDT in kaslr_early_init()
112 seed = get_kaslr_seed(fdt); in kaslr_early_init()
131 seed ^= raw; in kaslr_early_init()
133 if (!seed) { in kaslr_early_init()
140 * kernel image offset from the seed. Let's place the kernel in the in kaslr_early_init()
149 offset = BIT(VA_BITS_MIN - 3) + (seed & mask); in kaslr_early_init()
152 memstart_offset_seed = seed >> 48; in kaslr_early_init()
190 module_alloc_base += (module_range * (seed in kaslr_early_init()
[all...]
/kernel/linux/linux-5.10/drivers/crypto/
H A Dexynos-rng.c40 /* Five seed and output registers, each 4 bytes */
52 * backtracking of the original seed.
54 * Time for next re-seed in ms.
98 const u8 *seed, unsigned int slen) in exynos_rng_set_seed()
103 /* Round seed length because loop iterates over full register size */ in exynos_rng_set_seed()
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()
171 /* Re-seed itsel
97 exynos_rng_set_seed(struct exynos_rng_dev *rng, const u8 *seed, unsigned int slen) exynos_rng_set_seed() argument
178 u8 seed[EXYNOS_RNG_SEED_SIZE]; exynos_rng_reseed() local
225 exynos_rng_seed(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) exynos_rng_seed() argument
[all...]
/kernel/linux/linux-6.6/drivers/crypto/
H A Dexynos-rng.c40 /* Five seed and output registers, each 4 bytes */
52 * backtracking of the original seed.
54 * Time for next re-seed in ms.
98 const u8 *seed, unsigned int slen) in exynos_rng_set_seed()
103 /* Round seed length because loop iterates over full register size */ in exynos_rng_set_seed()
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()
171 /* Re-seed itsel
97 exynos_rng_set_seed(struct exynos_rng_dev *rng, const u8 *seed, unsigned int slen) exynos_rng_set_seed() argument
178 u8 seed[EXYNOS_RNG_SEED_SIZE]; exynos_rng_reseed() local
225 exynos_rng_seed(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) exynos_rng_seed() argument
[all...]
/kernel/linux/linux-5.10/drivers/firmware/efi/
H A Defi.c594 struct linux_efi_random_seed *seed; in efi_config_parse_tables() local
597 seed = early_memremap(efi_rng_seed, sizeof(*seed)); in efi_config_parse_tables()
598 if (seed != NULL) { in efi_config_parse_tables()
599 size = min_t(u32, seed->size, SZ_1K); // sanity check in efi_config_parse_tables()
600 early_memunmap(seed, sizeof(*seed)); in efi_config_parse_tables()
602 pr_err("Could not map UEFI random seed!\n"); in efi_config_parse_tables()
605 seed = early_memremap(efi_rng_seed, in efi_config_parse_tables()
606 sizeof(*seed) in efi_config_parse_tables()
1026 struct linux_efi_random_seed *seed; update_efi_random_seed() local
[all...]
/kernel/linux/linux-6.6/drivers/firmware/efi/
H A Defi.c695 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()
703 pr_err("Could not map UEFI random seed!\n"); in efi_config_parse_tables()
706 seed = early_memremap(efi_rng_seed, in efi_config_parse_tables()
707 sizeof(*seed) in efi_config_parse_tables()
1144 struct linux_efi_random_seed *seed; update_efi_random_seed() local
[all...]
/kernel/linux/linux-5.10/crypto/
H 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()
/kernel/linux/linux-5.10/drivers/crypto/allwinner/sun4i-ss/
H A Dsun4i-ss-prng.c3 int sun4i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, in sun4i_ss_prng_seed() argument
10 memcpy(algt->ss->seed, seed, slen); in sun4i_ss_prng_seed()
40 /* write the seed */ in sun4i_ss_prng_generate()
42 writel(ss->seed[i], ss->base + SS_KEY0 + i * 4); in sun4i_ss_prng_generate()
50 /* Update the seed */ in sun4i_ss_prng_generate()
53 ss->seed[i] = v; in sun4i_ss_prng_generate()
/kernel/linux/linux-6.6/arch/arm64/kernel/pi/
H A Dkaslr_early.c79 prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len); in get_kaslr_seed()
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()
104 * kernel image offset from the seed. Let's place the kernel in the in kaslr_early_init()
109 return BIT(VA_BITS_MIN - 3) + (seed & GENMASK(VA_BITS_MIN - 3, 0)); in kaslr_early_init()

Completed in 10 milliseconds

12345678910>>...12