/linux-6.14.4/drivers/firmware/efi/libstub/ |
D | random.c | 53 * 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-6.14.4/include/crypto/ |
D | rng.h | 26 * @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 169 * @seed: seed input data 170 * @slen: length of the seed input data [all …]
|
/linux-6.14.4/include/linux/ |
D | prandom.h | 36 * 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 * 1664525 + 1013904223; in next_pseudo_random32()
|
D | xxhash.h | 85 * 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 …]
|
/linux-6.14.4/tools/testing/selftests/bpf/prog_tests/ |
D | test_csum_diff.c | 13 unsigned short seed; member 27 .seed = 0, 38 .seed = 0x1234, 49 .seed = 0x1234, 126 .seed = 0xffff, 141 .seed = 0, 152 .seed = 0x1234, 163 .seed = 0x1234, 240 .seed = 0xffff, 257 .seed = 0, [all …]
|
/linux-6.14.4/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.14.4/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.14.4/scripts/basic/ |
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-6.14.4/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 | 24 /* 32-bit XORSHIFT generator. Seed must not be zero. */ 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()
|
/linux-6.14.4/arch/arm64/kernel/pi/ |
D | kaslr_early.c | 25 static char const seed_str[] __initconst = "kaslr-seed"; in get_kaslr_seed() 44 u64 seed, range; in kaslr_early_init() local 49 seed = get_kaslr_seed(fdt, chosen); in kaslr_early_init() 50 if (!seed) { in kaslr_early_init() 52 !__arm64_rndr((unsigned long *)&seed)) in kaslr_early_init() 56 memstart_offset_seed = seed & U16_MAX; in kaslr_early_init() 60 * kernel image offset from the seed. Let's place the kernel in the in kaslr_early_init() 65 return range / 2 + (((__uint128_t)range * seed) >> 64); in kaslr_early_init()
|
/linux-6.14.4/drivers/crypto/ |
D | exynos-rng.c | 40 /* 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() argument 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() 122 dev_warn(rng->dev, "Seed setting not finished\n"); in exynos_rng_set_seed() [all …]
|
/linux-6.14.4/arch/x86/tools/ |
D | insn_sanity.c | 33 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-6.14.4/drivers/char/hw_random/ |
D | hisi-rng.c | 27 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-6.14.4/kernel/trace/ |
D | trace_benchmark.c | 43 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-6.14.4/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() 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-6.14.4/block/ |
D | t10-pi.c | 18 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-6.14.4/drivers/firmware/efi/ |
D | efi.c | 728 struct linux_efi_random_seed *seed; in efi_config_parse_tables() local 731 seed = early_memremap(efi_rng_seed, sizeof(*seed)); in efi_config_parse_tables() 732 if (seed != NULL) { in efi_config_parse_tables() 733 size = min_t(u32, seed->size, SZ_1K); // sanity check in efi_config_parse_tables() 734 early_memunmap(seed, sizeof(*seed)); in efi_config_parse_tables() 736 pr_err("Could not map UEFI random seed!\n"); in efi_config_parse_tables() 739 seed = early_memremap(efi_rng_seed, in efi_config_parse_tables() 740 sizeof(*seed) + size); in efi_config_parse_tables() 741 if (seed != NULL) { in efi_config_parse_tables() 742 add_bootloader_randomness(seed->bits, size); in efi_config_parse_tables() [all …]
|
/linux-6.14.4/arch/powerpc/mm/nohash/ |
D | kaslr_booke.c | 85 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-6.14.4/crypto/ |
D | ansi_cprng.c | 33 * V is our seed vector 359 * This is the cprng_registered reset method the seed value is 362 * as being present by testing the length of the seed 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() 406 /* fips strictly requires seed != key */ in fips_cprng_reset() 407 if (!memcmp(seed, key, DEFAULT_PRNG_KSZ)) in fips_cprng_reset() [all …]
|
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()
|
/linux-6.14.4/tools/testing/selftests/net/forwarding/ |
D | router_mpath_seed.sh | 181 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-6.14.4/fs/nilfs2/ |
D | segbuf.c | 176 nilfs_segbuf_fill_in_segsum_crc(struct nilfs_segment_buffer *segbuf, u32 seed) in nilfs_segbuf_fill_in_segsum_crc() argument 188 crc = crc32_le(seed, in nilfs_segbuf_fill_in_segsum_crc() 204 u32 seed) in nilfs_segbuf_fill_in_data_crc() argument 213 crc = crc32_le(seed, in nilfs_segbuf_fill_in_data_crc() 235 u32 seed) in nilfs_segbuf_fill_in_super_root_crc() argument 244 crc = crc32_le(seed, in nilfs_segbuf_fill_in_super_root_crc() 320 * @seed: checksum seed value 322 void nilfs_add_checksums_on_logs(struct list_head *logs, u32 seed) in nilfs_add_checksums_on_logs() argument 328 nilfs_segbuf_fill_in_super_root_crc(segbuf, seed); in nilfs_add_checksums_on_logs() 329 nilfs_segbuf_fill_in_segsum_crc(segbuf, seed); in nilfs_add_checksums_on_logs() [all …]
|
/linux-6.14.4/Documentation/security/tpm/ |
D | tpm-security.rst | 89 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-6.14.4/drivers/staging/media/atomisp/pci/ |
D | ia_css_prbs.h | 33 * Seed the for the Pseudo Random Bit Sequence. 41 int seed; /** random seed for the 1st 2-pixel-components/clock */ member 42 int seed1; /** random seed for the 2nd 2-pixel-components/clock */
|