Richard Levitte - VMS Whacker <[EMAIL PROTECTED]>:
> Ben Laurie <[EMAIL PROTECTED]>:

>> BTW, Bodo mentioned that dup_expand was dupping regardless of whether it
>> expands - if so, that'll slow it down a lot, I'd guess. Did you fix
>> that?

> Depends on what you mean with "fix".  As it is in the repository right
> now, no.  That's exactly what is required if constness shall be
> perfectly clean, since BN_mul needs to make absolutely sure the extra
> data is 0.  Since the BIGNUM may already be of the correct size
> (remember, top and dmax are not the same thing), there may as well
> some random data in that last word.  The only way to solve that so
> constness wasn't broken was to dup it "needlessly".

That's not the only way.  The other way would be to look if 'dmax'
is large enough and if the additional word contains 0 already
(I didn't check, but it wouldn't be surprising if algorithms
that decrement 'top' because the result of some computation is
smaller than the input values can leave such a zero in place).
But I prefer to keep BN_mul in its original form, without 'const',
and to constify just the higher-level functions such as modular
exponentiation (by copying BIGNUMs where necessary).
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to