diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_depr.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_depr.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/src/lib/libcrypto/bn/bn_depr.c b/src/lib/libcrypto/bn/bn_depr.c index 0e9f622586..f8b01b7bf6 100644 --- a/src/lib/libcrypto/bn/bn_depr.c +++ b/src/lib/libcrypto/bn/bn_depr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_depr.c,v 1.8 2022/11/26 16:08:51 tb Exp $ */ | 1 | /* $OpenBSD: bn_depr.c,v 1.9 2023/01/28 17:09:00 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -62,54 +62,3 @@ | |||
62 | #include <openssl/opensslconf.h> | 62 | #include <openssl/opensslconf.h> |
63 | 63 | ||
64 | #include "bn_local.h" | 64 | #include "bn_local.h" |
65 | |||
66 | #ifndef OPENSSL_NO_DEPRECATED | ||
67 | BIGNUM * | ||
68 | BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, | ||
69 | const BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg) | ||
70 | { | ||
71 | BN_GENCB cb; | ||
72 | BIGNUM *rnd = NULL; | ||
73 | int found = 0; | ||
74 | |||
75 | BN_GENCB_set_old(&cb, callback, cb_arg); | ||
76 | |||
77 | if (ret == NULL) { | ||
78 | if ((rnd = BN_new()) == NULL) | ||
79 | goto err; | ||
80 | } else | ||
81 | rnd = ret; | ||
82 | if (!BN_generate_prime_ex(rnd, bits, safe, add, rem, &cb)) | ||
83 | goto err; | ||
84 | |||
85 | /* we have a prime :-) */ | ||
86 | found = 1; | ||
87 | |||
88 | err: | ||
89 | if (!found && (ret == NULL) && (rnd != NULL)) | ||
90 | BN_free(rnd); | ||
91 | return (found ? rnd : NULL); | ||
92 | } | ||
93 | |||
94 | int | ||
95 | BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int, int, void *), | ||
96 | BN_CTX *ctx_passed, void *cb_arg) | ||
97 | { | ||
98 | BN_GENCB cb; | ||
99 | |||
100 | BN_GENCB_set_old(&cb, callback, cb_arg); | ||
101 | return BN_is_prime_ex(a, checks, ctx_passed, &cb); | ||
102 | } | ||
103 | |||
104 | int | ||
105 | BN_is_prime_fasttest(const BIGNUM *a, int checks, | ||
106 | void (*callback)(int, int, void *), BN_CTX *ctx_passed, void *cb_arg, | ||
107 | int do_trial_division) | ||
108 | { | ||
109 | BN_GENCB cb; | ||
110 | |||
111 | BN_GENCB_set_old(&cb, callback, cb_arg); | ||
112 | return BN_is_prime_fasttest_ex(a, checks, ctx_passed, | ||
113 | do_trial_division, &cb); | ||
114 | } | ||
115 | #endif | ||