Botan  1.11.15
src/lib/modes/aead/aead.cpp
Go to the documentation of this file.
00001 /*
00002 * (C) 2013,2015 Jack Lloyd
00003 *
00004 * Botan is released under the Simplified BSD License (see license.txt)
00005 */
00006 
00007 #include <botan/internal/mode_utils.h>
00008 #include <botan/aead.h>
00009 
00010 namespace Botan {
00011 
00012 AEAD_Mode* get_aead(const std::string& algo_spec, Cipher_Dir direction)
00013    {
00014    std::unique_ptr<Cipher_Mode> mode(get_cipher_mode(algo_spec, direction));
00015 
00016    if(AEAD_Mode* aead = dynamic_cast<AEAD_Mode*>(mode.get()))
00017       {
00018       mode.release();
00019       return aead;
00020       }
00021 
00022    return nullptr;
00023    }
00024 
00025 }