summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/Symbols.namespace5
-rw-r--r--src/lib/libcrypto/bn/bn.h11
-rw-r--r--src/lib/libcrypto/bn/bn_div.c3
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c4
-rw-r--r--src/lib/libcrypto/bn/bn_gcd.c10
-rw-r--r--src/lib/libcrypto/hidden/openssl/bn.h7
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
351int BN_is_negative(const BIGNUM *b); 351int BN_is_negative(const BIGNUM *b);
352 352
353#ifndef LIBRESSL_INTERNAL
354int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, 353int 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
358int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); 357int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
359int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); 358int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
360int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); 359int 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);
383int BN_lshift1(BIGNUM *r, const BIGNUM *a); 382int BN_lshift1(BIGNUM *r, const BIGNUM *a);
384int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); 383int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
385 384
386#ifndef LIBRESSL_INTERNAL
387int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 385int 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);
389int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 387int 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
392int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 389int 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);
407int BN_hex2bn(BIGNUM **a, const char *str); 404int BN_hex2bn(BIGNUM **a, const char *str);
408int BN_dec2bn(BIGNUM **a, const char *str); 405int BN_dec2bn(BIGNUM **a, const char *str);
409int BN_asc2bn(BIGNUM **a, const char *str); 406int BN_asc2bn(BIGNUM **a, const char *str);
410#ifndef LIBRESSL_INTERNAL
411int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); 407int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
412#endif
413int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ 408int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */
414#ifndef LIBRESSL_INTERNAL
415BIGNUM *BN_mod_inverse(BIGNUM *ret, 409BIGNUM *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
418BIGNUM *BN_mod_sqrt(BIGNUM *ret, 411BIGNUM *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}
444LCRYPTO_ALIAS(BN_div);
444 445
445int 446int
446BN_div_nonct(BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, 447BN_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}
802LCRYPTO_ALIAS(BN_mod_exp_mont);
802 803
803int 804int
804BN_mod_exp_mont_ct(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 805BN_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}
1164LCRYPTO_ALIAS(BN_mod_exp);
1163 1165
1164int 1166int
1165BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 1167BN_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 198LCRYPTO_ALIAS(BN_gcd);
199int
200BN_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}
806LCRYPTO_ALIAS(BN_mod_inverse);
811 807
812BIGNUM * 808BIGNUM *
813BN_mod_inverse_nonct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 809BN_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);
136LCRYPTO_USED(BN_get_rfc3526_prime_6144); 136LCRYPTO_USED(BN_get_rfc3526_prime_6144);
137LCRYPTO_USED(BN_get_rfc3526_prime_8192); 137LCRYPTO_USED(BN_get_rfc3526_prime_8192);
138LCRYPTO_USED(ERR_load_BN_strings); 138LCRYPTO_USED(ERR_load_BN_strings);
139LCRYPTO_UNUSED(BN_div);
140LCRYPTO_UNUSED(BN_mod_exp);
141LCRYPTO_UNUSED(BN_mod_exp_mont);
142LCRYPTO_UNUSED(BN_gcd);
143LCRYPTO_UNUSED(BN_mod_inverse);
139 144
140#endif /* _LIBCRYPTO_BN_H */ 145#endif /* _LIBCRYPTO_BN_H */