From: cristy Date: Sat, 14 Apr 2012 01:44:01 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5813 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baf31e9cff9583839ab6a23eaa57036beb1814ef;p=imagemagick --- diff --git a/MagickCore/random.c b/MagickCore/random.c index 3aed52f22..d5b664d99 100644 --- a/MagickCore/random.c +++ b/MagickCore/random.c @@ -127,7 +127,7 @@ static SemaphoreInfo *random_semaphore = (SemaphoreInfo *) NULL; static unsigned long - random_seed = ~0UL; + secret_key = ~0UL; static MagickBooleanType gather_true_random = MagickFalse; @@ -189,7 +189,7 @@ MagickExport RandomInfo *AcquireRandomInfo(void) random_info->signature_info)); ResetStringInfo(random_info->reservoir); random_info->normalize=1.0/(~0UL); - random_info->secret_key=random_seed; + random_info->secret_key=secret_key; random_info->protocol_major=RandomProtocolMajorVersion; random_info->protocol_minor=RandomProtocolMinorVersion; random_info->semaphore=AllocateSemaphoreInfo(); @@ -771,34 +771,6 @@ MagickPrivate void RandomComponentTerminus(void) % % % % % % -% S e e d P s e u d o R a n d o m G e n e r a t o r % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% SetRandomSecretKey() initializes the pseudo-random number generator -% with a random seed. -% -% The format of the SetRandomSecretKey method is: -% -% void SetRandomSecretKey(const unsigned long seed) -% -% A description of each parameter follows: -% -% o seed: the seed. -% -*/ -MagickExport void SetRandomSecretKey(const unsigned long seed) -{ - random_seed=seed; -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % S e t R a n d o m K e y % % % % % @@ -900,6 +872,33 @@ MagickExport void SetRandomKey(RandomInfo *random_info,const size_t length, % % % % % % +% S e t R a n d o m S e c r e t K e y % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetRandomSecretKey() sets the pseudo-random number generator secret key. +% +% The format of the SetRandomSecretKey method is: +% +% void SetRandomSecretKey(const unsigned long key) +% +% A description of each parameter follows: +% +% o seed: the seed. +% +*/ +MagickExport void SetRandomSecretKey(const unsigned long key) +{ + secret_key=key; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % S e t R a n d o m T r u e R a n d o m % % % % %