diff options
author | tb <> | 2023-04-25 17:13:06 +0000 |
---|---|---|
committer | tb <> | 2023-04-25 17:13:06 +0000 |
commit | 40b54d8027905be4dfb3c5685a568e5bfe934136 (patch) | |
tree | e1d177f3d47bcfc7aad6bc2a3dcfef43d5cb93f5 /src/lib | |
parent | c0c3065e1fbb425e8de2cf12d6809e3d303a64ac (diff) | |
download | openbsd-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.h | 24 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_local.h | 17 |
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); | |||
340 | int BN_num_bits(const BIGNUM *a); | 340 | int BN_num_bits(const BIGNUM *a); |
341 | int BN_num_bits_word(BN_ULONG); | 341 | int BN_num_bits_word(BN_ULONG); |
342 | BIGNUM *BN_new(void); | 342 | BIGNUM *BN_new(void); |
343 | /* Move to bn_local.h in the next major bump. */ | ||
344 | #if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL) | ||
345 | void BN_init(BIGNUM *); | ||
346 | #endif | ||
347 | void BN_clear_free(BIGNUM *a); | 343 | void BN_clear_free(BIGNUM *a); |
348 | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); | 344 | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); |
349 | void BN_swap(BIGNUM *a, BIGNUM *b); | 345 | void BN_swap(BIGNUM *a, BIGNUM *b); |
@@ -420,10 +416,6 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | |||
420 | int BN_mask_bits(BIGNUM *a, int n); | 416 | int BN_mask_bits(BIGNUM *a, int n); |
421 | int BN_print_fp(FILE *fp, const BIGNUM *a); | 417 | int BN_print_fp(FILE *fp, const BIGNUM *a); |
422 | int BN_print(BIO *fp, const BIGNUM *a); | 418 | int 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) | ||
425 | int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); | ||
426 | #endif | ||
427 | int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); | 419 | int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); |
428 | int BN_rshift1(BIGNUM *r, const BIGNUM *a); | 420 | int BN_rshift1(BIGNUM *r, const BIGNUM *a); |
429 | void BN_clear(BIGNUM *a); | 421 | void BN_clear(BIGNUM *a); |
@@ -517,20 +509,6 @@ void BN_set_params(int mul, int high, int low, int mont); | |||
517 | int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ | 509 | int 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) | ||
522 | void BN_RECP_CTX_init(BN_RECP_CTX *recp); | ||
523 | BN_RECP_CTX *BN_RECP_CTX_new(void); | ||
524 | void BN_RECP_CTX_free(BN_RECP_CTX *recp); | ||
525 | int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); | ||
526 | int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, | ||
527 | BN_RECP_CTX *recp, BN_CTX *ctx); | ||
528 | int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
529 | const BIGNUM *m, BN_CTX *ctx); | ||
530 | int 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, | |||
279 | int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); | 279 | int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); |
280 | int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc); | 280 | int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc); |
281 | 281 | ||
282 | void BN_init(BIGNUM *); | ||
283 | |||
284 | int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); | ||
285 | |||
286 | void BN_RECP_CTX_init(BN_RECP_CTX *recp); | ||
287 | BN_RECP_CTX *BN_RECP_CTX_new(void); | ||
288 | void BN_RECP_CTX_free(BN_RECP_CTX *recp); | ||
289 | int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); | ||
290 | int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, | ||
291 | BN_RECP_CTX *recp, BN_CTX *ctx); | ||
292 | int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
293 | const BIGNUM *m, BN_CTX *ctx); | ||
294 | int 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 */ |
283 | int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 298 | int 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); |