Under VMS, ftruncate should be available
[openssl.git] / crypto / bn / bn.h
index ce5a4746e4513882a2a975fd68f7bcf6b35849e6..f803f0fea145c45e65a5379d356fefa5724cbd9a 100644 (file)
@@ -142,7 +142,7 @@ extern "C" {
 #endif
 
 #ifdef THIRTY_TWO_BIT
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
 #define BN_ULLONG      unsigned _int64
 #else
 #define BN_ULLONG      unsigned long long
@@ -283,7 +283,8 @@ typedef struct bn_recp_ctx_st
 #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\
        r,a,&((mont)->RR),(mont),ctx)
 
-#define BN_prime_checks                (5)
+#define BN_prime_checks 0 /* default: select number of iterations
+                            based on the size of the number */
 
 #define BN_num_bytes(a)        ((BN_num_bits(a)+7)/8)
 #define BN_is_word(a,w)        (((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w)))
@@ -323,9 +324,9 @@ void        BN_init(BIGNUM *);
 void   BN_clear_free(BIGNUM *a);
 BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
 BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret);
-int    BN_bn2bin(BIGNUM *a, unsigned char *to);
+int    BN_bn2bin(const BIGNUM *a, unsigned char *to);
 BIGNUM *BN_mpi2bn(unsigned char *s,int len,BIGNUM *ret);
-int    BN_bn2mpi(BIGNUM *a, unsigned char *to);
+int    BN_bn2mpi(const BIGNUM *a, unsigned char *to);
 int    BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
 int    BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
 int    BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
@@ -375,13 +376,13 @@ BIGNUM *BN_dup(const BIGNUM *a);
 int    BN_ucmp(const BIGNUM *a, const BIGNUM *b);
 int    BN_set_bit(BIGNUM *a, int n);
 int    BN_clear_bit(BIGNUM *a, int n);
-char * BN_bn2hex(BIGNUM *a);
-char * BN_bn2dec(BIGNUM *a);
-int    BN_hex2bn(BIGNUM **a,char *str);
-int    BN_dec2bn(BIGNUM **a,char *str);
+char * BN_bn2hex(const BIGNUM *a);
+char * BN_bn2dec(const BIGNUM *a);
+int    BN_hex2bn(BIGNUM **a, const char *str);
+int    BN_dec2bn(BIGNUM **a, const char *str);
 int    BN_gcd(BIGNUM *r,BIGNUM *in_a,BIGNUM *in_b,BN_CTX *ctx);
 BIGNUM *BN_mod_inverse(BIGNUM *ret,BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
-BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int strong,BIGNUM *add,
+BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,BIGNUM *add,
                BIGNUM *rem,void (*callback)(int,int,void *),void *cb_arg);
 int    BN_is_prime(BIGNUM *p,int nchecks,void (*callback)(int,int,void *),
                BN_CTX *ctx,void *cb_arg);