diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_mod.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_mod.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_mod.c b/src/lib/libcrypto/bn/bn_mod.c index 79766d0036..365f6fcf03 100644 --- a/src/lib/libcrypto/bn/bn_mod.c +++ b/src/lib/libcrypto/bn/bn_mod.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_mod.c,v 1.21 2023/06/13 09:28:13 tb Exp $ */ | 1 | /* $OpenBSD: bn_mod.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ |
2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> | 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> |
3 | * for the OpenSSL project. */ | 3 | * for the OpenSSL project. */ |
4 | /* ==================================================================== | 4 | /* ==================================================================== |
@@ -146,6 +146,7 @@ BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) | |||
146 | return BN_usub(r, m, r); | 146 | return BN_usub(r, m, r); |
147 | return 1; | 147 | return 1; |
148 | } | 148 | } |
149 | LCRYPTO_ALIAS(BN_nnmod); | ||
149 | 150 | ||
150 | int | 151 | int |
151 | BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, | 152 | BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, |
@@ -159,6 +160,7 @@ BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, | |||
159 | return 0; | 160 | return 0; |
160 | return BN_nnmod(r, r, m, ctx); | 161 | return BN_nnmod(r, r, m, ctx); |
161 | } | 162 | } |
163 | LCRYPTO_ALIAS(BN_mod_add); | ||
162 | 164 | ||
163 | /* | 165 | /* |
164 | * BN_mod_add() variant that may only be used if both a and b are non-negative | 166 | * BN_mod_add() variant that may only be used if both a and b are non-negative |
@@ -177,6 +179,7 @@ BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m) | |||
177 | return BN_usub(r, r, m); | 179 | return BN_usub(r, r, m); |
178 | return 1; | 180 | return 1; |
179 | } | 181 | } |
182 | LCRYPTO_ALIAS(BN_mod_add_quick); | ||
180 | 183 | ||
181 | int | 184 | int |
182 | BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, | 185 | BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, |
@@ -190,6 +193,7 @@ BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, | |||
190 | return 0; | 193 | return 0; |
191 | return BN_nnmod(r, r, m, ctx); | 194 | return BN_nnmod(r, r, m, ctx); |
192 | } | 195 | } |
196 | LCRYPTO_ALIAS(BN_mod_sub); | ||
193 | 197 | ||
194 | /* | 198 | /* |
195 | * BN_mod_sub() variant that may only be used if both a and b are non-negative | 199 | * BN_mod_sub() variant that may only be used if both a and b are non-negative |
@@ -208,6 +212,7 @@ BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m) | |||
208 | return 0; | 212 | return 0; |
209 | return BN_usub(r, m, r); | 213 | return BN_usub(r, m, r); |
210 | } | 214 | } |
215 | LCRYPTO_ALIAS(BN_mod_sub_quick); | ||
211 | 216 | ||
212 | int | 217 | int |
213 | BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, | 218 | BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, |
@@ -246,12 +251,14 @@ BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, | |||
246 | 251 | ||
247 | return ret; | 252 | return ret; |
248 | } | 253 | } |
254 | LCRYPTO_ALIAS(BN_mod_mul); | ||
249 | 255 | ||
250 | int | 256 | int |
251 | BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) | 257 | BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) |
252 | { | 258 | { |
253 | return BN_mod_mul(r, a, a, m, ctx); | 259 | return BN_mod_mul(r, a, a, m, ctx); |
254 | } | 260 | } |
261 | LCRYPTO_ALIAS(BN_mod_sqr); | ||
255 | 262 | ||
256 | int | 263 | int |
257 | BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) | 264 | BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) |
@@ -264,6 +271,7 @@ BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) | |||
264 | return 0; | 271 | return 0; |
265 | return BN_nnmod(r, r, m, ctx); | 272 | return BN_nnmod(r, r, m, ctx); |
266 | } | 273 | } |
274 | LCRYPTO_ALIAS(BN_mod_lshift1); | ||
267 | 275 | ||
268 | /* | 276 | /* |
269 | * BN_mod_lshift1() variant that may be used if a is non-negative | 277 | * BN_mod_lshift1() variant that may be used if a is non-negative |
@@ -282,6 +290,7 @@ BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m) | |||
282 | return BN_usub(r, r, m); | 290 | return BN_usub(r, r, m); |
283 | return 1; | 291 | return 1; |
284 | } | 292 | } |
293 | LCRYPTO_ALIAS(BN_mod_lshift1_quick); | ||
285 | 294 | ||
286 | int | 295 | int |
287 | BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx) | 296 | BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx) |
@@ -316,6 +325,7 @@ BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx) | |||
316 | 325 | ||
317 | return ret; | 326 | return ret; |
318 | } | 327 | } |
328 | LCRYPTO_ALIAS(BN_mod_lshift); | ||
319 | 329 | ||
320 | /* | 330 | /* |
321 | * BN_mod_lshift() variant that may be used if a is non-negative | 331 | * BN_mod_lshift() variant that may be used if a is non-negative |
@@ -356,3 +366,4 @@ BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m) | |||
356 | 366 | ||
357 | return 1; | 367 | return 1; |
358 | } | 368 | } |
369 | LCRYPTO_ALIAS(BN_mod_lshift_quick); | ||