aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/random32.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/random32.c b/lib/random32.c
index dc75dc59b..6056fdc02 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -152,7 +152,8 @@ static u32 __extract_hwseed(void)
{
unsigned int val = 0;
- (void)(arch_get_random_int(&val));
+ (void)(arch_get_random_seed_int(&val) ||
+ arch_get_random_int(&val));
return val;
}
@@ -221,7 +222,7 @@ static void __prandom_timer(unsigned long dontcare)
u32 entropy;
unsigned long expires;
- erandom_get_random_bytes((char *)&entropy, sizeof(entropy));
+ get_random_bytes(&entropy, sizeof(entropy));
prandom_seed(entropy);
/* reseed every ~60 seconds, in [40 .. 80) interval with slack */
@@ -271,7 +272,7 @@ static void __prandom_reseed(bool late)
struct rnd_state *state = &per_cpu(net_rand_state,i);
u32 seeds[4];
- erandom_get_random_bytes((char *)&seeds, sizeof(seeds));
+ get_random_bytes(&seeds, sizeof(seeds));
state->s1 = __seed(seeds[0], 2U);
state->s2 = __seed(seeds[1], 8U);
state->s3 = __seed(seeds[2], 16U);