random.c File Reference

#include "magick/studio.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/memory_.h"
#include "magick/semaphore.h"
#include "magick/random_.h"
#include "magick/resource_.h"
#include "magick/signature-private.h"
#include "magick/string_.h"
#include "magick/thread_.h"
#include "magick/thread-private.h"
#include "magick/utility.h"
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)
MagickExport MagickBooleanType RandomComponentGenesis (void)
MagickExport 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 65 of file random.c.

#define RandomEntropyLevel   9

Definition at line 66 of file random.c.

#define RandomFilename   "reservoir.xdm"

Definition at line 67 of file random.c.

#define RandomFiletype   "random"

Definition at line 68 of file random.c.

#define RandomProtocolMajorVersion   1

Definition at line 69 of file random.c.

Referenced by AcquireRandomInfo().

#define RandomProtocolMinorVersion   0

Definition at line 70 of file random.c.

Referenced by AcquireRandomInfo().


Function Documentation

MagickExport RandomInfo* AcquireRandomInfo ( void   ) 
MagickExport RandomInfo* DestroyRandomInfo ( RandomInfo random_info  ) 
static StringInfo * GenerateEntropicChaos ( RandomInfo random_info  )  [static]
MagickExport double GetPseudoRandomValue ( RandomInfo random_info  ) 
MagickExport StringInfo* GetRandomKey ( RandomInfo random_info,
const size_t  length 
)

Definition at line 641 of file random.c.

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

Referenced by AcquireRandomInfo(), and AcquireUniqueFileResource().

MagickExport double GetRandomValue ( RandomInfo random_info  ) 

Definition at line 673 of file random.c.

References SetRandomKey().

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

Definition at line 792 of file random.c.

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

Referenced by SetRandomKey().

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

Definition at line 155 of file random.c.

Referenced by AcquireRandomInfo().

MagickExport MagickBooleanType RandomComponentGenesis ( void   ) 

Definition at line 705 of file random.c.

References AcquireSemaphoreInfo(), MagickTrue, and random_semaphore.

Referenced by MagickCoreGenesis().

MagickExport void RandomComponentTerminus ( void   ) 

Definition at line 729 of file random.c.

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

Referenced by MagickCoreTerminus().

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

Definition at line 319 of file random.c.

References read.

Referenced by GenerateEntropicChaos().

MagickExport void SeedPseudoRandomGenerator ( const unsigned long  seed  ) 

Definition at line 759 of file random.c.

References random_seed.

MagickExport void SetRandomKey ( RandomInfo random_info,
const size_t  length,
unsigned char *  key 
)
MagickExport void SetRandomTrueRandom ( const MagickBooleanType  true_random  ) 

Definition at line 889 of file random.c.

References gather_true_random.


Variable Documentation

char** environ

Referenced by GenerateEntropicChaos().

MagickBooleanType gather_true_random = MagickFalse [static]

Definition at line 128 of file random.c.

Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().

unsigned long random_seed = ~0UL [static]

Definition at line 125 of file random.c.

Referenced by AcquireRandomInfo(), and SeedPseudoRandomGenerator().

Definition at line 122 of file random.c.

Referenced by RandomComponentGenesis(), and RandomComponentTerminus().

Generated by  doxygen 1.6.2-20100208