[squeak-dev] Cryptography: Fortuna>>nextInt:
Gary Chambers
gazzaguru2 at btinternet.com
Tue Jul 6 17:19:10 UTC 2010
Well, wit as used by "old" Crypto package (3.9 era)... still useful in a
general sense to avoid blow-up for large requests.
Was just wondering if the current crypto use (prime generation) would run
into similar problems.
Regards, Gary
----- Original Message -----
From: "C. David Shaffer" <cdshaffer at acm.org>
To: <squeak-dev at lists.squeakfoundation.org>; "Squeak Cryptography"
<cryptography at lists.squeakfoundation.org>
Sent: Tuesday, July 06, 2010 5:52 PM
Subject: Re: [squeak-dev] Cryptography: Fortuna>>nextInt:
> On 07/06/10 12:05, Gary Chambers wrote:
>> Having dealt with rather large encryption keys (2048 bit) here's the
>> fix we've had for Random>>nextInt:
>>
>> nextInt: anInteger
>> "Answer a random integer in the interval [1, anInteger].
>> Handle large numbers too (for cryptography)."
>>
>> anInteger strictlyPositive ifFalse: [ self error: 'Range must be
>> positive' ].
>> anInteger asFloat isInfinite
>> ifTrue: [^(self next asFraction * anInteger) truncated + 1].
>> ^ (self next * anInteger) truncated + 1
>>
>> Regards, Gary
>>
>
> This looks like a proposed patch to the base image's Random.
> Cryptography doesn't use this random generator. Maybe this should be
> added to the source.squeak.org inbox?
>
> David
>
More information about the Squeak-dev
mailing list
|