[ Assumption in the following text: BIGNUM *foo; ]
I get a little confused by the code I see. It looks like some
functions (for example BN_sqr()) assumes the data in foo->d, from
foo->top+1 to foo->dmax (inclusive), is filled with 0, while others,
like BN_mul(), do not assume that and fill in a lot of 0's. The two
pieces of code that I'm thinking of are:
>From BN_sqr() before I started fiddling:
if (bn_wexpand(a,k*2) == NULL) goto err;
if (bn_wexpand(tmp,k*2) == NULL) goto err;
bn_sqr_recursive(rr->d,a->d,al,tmp->d);
>From BN_mul() before I started fiddling:
bn_wexpand(a,k);
bn_wexpand(b,k);
bn_wexpand(t,k*4);
bn_wexpand(rr,k*4);
for (i=a->top; i<k; i++)
a->d[i]=0;
for (i=b->top; i<k; i++)
b->d[i]=0;
bn_mul_part_recursive(rr->d,a->d,b->d,al-j,j,t->d);
And I'm pretty sure that at least bn_sqr_recursive assumes the part of
a->d starting at a->d[al] is 0-filled...
So, what's the deal with this? What are the real guarantees? Or, if
I'm missing something (by not readin enough code), please point me in
the right direction, as this is my first real dive in the BIGNUM code
:-).
--
Richard Levitte \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken \ S-168 35 BROMMA \ T: +46-8-26 52 47
Redakteur@Stacken \ SWEDEN \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/
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]
What are the guarantees of the data part of a BIGNUM?
Richard Levitte - VMS Whacker Sun, 12 Nov 2000 08:04:06 -0800
