diff options
author | Simon Warta <[email protected]> | 2015-06-23 20:07:15 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-23 20:07:15 +0200 |
commit | fd1c77c5cf8d86c6ba6d2f5c8cf898502c463eba (patch) | |
tree | 6ac5df8e74d2ad203f03da28aba46e2a4bfdbea5 /src/lib/pubkey/pubkey.h | |
parent | 2a83523815461a4aa461ce5cc3b1288727440705 (diff) |
lib/pubkey: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/pubkey/pubkey.h')
-rw-r--r-- | src/lib/pubkey/pubkey.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h index 54c55c597..c95ed4469 100644 --- a/src/lib/pubkey/pubkey.h +++ b/src/lib/pubkey/pubkey.h @@ -53,7 +53,7 @@ class BOTAN_DLL PK_Encryptor std::vector<byte> encrypt(const std::vector<byte, Alloc>& in, RandomNumberGenerator& rng) const { - return enc(&in[0], in.size(), rng); + return enc(in.data(), in.size(), rng); } /** @@ -99,7 +99,7 @@ class BOTAN_DLL PK_Decryptor template<typename Alloc> secure_vector<byte> decrypt(const std::vector<byte, Alloc>& in) const { - return dec(&in[0], in.size()); + return dec(in.data(), in.size()); } PK_Decryptor() {} @@ -142,11 +142,11 @@ class BOTAN_DLL PK_Signer */ std::vector<byte> sign_message(const std::vector<byte>& in, RandomNumberGenerator& rng) - { return sign_message(&in[0], in.size(), rng); } + { return sign_message(in.data(), in.size(), rng); } std::vector<byte> sign_message(const secure_vector<byte>& in, RandomNumberGenerator& rng) - { return sign_message(&in[0], in.size(), rng); } + { return sign_message(in.data(), in.size(), rng); } /** * Add a message part (single byte). @@ -165,7 +165,7 @@ class BOTAN_DLL PK_Signer * Add a message part. * @param in the message part to add */ - void update(const std::vector<byte>& in) { update(&in[0], in.size()); } + void update(const std::vector<byte>& in) { update(in.data(), in.size()); } /** * Get the signature of the so far processed message (provided by the @@ -224,8 +224,8 @@ class BOTAN_DLL PK_Verifier bool verify_message(const std::vector<byte, Alloc>& msg, const std::vector<byte, Alloc2>& sig) { - return verify_message(&msg[0], msg.size(), - &sig[0], sig.size()); + return verify_message(msg.data(), msg.size(), + sig.data(), sig.size()); } /** @@ -249,7 +249,7 @@ class BOTAN_DLL PK_Verifier * @param in the new message part */ void update(const std::vector<byte>& in) - { update(&in[0], in.size()); } + { update(in.data(), in.size()); } /** * Check the signature of the buffered message, i.e. the one build @@ -269,7 +269,7 @@ class BOTAN_DLL PK_Verifier template<typename Alloc> bool check_signature(const std::vector<byte, Alloc>& sig) { - return check_signature(&sig[0], sig.size()); + return check_signature(sig.data(), sig.size()); } /** @@ -326,7 +326,7 @@ class BOTAN_DLL PK_Key_Agreement const byte params[], size_t params_len) const { - return derive_key(key_len, &in[0], in.size(), + return derive_key(key_len, in.data(), in.size(), params, params_len); } @@ -356,7 +356,7 @@ class BOTAN_DLL PK_Key_Agreement const std::vector<byte>& in, const std::string& params = "") const { - return derive_key(key_len, &in[0], in.size(), + return derive_key(key_len, in.data(), in.size(), reinterpret_cast<const byte*>(params.data()), params.length()); } |