diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 67 |
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 | */ | ||
134 | static int bn_limit_bits = 0; | ||
135 | static int bn_limit_num = 8; /* (1<<bn_limit_bits) */ | ||
136 | static int bn_limit_bits_low = 0; | ||
137 | static int bn_limit_num_low = 8; /* (1<<bn_limit_bits_low) */ | ||
138 | static int bn_limit_bits_high = 0; | ||
139 | static int bn_limit_num_high = 8; /* (1<<bn_limit_bits_high) */ | ||
140 | static int bn_limit_bits_mont = 0; | ||
141 | static int bn_limit_num_mont = 8; /* (1<<bn_limit_bits_mont) */ | ||
142 | |||
143 | void | ||
144 | BN_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 | |||
172 | int | ||
173 | BN_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 | |||
188 | void | 123 | void |
189 | BN_set_flags(BIGNUM *b, int n) | 124 | BN_set_flags(BIGNUM *b, int n) |
190 | { | 125 | { |