MagickCore
7.0.0
|
#include "MagickCore/studio.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/memory_.h"
#include "MagickCore/semaphore.h"
#include "MagickCore/random_.h"
#include "MagickCore/random-private.h"
#include "MagickCore/resource_.h"
#include "MagickCore/signature-private.h"
#include "MagickCore/string_.h"
#include "MagickCore/thread_.h"
#include "MagickCore/thread-private.h"
#include "MagickCore/utility.h"
#include "MagickCore/utility-private.h"
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 |
Variables | |
char ** | environ |
static SemaphoreInfo * | random_semaphore = (SemaphoreInfo *) NULL |
static unsigned long | secret_key = ~0UL |
static MagickBooleanType | gather_true_random = MagickFalse |
#define MaxEntropyExtent 64 |
Referenced by GenerateEntropicChaos().
#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().
MagickExport RandomInfo* AcquireRandomInfo | ( | void | ) |
Definition at line 167 of file random.c.
References AcquireMagickMemory(), AcquireSignatureInfo(), AcquireStringInfo(), AllocateSemaphoreInfo(), CopyMagickMemory(), DestroySignatureInfo(), DestroyStringInfo(), FinalizeSignature(), GenerateEntropicChaos(), GetRandomKey(), GetSignatureDigest(), GetSignatureDigestsize(), GetStringInfoDatum(), GetStringInfoLength(), InitializeSignature(), MagickMin(), MagickSignature, _RandomInfo::nonce, _RandomInfo::normalize, _RandomInfo::protocol_major, _RandomInfo::protocol_minor, random_info, RandomProtocolMajorVersion, RandomProtocolMinorVersion, _RandomInfo::reservoir, ResetMagickMemory(), ResetStringInfo(), ResourceLimitFatalError, _RandomInfo::secret_key, secret_key, _RandomInfo::seed, _RandomInfo::semaphore, SetStringInfo(), SetStringInfoDatum(), SetStringInfoLength(), _RandomInfo::signature, _RandomInfo::signature_info, ThrowFatalException, _RandomInfo::timestamp, and UpdateSignature().
Referenced by AcquireFxInfo(), AcquireRandomInfoThreadSet(), AcquireUniqueFileResource(), DistributePixelCacheClient(), GetVirtualPixelsFromNexus(), PlasmaImage(), and ShredFile().
MagickExport RandomInfo* DestroyRandomInfo | ( | RandomInfo * | random_info | ) |
Definition at line 279 of file random.c.
References DestroySemaphoreInfo(), DestroySignatureInfo(), DestroyStringInfo(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickSignature, _RandomInfo::nonce, RelinquishMagickMemory(), _RandomInfo::reservoir, ResetMagickMemory(), _RandomInfo::seed, _RandomInfo::semaphore, _RandomInfo::signature, _RandomInfo::signature_info, TraceEvent, and UnlockSemaphoreInfo().
Referenced by DestroyFxInfo(), DestroyPixelCache(), DestroyRandomInfoThreadSet(), DistributePixelCacheClient(), PlasmaImage(), ResourceComponentTerminus(), and ShredFile().
|
static |
Definition at line 352 of file random.c.
References AcquireString(), AcquireStringInfo(), ConcatenateStringInfo(), ConstantString(), DestroyString(), DestroyStringInfo(), environ, gather_true_random, GetMagickThreadId(), GetStringInfoDatum(), LockSemaphoreInfo(), MagickFalse, MaxEntropyExtent, O_BINARY, open_utf8(), ReadRandom(), remove_utf8(), _RandomInfo::semaphore, SetStringInfoDatum(), SetStringInfoLength(), StringToStringInfo(), and UnlockSemaphoreInfo().
Referenced by AcquireRandomInfo().
MagickExport double GetPseudoRandomValue | ( | RandomInfo * | random_info | ) |
Definition at line 604 of file random.c.
References _RandomInfo::normalize, and _RandomInfo::seed.
Referenced by FxEvaluateSubexpression(), GenerateDifferentialNoise(), PlasmaPixel(), RandomThresholdImage(), RandomX(), RandomY(), SketchImage(), and SpreadImage().
MagickExport StringInfo* GetRandomKey | ( | RandomInfo * | random_info, |
const size_t | length | ||
) |
Definition at line 648 of file random.c.
References AcquireStringInfo(), GetStringInfoDatum(), and SetRandomKey().
Referenced by AcquireRandomInfo(), AcquireUniqueFileResource(), DistributePixelCacheClient(), and ShredFile().
MagickExport unsigned long GetRandomSecretKey | ( | const RandomInfo * | random_info | ) |
Definition at line 681 of file random.c.
References _RandomInfo::secret_key.
Referenced by AddNoiseImage(), EvaluateImage(), EvaluateImages(), RandomThresholdImage(), SketchImage(), and SpreadImage().
MagickExport double GetRandomValue | ( | RandomInfo * | random_info | ) |
Definition at line 706 of file random.c.
References SetRandomKey().
|
inlinestatic |
Definition at line 797 of file random.c.
References GetStringInfoDatum(), GetStringInfoLength(), RandomFatalError, and ThrowFatalException.
Referenced by SetRandomKey().
|
inlinestatic |
Definition at line 160 of file random.c.
Referenced by AcquireRandomInfo().
MagickPrivate MagickBooleanType RandomComponentGenesis | ( | void | ) |
Definition at line 738 of file random.c.
References AcquireSemaphoreInfo(), MagickTrue, and random_semaphore.
Referenced by MagickCoreGenesis().
MagickPrivate void RandomComponentTerminus | ( | void | ) |
Definition at line 762 of file random.c.
References AcquireSemaphoreInfo(), DestroySemaphoreInfo(), and random_semaphore.
Referenced by MagickCoreTerminus().
|
static |
Definition at line 325 of file random.c.
Referenced by GenerateEntropicChaos().
MagickExport void SetRandomKey | ( | RandomInfo * | random_info, |
const size_t | length, | ||
unsigned char * | key | ||
) |
Definition at line 815 of file random.c.
References CopyMagickMemory(), FinalizeSignature(), GetSignatureDigest(), GetSignatureDigestsize(), GetStringInfoDatum(), _RandomInfo::i, IncrementRandomNonce(), InitializeSignature(), LockSemaphoreInfo(), _RandomInfo::nonce, _RandomInfo::reservoir, _RandomInfo::semaphore, SetStringInfo(), _RandomInfo::signature_info, UnlockSemaphoreInfo(), and UpdateSignature().
Referenced by GetRandomKey(), and GetRandomValue().
MagickExport void SetRandomSecretKey | ( | const unsigned long | key | ) |
Definition at line 892 of file random.c.
References secret_key.
MagickExport void SetRandomTrueRandom | ( | const MagickBooleanType | true_random | ) |
Definition at line 921 of file random.c.
References gather_true_random.
char** environ |
Referenced by GenerateEntropicChaos().
|
static |
Definition at line 133 of file random.c.
Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().
|
static |
Definition at line 127 of file random.c.
Referenced by RandomComponentGenesis(), and RandomComponentTerminus().
|
static |
Definition at line 130 of file random.c.
Referenced by AcquireRandomInfo(), and SetRandomSecretKey().