aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-13 15:21:31 +0000
committerlloyd <[email protected]>2010-09-13 15:21:31 +0000
commit4a7e9edcc92b08a285ea24549fd8c813d10b63b9 (patch)
tree569e357cbc1bd2b195c1b10b281f6c0bbf01fd33 /src/math
parent27d79c87365105d6128afe9eaf8a82383976ed44 (diff)
First set of changes for avoiding use implicit vector->pointer conversions
Diffstat (limited to 'src/math')
-rw-r--r--src/math/numbertheory/dsa_gen.cpp6
-rw-r--r--src/math/numbertheory/powm_mnt.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/math/numbertheory/dsa_gen.cpp b/src/math/numbertheory/dsa_gen.cpp
index 535c22976..e88af0d87 100644
--- a/src/math/numbertheory/dsa_gen.cpp
+++ b/src/math/numbertheory/dsa_gen.cpp
@@ -98,10 +98,10 @@ bool generate_dsa_primes(RandomNumberGenerator& rng,
{
++seed;
hash->update(seed);
- hash->final(V + HASH_SIZE * (n-k));
+ hash->final(&V[HASH_SIZE * (n-k)]);
}
- X.binary_decode(V + (HASH_SIZE - 1 - b/8),
+ X.binary_decode(&V[HASH_SIZE - 1 - b/8],
V.size() - (HASH_SIZE - 1 - b/8));
X.set_bit(pbits-1);
@@ -125,7 +125,7 @@ SecureVector<byte> generate_dsa_primes(RandomNumberGenerator& rng,
while(true)
{
- rng.randomize(seed, seed.size());
+ rng.randomize(&seed[0], seed.size());
if(generate_dsa_primes(rng, af, p, q, pbits, qbits, seed))
return seed;
diff --git a/src/math/numbertheory/powm_mnt.cpp b/src/math/numbertheory/powm_mnt.cpp
index b565d7a21..7e6b2c811 100644
--- a/src/math/numbertheory/powm_mnt.cpp
+++ b/src/math/numbertheory/powm_mnt.cpp
@@ -52,7 +52,7 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
SecureVector<word> workspace(z.size());
g[0] = (base >= modulus) ? (base % modulus) : base;
- bigint_mul(&z[0], z.size(), workspace,
+ bigint_mul(&z[0], z.size(), &workspace[0],
g[0].data(), g[0].size(), g[0].sig_words(),
R2.data(), R2.size(), R2.sig_words());
@@ -67,7 +67,7 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
const u32bit y_sig = y.sig_words();
zeroise(z);
- bigint_mul(&z[0], z.size(), workspace,
+ bigint_mul(&z[0], z.size(), &workspace[0],
x.data(), x.size(), x_sig,
y.data(), y.size(), y_sig);
@@ -91,7 +91,7 @@ BigInt Montgomery_Exponentiator::execute() const
for(u32bit k = 0; k != window_bits; ++k)
{
zeroise(z);
- bigint_sqr(&z[0], z.size(), workspace,
+ bigint_sqr(&z[0], z.size(), &workspace[0],
x.data(), x.size(), x.sig_words());
montgomery_reduce(x, z, modulus, mod_words, mod_prime);
@@ -103,7 +103,7 @@ BigInt Montgomery_Exponentiator::execute() const
const BigInt& y = g[nibble-1];
zeroise(z);
- bigint_mul(&z[0], z.size(), workspace,
+ bigint_mul(&z[0], z.size(), &workspace[0],
x.data(), x.size(), x.sig_words(),
y.data(), y.size(), y.sig_words());