diff options
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn.h | 11 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_div.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_exp.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_gcd.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/bn.h | 7 |
6 files changed, 21 insertions, 19 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 09c0db44ce..2df5dd6f7d 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -3196,3 +3196,8 @@ _libre_RC2_decrypt | |||
3196 | _libre_RC2_cbc_encrypt | 3196 | _libre_RC2_cbc_encrypt |
3197 | _libre_RC2_cfb64_encrypt | 3197 | _libre_RC2_cfb64_encrypt |
3198 | _libre_RC2_ofb64_encrypt | 3198 | _libre_RC2_ofb64_encrypt |
3199 | _libre_BN_div | ||
3200 | _libre_BN_mod_exp | ||
3201 | _libre_BN_mod_exp_mont | ||
3202 | _libre_BN_gcd | ||
3203 | _libre_BN_mod_inverse | ||
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index 7921075294..523ff42877 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn.h,v 1.77 2024/03/02 09:27:31 tb Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.78 2024/04/10 14:58:06 beck Exp $ */ |
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -350,11 +350,10 @@ void BN_set_negative(BIGNUM *b, int n); | |||
350 | 350 | ||
351 | int BN_is_negative(const BIGNUM *b); | 351 | int BN_is_negative(const BIGNUM *b); |
352 | 352 | ||
353 | #ifndef LIBRESSL_INTERNAL | ||
354 | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, | 353 | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, |
355 | BN_CTX *ctx); | 354 | BN_CTX *ctx); |
356 | #define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) | 355 | #define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) |
357 | #endif | 356 | |
358 | int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); | 357 | int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); |
359 | int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); | 358 | int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); |
360 | int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); | 359 | int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); |
@@ -383,12 +382,10 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); | |||
383 | int BN_lshift1(BIGNUM *r, const BIGNUM *a); | 382 | int BN_lshift1(BIGNUM *r, const BIGNUM *a); |
384 | int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); | 383 | int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); |
385 | 384 | ||
386 | #ifndef LIBRESSL_INTERNAL | ||
387 | int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 385 | int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
388 | const BIGNUM *m, BN_CTX *ctx); | 386 | const BIGNUM *m, BN_CTX *ctx); |
389 | int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 387 | int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
390 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 388 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
391 | #endif | ||
392 | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, | 389 | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, |
393 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); | 390 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); |
394 | 391 | ||
@@ -407,14 +404,10 @@ char * BN_bn2dec(const BIGNUM *a); | |||
407 | int BN_hex2bn(BIGNUM **a, const char *str); | 404 | int BN_hex2bn(BIGNUM **a, const char *str); |
408 | int BN_dec2bn(BIGNUM **a, const char *str); | 405 | int BN_dec2bn(BIGNUM **a, const char *str); |
409 | int BN_asc2bn(BIGNUM **a, const char *str); | 406 | int BN_asc2bn(BIGNUM **a, const char *str); |
410 | #ifndef LIBRESSL_INTERNAL | ||
411 | int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); | 407 | int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
412 | #endif | ||
413 | int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ | 408 | int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ |
414 | #ifndef LIBRESSL_INTERNAL | ||
415 | BIGNUM *BN_mod_inverse(BIGNUM *ret, | 409 | BIGNUM *BN_mod_inverse(BIGNUM *ret, |
416 | const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); | 410 | const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); |
417 | #endif | ||
418 | BIGNUM *BN_mod_sqrt(BIGNUM *ret, | 411 | BIGNUM *BN_mod_sqrt(BIGNUM *ret, |
419 | const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); | 412 | const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); |
420 | 413 | ||
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c index 3225fa4424..09a8a364df 100644 --- a/src/lib/libcrypto/bn/bn_div.c +++ b/src/lib/libcrypto/bn/bn_div.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_div.c,v 1.40 2023/03/27 10:21:23 tb Exp $ */ | 1 | /* $OpenBSD: bn_div.c,v 1.41 2024/04/10 14:58:06 beck 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 | * |
@@ -441,6 +441,7 @@ BN_div(BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, | |||
441 | 441 | ||
442 | return BN_div_internal(quotient, remainder, numerator, divisor, ctx, ct); | 442 | return BN_div_internal(quotient, remainder, numerator, divisor, ctx, ct); |
443 | } | 443 | } |
444 | LCRYPTO_ALIAS(BN_div); | ||
444 | 445 | ||
445 | int | 446 | int |
446 | BN_div_nonct(BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, | 447 | BN_div_nonct(BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, |
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c index 04852424f7..c51296c3c3 100644 --- a/src/lib/libcrypto/bn/bn_exp.c +++ b/src/lib/libcrypto/bn/bn_exp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_exp.c,v 1.52 2024/03/02 09:27:31 tb Exp $ */ | 1 | /* $OpenBSD: bn_exp.c,v 1.53 2024/04/10 14:58:06 beck 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 | * |
@@ -799,6 +799,7 @@ BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, | |||
799 | return BN_mod_exp_mont_internal(rr, a, p, m, ctx, in_mont, | 799 | return BN_mod_exp_mont_internal(rr, a, p, m, ctx, in_mont, |
800 | (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)); | 800 | (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)); |
801 | } | 801 | } |
802 | LCRYPTO_ALIAS(BN_mod_exp_mont); | ||
802 | 803 | ||
803 | int | 804 | int |
804 | BN_mod_exp_mont_ct(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, | 805 | BN_mod_exp_mont_ct(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, |
@@ -1160,6 +1161,7 @@ BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, | |||
1160 | return BN_mod_exp_internal(r, a, p, m, ctx, | 1161 | return BN_mod_exp_internal(r, a, p, m, ctx, |
1161 | (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)); | 1162 | (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)); |
1162 | } | 1163 | } |
1164 | LCRYPTO_ALIAS(BN_mod_exp); | ||
1163 | 1165 | ||
1164 | int | 1166 | int |
1165 | BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, | 1167 | BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, |
diff --git a/src/lib/libcrypto/bn/bn_gcd.c b/src/lib/libcrypto/bn/bn_gcd.c index 6b3d8a3cb9..fa5d71a7f3 100644 --- a/src/lib/libcrypto/bn/bn_gcd.c +++ b/src/lib/libcrypto/bn/bn_gcd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_gcd.c,v 1.28 2023/06/02 17:15:30 tb Exp $ */ | 1 | /* $OpenBSD: bn_gcd.c,v 1.29 2024/04/10 14:58:06 beck 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 | * |
@@ -195,12 +195,7 @@ BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) | |||
195 | BN_CTX_end(ctx); | 195 | BN_CTX_end(ctx); |
196 | return (ret); | 196 | return (ret); |
197 | } | 197 | } |
198 | 198 | LCRYPTO_ALIAS(BN_gcd); | |
199 | int | ||
200 | BN_gcd_nonct(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) | ||
201 | { | ||
202 | return BN_gcd(r, in_a, in_b, ctx); | ||
203 | } | ||
204 | 199 | ||
205 | /* | 200 | /* |
206 | * BN_gcd_no_branch is a special version of BN_mod_inverse_no_branch. | 201 | * BN_gcd_no_branch is a special version of BN_mod_inverse_no_branch. |
@@ -808,6 +803,7 @@ BN_mod_inverse(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) | |||
808 | (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)); | 803 | (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)); |
809 | return BN_mod_inverse_internal(in, a, n, ctx, ct); | 804 | return BN_mod_inverse_internal(in, a, n, ctx, ct); |
810 | } | 805 | } |
806 | LCRYPTO_ALIAS(BN_mod_inverse); | ||
811 | 807 | ||
812 | BIGNUM * | 808 | BIGNUM * |
813 | BN_mod_inverse_nonct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) | 809 | BN_mod_inverse_nonct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) |
diff --git a/src/lib/libcrypto/hidden/openssl/bn.h b/src/lib/libcrypto/hidden/openssl/bn.h index f6f00cf766..af3465c790 100644 --- a/src/lib/libcrypto/hidden/openssl/bn.h +++ b/src/lib/libcrypto/hidden/openssl/bn.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn.h,v 1.6 2024/03/02 09:27:31 tb Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.7 2024/04/10 14:58:06 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -136,5 +136,10 @@ LCRYPTO_USED(BN_get_rfc3526_prime_4096); | |||
136 | LCRYPTO_USED(BN_get_rfc3526_prime_6144); | 136 | LCRYPTO_USED(BN_get_rfc3526_prime_6144); |
137 | LCRYPTO_USED(BN_get_rfc3526_prime_8192); | 137 | LCRYPTO_USED(BN_get_rfc3526_prime_8192); |
138 | LCRYPTO_USED(ERR_load_BN_strings); | 138 | LCRYPTO_USED(ERR_load_BN_strings); |
139 | LCRYPTO_UNUSED(BN_div); | ||
140 | LCRYPTO_UNUSED(BN_mod_exp); | ||
141 | LCRYPTO_UNUSED(BN_mod_exp_mont); | ||
142 | LCRYPTO_UNUSED(BN_gcd); | ||
143 | LCRYPTO_UNUSED(BN_mod_inverse); | ||
139 | 144 | ||
140 | #endif /* _LIBCRYPTO_BN_H */ | 145 | #endif /* _LIBCRYPTO_BN_H */ |