Remove NOPROTO definitions and error code comments.
[openssl.git] / crypto / bn / bntest.c
index e84cf250b2a4f97c77476fcaa89ff47daeddb268..c60cee7388e2bc7c6b959ec4b06152f93221fb0f 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "e_os.h"
-#include "bio.h"
-#include "bn.h"
-#include "rand.h"
-#include "x509.h"
-#include "err.h"
+#include <openssl/e_os.h>
+#include <openssl/bio.h>
+#include <openssl/bn.h>
+#include <openssl/rand.h>
+#include <openssl/x509.h>
+#include <openssl/err.h>
 
 #ifdef WINDOWS
 #include "../bio/bss_file.c"
 #endif
 
-#ifndef NOPROTO
 int test_add(BIO *bp);
 int test_sub(BIO *bp);
 int test_lshift1(BIO *bp);
@@ -87,24 +86,6 @@ int test_mod_mul(BIO *bp,BN_CTX *ctx);
 int test_mod_exp(BIO *bp,BN_CTX *ctx);
 int test_exp(BIO *bp,BN_CTX *ctx);
 int rand_neg(void);
-#else
-int test_add ();
-int test_sub ();
-int test_lshift1 ();
-int test_lshift ();
-int test_rshift1 ();
-int test_rshift ();
-int test_div ();
-int test_mul ();
-int test_sqr ();
-int test_mont ();
-int test_mod ();
-int test_mod_mul ();
-int test_mod_exp ();
-int test_exp ();
-int rand_neg();
-#endif
-
 static int results=0;
 
 #ifdef NO_STDIO
@@ -112,9 +93,7 @@ static int results=0;
 #include "bss_file.c"
 #endif
 
-int main(argc,argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
        {
        BN_CTX *ctx;
        BIO *out;
@@ -229,8 +208,7 @@ err:
        return(1);
        }
 
-int test_add(bp)
-BIO *bp;
+int test_add(BIO *bp)
        {
        BIGNUM a,b,c;
        int i;
@@ -269,8 +247,7 @@ BIO *bp;
        return(1);
        }
 
-int test_sub(bp)
-BIO *bp;
+int test_sub(BIO *bp)
        {
        BIGNUM a,b,c;
        int i;
@@ -309,9 +286,7 @@ BIO *bp;
        return(1);
        }
 
-int test_div(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_div(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM a,b,c,d;
        int i;
@@ -362,9 +337,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_div_recp(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_div_recp(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM a,b,c,d;
        BN_RECP_CTX recp;
@@ -419,8 +392,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_mul(bp)
-BIO *bp;
+int test_mul(BIO *bp)
        {
        BIGNUM a,b,c;
        int i;
@@ -464,9 +436,7 @@ BIO *bp;
        return(1);
        }
 
-int test_sqr(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_sqr(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM a,c;
        int i;
@@ -501,9 +471,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_mont(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_mont(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM a,b,c,A,B;
        BIGNUM n;
@@ -563,9 +531,7 @@ BN_num_bits(mont->N));
        return(1);
        }
 
-int test_mod(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_mod(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM *a,*b,*c;
        int i;
@@ -604,9 +570,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_mod_mul(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_mod_mul(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM *a,*b,*c,*d,*e;
        int i;
@@ -660,9 +624,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_mod_exp(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_mod_exp(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM *a,*b,*c,*d,*e;
        int i;
@@ -705,9 +667,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_exp(bp,ctx)
-BIO *bp;
-BN_CTX *ctx;
+int test_exp(BIO *bp, BN_CTX *ctx)
        {
        BIGNUM *a,*b,*d,*e;
        int i;
@@ -745,8 +705,7 @@ BN_CTX *ctx;
        return(1);
        }
 
-int test_lshift(bp)
-BIO *bp;
+int test_lshift(BIO *bp)
        {
        BIGNUM *a,*b,*c;
        int i;
@@ -781,8 +740,7 @@ BIO *bp;
        return(1);
        }
 
-int test_lshift1(bp)
-BIO *bp;
+int test_lshift1(BIO *bp)
        {
        BIGNUM *a,*b;
        int i;
@@ -813,8 +771,7 @@ BIO *bp;
        return(1);
        }
 
-int test_rshift(bp)
-BIO *bp;
+int test_rshift(BIO *bp)
        {
        BIGNUM *a,*b,*c;
        int i;
@@ -849,8 +806,7 @@ BIO *bp;
        return(1);
        }
 
-int test_rshift1(bp)
-BIO *bp;
+int test_rshift1(BIO *bp)
        {
        BIGNUM *a,*b;
        int i;
@@ -881,7 +837,7 @@ BIO *bp;
        return(1);
        }
 
-int rand_neg()
+int rand_neg(void)
        {
        static unsigned int neg=0;
        static int sign[8]={0,0,0,1,1,0,1,1};