mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
random: Add support for architectural random hooks
commit 63d7717326 upstream.
Add support for architecture-specific hooks into the kernel-directed
random number generator interfaces. This patchset does not use the
architecture random number generator interfaces for the
userspace-directed interfaces (/dev/random and /dev/urandom), thus
eliminating the need to distinguish between them based on a pool
pointer.
Changes in version 3:
- Moved the hooks from extract_entropy() to get_random_bytes().
- Changes the hooks to inlines.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7b1cad6280
commit
6133313b3b
@@ -91,6 +91,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed)
|
||||
state->s3 = __seed(i, 15);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_RANDOM
|
||||
# include <asm/archrandom.h>
|
||||
#else
|
||||
static inline int arch_get_random_long(unsigned long *v)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int arch_get_random_int(unsigned int *v)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL___ */
|
||||
|
||||
#endif /* _LINUX_RANDOM_H */
|
||||
|
||||
Reference in New Issue
Block a user