|
MagickCore
6.7.5
|
#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 |
Defines | |
| #define | PseudoRandomHash SHA256Hash |
| #define | RandomEntropyLevel 9 |
| #define | RandomFilename "reservoir.xdm" |
| #define | RandomFiletype "random" |
| #define | RandomProtocolMajorVersion 1 |
| #define | RandomProtocolMinorVersion 0 |
| #define | MaxEntropyExtent 64 |
Functions | |
| static StringInfo * | GenerateEntropicChaos (RandomInfo *) |
| static size_t | MagickMin (const size_t x, const size_t y) |
| 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 *random_info) |
| MagickExport StringInfo * | GetRandomKey (RandomInfo *random_info, const size_t length) |
| MagickExport double | GetRandomValue (RandomInfo *random_info) |
| MagickPrivate MagickBooleanType | RandomComponentGenesis (void) |
| MagickPrivate void | RandomComponentTerminus (void) |
| MagickExport void | SeedPseudoRandomGenerator (const unsigned long seed) |
| static void | IncrementRandomNonce (StringInfo *nonce) |
| MagickExport void | SetRandomKey (RandomInfo *random_info, const size_t length, unsigned char *key) |
| MagickExport void | SetRandomTrueRandom (const MagickBooleanType true_random) |
Variables | |
| char ** | environ |
| static SemaphoreInfo * | random_semaphore = (SemaphoreInfo *) NULL |
| static unsigned long | random_seed = ~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 164 of file random.c.
References random_info, AcquireMagickMemory(), ThrowFatalException, ResourceLimitFatalError, ResetMagickMemory(), _RandomInfo::signature_info, AcquireSignatureInfo(), _RandomInfo::nonce, AcquireStringInfo(), GetSignatureDigestsize(), ResetStringInfo(), _RandomInfo::reservoir, _RandomInfo::normalize, _RandomInfo::semaphore, AllocateSemaphoreInfo(), _RandomInfo::protocol_major, RandomProtocolMajorVersion, _RandomInfo::protocol_minor, RandomProtocolMinorVersion, _RandomInfo::timestamp, _RandomInfo::signature, MagickSignature, GenerateEntropicChaos(), InitializeSignature(), UpdateSignature(), FinalizeSignature(), SetStringInfoLength(), SetStringInfo(), GetSignatureDigest(), DestroyStringInfo(), random_seed, GetRandomKey(), CopyMagickMemory(), _RandomInfo::seed, GetStringInfoDatum(), GetStringInfoLength(), SetStringInfoDatum(), MagickMin(), and DestroySignatureInfo().
Referenced by GetVirtualPixelsFromNexus(), AcquireFxInfo(), PlasmaImage(), AcquireRandomInfoThreadSet(), and AcquireUniqueFileResource().
| MagickExport RandomInfo* DestroyRandomInfo | ( | RandomInfo * | random_info | ) |
Definition at line 275 of file random.c.
References LogMagickEvent(), TraceEvent, GetMagickModule, _RandomInfo::signature, MagickSignature, LockSemaphoreInfo(), _RandomInfo::semaphore, _RandomInfo::reservoir, DestroyStringInfo(), _RandomInfo::nonce, _RandomInfo::signature_info, DestroySignatureInfo(), ResetMagickMemory(), _RandomInfo::seed, UnlockSemaphoreInfo(), DestroySemaphoreInfo(), and RelinquishMagickMemory().
Referenced by DestroyPixelCache(), DestroyFxInfo(), PlasmaImage(), DestroyRandomInfoThreadSet(), and ResourceComponentTerminus().
| static StringInfo * GenerateEntropicChaos | ( | RandomInfo * | random_info | ) | [static] |
Definition at line 348 of file random.c.
References AcquireStringInfo(), LockSemaphoreInfo(), _RandomInfo::semaphore, SetStringInfoDatum(), ConcatenateStringInfo(), SetStringInfoLength(), GetMagickThreadId(), ConstantString(), O_BINARY, remove_utf8(), DestroyString(), MaxEntropyExtent, GetStringInfoDatum(), environ, AcquireString(), StringToStringInfo(), DestroyStringInfo(), open_utf8(), ReadRandom(), gather_true_random, MagickFalse, and UnlockSemaphoreInfo().
Referenced by AcquireRandomInfo().
| MagickExport double GetPseudoRandomValue | ( | RandomInfo * | random_info | ) |
Definition at line 599 of file random.c.
References _RandomInfo::seed, and _RandomInfo::normalize.
Referenced by RandomX(), RandomY(), SpreadImage(), FxEvaluateSubexpression(), PlasmaPixel(), SketchImage(), GenerateDifferentialNoise(), and RandomThresholdImage().
| MagickExport StringInfo* GetRandomKey | ( | RandomInfo * | random_info, |
| const size_t | length | ||
| ) |
Definition at line 643 of file random.c.
References AcquireStringInfo(), SetRandomKey(), and GetStringInfoDatum().
Referenced by AcquireRandomInfo(), and AcquireUniqueFileResource().
| MagickExport double GetRandomValue | ( | RandomInfo * | random_info | ) |
Definition at line 675 of file random.c.
References SetRandomKey().
| static void IncrementRandomNonce | ( | StringInfo * | nonce | ) | [inline, static] |
Definition at line 794 of file random.c.
References GetStringInfoDatum(), GetStringInfoLength(), ThrowFatalException, and RandomFatalError.
Referenced by SetRandomKey().
| static size_t MagickMin | ( | const size_t | x, |
| const size_t | y | ||
| ) | [inline, static] |
Definition at line 157 of file random.c.
Referenced by AcquireRandomInfo().
| MagickPrivate MagickBooleanType RandomComponentGenesis | ( | void | ) |
Definition at line 707 of file random.c.
References AcquireSemaphoreInfo(), random_semaphore, and MagickTrue.
Referenced by MagickCoreGenesis().
| MagickPrivate void RandomComponentTerminus | ( | void | ) |
Definition at line 731 of file random.c.
References random_semaphore, AcquireSemaphoreInfo(), and DestroySemaphoreInfo().
Referenced by MagickCoreTerminus().
| static ssize_t ReadRandom | ( | int | file, |
| unsigned char * | source, | ||
| size_t | length | ||
| ) | [static] |
Definition at line 321 of file random.c.
Referenced by GenerateEntropicChaos().
| MagickExport void SeedPseudoRandomGenerator | ( | const unsigned long | seed | ) |
Definition at line 761 of file random.c.
References random_seed.
| MagickExport void SetRandomKey | ( | RandomInfo * | random_info, |
| const size_t | length, | ||
| unsigned char * | key | ||
| ) |
Definition at line 812 of file random.c.
References LockSemaphoreInfo(), _RandomInfo::semaphore, _RandomInfo::signature_info, GetStringInfoDatum(), _RandomInfo::reservoir, _RandomInfo::i, GetSignatureDigestsize(), InitializeSignature(), UpdateSignature(), _RandomInfo::nonce, FinalizeSignature(), IncrementRandomNonce(), CopyMagickMemory(), GetSignatureDigest(), SetStringInfo(), and UnlockSemaphoreInfo().
Referenced by GetRandomKey(), and GetRandomValue().
| MagickExport void SetRandomTrueRandom | ( | const MagickBooleanType | true_random | ) |
Definition at line 891 of file random.c.
References gather_true_random.
| char** environ |
Referenced by GenerateEntropicChaos().
MagickBooleanType gather_true_random = MagickFalse [static] |
Definition at line 130 of file random.c.
Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().
unsigned long random_seed = ~0UL [static] |
Definition at line 127 of file random.c.
Referenced by AcquireRandomInfo(), and SeedPseudoRandomGenerator().
SemaphoreInfo* random_semaphore = (SemaphoreInfo *) NULL [static] |
Definition at line 124 of file random.c.
Referenced by RandomComponentGenesis(), and RandomComponentTerminus().