summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-03-26 19:09:42 +0000
committertb <>2023-03-26 19:09:42 +0000
commit9b31f9948a949769a2079f7e09b17226e584993d (patch)
tree5064ac55b84d6c0dbded1f97370b2ed9c5840a42 /src
parent3d89c2c784f0833844993c6b017566209f36071e (diff)
downloadopenbsd-9b31f9948a949769a2079f7e09b17226e584993d.tar.gz
openbsd-9b31f9948a949769a2079f7e09b17226e584993d.tar.bz2
openbsd-9b31f9948a949769a2079f7e09b17226e584993d.zip
Minor whitespace tidying
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c9
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index e2e4aa541c..9e4497bb06 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.40 2023/03/26 18:52:29 tb Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.41 2023/03/26 19:09:42 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 *
@@ -409,9 +409,10 @@ BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
409 409
410 BN_CTX_start(ctx); 410 BN_CTX_start(ctx);
411 411
412 /* Allocate a montgomery context if it was not supplied by the caller. 412 /*
413 * Allocate a Montgomery context if it was not supplied by the caller.
413 * If this is not done, things will break in the montgomery part. 414 * If this is not done, things will break in the montgomery part.
414 */ 415 */
415 if (in_mont != NULL) 416 if (in_mont != NULL)
416 mont = in_mont; 417 mont = in_mont;
417 else { 418 else {
@@ -1100,7 +1101,7 @@ BN_mod_exp_internal(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m
1100 * standard algorithm: 1101 * standard algorithm:
1101 * 1102 *
1102 * BN_mod_exp_mont 33 .. 40 % [AMD K6-2, Linux, debug configuration] 1103 * BN_mod_exp_mont 33 .. 40 % [AMD K6-2, Linux, debug configuration]
1103 * 55 .. 77 % [UltraSparc processor, but 1104 * 55 .. 77 % [UltraSparc processor, but
1104 * debug-solaris-sparcv8-gcc conf.] 1105 * debug-solaris-sparcv8-gcc conf.]
1105 * 1106 *
1106 * BN_mod_exp_recp 50 .. 70 % [AMD K6-2, Linux, debug configuration] 1107 * BN_mod_exp_recp 50 .. 70 % [AMD K6-2, Linux, debug configuration]
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index ed49ec83eb..582c8d4ef8 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.52 2023/03/07 09:42:09 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.53 2023/03/26 19:09:42 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 *
@@ -354,7 +354,7 @@ bn_montgomery_multiply_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *b
354 for (i = 0; i < n_len; i++) { 354 for (i = 0; i < n_len; i++) {
355 /* Compute new t[0] * n0, as we need it inside the loop. */ 355 /* Compute new t[0] * n0, as we need it inside the loop. */
356 w = (ap[0] * bp[i] + tp[0]) * n0; 356 w = (ap[0] * bp[i] + tp[0]) * n0;
357 357
358 carry1 = carry2 = 0; 358 carry1 = carry2 = 0;
359 for (j = 0; j < n_len; j++) { 359 for (j = 0; j < n_len; j++) {
360 bn_mulw_addw_addw(ap[j], bp[i], tp[j], carry1, &carry1, &x); 360 bn_mulw_addw_addw(ap[j], bp[i], tp[j], carry1, &carry1, &x);