MagickCore  6.7.5
random.c File Reference
Include dependency graph for random.c:

Go to the source code of this file.

Data Structures

struct  _RandomInfo

Defines

#define PseudoRandomHash   SHA256Hash
#define RandomEntropyLevel   9
#define RandomFilename   "reservoir.xdm"
#define RandomFiletype   "random"
#define RandomProtocolMajorVersion   1
#define RandomProtocolMinorVersion   0
#define MaxEntropyExtent   64

Functions

static StringInfoGenerateEntropicChaos (RandomInfo *)
static size_t MagickMin (const size_t x, const size_t y)
MagickExport RandomInfoAcquireRandomInfo (void)
MagickExport RandomInfoDestroyRandomInfo (RandomInfo *random_info)
static ssize_t ReadRandom (int file, unsigned char *source, size_t length)
MagickExport double GetPseudoRandomValue (RandomInfo *random_info)
MagickExport StringInfoGetRandomKey (RandomInfo *random_info, const size_t length)
MagickExport double GetRandomValue (RandomInfo *random_info)
MagickPrivate MagickBooleanType RandomComponentGenesis (void)
MagickPrivate void RandomComponentTerminus (void)
MagickExport void SeedPseudoRandomGenerator (const unsigned long seed)
static void IncrementRandomNonce (StringInfo *nonce)
MagickExport void SetRandomKey (RandomInfo *random_info, const size_t length, unsigned char *key)
MagickExport void SetRandomTrueRandom (const MagickBooleanType true_random)

Variables

char ** environ
static SemaphoreInforandom_semaphore = (SemaphoreInfo *) NULL
static unsigned long random_seed = ~0UL
static MagickBooleanType gather_true_random = MagickFalse

Define Documentation

#define MaxEntropyExtent   64

Referenced by GenerateEntropicChaos().

#define PseudoRandomHash   SHA256Hash

Definition at line 67 of file random.c.

#define RandomEntropyLevel   9

Definition at line 68 of file random.c.

#define RandomFilename   "reservoir.xdm"

Definition at line 69 of file random.c.

#define RandomFiletype   "random"

Definition at line 70 of file random.c.

#define RandomProtocolMajorVersion   1

Definition at line 71 of file random.c.

Referenced by AcquireRandomInfo().

#define RandomProtocolMinorVersion   0

Definition at line 72 of file random.c.

Referenced by AcquireRandomInfo().


Function Documentation

MagickExport double GetPseudoRandomValue ( RandomInfo random_info)
MagickExport StringInfo* GetRandomKey ( RandomInfo random_info,
const size_t  length 
)

Definition at line 643 of file random.c.

References AcquireStringInfo(), SetRandomKey(), and GetStringInfoDatum().

Referenced by AcquireRandomInfo(), and AcquireUniqueFileResource().

MagickExport double GetRandomValue ( RandomInfo random_info)

Definition at line 675 of file random.c.

References SetRandomKey().

static void IncrementRandomNonce ( StringInfo nonce) [inline, static]

Definition at line 794 of file random.c.

References GetStringInfoDatum(), GetStringInfoLength(), ThrowFatalException, and RandomFatalError.

Referenced by SetRandomKey().

static size_t MagickMin ( const size_t  x,
const size_t  y 
) [inline, static]

Definition at line 157 of file random.c.

Referenced by AcquireRandomInfo().

MagickPrivate MagickBooleanType RandomComponentGenesis ( void  )

Definition at line 707 of file random.c.

References AcquireSemaphoreInfo(), random_semaphore, and MagickTrue.

Referenced by MagickCoreGenesis().

MagickPrivate void RandomComponentTerminus ( void  )

Definition at line 731 of file random.c.

References random_semaphore, AcquireSemaphoreInfo(), and DestroySemaphoreInfo().

Referenced by MagickCoreTerminus().

static ssize_t ReadRandom ( int  file,
unsigned char *  source,
size_t  length 
) [static]

Definition at line 321 of file random.c.

Referenced by GenerateEntropicChaos().

MagickExport void SeedPseudoRandomGenerator ( const unsigned long  seed)

Definition at line 761 of file random.c.

References random_seed.

MagickExport void SetRandomTrueRandom ( const MagickBooleanType  true_random)

Definition at line 891 of file random.c.

References gather_true_random.


Variable Documentation

char** environ

Referenced by GenerateEntropicChaos().

MagickBooleanType gather_true_random = MagickFalse [static]

Definition at line 130 of file random.c.

Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().

unsigned long random_seed = ~0UL [static]

Definition at line 127 of file random.c.

Referenced by AcquireRandomInfo(), and SeedPseudoRandomGenerator().

Definition at line 124 of file random.c.

Referenced by RandomComponentGenesis(), and RandomComponentTerminus().