#include "magick/studio.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/image-private.h"
#include "magick/memory_.h"
#include "magick/memory-private.h"
#include "magick/random_.h"
#include "magick/resource_.h"
#include "magick/semaphore.h"
#include "magick/signature-private.h"
#include "magick/string_.h"
#include "magick/thread_.h"
#include "magick/thread-private.h"
#include "magick/utility-private.h"
Data Structures | |
struct | _RandomInfo |
Defines | |
#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)))) |
Functions | |
static StringInfo * | GenerateEntropicChaos (RandomInfo *) |
MagickExport RandomInfo * | AcquireRandomInfo (void) |
MagickExport RandomInfo * | DestroyRandomInfo (RandomInfo *random_info) |
static ssize_t | ReadRandom (int file, unsigned char *source, size_t length) |
MagickExport double | GetPseudoRandomValue (RandomInfo *magick_restrict random_info) |
MagickPrivate double | GetRandomInfoNormalize (const RandomInfo *random_info) |
MagickPrivate unsigned long * | GetRandomInfoSeed (RandomInfo *random_info) |
MagickExport StringInfo * | GetRandomKey (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 SemaphoreInfo * | random_semaphore = (SemaphoreInfo *) NULL |
static unsigned long | secret_key = ~0UL |
static MagickBooleanType | gather_true_random = MagickFalse |
#define MaxEntropyExtent 64 |
Referenced by GenerateEntropicChaos().
#define PseudoRandomHash SHA256Hash |
#define RandomEntropyLevel 9 |
#define RandomFilename "reservoir.xdm" |
#define RandomFiletype "random" |
#define RandomProtocolMajorVersion 1 |
Referenced by AcquireRandomInfo().
#define RandomProtocolMinorVersion 0 |
Referenced by AcquireRandomInfo().
#define RandomROTL | ( | x, | |||
k | ) | (((x) << (k)) | ((x) >> (64-(k)))) |
Referenced by GetPseudoRandomValue().
MagickExport RandomInfo* AcquireRandomInfo | ( | void | ) |
References AcquireCriticalMemory(), AcquireSignatureInfo(), AcquireStringInfo(), AllocateSemaphoreInfo(), 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, secret_key, _RandomInfo::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(), GetVirtualPixelCacheNexus(), PlasmaImage(), RandomChannelThresholdImage(), and ShredFile().
MagickExport RandomInfo* DestroyRandomInfo | ( | RandomInfo * | random_info | ) |
References DestroySemaphoreInfo(), DestroySignatureInfo(), DestroyStringInfo(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, _RandomInfo::nonce, RelinquishMagickMemory(), _RandomInfo::reservoir, _RandomInfo::seed, _RandomInfo::semaphore, _RandomInfo::signature, _RandomInfo::signature_info, TraceEvent, and UnlockSemaphoreInfo().
Referenced by DestroyFxInfo(), DestroyPixelCache(), DestroyRandomInfoThreadSet(), DistributePixelCacheClient(), PlasmaImage(), RandomChannelThresholdImage(), ResourceComponentTerminus(), and ShredFile().
static StringInfo * GenerateEntropicChaos | ( | RandomInfo * | random_info | ) | [static] |
References AcquireString(), AcquireStringInfo(), ConcatenateStringInfo(), DestroyString(), DestroyStringInfo(), environ, gather_true_random, GetMagickThreadId(), GetStringInfoDatum(), LockSemaphoreInfo(), MagickFalse, MaxEntropyExtent, O_BINARY, open_utf8(), ReadRandom(), _RandomInfo::semaphore, SetStringInfoDatum(), SetStringInfoLength(), StringToStringInfo(), and UnlockSemaphoreInfo().
Referenced by AcquireRandomInfo().
MagickExport double GetPseudoRandomValue | ( | RandomInfo *magick_restrict | random_info | ) |
References RandomROTL.
Referenced by FxEvaluateSubexpression(), GenerateDifferentialNoise(), PlasmaPixel(), RandomChannelThresholdImage(), RandomThresholdImageChannel(), RandomX(), RandomY(), SketchImage(), and SpreadImage().
MagickPrivate double GetRandomInfoNormalize | ( | const RandomInfo * | random_info | ) |
References _RandomInfo::normalize.
MagickPrivate unsigned long* GetRandomInfoSeed | ( | RandomInfo * | random_info | ) |
References _RandomInfo::seed.
MagickExport StringInfo* GetRandomKey | ( | RandomInfo * | random_info, | |
const size_t | length | |||
) |
References AcquireStringInfo(), GetStringInfoDatum(), and SetRandomKey().
Referenced by AcquireRandomInfo(), AcquireUniqueFileResource(), DistributePixelCacheClient(), and ShredFile().
MagickExport unsigned long GetRandomSecretKey | ( | const RandomInfo * | random_info | ) |
References _RandomInfo::secret_key.
Referenced by AddNoiseImageChannel(), EvaluateImageChannel(), EvaluateImages(), RandomThresholdImageChannel(), SketchImage(), and SpreadImage().
MagickExport double GetRandomValue | ( | RandomInfo * | random_info | ) |
References SetRandomKey().
static void IncrementRandomNonce | ( | StringInfo * | nonce | ) | [inline, static] |
References GetStringInfoDatum(), GetStringInfoLength(), RandomFatalError, and ThrowFatalException.
Referenced by SetRandomKey().
MagickExport MagickBooleanType RandomComponentGenesis | ( | void | ) |
References AllocateSemaphoreInfo(), MagickTrue, and random_semaphore.
Referenced by MagickCoreGenesis().
MagickExport void RandomComponentTerminus | ( | void | ) |
References ActivateSemaphoreInfo(), DestroySemaphoreInfo(), and random_semaphore.
Referenced by MagickCoreTerminus().
static ssize_t ReadRandom | ( | int | file, | |
unsigned char * | source, | |||
size_t | length | |||
) | [static] |
Referenced by GenerateEntropicChaos().
MagickExport void SeedPseudoRandomGenerator | ( | const unsigned long | seed | ) |
References SetRandomSecretKey().
MagickExport void SetRandomKey | ( | RandomInfo * | random_info, | |
const size_t | length, | |||
unsigned char * | key | |||
) |
References 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 | ) |
References secret_key.
Referenced by SeedPseudoRandomGenerator().
MagickExport void SetRandomTrueRandom | ( | const MagickBooleanType | true_random | ) |
References gather_true_random.
char** environ |
Referenced by GenerateEntropicChaos().
MagickBooleanType gather_true_random = MagickFalse [static] |
Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().
SemaphoreInfo* random_semaphore = (SemaphoreInfo *) NULL [static] |
Referenced by RandomComponentGenesis(), and RandomComponentTerminus().
unsigned long secret_key = ~0UL [static] |
Referenced by AcquireRandomInfo(), and SetRandomSecretKey().