Home
last modified time | relevance | path

Searched full:seed (Results 1 – 25 of 251) sorted by relevance

1234567891011

/linux/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->bits); in efi_random_get_seed()
[all …]
/linux/include/crypto/
H A Drng.h26 * @seed: Seed or reseed the random number generator. With the
29 * random number generator requires a seed for setting
30 * up a new state, the seed must be provided by the
32 * size of the seed is defined with @seedsize .
35 * @seedsize: The seed size required for a random number generator
37 * random number generators does not require a seed
40 * the seed size is set to zero.
47 int (*seed)(struct crypto_rng *tfm, const u8 *seed, unsigned int slen); member
167 * @seed: seed input data
168 * @slen: length of the seed input data
[all …]
/linux/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: The seed can be used to alter the result predictably.
124 uint64_t seed) in xxhash() argument
127 return xxh64(input, length, seed); in xxhash()
[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()
/linux/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()
53 ctx->seed = NULL; in sun8i_ss_prng_exit()
[all …]
/linux/lib/
H A Dxxhash.c79 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/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
/linux/arch/x86/tools/
H A Dinsn_sanity.c33 static unsigned int seed; /* Random seed */ variable
42 fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n", prog); in usage()
46 fprintf(stderr, "\t-s Give a random seed (and iteration number)\n"); in usage()
100 /* Give a seed and iteration number */ in dump_stream()
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()
191 usage("Failed to parse seed"); in parse_args()
209 usage("Don't use input file (-i) with random seed (-s)"); in parse_args()
211 /* Initialize random seed */ in parse_args()
[all …]
/linux/drivers/char/hw_random/
H A Dhisi-rng.c27 MODULE_PARM_DESC(seed_sel, "Auto reload seed. 0, use LFSR(default); 1, use ring oscillator.");
38 u32 seed; in hisi_rng_init() local
40 /* get a random number as initial seed */ in hisi_rng_init()
41 get_random_bytes(&seed, sizeof(seed)); in hisi_rng_init()
43 writel_relaxed(seed, hrng->base + RNG_SEED); in hisi_rng_init()
46 * The seed is reload periodically, there are two choice in hisi_rng_init()
47 * of seeds, default seed using the value from LFSR, or in hisi_rng_init()
48 * will use seed generated by ring oscillator. in hisi_rng_init()
/linux/kernel/trace/
H A Dtrace_benchmark.c43 u64 seed; in trace_do_benchmark() local
115 * as our seed to find the std. in trace_do_benchmark()
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/drivers/crypto/allwinner/sun4i-ss/
H 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()
46 /* write the seed */ in sun4i_ss_prng_generate()
48 writel(ss->seed[i], ss->base + SS_KEY0 + i * 4); in sun4i_ss_prng_generate()
56 /* Update the seed */ in sun4i_ss_prng_generate()
59 ss->seed[i] = v; in sun4i_ss_prng_generate()
/linux/block/
H A Dt10-pi.c18 sector_t seed; member
54 pi->ref_tag = cpu_to_be32(lower_32_bits(iter->seed)); in t10_pi_generate()
60 iter->seed++; in t10_pi_generate()
79 lower_32_bits(iter->seed)) { in t10_pi_verify()
83 iter->seed, be32_to_cpu(pi->ref_tag)); in t10_pi_verify()
101 (unsigned long long)iter->seed, in t10_pi_verify()
109 iter->seed++; in t10_pi_verify()
232 put_unaligned_be48(iter->seed, pi->ref_tag); in ext_pi_crc64_generate()
238 iter->seed++; in ext_pi_crc64_generate()
257 u64 ref, seed; in ext_pi_crc64_verify() local
[all …]
/linux/arch/powerpc/mm/nohash/
H A Dkaslr_booke.c85 prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len); in get_kaslr_seed()
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()
302 * Retrieve (and wipe) the seed from the FDT 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()
308 pr_warn("KASLR: No safe seed for randomizing the kernel base.\n"); in kaslr_choose_location()
[all …]
/linux/tools/testing/selftests/net/forwarding/
H A Drouter_mpath_seed.sh181 check_err $? "mpath seed written as $seed_w, but read as $seed_r"
184 log_test "mpath seed set/get"
223 local seed=$1; shift
226 sysctl -qw net.ipv4.fib_multipath_hash_seed=$seed
251 log_test "mpath seed $what"
271 local seed=$1; shift
276 check_err $? "seed $seed: active NH moved from $act_0 to $act_1 after seed change"
291 # Initial active NH before touching the seed at all.
307 log_test "mpath seed stability $what"
/linux/Documentation/security/tpm/
H A Dtpm-security.rst89 elliptic curve key from the null seed using the standard storage seed
90 parameters. The null seed has two advantages: firstly the hierarchy
92 it and secondly, the null seed changes across TPM resets, meaning if
93 we establish trust on the null seed at start of day, all sessions
94 salted with the derived key will fail if the TPM is reset and the seed
97 Obviously using the null seed without any other prior shared secrets,
102 certifying the null seed primary with that key) which is too complex
116 hands to user-space the name of the derived null seed key which can
120 null seed scheme for security and hand the name off to the kernel in
201 null seed name presented by the kernel in
/linux/lib/crc/
H A Dcrc32-main.c16 * There are various incantations of crc32(). Some use a seed of 0 or ~0.
18 * seed as an argument, and doesn't xor at the end. Then individual
20 * drivers/net/smc9194.c uses seed ~0, doesn't xor with ~0.
21 * fs/jffs2 uses seed 0, doesn't xor with ~0.
22 * fs/partitions/efi.c uses seed ~0, xor's with ~0.
/linux/drivers/of/
H A Dkexec.c27 * bootargs, kaslr-seed, rng-seed, useable-memory-range and elfcorehdr.
470 /* add kaslr-seed */ in of_kexec_alloc_and_setup_fdt()
471 ret = fdt_delprop(fdt, chosen_node, "kaslr-seed"); in of_kexec_alloc_and_setup_fdt()
478 u64 seed = get_random_u64(); in of_kexec_alloc_and_setup_fdt() local
480 ret = fdt_setprop_u64(fdt, chosen_node, "kaslr-seed", seed); in of_kexec_alloc_and_setup_fdt()
485 "kaslr-seed"); in of_kexec_alloc_and_setup_fdt()
488 /* add rng-seed */ in of_kexec_alloc_and_setup_fdt()
492 ret = fdt_setprop_placeholder(fdt, chosen_node, "rng-seed", in of_kexec_alloc_and_setup_fdt()
499 "rng-seed"); in of_kexec_alloc_and_setup_fdt()
/linux/drivers/crypto/hisilicon/trng/
H 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/fs/ext4/
H A Dhash.c192 * The seed is an 4 longword (32 bits) "secret" which can be used to
193 * uniquify a hash. If the seed is all zero's, then some default seed
196 * A particular hash version specifies whether or not the seed is
211 /* Initialize the default seed for the hash checksum functions */ in __ext4fs_dirhash()
217 /* Check to see if the seed is all zero's */ in __ext4fs_dirhash()
218 if (hinfo->seed) { in __ext4fs_dirhash()
220 if (hinfo->seed[i]) { in __ext4fs_dirhash()
221 memcpy(buf, hinfo->seed, sizeof(buf)); in __ext4fs_dirhash()
/linux/scripts/
H A Dgen-randstruct-seed.sh4 SEED=$(od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n')
5 echo "$SEED" > "$1"
6 HASH=$(echo -n "$SEED" | sha256sum | cut -d" " -f1)
/linux/arch/s390/boot/
H 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/riscv/kernel/pi/
H A Darchrandom_early.c21 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/mtd/tests/
H 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/net/netfilter/
H A Dnft_hash.c22 u32 seed; member
34 h = reciprocal_scale(jhash(data, priv->len, priv->seed), in nft_jhash_eval()
107 priv->seed = ntohl(nla_get_be32(tb[NFTA_HASH_SEED])); in nft_jhash_init()
110 get_random_bytes(&priv->seed, sizeof(priv->seed)); in nft_jhash_init()
156 nla_put_be32(skb, NFTA_HASH_SEED, htonl(priv->seed))) in nft_jhash_dump()
/linux/include/net/
H A Dipv6_frag.h41 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()

1234567891011