MagickCore
7.0.11
|
#include "MagickCore/studio.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/image-private.h"
#include "MagickCore/memory_.h"
#include "MagickCore/memory-private.h"
#include "MagickCore/random_.h"
#include "MagickCore/random-private.h"
#include "MagickCore/resource_.h"
#include "MagickCore/semaphore.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 |
#define | RandomROTL(x, k) (((x) << (k)) | ((x) >> (64-(k)))) |
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 73 of file random.c.
Referenced by AcquireRandomInfo().
#define RandomProtocolMinorVersion 0 |
Definition at line 74 of file random.c.
Referenced by AcquireRandomInfo().
#define RandomROTL | ( | x, | |
k | |||
) | (((x) << (k)) | ((x) >> (64-(k)))) |
Referenced by GetPseudoRandomValue().
MagickExport RandomInfo* AcquireRandomInfo | ( | void | ) |
Definition at line 163 of file random.c.
References AcquireCriticalMemory(), AcquireSemaphoreInfo(), AcquireSignatureInfo(), AcquireStringInfo(), DestroySignatureInfo(), DestroyStringInfo(), FinalizeSignature(), GenerateEntropicChaos(), GetRandomKey(), GetSignatureDigest(), GetSignatureDigestsize(), GetStringInfoDatum(), InitializeSignature(), MagickCoreSignature, MagickMin, MagickULLConstant, _RandomInfo::nonce, _RandomInfo::normalize, _RandomInfo::protocol_major, _RandomInfo::protocol_minor, random_info, RandomProtocolMajorVersion, RandomProtocolMinorVersion, _RandomInfo::reservoir, 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(), GetVirtualPixelCacheNexus(), KmeansImage(), PlasmaImage(), and ShredFile().
MagickExport RandomInfo* DestroyRandomInfo | ( | RandomInfo * | random_info | ) |
Definition at line 274 of file random.c.
References DestroySignatureInfo(), DestroyStringInfo(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, _RandomInfo::nonce, random_info, RelinquishMagickMemory(), RelinquishSemaphoreInfo(), _RandomInfo::reservoir, _RandomInfo::seed, _RandomInfo::semaphore, _RandomInfo::signature, _RandomInfo::signature_info, TraceEvent, and UnlockSemaphoreInfo().
Referenced by DestroyFxInfo(), DestroyPixelCache(), DestroyRandomInfoThreadSet(), KmeansImage(), PlasmaImage(), ResourceComponentTerminus(), and ShredFile().
|
static |
Definition at line 347 of file random.c.
References AcquireString(), AcquireStringInfo(), ConcatenateStringInfo(), DestroyString(), DestroyStringInfo(), environ, gather_true_random, GetMagickThreadId(), GetStringInfoDatum(), LockSemaphoreInfo(), MagickFalse, MaxEntropyExtent, O_BINARY, open_utf8(), random_info, ReadRandom(), _RandomInfo::semaphore, SetStringInfoDatum(), SetStringInfoLength(), StringToStringInfo(), and UnlockSemaphoreInfo().
Referenced by AcquireRandomInfo().
MagickExport double GetPseudoRandomValue | ( | RandomInfo *magick_restrict | random_info | ) |
Definition at line 584 of file random.c.
References _RandomInfo::normalize, random_info, RandomROTL, and _RandomInfo::seed.
Referenced by FxEvaluateSubexpression(), GenerateDifferentialNoise(), PlasmaPixel(), RandomThresholdImage(), RandomX(), RandomY(), SketchImage(), and SpreadImage().
MagickPrivate double GetRandomInfoNormalize | ( | const RandomInfo * | random_info | ) |
Definition at line 624 of file random.c.
References _RandomInfo::normalize, and random_info.
MagickPrivate unsigned long* GetRandomInfoSeed | ( | RandomInfo * | random_info | ) |
Definition at line 652 of file random.c.
References random_info, and _RandomInfo::seed.
MagickExport StringInfo* GetRandomKey | ( | RandomInfo * | random_info, |
const size_t | length | ||
) |
Definition at line 682 of file random.c.
References AcquireStringInfo(), GetStringInfoDatum(), random_info, and SetRandomKey().
Referenced by AcquireRandomInfo(), AcquireUniqueFileResource(), and ShredFile().
MagickExport unsigned long GetRandomSecretKey | ( | const RandomInfo * | random_info | ) |
Definition at line 715 of file random.c.
References random_info, and _RandomInfo::secret_key.
Referenced by AddNoiseImage(), EvaluateImage(), EvaluateImages(), RandomThresholdImage(), SketchImage(), and SpreadImage().
MagickExport double GetRandomValue | ( | RandomInfo * | random_info | ) |
Definition at line 740 of file random.c.
References random_info, and SetRandomKey().
|
inlinestatic |
Definition at line 832 of file random.c.
References GetStringInfoDatum(), GetStringInfoLength(), RandomFatalError, and ThrowFatalException.
Referenced by SetRandomKey().
MagickPrivate MagickBooleanType RandomComponentGenesis | ( | void | ) |
Definition at line 772 of file random.c.
References AcquireSemaphoreInfo(), MagickTrue, and random_semaphore.
Referenced by MagickCoreGenesis().
MagickPrivate void RandomComponentTerminus | ( | void | ) |
Definition at line 797 of file random.c.
References ActivateSemaphoreInfo(), random_semaphore, and RelinquishSemaphoreInfo().
Referenced by MagickCoreTerminus().
|
static |
Definition at line 320 of file random.c.
Referenced by GenerateEntropicChaos().
MagickExport void SetRandomKey | ( | RandomInfo * | random_info, |
const size_t | length, | ||
unsigned char * | key | ||
) |
Definition at line 850 of file random.c.
References FinalizeSignature(), GetSignatureDigest(), GetSignatureDigestsize(), GetStringInfoDatum(), _RandomInfo::i, IncrementRandomNonce(), InitializeSignature(), LockSemaphoreInfo(), _RandomInfo::nonce, random_info, _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 927 of file random.c.
References secret_key.
MagickExport void SetRandomTrueRandom | ( | const MagickBooleanType | true_random | ) |
Definition at line 956 of file random.c.
References gather_true_random.
char** environ |
Referenced by GenerateEntropicChaos().
|
static |
Definition at line 137 of file random.c.
Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().
|
static |
Definition at line 131 of file random.c.
Referenced by RandomComponentGenesis(), and RandomComponentTerminus().
|
static |
Definition at line 134 of file random.c.
Referenced by AcquireRandomInfo(), and SetRandomSecretKey().