diff options
Diffstat (limited to 'src/libstate/lookup.cpp')
-rw-r--r-- | src/libstate/lookup.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp index 24a46e3e9..1263c0897 100644 --- a/src/libstate/lookup.cpp +++ b/src/libstate/lookup.cpp @@ -108,4 +108,18 @@ Keyed_Filter* get_cipher(const std::string& algo_spec, key, InitializationVector(), direction); } +AEAD_Mode* get_aead(const std::string& algo_spec, + Cipher_Dir direction) + { + std::unique_ptr<Keyed_Filter> c(get_cipher(algo_spec, direction)); + + if(AEAD_Mode* aead = dynamic_cast<AEAD_Mode*>(c.get())) + { + c.release(); + return aead; + } + + return nullptr; + } + } |