diff options
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/mceies/info.txt | 2 | ||||
-rw-r--r-- | src/lib/pubkey/mceies/mceies.cpp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/pubkey/mceies/info.txt b/src/lib/pubkey/mceies/info.txt index b4a25329e..547e4a47a 100644 --- a/src/lib/pubkey/mceies/info.txt +++ b/src/lib/pubkey/mceies/info.txt @@ -1,5 +1,7 @@ +define MCEIES 20150706 <requires> +aes mce ocb </requires> diff --git a/src/lib/pubkey/mceies/mceies.cpp b/src/lib/pubkey/mceies/mceies.cpp index 9e9ae1cb8..58dde2e27 100644 --- a/src/lib/pubkey/mceies/mceies.cpp +++ b/src/lib/pubkey/mceies/mceies.cpp @@ -45,9 +45,10 @@ mceies_encrypt(const McEliece_PublicKey& pubkey, BOTAN_ASSERT(mce_ciphertext.size() == mce_code_bytes, "Unexpected size"); - std::unique_ptr<AEAD_Mode> aead(get_aead("AES-256/OCB", ENCRYPTION)); + const std::string algo = "AES-256/OCB"; + std::unique_ptr<AEAD_Mode> aead(get_aead(algo, ENCRYPTION)); if(!aead) - throw std::runtime_error("mce_encrypt unable to create AEAD instance"); + throw std::runtime_error("mce_encrypt unable to create AEAD instance '" + algo + "'"); const size_t nonce_len = aead->default_nonce_length(); @@ -77,9 +78,11 @@ mceies_decrypt(const McEliece_PrivateKey& privkey, const size_t mce_code_bytes = (privkey.get_code_length() + 7) / 8; - std::unique_ptr<AEAD_Mode> aead(get_aead("AES-256/OCB", DECRYPTION)); + + const std::string algo = "AES-256/OCB"; + std::unique_ptr<AEAD_Mode> aead(get_aead(algo, DECRYPTION)); if(!aead) - throw std::runtime_error("Unable to create AEAD instance"); + throw std::runtime_error("Unable to create AEAD instance '" + algo + "'"); const size_t nonce_len = aead->default_nonce_length(); |