Use new-style system-id macros.
[openssl.git] / crypto / bn / bn.h
index a5b6ed9d4c70c5450f8899625a4bcb5c89ed7e94..218907b8cd0782c0edf23ed14cde1bde47cb3759 100644 (file)
@@ -59,7 +59,7 @@
 #ifndef HEADER_BN_H
 #define HEADER_BN_H
 
-#ifndef NO_FP_API
+#ifndef OPENSSL_NO_FP_API
 #include <stdio.h> /* FILE */
 #endif
 #include <openssl/opensslconf.h>
@@ -68,7 +68,7 @@
 extern "C" {
 #endif
 
-#ifdef VMS
+#ifdef OPENSSL_SYS_VMS
 #undef BN_LLONG /* experimental, so far... */
 #endif
 
@@ -87,7 +87,8 @@ extern "C" {
  * For machines with only one compiler (or shared libraries), this should
  * be on.  Again this in only really a problem on machines
  * using "long long's", are 32bit, and are not using my assembler code. */
-#if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux)
+#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \
+    defined(OPENSSL_SYS_WIN32) || defined(linux)
 #undef BN_DIV2W
 #define BN_DIV2W
 #endif
@@ -141,7 +142,7 @@ extern "C" {
 #endif
 
 #ifdef THIRTY_TWO_BIT
-#if defined(WIN32) && !defined(__GNUC__)
+#if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__)
 #define BN_ULLONG      unsigned _int64
 #else
 #define BN_ULLONG      unsigned long long
@@ -152,7 +153,7 @@ extern "C" {
 #define BN_BYTES       4
 #define BN_BITS2       32
 #define BN_BITS4       16
-#ifdef WIN32
+#ifdef OPENSSL_SYS_WIN32
 /* VC++ doesn't like the LL suffix */
 #define BN_MASK                (0xffffffffffffffffL)
 #else
@@ -329,6 +330,7 @@ BIGNUM *BN_CTX_get(BN_CTX *ctx);
 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_num_bits(const BIGNUM *a);
 int    BN_num_bits_word(BN_ULONG);
 BIGNUM *BN_new(void);
@@ -391,7 +393,7 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
        const BIGNUM *m,BN_CTX *ctx);
 
 int    BN_mask_bits(BIGNUM *a,int n);
-#ifndef NO_FP_API
+#ifndef OPENSSL_NO_FP_API
 int    BN_print_fp(FILE *fp, const BIGNUM *a);
 #endif
 #ifdef HEADER_BIO_H
@@ -526,22 +528,24 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
 #define BN_F_BN_MPI2BN                                  112
 #define BN_F_BN_NEW                                     113
 #define BN_F_BN_RAND                                    114
+#define BN_F_BN_RAND_RANGE                              122
 #define BN_F_BN_USUB                                    115
 
 /* Reason codes. */
 #define BN_R_ARG2_LT_ARG3                               100
 #define BN_R_BAD_RECIPROCAL                             101
+#define BN_R_BIGNUM_TOO_LONG                            114
 #define BN_R_CALLED_WITH_EVEN_MODULUS                   102
 #define BN_R_DIV_BY_ZERO                                103
 #define BN_R_ENCODING_ERROR                             104
 #define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA               105
 #define BN_R_INPUT_NOT_REDUCED                          110
 #define BN_R_INVALID_LENGTH                             106
+#define BN_R_INVALID_RANGE                              115
 #define BN_R_NOT_A_SQUARE                               111
 #define BN_R_NOT_INITIALIZED                            107
 #define BN_R_NO_INVERSE                                         108
 #define BN_R_P_IS_NOT_PRIME                             112
-#define BN_R_TOO_LARGE                                  114
 #define BN_R_TOO_MANY_ITERATIONS                        113
 #define BN_R_TOO_MANY_TEMPORARY_VARIABLES               109