aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory
diff options
context:
space:
mode:
authorDaniel Seither <[email protected]>2015-06-20 18:27:06 +0200
committerDaniel Seither <[email protected]>2015-06-20 19:05:07 +0200
commitf19604516c0138ffc240388073af2ce0735c48aa (patch)
tree007b800a51542e11dabcc72250d9c5ee2d56d9f2 /src/lib/math/numbertheory
parentde51fccc5ad04ca734ee91a829298ee06ee948f4 (diff)
lib/math: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/math/numbertheory')
-rw-r--r--src/lib/math/numbertheory/dsa_gen.cpp2
-rw-r--r--src/lib/math/numbertheory/mp_numth.cpp4
-rw-r--r--src/lib/math/numbertheory/powm_mnt.cpp12
3 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/math/numbertheory/dsa_gen.cpp b/src/lib/math/numbertheory/dsa_gen.cpp
index e28873550..bd3c0e4a1 100644
--- a/src/lib/math/numbertheory/dsa_gen.cpp
+++ b/src/lib/math/numbertheory/dsa_gen.cpp
@@ -120,7 +120,7 @@ std::vector<byte> generate_dsa_primes(RandomNumberGenerator& rng,
while(true)
{
std::vector<byte> seed(qbits / 8);
- rng.randomize(&seed[0], seed.size());
+ rng.randomize(seed.data(), seed.size());
if(generate_dsa_primes(rng, p, q, pbits, qbits, seed))
return seed;
diff --git a/src/lib/math/numbertheory/mp_numth.cpp b/src/lib/math/numbertheory/mp_numth.cpp
index 724f0c774..fafc6b03f 100644
--- a/src/lib/math/numbertheory/mp_numth.cpp
+++ b/src/lib/math/numbertheory/mp_numth.cpp
@@ -23,7 +23,7 @@ BigInt square(const BigInt& x)
secure_vector<word> workspace(z.size());
bigint_sqr(z.mutable_data(), z.size(),
- &workspace[0],
+ workspace.data(),
x.data(), x.size(), x_sw);
return z;
}
@@ -48,7 +48,7 @@ BigInt mul_add(const BigInt& a, const BigInt& b, const BigInt& c)
secure_vector<word> workspace(r.size());
bigint_mul(r.mutable_data(), r.size(),
- &workspace[0],
+ workspace.data(),
a.data(), a.size(), a_sw,
b.data(), b.size(), b_sw);
diff --git a/src/lib/math/numbertheory/powm_mnt.cpp b/src/lib/math/numbertheory/powm_mnt.cpp
index 5e797b195..5c441db3a 100644
--- a/src/lib/math/numbertheory/powm_mnt.cpp
+++ b/src/lib/math/numbertheory/powm_mnt.cpp
@@ -38,7 +38,7 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
m_g[0].data(), m_g[0].size(), m_g[0].sig_words(),
m_R2_mod.data(), m_R2_mod.size(), m_R2_mod.sig_words(),
m_modulus.data(), m_mod_words, m_mod_prime,
- &workspace[0]);
+ workspace.data());
m_g[0] = z;
@@ -48,7 +48,7 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
m_g[1].data(), m_g[1].size(), m_g[1].sig_words(),
m_R2_mod.data(), m_R2_mod.size(), m_R2_mod.sig_words(),
m_modulus.data(), m_mod_words, m_mod_prime,
- &workspace[0]);
+ workspace.data());
m_g[1] = z;
@@ -64,7 +64,7 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
x.data(), x.size(), x_sig,
y.data(), y.size(), y_sig,
m_modulus.data(), m_mod_words, m_mod_prime,
- &workspace[0]);
+ workspace.data());
m_g[i] = z;
}
@@ -91,7 +91,7 @@ BigInt Montgomery_Exponentiator::execute() const
bigint_monty_sqr(z.mutable_data(), z_size,
x.data(), x.size(), x.sig_words(),
m_modulus.data(), m_mod_words, m_mod_prime,
- &workspace[0]);
+ workspace.data());
x = z;
}
@@ -104,7 +104,7 @@ BigInt Montgomery_Exponentiator::execute() const
x.data(), x.size(), x.sig_words(),
y.data(), y.size(), y.sig_words(),
m_modulus.data(), m_mod_words, m_mod_prime,
- &workspace[0]);
+ workspace.data());
x = z;
}
@@ -113,7 +113,7 @@ BigInt Montgomery_Exponentiator::execute() const
bigint_monty_redc(x.mutable_data(),
m_modulus.data(), m_mod_words, m_mod_prime,
- &workspace[0]);
+ workspace.data());
return x;
}