This commit was manufactured by cvs2svn to create branch
[openssl.git] / crypto / bn / bn_rand.c
index 323bfa74bc12f5e7c2e6631818d360c1151e3a06..b376c28ff3ff25b027922964af6ca26b4995250a 100644 (file)
@@ -134,7 +134,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
        buf=(unsigned char *)OPENSSL_malloc(bytes);
        if (buf == NULL)
                {
-               BNerr(BN_F_BN_RAND,ERR_R_MALLOC_FAILURE);
+               BNerr(BN_F_BNRAND,ERR_R_MALLOC_FAILURE);
                goto err;
                }
 
@@ -227,7 +227,7 @@ int     BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
 
 
 /* random number r:  0 <= r < range */
-static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
+static int bn_rand_range(int pseudo, BIGNUM *r, const BIGNUM *range)
        {
        int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
        int n;
@@ -294,12 +294,12 @@ static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
        }
 
 
-int    BN_rand_range(BIGNUM *r, BIGNUM *range)
+int    BN_rand_range(BIGNUM *r, const BIGNUM *range)
        {
        return bn_rand_range(0, r, range);
        }
 
-int    BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
+int    BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range)
        {
        return bn_rand_range(1, r, range);
        }