FWIW DigitalSignalAlgorithm>>remainder:mod: fails in the same way on a 2.7 image and VM. Test code following reproduces the error:
dsa _ DigitalSignatureAlgorithm new initRandom: 3073858295119816861619518188919816443211816758784546085350209989871066306407 0074149469027751252808366839610325226801786119623563694795185024364922876162 51. x _ 1. y _ 1456264555551690166006364982944671635636330287773. val _ dsa remainder: x mod: y.
Bob Jarvis Compuware @ Timken
-----Original Message----- From: JArchibald@aol.com [mailto:JArchibald@aol.com] Sent: Tuesday, May 30, 2000 2:25 PM To: sr@evolgo.de; squeak@cs.uiuc.edu Subject: Re: [BUG] DSA failure in LargePositiveInteger in #new: <primitive: 71>
=> 5/30/00 11:29:21 AM EDT, sr@evolgo.de => << Could you please - by using the debugger - take a view into this method and look for the argument of this >>new: here? >>
Stephan,
Okay, here are the gory details (and they are very gory indeed).
When I run DigitalSignatureAlgorithm>>generateKeySet, I get an error in Behavior>>new: with the following walk-back:
Error: a primitive has failed
LargePositiveInteger class(Object)>>error: LargePositiveInteger class(Object)>>primitiveFailed LargePositiveInteger class(Behavior)>>new: DigitalSignatureAlgorithm>>remainder:mod: DigitalSignatureAlgorithm>>isProbablyPrime: DigitalSignatureAlgorithm>>generateSandQ DigitalSignatureAlgorithm>>generateQandP DigitalSignatureAlgorithm>>generateKeySet DigitalSignatureAlgorithm class>>generateKeySet UndefinedObject>>DoIt
in method DigitalSignatureAlgorithm>>remainder:mod: the run-down at the time of failure for local variables is:
instance variables: randKey =>
30738582951198168616195181889198164432118167587845460853502099 8987106630640700 74149469027751252808366839610325226801786119623563694795185024 36492287616251 (class LargePositiveInteger) randSeed => 1369035390015187928040555654137399981674798064385 (class LargePositiveInteger)
arguments: x => 1 (class SmallInteger) y => 1456264555551690166006364982944671635636330287773 (class LargePositiveInteger)
temporaries: remainder => 01 (class LargePositiveInteger, size = 2) divisor => 1456264555551690166006364982944671635636330287773 (class LargePositiveInteger) shift => 0 (class SmallInteger) quotient => nil (class UndefinedObject)
and the argument to LargePositiveInteger>>new: is -18 (in statement mentioned in next paragraph). LargePositiveInteger>>new: works only if the parameter to #new: is >= 0. Since we are getting a negative value there, something in the new implementation of LargeInteger is causing this routine to go whacko.
These are some very big numbers. Not as big as those I got in other tests mentioned in previous E-mails, but big enough. In any case, the body of DigitalSignatureAlgorithm>>remainder:mod: is attempting to do an Integer>>new: with a negative parameter in statement quotient _ LargePositiveInteger new: remainder digitLength - divisor digitLength. There are a number of numeric operations in that routine prior to this statement, and my suspicion is that one of them is behaving badly.
BTW (world), who did the DSA stuff?
Still sincerely lost, Jerry. ____________________________
Jerry L. Archibald systemObjectivesIncorporated ____________________________
"Knowledge is something that you can use, Belief is something that uses you." Idries Shah
squeak-dev@lists.squeakfoundation.org