Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
random32.c File Reference
#include <linux/types.h>
#include <linux/percpu.h>
#include <linux/export.h>
#include <linux/jiffies.h>
#include <linux/random.h>

Go to the source code of this file.

Macros

#define TAUSWORTHE(s, a, b, c, d)   ((s&c)<<d) ^ (((s <<a) ^ s)>>b)
 
#define LCG(x)   ((x) * 69069) /* super-duper LCG */
 

Functions

u32 prandom32 (struct rnd_state *state)
 
 EXPORT_SYMBOL (prandom32)
 
u32 random32 (void)
 
 EXPORT_SYMBOL (random32)
 
void srandom32 (u32 entropy)
 
 EXPORT_SYMBOL (srandom32)
 
 core_initcall (random32_init)
 
 late_initcall (random32_reseed)
 

Macro Definition Documentation

#define LCG (   x)    ((x) * 69069) /* super-duper LCG */
#define TAUSWORTHE (   s,
  a,
  b,
  c,
  d 
)    ((s&c)<<d) ^ (((s <<a) ^ s)>>b)

Function Documentation

core_initcall ( random32_init  )
EXPORT_SYMBOL ( prandom32  )
EXPORT_SYMBOL ( random32  )
EXPORT_SYMBOL ( srandom32  )
late_initcall ( random32_reseed  )
u32 prandom32 ( struct rnd_state state)

prandom32 - seeded pseudo-random number generator. : pointer to state structure holding seeded state.

This is used for pseudo-randomness with no outside seeding. For more random results, use random32().

Definition at line 51 of file random32.c.

u32 random32 ( void  )

random32 - pseudo random number generator

A 32 bit pseudo-random number is generated using a fast algorithm suitable for simulation. This algorithm is NOT considered safe for cryptographic use.

Definition at line 70 of file random32.c.

void srandom32 ( u32  entropy)

srandom32 - add entropy to pseudo random number generator : seed value

Add some additional seeding to the random32() pool.

Definition at line 86 of file random32.c.