aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/bigint/big_ops3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/math/bigint/big_ops3.cpp')
-rw-r--r--src/lib/math/bigint/big_ops3.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/math/bigint/big_ops3.cpp b/src/lib/math/bigint/big_ops3.cpp
index 492a69ad0..3f34e0bf1 100644
--- a/src/lib/math/bigint/big_ops3.cpp
+++ b/src/lib/math/bigint/big_ops3.cpp
@@ -126,6 +126,24 @@ BigInt operator*(const BigInt& x, const BigInt& y)
}
/*
+* Multiplication Operator
+*/
+BigInt operator*(const BigInt& x, word y)
+ {
+ const size_t x_sw = x.sig_words();
+
+ BigInt z(BigInt::Positive, x_sw + 1);
+
+ if(x_sw && y)
+ {
+ bigint_linmul3(z.mutable_data(), x.data(), x_sw, y);
+ z.set_sign(x.sign());
+ }
+
+ return z;
+ }
+
+/*
* Division Operator
*/
BigInt operator/(const BigInt& x, const BigInt& y)