summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-04-25 17:13:06 +0000
committertb <>2023-04-25 17:13:06 +0000
commit40b54d8027905be4dfb3c5685a568e5bfe934136 (patch)
treee1d177f3d47bcfc7aad6bc2a3dcfef43d5cb93f5 /src/lib
parentc0c3065e1fbb425e8de2cf12d6809e3d303a64ac (diff)
downloadopenbsd-40b54d8027905be4dfb3c5685a568e5bfe934136.tar.gz
openbsd-40b54d8027905be4dfb3c5685a568e5bfe934136.tar.bz2
openbsd-40b54d8027905be4dfb3c5685a568e5bfe934136.zip
Move a few now internal prototypes to bn_local.h
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/bn/bn.h24
-rw-r--r--src/lib/libcrypto/bn/bn_local.h17
2 files changed, 17 insertions, 24 deletions
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h
index 79a802eeed..9fefde20a8 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.65 2023/04/25 17:01:21 tb Exp $ */ 1/* $OpenBSD: bn.h,v 1.66 2023/04/25 17:13:06 tb 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 *
@@ -340,10 +340,6 @@ int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
340int BN_num_bits(const BIGNUM *a); 340int BN_num_bits(const BIGNUM *a);
341int BN_num_bits_word(BN_ULONG); 341int BN_num_bits_word(BN_ULONG);
342BIGNUM *BN_new(void); 342BIGNUM *BN_new(void);
343/* Move to bn_local.h in the next major bump. */
344#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
345void BN_init(BIGNUM *);
346#endif
347void BN_clear_free(BIGNUM *a); 343void BN_clear_free(BIGNUM *a);
348BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); 344BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
349void BN_swap(BIGNUM *a, BIGNUM *b); 345void BN_swap(BIGNUM *a, BIGNUM *b);
@@ -420,10 +416,6 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
420int BN_mask_bits(BIGNUM *a, int n); 416int BN_mask_bits(BIGNUM *a, int n);
421int BN_print_fp(FILE *fp, const BIGNUM *a); 417int BN_print_fp(FILE *fp, const BIGNUM *a);
422int BN_print(BIO *fp, const BIGNUM *a); 418int BN_print(BIO *fp, const BIGNUM *a);
423/* Move to bn_local.h in the next major bump. */
424#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
425int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
426#endif
427int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); 419int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
428int BN_rshift1(BIGNUM *r, const BIGNUM *a); 420int BN_rshift1(BIGNUM *r, const BIGNUM *a);
429void BN_clear(BIGNUM *a); 421void BN_clear(BIGNUM *a);
@@ -517,20 +509,6 @@ void BN_set_params(int mul, int high, int low, int mont);
517int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ 509int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
518#endif 510#endif
519 511
520/* Move to bn_local.h in the next major bump. */
521#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
522void BN_RECP_CTX_init(BN_RECP_CTX *recp);
523BN_RECP_CTX *BN_RECP_CTX_new(void);
524void BN_RECP_CTX_free(BN_RECP_CTX *recp);
525int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
526int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
527 BN_RECP_CTX *recp, BN_CTX *ctx);
528int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
529 const BIGNUM *m, BN_CTX *ctx);
530int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
531 BN_RECP_CTX *recp, BN_CTX *ctx);
532#endif
533
534#ifndef OPENSSL_NO_EC2M 512#ifndef OPENSSL_NO_EC2M
535 513
536/* Functions for arithmetic over binary polynomials represented by BIGNUMs. 514/* Functions for arithmetic over binary polynomials represented by BIGNUMs.
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h
index 5e85dfc3de..061544056b 100644
--- a/src/lib/libcrypto/bn/bn_local.h
+++ b/src/lib/libcrypto/bn/bn_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_local.h,v 1.19 2023/04/19 10:51:22 jsing Exp $ */ 1/* $OpenBSD: bn_local.h,v 1.20 2023/04/25 17:13:06 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 *
@@ -279,6 +279,21 @@ void bn_div_rem_words(BN_ULONG h, BN_ULONG l, BN_ULONG d, BN_ULONG *out_q,
279int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); 279int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
280int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc); 280int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc);
281 281
282void BN_init(BIGNUM *);
283
284int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
285
286void BN_RECP_CTX_init(BN_RECP_CTX *recp);
287BN_RECP_CTX *BN_RECP_CTX_new(void);
288void BN_RECP_CTX_free(BN_RECP_CTX *recp);
289int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
290int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
291 BN_RECP_CTX *recp, BN_CTX *ctx);
292int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
293 const BIGNUM *m, BN_CTX *ctx);
294int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
295 BN_RECP_CTX *recp, BN_CTX *ctx);
296
282/* Explicitly const time / non-const time versions for internal use */ 297/* Explicitly const time / non-const time versions for internal use */
283int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 298int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
284 const BIGNUM *m, BN_CTX *ctx); 299 const BIGNUM *m, BN_CTX *ctx);