diff options
Diffstat (limited to 'src/lib/pubkey/mceies')
-rw-r--r-- | src/lib/pubkey/mceies/mceies.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/pubkey/mceies/mceies.cpp b/src/lib/pubkey/mceies/mceies.cpp index 6b013c250..9e9ae1cb8 100644 --- a/src/lib/pubkey/mceies/mceies.cpp +++ b/src/lib/pubkey/mceies/mceies.cpp @@ -58,8 +58,8 @@ mceies_encrypt(const McEliece_PublicKey& pubkey, secure_vector<byte> msg(mce_ciphertext.size() + nonce.size() + 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()); + copy_mem(msg.data() + mce_ciphertext.size(), nonce.data(), nonce.size()); + copy_mem(msg.data() + mce_ciphertext.size() + nonce.size(), pt.data(), pt.size()); aead->start(nonce); aead->finish(msg, mce_ciphertext.size() + nonce.size()); @@ -91,7 +91,7 @@ mceies_decrypt(const McEliece_PrivateKey& privkey, aead->set_key(aead_key(mce_key, *aead)); aead->set_associated_data(ad, ad_len); - secure_vector<byte> pt(&ct[mce_code_bytes + nonce_len], &ct[ct.size()]); + secure_vector<byte> pt(ct.begin() + mce_code_bytes + nonce_len, ct.end()); aead->start(&ct[mce_code_bytes], nonce_len); aead->finish(pt, 0); |