Remove two bn_wexpand() from BN_mul(), which is a step toward getting
authorRichard Levitte <levitte@openssl.org>
Sat, 18 Nov 2000 22:58:26 +0000 (22:58 +0000)
committerRichard Levitte <levitte@openssl.org>
Sat, 18 Nov 2000 22:58:26 +0000 (22:58 +0000)
commitbaa257f1ed218c28d4db43e3cd2034d8da17bc09
tree5142fb70a6018f3e59d82a721d1ade6082c11ce0
parente06cc5711839b3c78df1abe050659b740c167935
Remove two bn_wexpand() from BN_mul(), which is a step toward getting
BN_mul() correctly constified, avoids two realloc()'s that aren't
really necessary and saves memory to boot.  This required a small
change in bn_mul_part_recursive() and the addition of variants of
bn_cmp_words(), bn_add_words() and bn_sub_words() that can take arrays
with differing sizes.

The test results show a performance that very closely matches the
original code from before my constification.  This may seem like a
very small win from a performance point of view, but if one remembers
that the variants of bn_cmp_words(), bn_add_words() and bn_sub_words()
are not at all optimized for the moment (and there's no corresponding
assembler code), and that their use may be just as non-optimal, I'm
pretty confident there are possibilities...

This code needs reviewing!
CHANGES
crypto/bn/bn_mul.c