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/mceies | |
parent | 2a83523815461a4aa461ce5cc3b1288727440705 (diff) |
lib/pubkey: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/pubkey/mceies')
-rw-r--r-- | src/lib/pubkey/mceies/mceies.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/pubkey/mceies/mceies.cpp b/src/lib/pubkey/mceies/mceies.cpp index 3fec1fd48..6b013c250 100644 --- a/src/lib/pubkey/mceies/mceies.cpp +++ b/src/lib/pubkey/mceies/mceies.cpp @@ -57,9 +57,9 @@ mceies_encrypt(const McEliece_PublicKey& pubkey, const secure_vector<byte> nonce = rng.random_vec(nonce_len); secure_vector<byte> msg(mce_ciphertext.size() + nonce.size() + pt.size()); - copy_mem(&msg[0], &mce_ciphertext[0], mce_ciphertext.size()); - copy_mem(&msg[mce_ciphertext.size()], &nonce[0], nonce.size()); - copy_mem(&msg[mce_ciphertext.size() + nonce.size()], &pt[0], pt.size()); + copy_mem(msg.data(), mce_ciphertext.data(), mce_ciphertext.size()); + copy_mem(&msg[mce_ciphertext.size()], nonce.data(), nonce.size()); + copy_mem(&msg[mce_ciphertext.size() + nonce.size()], pt.data(), pt.size()); aead->start(nonce); aead->finish(msg, mce_ciphertext.size() + nonce.size()); @@ -86,7 +86,7 @@ mceies_decrypt(const McEliece_PrivateKey& privkey, if(ct.size() < mce_code_bytes + nonce_len + aead->tag_size()) throw std::runtime_error("Input message too small to be valid"); - const secure_vector<byte> mce_key = kem_op.decrypt(&ct[0], mce_code_bytes); + const secure_vector<byte> mce_key = kem_op.decrypt(ct.data(), mce_code_bytes); aead->set_key(aead_key(mce_key, *aead)); aead->set_associated_data(ad, ad_len); |