diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-25 05:06:32 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-25 05:06:32 +0300 |
commit | 1814c6c63fbca23e1e22ded012f38fd71489a593 (patch) | |
tree | a6f604db2e7b188936733ba2bde13e775cfd8394 /cxx/include/aesnixx/mode.hpp | |
parent | remove specialized buffer encryption functions (diff) | |
download | aes-tools-1814c6c63fbca23e1e22ded012f38fd71489a593.tar.gz aes-tools-1814c6c63fbca23e1e22ded012f38fd71489a593.zip |
cxx: import more stuff
Diffstat (limited to 'cxx/include/aesnixx/mode.hpp')
-rw-r--r-- | cxx/include/aesnixx/mode.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cxx/include/aesnixx/mode.hpp b/cxx/include/aesnixx/mode.hpp index ec26170..9bcbbd5 100644 --- a/cxx/include/aesnixx/mode.hpp +++ b/cxx/include/aesnixx/mode.hpp @@ -10,7 +10,22 @@ #include <aesni/all.h> +#include <type_traits> + namespace aesni { typedef AesNI_Mode Mode; + + template <Mode mode> + struct ModeRequiresInitializationVector : public std::true_type + { }; + + template <> + struct ModeRequiresInitializationVector<AESNI_ECB> : public std::false_type + { }; + + inline bool mode_requires_initialization_vector(Mode mode) + { + return mode != AESNI_ECB; + } } |