aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/math.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-05-02 20:28:18 -0400
committerJack Lloyd <[email protected]>2018-05-02 20:34:49 -0400
commitc446f0791175c41b7a70f64506c71ddfafe5a3c1 (patch)
treeb992211ab7fa909a1ad2819a62c7e657450127b1 /src/cli/math.cpp
parent9aafe361e714a0376d5bf4ebfdaae6e0a3aaa915 (diff)
Use Montgomery_Int::sub to avoid an allocation
Diffstat (limited to 'src/cli/math.cpp')
-rw-r--r--src/cli/math.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cli/math.cpp b/src/cli/math.cpp
index 0ddc9c48c..0ba709f36 100644
--- a/src/cli/math.cpp
+++ b/src/cli/math.cpp
@@ -176,8 +176,8 @@ class Factor final : public Command
Botan::Montgomery_Int x(monty_n, Botan::BigInt::random_integer(rng, 2, n - 3), false);
Botan::Montgomery_Int y = x;
Botan::Montgomery_Int z = one;
- Botan::BigInt d;
Botan::Montgomery_Int t(monty_n);
+ Botan::BigInt d;
Botan::secure_vector<Botan::word> ws;
@@ -196,7 +196,7 @@ class Factor final : public Command
x.add(one, ws);
t = y;
- t -= x;
+ t.sub(x, ws);
z.mul_by(t, ws);