aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/pbkdf/pbkdf.cpp4
-rw-r--r--src/lib/pbkdf/pbkdf.h4
-rw-r--r--src/lib/pbkdf/pbkdf1/pbkdf1.cpp4
-rw-r--r--src/lib/pbkdf/pbkdf2/pbkdf2.cpp12
4 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/pbkdf/pbkdf.cpp b/src/lib/pbkdf/pbkdf.cpp
index 6fbf8ba37..7f0a68a01 100644
--- a/src/lib/pbkdf/pbkdf.cpp
+++ b/src/lib/pbkdf/pbkdf.cpp
@@ -39,7 +39,7 @@ secure_vector<byte> PBKDF::pbkdf_iterations(size_t out_len,
size_t iterations) const
{
secure_vector<byte> out(out_len);
- pbkdf_iterations(&out[0], out_len, passphrase, salt, salt_len, iterations);
+ pbkdf_iterations(out.data(), out_len, passphrase, salt, salt_len, iterations);
return out;
}
@@ -50,7 +50,7 @@ secure_vector<byte> PBKDF::pbkdf_timed(size_t out_len,
size_t& iterations) const
{
secure_vector<byte> out(out_len);
- pbkdf_timed(&out[0], out_len, passphrase, salt, salt_len, msec, iterations);
+ pbkdf_timed(out.data(), out_len, passphrase, salt, salt_len, msec, iterations);
return out;
}
diff --git a/src/lib/pbkdf/pbkdf.h b/src/lib/pbkdf/pbkdf.h
index 3eaa293a1..5f6cd904c 100644
--- a/src/lib/pbkdf/pbkdf.h
+++ b/src/lib/pbkdf/pbkdf.h
@@ -107,7 +107,7 @@ class BOTAN_DLL PBKDF
const std::vector<byte, Alloc>& salt,
size_t iterations) const
{
- return pbkdf_iterations(out_len, passphrase, &salt[0], salt.size(), iterations);
+ return pbkdf_iterations(out_len, passphrase, salt.data(), salt.size(), iterations);
}
/**
@@ -143,7 +143,7 @@ class BOTAN_DLL PBKDF
std::chrono::milliseconds msec,
size_t& iterations) const
{
- return pbkdf_timed(out_len, passphrase, &salt[0], salt.size(), msec, iterations);
+ return pbkdf_timed(out_len, passphrase, salt.data(), salt.size(), msec, iterations);
}
};
diff --git a/src/lib/pbkdf/pbkdf1/pbkdf1.cpp b/src/lib/pbkdf/pbkdf1/pbkdf1.cpp
index 8134b39c4..a2b5957a0 100644
--- a/src/lib/pbkdf/pbkdf1/pbkdf1.cpp
+++ b/src/lib/pbkdf/pbkdf1/pbkdf1.cpp
@@ -45,12 +45,12 @@ size_t PKCS5_PBKDF1::pbkdf(byte output_buf[], size_t output_len,
break;
m_hash->update(key);
- m_hash->final(&key[0]);
+ m_hash->final(key.data());
++iterations_performed;
}
- copy_mem(output_buf, &key[0], output_len);
+ copy_mem(output_buf, key.data(), output_len);
return iterations_performed;
}
diff --git a/src/lib/pbkdf/pbkdf2/pbkdf2.cpp b/src/lib/pbkdf/pbkdf2/pbkdf2.cpp
index ab3735bac..a27b9b15c 100644
--- a/src/lib/pbkdf/pbkdf2/pbkdf2.cpp
+++ b/src/lib/pbkdf/pbkdf2/pbkdf2.cpp
@@ -66,9 +66,9 @@ pbkdf2(MessageAuthenticationCode& prf,
prf.update(salt, salt_len);
prf.update_be(counter++);
- prf.final(&U[0]);
+ prf.final(U.data());
- xor_buf(out, &U[0], prf_output);
+ xor_buf(out, U.data(), prf_output);
if(iterations == 0)
{
@@ -84,8 +84,8 @@ pbkdf2(MessageAuthenticationCode& prf,
while(true)
{
prf.update(U);
- prf.final(&U[0]);
- xor_buf(out, &U[0], prf_output);
+ prf.final(U.data());
+ xor_buf(out, U.data(), prf_output);
iterations++;
/*
@@ -107,8 +107,8 @@ pbkdf2(MessageAuthenticationCode& prf,
for(size_t i = 1; i != iterations; ++i)
{
prf.update(U);
- prf.final(&U[0]);
- xor_buf(out, &U[0], prf_output);
+ prf.final(U.data());
+ xor_buf(out, U.data(), prf_output);
}
}