diff options
author | Jack Lloyd <[email protected]> | 2018-03-01 17:39:56 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-01 18:00:57 -0500 |
commit | d36a745ccfd3efec8a011dd1d76e34bbc3f193fb (patch) | |
tree | e8ebb6b59b88cd2213c9c729eb2b4984dccda912 | |
parent | 7801984d217b150c231b9e896179dc4ca729b831 (diff) |
Tiny but useful optimization in bigint_monty_redc
Increases perf of larger DH by 5-8%
-rw-r--r-- | src/lib/math/mp/mp_monty.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/math/mp/mp_monty.cpp b/src/lib/math/mp/mp_monty.cpp index b2b3b5e4e..e2f93a9a7 100644 --- a/src/lib/math/mp/mp_monty.cpp +++ b/src/lib/math/mp/mp_monty.cpp @@ -60,7 +60,7 @@ void bigint_monty_redc(word z[], for(size_t j = p_size + 1; j < z_size - i; ++j) { z_i[j] += carry; - carry = carry & !z_i[j]; + carry = (z_i[j] < carry); } } |