bn_exp.c: improve portability.
[openssl.git] / crypto / bn / bn_lib.c
index 2564c332b376cdde4b486e3f2a95c12918bdcc0f..e7dea71911c45f0cccd60e847baef6a8804f0c70 100644 (file)
@@ -61,6 +61,8 @@
 # define NDEBUG
 #endif
 
+#define OPENSSL_FIPSAPI
+
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
@@ -139,25 +141,6 @@ const BIGNUM *BN_value_one(void)
        return(&const_one);
        }
 
-char *BN_options(void)
-       {
-       static int init=0;
-       static char data[16];
-
-       if (!init)
-               {
-               init++;
-#ifdef BN_LLONG
-               BIO_snprintf(data,sizeof data,"bn(%d,%d)",
-                            (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
-#else
-               BIO_snprintf(data,sizeof data,"bn(%d,%d)",
-                            (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
-#endif
-               }
-       return(data);
-       }
-
 int BN_num_bits_word(BN_ULONG l)
        {
        static const unsigned char bits[256]={
@@ -763,7 +746,7 @@ int BN_is_bit_set(const BIGNUM *a, int n)
        i=n/BN_BITS2;
        j=n%BN_BITS2;
        if (a->top <= i) return 0;
-       return(((a->d[i])>>j)&((BN_ULONG)1)==1);
+       return (int)(((a->d[i])>>j)&((BN_ULONG)1));
        }
 
 int BN_mask_bits(BIGNUM *a, int n)