aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/mpi-pow.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-08-02 14:10:55 +0200
committerThomas Gleixner <tglx@linutronix.de>2024-08-02 14:10:55 +0200
commit4436e6da008fee87d54c038e983e5be9a6baf8fb (patch)
tree265a15efcf6f17e0e32e258d66b274fc5cad41d4 /lib/crypto/mpi/mpi-pow.c
parentb7c35279e0da414e7d90eba76f58a16223a734cb (diff)
parent8400291e289ee6b2bf9779ff1c83a291501f017b (diff)
Merge branch 'linus' into x86/mm
Bring x86 and selftests up to date
Diffstat (limited to 'lib/crypto/mpi/mpi-pow.c')
-rw-r--r--lib/crypto/mpi/mpi-pow.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/crypto/mpi/mpi-pow.c b/lib/crypto/mpi/mpi-pow.c
index 2fd7a46d55ec..67fbd4c2503d 100644
--- a/lib/crypto/mpi/mpi-pow.c
+++ b/lib/crypto/mpi/mpi-pow.c
@@ -176,7 +176,6 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
for (;;) {
while (c) {
- mpi_ptr_t tp;
mpi_size_t xsize;
/*if (mpihelp_mul_n(xp, rp, rp, rsize) < 0) goto enomem */
@@ -207,9 +206,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
xsize = msize;
}
- tp = rp;
- rp = xp;
- xp = tp;
+ swap(rp, xp);
rsize = xsize;
if ((mpi_limb_signed_t) e < 0) {
@@ -235,9 +232,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
xsize = msize;
}
- tp = rp;
- rp = xp;
- xp = tp;
+ swap(rp, xp);
rsize = xsize;
}
e <<= 1;