Variety of belt-tightenings in the bignum code. (Please help test this!)
authorGeoff Thorpe <geoff@openssl.org>
Wed, 17 Mar 2004 17:36:54 +0000 (17:36 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Wed, 17 Mar 2004 17:36:54 +0000 (17:36 +0000)
commite042540f6bb0ebd8acf5c2ab0ccd1f14b5fc0f77
tree45cc4498f4011adb6d3a20a608f131b01bcc2c7a
parent4e8172d6dafec18c4512267b80879de7f0a9fff9
Variety of belt-tightenings in the bignum code. (Please help test this!)

- Remove some unnecessary "+1"-like fudges. Sizes should be handled
  exactly, as enlarging size parameters causes needless bloat and may just
  make bugs less likely rather than fixing them: bn_expand() macro,
  bn_expand_internal(), and BN_sqr().
- Deprecate bn_dup_expand() - it's new since 0.9.7, unused, and not that
  useful.
- Remove unnecessary zeroing of unused bytes in bn_expand2().
- Rewrite BN_set_word() - it should be much simpler, the previous
  complexities probably date from old mismatched type issues.
- Add missing bn_check_top() macros in bn_word.c
- Improve some degenerate case handling in BN_[add|sub]_word(), add
  comments, and avoid a bignum expansion if an overflow isn't possible.
crypto/bn/bn.h
crypto/bn/bn_lib.c
crypto/bn/bn_sqr.c
crypto/bn/bn_word.c