aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-24 18:04:26 +0000
committerlloyd <[email protected]>2010-09-24 18:04:26 +0000
commit27126e7bf1ac37a9aebd7a03db86669759962289 (patch)
treee93ba7350219ad45d6f22740520da77b73452674
parent6bce29a5d0e2a004fdbac4f30e35c9266ff45295 (diff)
Minor performance tweak, avoid zeroing things we'll immediately write
to. Helps more than I would have thought.
-rw-r--r--src/math/bigint/monty_generic/mp_monty.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/math/bigint/monty_generic/mp_monty.cpp b/src/math/bigint/monty_generic/mp_monty.cpp
index d8c88a7e7..bce35259a 100644
--- a/src/math/bigint/monty_generic/mp_monty.cpp
+++ b/src/math/bigint/monty_generic/mp_monty.cpp
@@ -63,9 +63,8 @@ void bigint_monty_redc(word z[], u32bit z_size,
copy_mem(ws + x_size + 1, z + x_size, x_size + 1);
- clear_mem(z, z_size);
-
copy_mem(z, ws + borrow*(x_size+1), x_size + 1);
+ clear_mem(z + x_size + 1, z_size - x_size - 1);
}
}