Minimise the amount of code dependent on BN_DEBUG_RAND. In particular,
[openssl.git] / crypto / bn / bn_lcl.h
index 0c448724d54c81e2f475f8c333987b7a7227afc1..45e19221aafe2280bcb57432ca8d87ad077b8b4a 100644 (file)
@@ -240,7 +240,7 @@ extern "C" {
 #define Lw(t)    (((BN_ULONG)(t))&BN_MASK2)
 #define Hw(t)    (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2)
 
-
+#ifdef BN_DEBUG_RAND
 #define bn_clear_top2max(a) \
        { \
        int      ind = (a)->dmax - (a)->top; \
@@ -248,47 +248,10 @@ extern "C" {
        for (; ind != 0; ind--) \
                *(++ftl) = 0x0; \
        }
-
-
-/* This is used for internal error checking and is not normally used */
-#ifdef BN_DEBUG
-# include <assert.h>
-# define bn_check_top(a) assert ((a)->top >= 0 && (a)->top <= (a)->dmax);
-#else
-# define bn_check_top(a)
-#endif
-
-/* This macro is to add extra stuff for development checking */
-#ifdef BN_DEBUG
-#define        bn_set_max(r) ((r)->max=(r)->top,BN_set_flags((r),BN_FLG_STATIC_DATA))
 #else
-#define        bn_set_max(r)
+#define bn_clear_top2max(a)
 #endif
 
-/* These macros are used to 'take' a section of a bignum for read only use */
-#define bn_set_low(r,a,n) \
-       { \
-       (r)->top=((a)->top > (n))?(n):(a)->top; \
-       (r)->d=(a)->d; \
-       (r)->neg=(a)->neg; \
-       (r)->flags|=BN_FLG_STATIC_DATA; \
-       bn_set_max(r); \
-       }
-
-#define bn_set_high(r,a,n) \
-       { \
-       if ((a)->top > (n)) \
-               { \
-               (r)->top=(a)->top-n; \
-               (r)->d= &((a)->d[n]); \
-               } \
-       else \
-               (r)->top=0; \
-       (r)->neg=(a)->neg; \
-       (r)->flags|=BN_FLG_STATIC_DATA; \
-       bn_set_max(r); \
-       }
-
 #ifdef BN_LLONG
 #define mul_add(r,a,w,c) { \
        BN_ULLONG t; \