[BUG] DSA failure in LargePositiveInteger in #new: <primitive: 71>

Stephan Rudlof sr at evolgo.de
Tue May 30 20:56:18 UTC 2000


Bob Arning wrote:
> 
> On Tue, 30 May 2000 20:47:09 +0200 Stephan Rudlof <sr at evolgo.de> wrote:
> >It would be interesting to implement the DSA algorithm in plain ST by
> >using - indirectly by arithmetic operations - the LargeIntegers module
> >and *not* using the DSA module. Then to compare the speed of this
> >implementation with - an older running - DSA module using
> >implementation.
> 
> I took three of the existing routines that compared DSA math to Squeak math and converted them to run either one or the other. Here are the results
> 
> the dsa plugin results:
> 100,000  multiply took 11,751 ms
> 100,000  remainder took 14,296 ms
> 100,000  divide took 15,318 ms
> 
> the large integer plugin results:
> 100,000  multiply took 10,600 ms
> 100,000  remainder took 16,298 ms
> 100,000  divide took 20,248 ms
> 
> Note that each iteration of the loop above includes the creation of new random input numbers. With that moved outside the loop (and hoping that neither plugin is particularly sensitive to the exact data used) reveals:
> 
> dsa plugin
> 100,000  multiply took 1,656 ms
> 100,000  remainder took 3,546 ms
> 100,000  divide took 4,577 ms
> 
> integer plugin
> 100,000  multiply took 1,142 ms
> 100,000  remainder took 5,986 ms
> 100,000  divide took 9,565 ms
> 
> The integer plugin times are considerably longer since I included both c // d and c \\ d to parallel the fact that DSA returns both when doing a divide.

Using - private - method Integer>>digitDiv:neg: directly should speed
this up, because it returns an Array with quotient and remainder; but
only with normalized LargeIntegers!

Stephan

> 
> I have also modified the normal DSA methods to use standard Squeak arithmetic, but beyond the single test "DigitalSignatureAlgorithm example" which was successful, I'm not sure how else to validate the changes.
> 
> Cheers,
> Bob

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list