X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbn%2Fbn_lcl.h;h=1db940f4c5865bb4de69c26a1437e388007add40;hb=90a617e05054f4b56aebf0b41a6cd465a26ebeca;hp=a14188e2d207c51bedee0ef8ec89cfe370d086fa;hpb=15156cce0eed843d74ca06392144cad29c306ff7;p=oweals%2Fopenssl.git diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h index a14188e2d2..1db940f4c5 100644 --- a/crypto/bn/bn_lcl.h +++ b/crypto/bn/bn_lcl.h @@ -119,6 +119,20 @@ extern "C" { #endif +/* Used for temp variables */ +#define BN_CTX_NUM 32 +#define BN_CTX_NUM_POS 12 +struct bignum_ctx + { + int tos; + BIGNUM bn[BN_CTX_NUM]; + int flags; + int depth; + int pos[BN_CTX_NUM_POS]; + int too_many; + } /* BN_CTX */; + + /* * BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions * @@ -171,7 +185,7 @@ extern "C" { #define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ #define BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ -#if !defined(NO_ASM) && !defined(NO_INLINE_ASM) && !defined(PEDANTIC) +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) /* * BN_UMULT_HIGH section. * @@ -217,7 +231,7 @@ extern "C" { ret; }) # endif /* compiler */ # endif /* cpu */ -#endif /* NO_ASM */ +#endif /* OPENSSL_NO_ASM */ /************************************************************* * Using the long long type @@ -225,6 +239,16 @@ extern "C" { #define Lw(t) (((BN_ULONG)(t))&BN_MASK2) #define Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2) + +#define bn_clear_top2max(a) \ + { \ + int ind = (a)->dmax - (a)->top; \ + BN_ULONG *ftl = &(a)->d[(a)->top-1]; \ + for (; ind != 0; ind--) \ + *(++ftl) = 0x0; \ + } + + /* This is used for internal error checking and is not normally used */ #ifdef BN_DEBUG # include @@ -414,6 +438,8 @@ void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, BN_ULONG *t); void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2, BN_ULONG *t); +BN_ULONG bn_add_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + int cl, int dl); BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int cl, int dl);