fix assertion
[openssl.git] / crypto / bn / divtest.c
index 60b3d662d95de30a97849213b7d63ccfc72f6172..d3fc688f33572cfae548fc180c38488ef2c4faee 100644 (file)
@@ -1,13 +1,14 @@
 #include <openssl/bn.h>
+#include <openssl/rand.h>
 
-int rand(n)
+static int Rand(n)
 {
     unsigned char x[2];
-    RAND_pseudo_bytes(&x,2);
+    RAND_pseudo_bytes(x,2);
     return (x[0] + 2*x[1]);
 }
 
-void bug(char *m, BIGNUM *a, BIGNUM *b)
+static void bug(char *m, BIGNUM *a, BIGNUM *b)
 {
     printf("%s!\na=",m);
     BN_print_fp(stdout, a);
@@ -25,8 +26,8 @@ main()
     BN_CTX *ctx=BN_CTX_new();
 
     for(;;) {
-       BN_pseudo_rand(a,rand(),0,0);
-       BN_pseudo_rand(b,rand(),0,0);
+       BN_pseudo_rand(a,Rand(),0,0);
+       BN_pseudo_rand(b,Rand(),0,0);
        if (BN_is_zero(b)) continue;
 
        BN_RECP_CTX_set(recp,b,ctx);