In message <[EMAIL PROTECTED]> on Sat, 12 Oct 2002 11:04:56 
-0700, David Brumley <[EMAIL PROTECTED]> said:

dbrumley> > dbrumley> The problem seems to be manifested in BN_dec2bn() because of
dbrumley> > dbrumley> the BN_mul_words and BN_add_words (e.g. line b).  Since the
dbrumley> > dbrumley> upper parts of d aren't cleared out, those routines end up
dbrumley> > dbrumley> adding to whatever junk happened to be left in d from the
dbrumley> > dbrumley> previous iteration.
dbrumley> >
dbrumley> > Perhaps there's a bug in those.
dbrumley> >
dbrumley> > Can you send us a small piece of code that actually shows the problem?
dbrumley> > Please send us the result that you get, so we can compare.
dbrumley> 
dbrumley> The following program with the attached input file gives the
dbrumley> problem.  The output doesn't match the input when ran (which
dbrumley> it should).

Thanks, I found the bug.  It seems like BN_add_word() (and
BN_mul_word()) advances top without zeroing the next word.  The result
is that the value of that next word gets added to whatever is given as
the next word to add.  The simplest (and fastest, I believe) way to
handle that is to have those functions zero the next word if top
advances.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-168 35  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to