comment
[openssl.git] / crypto / bn / bntest.c
index b83d0ba30d420e96ac70adde2c2eedd157130ca1..443cf420e5ce9cd54a2f420676adf465d1b08db0 100644 (file)
@@ -60,7 +60,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "openssl/e_os.h"
+#include "e_os.h"
 
 #include <openssl/bio.h>
 #include <openssl/bn.h>
@@ -68,7 +68,7 @@
 #include <openssl/x509.h>
 #include <openssl/err.h>
 
-#ifdef WINDOWS
+#ifdef OPENSSL_SYS_WINDOWS
 #include "../bio/bss_file.c"
 #endif
 
@@ -96,7 +96,7 @@ int test_sqrt(BIO *bp,BN_CTX *ctx);
 int rand_neg(void);
 static int results=0;
 
-#ifdef NO_STDIO
+#ifdef OPENSSL_NO_STDIO
 #define APPS_WIN16
 #include "bss_file.c"
 #endif
@@ -485,9 +485,11 @@ int test_mul(BIO *bp)
        {
        BIGNUM a,b,c,d,e;
        int i;
-       BN_CTX ctx;
+       BN_CTX *ctx;
 
-       BN_CTX_init(&ctx);
+       ctx = BN_CTX_new();
+       if (ctx == NULL) exit(1);
+       
        BN_init(&a);
        BN_init(&b);
        BN_init(&c);
@@ -505,7 +507,7 @@ int test_mul(BIO *bp)
                        BN_bntest_rand(&b,i-num1,0,0);
                a.neg=rand_neg();
                b.neg=rand_neg();
-               BN_mul(&c,&a,&b,&ctx);
+               BN_mul(&c,&a,&b,ctx);
                if (bp != NULL)
                        {
                        if (!results)
@@ -518,7 +520,7 @@ int test_mul(BIO *bp)
                        BN_print(bp,&c);
                        BIO_puts(bp,"\n");
                        }
-               BN_div(&d,&e,&c,&a,&ctx);
+               BN_div(&d,&e,&c,&a,ctx);
                BN_sub(&d,&d,&b);
                if(!BN_is_zero(&d) || !BN_is_zero(&e))
                    {
@@ -531,7 +533,7 @@ int test_mul(BIO *bp)
        BN_free(&c);
        BN_free(&d);
        BN_free(&e);
-       BN_CTX_free(&ctx);
+       BN_CTX_free(ctx);
        return(1);
        }