aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-08-01 14:28:35 +0000
committerlloyd <[email protected]>2012-08-01 14:28:35 +0000
commitcbefe4dd95982006e4d8391aea645e40baa17496 (patch)
treedccafc4a8ebd87d40a930dbd268fdcf449801208 /src
parentd23dffe70d1f0b2ef6bd18d1c490fff52b8b401c (diff)
Remove BigInt::get_reg
Diffstat (limited to 'src')
-rw-r--r--src/engine/gnump/gmp_wrap.cpp4
-rw-r--r--src/math/bigint/bigint.cpp6
-rw-r--r--src/math/bigint/bigint.h9
3 files changed, 6 insertions, 13 deletions
diff --git a/src/engine/gnump/gmp_wrap.cpp b/src/engine/gnump/gmp_wrap.cpp
index 22c46c7ad..9a5016d36 100644
--- a/src/engine/gnump/gmp_wrap.cpp
+++ b/src/engine/gnump/gmp_wrap.cpp
@@ -88,9 +88,9 @@ BigInt GMP_MPZ::to_bigint() const
BigInt out(BigInt::Positive, (bytes() + sizeof(word) - 1) / sizeof(word));
size_t dummy = 0;
- auto reg = out.get_reg();
+ const word* reg = out.data();
- mpz_export(&reg[0], &dummy, -1, sizeof(word), 0, 0, value);
+ mpz_export(reg, &dummy, -1, sizeof(word), 0, 0, value);
if(mpz_sgn(value) < 0)
out.flip_sign();
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp
index 8669beea3..e28f71df5 100644
--- a/src/math/bigint/bigint.cpp
+++ b/src/math/bigint/bigint.cpp
@@ -42,10 +42,10 @@ BigInt::BigInt(Sign s, size_t size)
/*
* Copy constructor
*/
-BigInt::BigInt(const BigInt& b)
+BigInt::BigInt(const BigInt& other)
{
- m_reg = b.get_reg();
- set_sign(b.sign());
+ m_reg = other.m_reg;
+ m_signedness = other.m_signedness;
}
/*
diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h
index a74a5c280..81217d0bd 100644
--- a/src/math/bigint/bigint.h
+++ b/src/math/bigint/bigint.h
@@ -268,7 +268,7 @@ class BOTAN_DLL BigInt
* Give size of internal register
* @result size of internal register in words
*/
- size_t size() const { return get_reg().size(); }
+ size_t size() const { return m_reg.size(); }
/**
* Return how many words we need to hold this value
@@ -309,13 +309,6 @@ class BOTAN_DLL BigInt
const word* data() const { return &m_reg[0]; }
/**
- * return a const reference to the internal register containing the value
- * @result a const reference to the word-array (secure_vector<word>)
- * with the internal register value (containing the integer value)
- */
- const secure_vector<word>& get_reg() const { return m_reg; }
-
- /**
* Assign using a plain word array
*/
void assign(const word x[], size_t length)