1. 14 3月, 2004 2 次提交
    • G
      The efforts to eliminate the dual-representation of zero and to ensure · 5d735465
      Geoff Thorpe 提交于
      bignums are passed in and out of functions and APIs in a consistent form
      has highlighted that zero-valued bignums don't need any allocated word
      data. The use of BN_set_word() to initialise a bignum to zero causes
      needless allocation and gives it a return value that must be checked. This
      change converts BN_zero() to a self-contained macro that has no
      return/expression value and does not cause any expansion of bignum data.
      
      Note, it would be tempting to rewrite the deprecated version as a
      success-valued comma expression, such as;
         #define BN_zero(a) ((a)->top = (a)->neg = 0, 1)
      However, this evaluates 'a' twice and would confuse initialisation loops
      (eg. while(..) { BN_zero(bn++) } ). As such, the deprecated version
      continues to use BN_set_word().
      5d735465
    • G
      Document a change I'd already made, and at the same time, correct the · 9e051bac
      Geoff Thorpe 提交于
      change to work properly; BN_zero() should set 'neg' to zero as well as
      'top' to match the behaviour of BN_new().
      9e051bac
  2. 09 3月, 2004 2 次提交
  3. 23 2月, 2004 1 次提交
  4. 07 2月, 2004 1 次提交
  5. 30 1月, 2004 2 次提交
  6. 29 1月, 2004 1 次提交
  7. 25 1月, 2004 1 次提交
  8. 27 12月, 2003 2 次提交
  9. 06 12月, 2003 2 次提交
  10. 03 12月, 2003 1 次提交
    • G
      Incremental cleanups to bn_lib.c. · 2bfd2c74
      Geoff Thorpe 提交于
      - Add missing bn_check_top() calls and relocate some others
      - Use BN_is_zero() where appropriate
      - Remove assert()s that bn_check_top() is already covering
      - Simplify the code in places (esp. bn_expand2())
      - Only keep ambiguous zero handling if BN_STRICT isn't defined
      - Remove some white-space and make some other aesthetic tweaks
      2bfd2c74
  11. 02 12月, 2003 7 次提交
  12. 01 12月, 2003 3 次提交
  13. 30 11月, 2003 1 次提交
  14. 29 11月, 2003 1 次提交
  15. 28 11月, 2003 1 次提交
  16. 26 11月, 2003 2 次提交
  17. 25 11月, 2003 1 次提交
  18. 23 11月, 2003 1 次提交
    • G
      BN_div() cleanup: replace the use of BN_sub and BN_add with bn_sub_words · 9e989810
      Geoff Thorpe 提交于
      and bn_add_words to avoid using fake bignums to window other bignums that
      can lead to corruption. This change allows all bignum tests to pass with
      BN_DEBUG and BN_DEBUG_RAND debugging and valgrind. NB: This should be
      tested on a few different architectures and configuration targets, as the
      bignum code this deals with is quite preprocessor (and assembly) sensitive.
      
      Submitted by: Nils Narsch
      Reviewed by: Geoff Thorpe, Ulf Moeller
      9e989810
  19. 15 11月, 2003 1 次提交
  20. 13 11月, 2003 1 次提交
    • G
      This rewrites two "for" loops in BN_rshift() - equality with zero is · 9dde17e8
      Geoff Thorpe 提交于
      generally a more efficient comparison than comparing two integers, and the
      first of these two loops was off-by-one (copying one too many values). This
      change also removes a superfluous assignment that would set an unused word
      to zero (and potentially allow an overrun in some cases).
      
      Submitted by: Nils Larsch
      Reviewed by: Geoff Thorpe
      9dde17e8
  21. 07 11月, 2003 3 次提交
  22. 06 11月, 2003 3 次提交