diff options
author | Bodo Möller <bodo@openssl.org> | 2002-10-28 14:02:19 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2002-10-28 14:02:19 +0000 |
commit | 19b8d06a7911d41ce8b3e347b4f58878e12d92ff (patch) | |
tree | deb9c6b9a4d34e5fb9dac030f672c17e17ca4cbb /crypto/bn/bn_lcl.h | |
parent | 5c6bf03117a26942327f43d02e9113e9870f7aba (diff) | |
download | openssl-19b8d06a7911d41ce8b3e347b4f58878e12d92ff.tar.gz |
clean up new code for NIST primes
create new lock CRYPTO_LOCK_BN to avoid race condition
Diffstat (limited to 'crypto/bn/bn_lcl.h')
-rw-r--r-- | crypto/bn/bn_lcl.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h index 8a4dba375a..090a7a0d00 100644 --- a/crypto/bn/bn_lcl.h +++ b/crypto/bn/bn_lcl.h @@ -239,6 +239,16 @@ struct bignum_ctx #define Lw(t) (((BN_ULONG)(t))&BN_MASK2) #define Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2) + +#define bn_clear_top2max(a) \ + { \ + int index = (a)->dmax - (a)->top; \ + BN_ULONG *ftl = &(a)->d[(a)->top-1]; \ + for (; index != 0; index--) \ + *(++ftl) = 0x0; \ + } + + /* This is used for internal error checking and is not normally used */ #ifdef BN_DEBUG # include <assert.h> |