summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
authortb <>2023-04-25 19:57:59 +0000
committertb <>2023-04-25 19:57:59 +0000
commit6ac0e3f4bfac557d01cfe3db37f290043cb40fcb (patch)
treeb5976467001913ddba531cfe162d423fca5677fb /src/lib/libcrypto/bn/bn_lib.c
parent0725c451bef02fc23e8b5bafa353df9cd02984b7 (diff)
downloadopenbsd-6ac0e3f4bfac557d01cfe3db37f290043cb40fcb.tar.gz
openbsd-6ac0e3f4bfac557d01cfe3db37f290043cb40fcb.tar.bz2
openbsd-6ac0e3f4bfac557d01cfe3db37f290043cb40fcb.zip
Remove the deprecated API from BN
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c67
1 files changed, 1 insertions, 66 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 78410e2133..439bdb1e9d 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.84 2023/04/19 11:12:43 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.85 2023/04/25 19:57:59 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -120,71 +120,6 @@ BN_clear_free(BIGNUM *bn)
120 BN_free(bn); 120 BN_free(bn);
121} 121}
122 122
123/* This stuff appears to be completely unused, so is deprecated */
124#ifndef OPENSSL_NO_DEPRECATED
125/* For a 32 bit machine
126 * 2 - 4 == 128
127 * 3 - 8 == 256
128 * 4 - 16 == 512
129 * 5 - 32 == 1024
130 * 6 - 64 == 2048
131 * 7 - 128 == 4096
132 * 8 - 256 == 8192
133 */
134static int bn_limit_bits = 0;
135static int bn_limit_num = 8; /* (1<<bn_limit_bits) */
136static int bn_limit_bits_low = 0;
137static int bn_limit_num_low = 8; /* (1<<bn_limit_bits_low) */
138static int bn_limit_bits_high = 0;
139static int bn_limit_num_high = 8; /* (1<<bn_limit_bits_high) */
140static int bn_limit_bits_mont = 0;
141static int bn_limit_num_mont = 8; /* (1<<bn_limit_bits_mont) */
142
143void
144BN_set_params(int mult, int high, int low, int mont)
145{
146 if (mult >= 0) {
147 if (mult > (int)(sizeof(int) * 8) - 1)
148 mult = sizeof(int) * 8 - 1;
149 bn_limit_bits = mult;
150 bn_limit_num = 1 << mult;
151 }
152 if (high >= 0) {
153 if (high > (int)(sizeof(int) * 8) - 1)
154 high = sizeof(int) * 8 - 1;
155 bn_limit_bits_high = high;
156 bn_limit_num_high = 1 << high;
157 }
158 if (low >= 0) {
159 if (low > (int)(sizeof(int) * 8) - 1)
160 low = sizeof(int) * 8 - 1;
161 bn_limit_bits_low = low;
162 bn_limit_num_low = 1 << low;
163 }
164 if (mont >= 0) {
165 if (mont > (int)(sizeof(int) * 8) - 1)
166 mont = sizeof(int) * 8 - 1;
167 bn_limit_bits_mont = mont;
168 bn_limit_num_mont = 1 << mont;
169 }
170}
171
172int
173BN_get_params(int which)
174{
175 if (which == 0)
176 return (bn_limit_bits);
177 else if (which == 1)
178 return (bn_limit_bits_high);
179 else if (which == 2)
180 return (bn_limit_bits_low);
181 else if (which == 3)
182 return (bn_limit_bits_mont);
183 else
184 return (0);
185}
186#endif
187
188void 123void
189BN_set_flags(BIGNUM *b, int n) 124BN_set_flags(BIGNUM *b, int n)
190{ 125{