summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-01-22 10:12:01 +0000
committertb <>2025-01-22 10:12:01 +0000
commit884764157a07e35ad4761bc538c4c284e8105c87 (patch)
tree1daa49a6d5d42627b55df6f8f43fbdcfc886478d /src
parent2a03b7cb56aaed711ed59aee8972dbd1c4129344 (diff)
downloadopenbsd-884764157a07e35ad4761bc538c4c284e8105c87.tar.gz
openbsd-884764157a07e35ad4761bc538c4c284e8105c87.tar.bz2
openbsd-884764157a07e35ad4761bc538c4c284e8105c87.zip
Rename BN_div_recp() into BN_div_reciprocal()
Requested by jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_local.h6
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h
index d9389995f7..fe3abeeb9a 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.47 2025/01/22 10:08:10 tb Exp $ */ 1/* $OpenBSD: bn_local.h,v 1.48 2025/01/22 10:12:01 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 *
@@ -273,8 +273,8 @@ void BN_init(BIGNUM *);
273 273
274BN_RECP_CTX *BN_RECP_CTX_create(const BIGNUM *N); 274BN_RECP_CTX *BN_RECP_CTX_create(const BIGNUM *N);
275void BN_RECP_CTX_free(BN_RECP_CTX *recp); 275void BN_RECP_CTX_free(BN_RECP_CTX *recp);
276int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp, 276int BN_div_reciprocal(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
277 BN_CTX *ctx); 277 BN_RECP_CTX *recp, BN_CTX *ctx);
278int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, 278int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
279 BN_RECP_CTX *recp, BN_CTX *ctx); 279 BN_RECP_CTX *recp, BN_CTX *ctx);
280int BN_mod_sqr_reciprocal(BIGNUM *r, const BIGNUM *x, BN_RECP_CTX *recp, 280int BN_mod_sqr_reciprocal(BIGNUM *r, const BIGNUM *x, BN_RECP_CTX *recp,
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index bf38380710..6277b06dab 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.28 2025/01/22 10:08:10 tb Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.29 2025/01/22 10:12:01 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 *
@@ -132,7 +132,7 @@ err:
132} 132}
133 133
134int 134int
135BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp, 135BN_div_reciprocal(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp,
136 BN_CTX *ctx) 136 BN_CTX *ctx)
137{ 137{
138 int i, j, ret = 0; 138 int i, j, ret = 0;
@@ -233,7 +233,7 @@ BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
233 if (!BN_mul(r, x, y, ctx)) 233 if (!BN_mul(r, x, y, ctx))
234 return 0; 234 return 0;
235 235
236 return BN_div_recp(NULL, r, r, recp, ctx); 236 return BN_div_reciprocal(NULL, r, r, recp, ctx);
237} 237}
238 238
239/* Compute r = x^2 % m. */ 239/* Compute r = x^2 % m. */
@@ -243,5 +243,5 @@ BN_mod_sqr_reciprocal(BIGNUM *r, const BIGNUM *x, BN_RECP_CTX *recp, BN_CTX *ctx
243 if (!BN_sqr(r, x, ctx)) 243 if (!BN_sqr(r, x, ctx))
244 return 0; 244 return 0;
245 245
246 return BN_div_recp(NULL, r, r, recp, ctx); 246 return BN_div_reciprocal(NULL, r, r, recp, ctx);
247} 247}