MagickCore  7.0.7
Convert, Edit, Or Compose Bitmap Images
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

◆ MaxEntropyExtent

#define MaxEntropyExtent   64

Referenced by GenerateEntropicChaos().

◆ PseudoRandomHash

#define PseudoRandomHash   SHA256Hash

Definition at line 69 of file random.c.

◆ RandomEntropyLevel

#define RandomEntropyLevel   9

Definition at line 70 of file random.c.

◆ RandomFilename

#define RandomFilename   "reservoir.xdm"

Definition at line 71 of file random.c.

◆ RandomFiletype

#define RandomFiletype   "random"

Definition at line 72 of file random.c.

◆ RandomProtocolMajorVersion

#define RandomProtocolMajorVersion   1

Definition at line 73 of file random.c.

Referenced by AcquireRandomInfo().

◆ RandomProtocolMinorVersion

#define RandomProtocolMinorVersion   0

Definition at line 74 of file random.c.

Referenced by AcquireRandomInfo().

Function Documentation

◆ AcquireRandomInfo()

◆ DestroyRandomInfo()

◆ GenerateEntropicChaos()

◆ GetPseudoRandomValue()

◆ GetRandomInfoNormalize()

MagickPrivate double GetRandomInfoNormalize ( const RandomInfo random_info)

Definition at line 652 of file random.c.

References _RandomInfo::normalize.

◆ GetRandomInfoSeed()

MagickPrivate unsigned long* GetRandomInfoSeed ( RandomInfo random_info)

Definition at line 680 of file random.c.

References _RandomInfo::seed.

◆ GetRandomKey()

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

◆ GetRandomSecretKey()

MagickExport unsigned long GetRandomSecretKey ( const RandomInfo random_info)

◆ GetRandomValue()

MagickExport double GetRandomValue ( RandomInfo random_info)

Definition at line 768 of file random.c.

References SetRandomKey().

◆ IncrementRandomNonce()

static void IncrementRandomNonce ( StringInfo nonce)
inlinestatic

◆ RandomComponentGenesis()

MagickPrivate MagickBooleanType RandomComponentGenesis ( void  )

Definition at line 800 of file random.c.

References AcquireSemaphoreInfo(), MagickTrue, and random_semaphore.

Referenced by MagickCoreGenesis().

◆ RandomComponentTerminus()

MagickPrivate void RandomComponentTerminus ( void  )

Definition at line 825 of file random.c.

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

Referenced by MagickCoreTerminus().

◆ ReadRandom()

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

Definition at line 320 of file random.c.

Referenced by GenerateEntropicChaos().

◆ SetRandomKey()

◆ SetRandomSecretKey()

MagickExport void SetRandomSecretKey ( const unsigned long  key)

Definition at line 955 of file random.c.

References _RandomInfo::secret_key.

◆ SetRandomTrueRandom()

MagickExport void SetRandomTrueRandom ( const MagickBooleanType  true_random)

Definition at line 984 of file random.c.

References gather_true_random.

Variable Documentation

◆ environ

char** environ

Referenced by GenerateEntropicChaos().

◆ gather_true_random

MagickBooleanType gather_true_random = MagickFalse
static

Definition at line 137 of file random.c.

Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().

◆ random_semaphore

SemaphoreInfo* random_semaphore = (SemaphoreInfo *) NULL
static

Definition at line 131 of file random.c.

Referenced by RandomComponentGenesis(), and RandomComponentTerminus().

◆ secret_key

unsigned long secret_key = ~0UL
static

Definition at line 134 of file random.c.