adjust to OpenSSL_0_9_6-stable version
[openssl.git] / crypto / bn / bn.h
index ed8cba5e3a4e3f38940762f6a2544532619909d0..103a1bdd09f0c9e52065411957af18de2801b91f 100644 (file)
@@ -89,8 +89,9 @@ extern "C" {
  * using "long long's", are 32bit, and are not using my assembler code. */
 #if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \
     defined(OPENSSL_SYS_WIN32) || defined(linux)
-#undef BN_DIV2W
-#define BN_DIV2W
+# ifndef BN_DIV2W
+#  define BN_DIV2W
+# endif
 #endif
 
 /* assuming long is 64bit - this is the DEC Alpha
@@ -238,18 +239,8 @@ typedef struct bignum_st
        int flags;
        } BIGNUM;
 
-/* Used for temp variables */
-#define BN_CTX_NUM     20
-#define BN_CTX_NUM_POS 12
-typedef 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;
+/* Used for temp variables (declaration hidden in bn_lcl.h) */
+typedef struct bignum_ctx BN_CTX;
 
 typedef struct bn_blinding_st
        {
@@ -320,7 +311,7 @@ typedef struct bn_recp_ctx_st
 /*#define BN_ascii2bn(a)       BN_hex2bn(a) */
 /*#define BN_bn2ascii(a)       BN_bn2hex(a) */
 
-BIGNUM *BN_value_one(void);
+const BIGNUM *BN_value_one(void);
 char * BN_options(void);
 BN_CTX *BN_CTX_new(void);
 void   BN_CTX_init(BN_CTX *c);
@@ -331,6 +322,7 @@ void        BN_CTX_end(BN_CTX *ctx);
 int     BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
 int     BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
 int    BN_rand_range(BIGNUM *rnd, BIGNUM *range);
+int    BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
 int    BN_num_bits(const BIGNUM *a);
 int    BN_num_bits_word(BN_ULONG);
 BIGNUM *BN_new(void);