bn_div.c: remove duplicate code by merging BN_div and BN_div_no_branch.
[openssl.git] / crypto / bn / bn_depr.c
index 76c349833c7634b5fd1e2d0bd7520284d9cb854a..27535e4fca00810485d1a1813313d3e3b90b92e2 100644 (file)
@@ -62,6 +62,9 @@
 #include "bn_lcl.h"
 #include <openssl/rand.h>
 
+static void *dummy=&dummy;
+
+#ifndef OPENSSL_NO_DEPRECATED
 BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
        const BIGNUM *add, const BIGNUM *rem,
        void (*callback)(int,int,void *), void *cb_arg)
@@ -70,9 +73,7 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
        BIGNUM *rnd=NULL;
        int found = 0;
 
-       cb.ver = 1;
-       cb.arg = cb_arg;
-       cb.cb_1 = callback;
+       BN_GENCB_set_old(&cb, callback, cb_arg);
 
        if (ret == NULL)
                {
@@ -94,9 +95,7 @@ int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int,int,void *),
        BN_CTX *ctx_passed, void *cb_arg)
        {
        BN_GENCB cb;
-       cb.ver = 1;
-       cb.arg = cb_arg;
-       cb.cb_1 = callback;
+       BN_GENCB_set_old(&cb, callback, cb_arg);
        return BN_is_prime_ex(a, checks, ctx_passed, &cb);
        }
 
@@ -106,9 +105,8 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
                int do_trial_division)
        {
        BN_GENCB cb;
-       cb.ver = 1;
-       cb.arg = cb_arg;
-       cb.cb_1 = callback;
+       BN_GENCB_set_old(&cb, callback, cb_arg);
        return BN_is_prime_fasttest_ex(a, checks, ctx_passed,
                                do_trial_division, &cb);
        }
+#endif