Some crypto applications are now being built on Unix, so they should on VMS as well...
[oweals/openssl.git] / crypto / bn / bn_prime.c
index 28610766d0cde49a4b851bf7937b601c0c55db84..6fa0f9be1ee32b4767e8ed154832b88923601119 100644 (file)
@@ -76,7 +76,7 @@ static int probable_prime_dh(BIGNUM *rnd, int bits,
 static int probable_prime_dh_strong(BIGNUM *rnd, int bits,
        BIGNUM *add, BIGNUM *rem, BN_CTX *ctx);
 BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int strong, BIGNUM *add,
-            BIGNUM *rem, void (*callback)(int,int,char *), char *cb_arg)
+            BIGNUM *rem, void (*callback)(int,int,void *), void *cb_arg)
        {
        BIGNUM *rnd=NULL;
        BIGNUM t;
@@ -151,8 +151,8 @@ err:
        return(ret);
        }
 
-int BN_is_prime(BIGNUM *a, int checks, void (*callback)(int,int,char *),
-            BN_CTX *ctx_passed, char *cb_arg)
+int BN_is_prime(BIGNUM *a, int checks, void (*callback)(int,int,void *),
+            BN_CTX *ctx_passed, void *cb_arg)
        {
        int i,j,c2=0,ret= -1;
        BIGNUM *check;
@@ -319,7 +319,7 @@ static int probable_prime_dh(BIGNUM *rnd, int bits, BIGNUM *add, BIGNUM *rem,
        loop: for (i=1; i<NUMPRIMES; i++)
                {
                /* check that rnd is a prime */
-               if (BN_mod_word(rnd,(BN_LONG)primes[i]) <= 1)
+               if (BN_mod_word(rnd,(BN_ULONG)primes[i]) <= 1)
                        {
                        if (!BN_add(rnd,rnd,add)) goto err;
                        goto loop;
@@ -366,8 +366,8 @@ static int probable_prime_dh_strong(BIGNUM *p, int bits, BIGNUM *padd,
                /* check that p and q are prime */
                /* check that for p and q
                 * gcd(p-1,primes) == 1 (except for 2) */
-               if (    (BN_mod_word(p,(BN_LONG)primes[i]) == 0) ||
-                       (BN_mod_word(q,(BN_LONG)primes[i]) == 0))
+               if (    (BN_mod_word(p,(BN_ULONG)primes[i]) == 0) ||
+                       (BN_mod_word(q,(BN_ULONG)primes[i]) == 0))
                        {
                        if (!BN_add(p,p,padd)) goto err;
                        if (!BN_add(q,q,qadd)) goto err;