MagickCore  6.9.10
Convert, Edit, Or Compose Bitmap Images
random.c File Reference
Include dependency graph for random.c:

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)
 
MagickExport MagickBooleanType RandomComponentGenesis (void)
 
MagickExport void RandomComponentTerminus (void)
 
static void IncrementRandomNonce (StringInfo *nonce)
 
MagickExport void SetRandomKey (RandomInfo *random_info, const size_t length, unsigned char *key)
 
MagickExport void SeedPseudoRandomGenerator (const unsigned long seed)
 
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

◆ RandomEntropyLevel

#define RandomEntropyLevel   9

◆ RandomFilename

#define RandomFilename   "reservoir.xdm"

◆ RandomFiletype

#define RandomFiletype   "random"

◆ RandomProtocolMajorVersion

#define RandomProtocolMajorVersion   1

Referenced by AcquireRandomInfo().

◆ RandomProtocolMinorVersion

#define RandomProtocolMinorVersion   0

Referenced by AcquireRandomInfo().

Function Documentation

◆ AcquireRandomInfo()

◆ DestroyRandomInfo()

◆ GenerateEntropicChaos()

◆ GetPseudoRandomValue()

◆ GetRandomInfoNormalize()

MagickPrivate double GetRandomInfoNormalize ( const RandomInfo random_info)

◆ GetRandomInfoSeed()

MagickPrivate unsigned long* GetRandomInfoSeed ( RandomInfo random_info)

References _RandomInfo::seed.

Referenced by AcquireRandomInfoThreadSet().

◆ GetRandomKey()

◆ GetRandomSecretKey()

◆ GetRandomValue()

MagickExport double GetRandomValue ( RandomInfo random_info)

References SetRandomKey().

◆ IncrementRandomNonce()

static void IncrementRandomNonce ( StringInfo nonce)
inlinestatic

◆ RandomComponentGenesis()

MagickExport MagickBooleanType RandomComponentGenesis ( void  )

◆ RandomComponentTerminus()

MagickExport void RandomComponentTerminus ( void  )

◆ ReadRandom()

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

Referenced by GenerateEntropicChaos().

◆ SeedPseudoRandomGenerator()

MagickExport void SeedPseudoRandomGenerator ( const unsigned long  seed)

References SetRandomSecretKey().

◆ SetRandomKey()

◆ SetRandomSecretKey()

MagickExport void SetRandomSecretKey ( const unsigned long  key)

◆ SetRandomTrueRandom()

MagickExport void SetRandomTrueRandom ( const MagickBooleanType  true_random)

References gather_true_random.

Variable Documentation

◆ environ

char** environ

Referenced by GenerateEntropicChaos().

◆ gather_true_random

MagickBooleanType gather_true_random = MagickFalse
static

◆ random_semaphore

SemaphoreInfo* random_semaphore = (SemaphoreInfo *) NULL
static

◆ secret_key

unsigned long secret_key = ~0UL
static