/** * (C) 2014 cryptosource GmbH * (C) 2014 Falko Strenzke fstrenzke@cryptosource.de * * Distributed under the terms of the Botan license * */ #ifndef BOTAN_MCE_KEM_H__ #define BOTAN_MCE_KEM_H__ #include #include namespace Botan { class BOTAN_DLL McEliece_KEM_Encryptor { public: McEliece_KEM_Encryptor(const McEliece_PublicKey& public_key); /** * returns the pair (mceliece ciphertext, symmetric key) */ std::pair, secure_vector> encrypt(RandomNumberGenerator& rng); private: McEliece_Public_Operation m_raw_pub_op; }; class BOTAN_DLL McEliece_KEM_Decryptor { public: McEliece_KEM_Decryptor(const McEliece_PrivateKey& mce_key); /** * returns the derived 512-bit symmetric key */ secure_vector decrypt(const byte msg[], size_t msg_len); /** * returns the derived 512-bit symmetric key */ template secure_vector decrypt_vec(const std::vector& v) { return decrypt(&v[0], v.size()); } private: McEliece_Private_Operation m_raw_priv_op; }; } #endif /* h-guard */