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

Go to the source code of this file.

Data Structures

struct  _RandomInfo
 

Macros

#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 *)
 
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)
 
MagickPrivate double GetRandomInfoNormalize (const RandomInfo *random_info)
 
MagickPrivate unsigned long * GetRandomInfoSeed (RandomInfo *random_info)
 
MagickExport StringInfoGetRandomKey (RandomInfo *random_info, const size_t length)
 
MagickExport unsigned long GetRandomSecretKey (const RandomInfo *random_info)
 
MagickExport double GetRandomValue (RandomInfo *random_info)
 
MagickPrivate MagickBooleanType RandomComponentGenesis (void)
 
MagickPrivate void RandomComponentTerminus (void)
 
static void IncrementRandomNonce (StringInfo *nonce)
 
MagickExport void SetRandomKey (RandomInfo *random_info, const size_t length, unsigned char *key)
 
MagickExport void SetRandomSecretKey (const unsigned long key)
 
MagickExport void SetRandomTrueRandom (const MagickBooleanType true_random)
 

Variables

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

Macro Definition Documentation

#define MaxEntropyExtent   64

Referenced by GenerateEntropicChaos().

#define PseudoRandomHash   SHA256Hash

Definition at line 69 of file random.c.

#define RandomEntropyLevel   9

Definition at line 70 of file random.c.

#define RandomFilename   "reservoir.xdm"

Definition at line 71 of file random.c.

#define RandomFiletype   "random"

Definition at line 72 of file random.c.

#define RandomProtocolMajorVersion   1

Definition at line 73 of file random.c.

Referenced by AcquireRandomInfo().

#define RandomProtocolMinorVersion   0

Definition at line 74 of file random.c.

Referenced by AcquireRandomInfo().

Function Documentation

MagickPrivate double GetRandomInfoNormalize ( const RandomInfo random_info)

Definition at line 651 of file random.c.

References _RandomInfo::normalize.

MagickPrivate unsigned long* GetRandomInfoSeed ( RandomInfo random_info)

Definition at line 679 of file random.c.

References _RandomInfo::seed.

MagickExport StringInfo* GetRandomKey ( RandomInfo random_info,
const size_t  length 
)
MagickExport unsigned long GetRandomSecretKey ( const RandomInfo random_info)
MagickExport double GetRandomValue ( RandomInfo random_info)

Definition at line 767 of file random.c.

References SetRandomKey().

static void IncrementRandomNonce ( StringInfo nonce)
inlinestatic

Definition at line 859 of file random.c.

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

Referenced by SetRandomKey().

MagickPrivate MagickBooleanType RandomComponentGenesis ( void  )

Definition at line 799 of file random.c.

References AcquireSemaphoreInfo(), MagickTrue, and random_semaphore.

Referenced by MagickCoreGenesis().

MagickPrivate void RandomComponentTerminus ( void  )

Definition at line 824 of file random.c.

References ActivateSemaphoreInfo(), random_semaphore, and RelinquishSemaphoreInfo().

Referenced by MagickCoreTerminus().

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

Definition at line 319 of file random.c.

Referenced by GenerateEntropicChaos().

MagickExport void SetRandomSecretKey ( const unsigned long  key)

Definition at line 954 of file random.c.

References secret_key.

MagickExport void SetRandomTrueRandom ( const MagickBooleanType  true_random)

Definition at line 983 of file random.c.

References gather_true_random.

Variable Documentation

char** environ

Referenced by GenerateEntropicChaos().

MagickBooleanType gather_true_random = MagickFalse
static

Definition at line 137 of file random.c.

Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().

SemaphoreInfo* random_semaphore = (SemaphoreInfo *) NULL
static

Definition at line 131 of file random.c.

Referenced by RandomComponentGenesis(), and RandomComponentTerminus().

unsigned long secret_key = ~0UL
static

Definition at line 134 of file random.c.

Referenced by AcquireRandomInfo(), and SetRandomSecretKey().