diff options
Diffstat (limited to 'src/lib/pubkey/mceies/mceies.cpp')
-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); |