On Fri, Nov 03, 2000 at 09:16:56AM +0000, Ben Laurie wrote:
> Richard Levitte - VMS Whacker wrote:
>> I tried to constify the BIGNUM arguments to a few BN functions, among
>> others BN_mul() (all but r). However, in BN_mul(), there's the
>> BN_RECURSION case that will only occur when the lengths of a and b are
>> 1 word from each other (if I understand correctly), and where a and b
>> get expanded so the get the same length.
>>
>> I wonder, how much do we gain from BN_RECURSION? Could the whole
>> thing be done in a way that doesn't need expanding a or b, so they can
>> be const?
> Woah! Let's not get carried away - unless they gain is actually zero,
> then constification is not justification, in itself, for doing this.
> Note, you could have a constified version that either didn't do
> BN_RECURSION or copied instead of expanding.
I think copying wouldn't be the way to do it -- rather, merely check
if the BIGNUM is already large enough and has the extra word set to 0.
Just if this is not the case, copying may make sense.
And usually, the numbers will be of the same size anyway (unless the
size difference is so large that the recursive algorithm is not
enabled anyway).
--
Bodo M�ller <[EMAIL PROTECTED]>
PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html
* TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt
* Tel. +49-6151-16-6628, Fax +49-6151-16-6036
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]