diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-25 01:10:53 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-25 01:10:53 +0300 |
commit | 1be5109d775697065d234a70b948de52e55efbd6 (patch) | |
tree | 0d4cfc62ee3568bead328709de857676170711a7 | |
parent | fix usage messages (diff) | |
download | aes-tools-1be5109d775697065d234a70b948de52e55efbd6.tar.gz aes-tools-1be5109d775697065d234a70b948de52e55efbd6.zip |
cxx: implement more stuff
Diffstat (limited to '')
-rw-r--r-- | cxx/include/aesnixx/algorithm.hpp | 16 | ||||
-rw-r--r-- | cxx/include/aesnixx/all.hpp | 2 | ||||
-rw-r--r-- | cxx/include/aesnixx/mode.hpp | 16 | ||||
-rw-r--r-- | utils/block/cxx/aes_common.hpp | 18 | ||||
-rw-r--r-- | utils/file/cxx/aes_common.hpp | 18 |
5 files changed, 52 insertions, 18 deletions
diff --git a/cxx/include/aesnixx/algorithm.hpp b/cxx/include/aesnixx/algorithm.hpp new file mode 100644 index 0000000..85d2fc4 --- /dev/null +++ b/cxx/include/aesnixx/algorithm.hpp @@ -0,0 +1,16 @@ +/** + * \file + * \author Egor Tensin <Egor.Tensin@gmail.com> + * \date 2015 + * \copyright This file is licensed under the terms of the MIT License. + * See LICENSE.txt for details. + */ + +#pragma once + +#include <aesni/all.h> + +namespace aesni +{ + typedef AesNI_Algorithm Algorithm; +} diff --git a/cxx/include/aesnixx/all.hpp b/cxx/include/aesnixx/all.hpp index 1452f68..2bdf301 100644 --- a/cxx/include/aesnixx/all.hpp +++ b/cxx/include/aesnixx/all.hpp @@ -9,6 +9,8 @@ #pragma once #include "aes.hpp" +#include "algorithm.hpp" #include "data.hpp" #include "debug.hpp" #include "error.hpp" +#include "mode.hpp" diff --git a/cxx/include/aesnixx/mode.hpp b/cxx/include/aesnixx/mode.hpp new file mode 100644 index 0000000..ec26170 --- /dev/null +++ b/cxx/include/aesnixx/mode.hpp @@ -0,0 +1,16 @@ +/** + * \file + * \author Egor Tensin <Egor.Tensin@gmail.com> + * \date 2015 + * \copyright This file is licensed under the terms of the MIT License. + * See LICENSE.txt for details. + */ + +#pragma once + +#include <aesni/all.h> + +namespace aesni +{ + typedef AesNI_Mode Mode; +} diff --git a/utils/block/cxx/aes_common.hpp b/utils/block/cxx/aes_common.hpp index 78126e5..cd5d669 100644 --- a/utils/block/cxx/aes_common.hpp +++ b/utils/block/cxx/aes_common.hpp @@ -8,7 +8,7 @@ #pragma once -#include <aesni/all.h> +#include <aesnixx/all.hpp> #include <boost/algorithm/string.hpp> #include <boost/program_options.hpp> @@ -22,7 +22,7 @@ #include <string> #include <vector> -static std::istream& operator>>(std::istream& is, AesNI_Mode& dest) +static std::istream& operator>>(std::istream& is, aesni::Mode& dest) { std::string src; is >> src; @@ -43,7 +43,7 @@ static std::istream& operator>>(std::istream& is, AesNI_Mode& dest) return is; } -static std::istream& operator>>(std::istream& is, AesNI_Algorithm& dest) +static std::istream& operator>>(std::istream& is, aesni::Algorithm& dest) { std::string src; is >> src; @@ -76,8 +76,8 @@ namespace m_options.add_options() ("help,h", "show this message and exit") - ("mode,m", po::value<AesNI_Mode>(&m_mode)->required(), "set mode of operation") - ("algorithm,a", po::value<AesNI_Algorithm>(&m_algorithm)->required(), "set algorithm"); + ("mode,m", po::value<aesni::Mode>(&m_mode)->required(), "set mode of operation") + ("algorithm,a", po::value<aesni::Algorithm>(&m_algorithm)->required(), "set algorithm"); po::options_description hidden_options; hidden_options.add_options() @@ -108,12 +108,12 @@ namespace std::cout << m_options << "\n"; } - AesNI_Mode get_mode() const + aesni::Mode get_mode() const { return m_mode; } - AesNI_Algorithm get_algorithm() const + aesni::Algorithm get_algorithm() const { return m_algorithm; } @@ -127,8 +127,8 @@ namespace const std::string m_program_name; boost::program_options::options_description m_options; - AesNI_Mode m_mode; - AesNI_Algorithm m_algorithm; + aesni::Mode m_mode; + aesni::Algorithm m_algorithm; std::vector<std::string> m_args; }; } diff --git a/utils/file/cxx/aes_common.hpp b/utils/file/cxx/aes_common.hpp index c15565f..28e16df 100644 --- a/utils/file/cxx/aes_common.hpp +++ b/utils/file/cxx/aes_common.hpp @@ -8,7 +8,7 @@ #pragma once -#include <aesni/all.h> +#include <aesnixx/all.hpp> #include <boost/algorithm/string.hpp> #include <boost/program_options.hpp> @@ -20,7 +20,7 @@ #include <string> #include <vector> -static std::istream& operator>>(std::istream& is, AesNI_Mode& dest) +static std::istream& operator>>(std::istream& is, aesni::Mode& dest) { std::string src; is >> src; @@ -41,7 +41,7 @@ static std::istream& operator>>(std::istream& is, AesNI_Mode& dest) return is; } -static std::istream& operator>>(std::istream& is, AesNI_Algorithm& dest) +static std::istream& operator>>(std::istream& is, aesni::Algorithm& dest) { std::string src; is >> src; @@ -74,8 +74,8 @@ namespace m_options.add_options() ("help,h", "show this message and exit") - ("mode,m", po::value<AesNI_Mode>(&m_mode)->required(), "set mode of operation") - ("algorithm,a", po::value<AesNI_Algorithm>(&m_algorithm)->required(), "set algorithm"); + ("mode,m", po::value<aesni::Mode>(&m_mode)->required(), "set mode of operation") + ("algorithm,a", po::value<aesni::Algorithm>(&m_algorithm)->required(), "set algorithm"); po::options_description hidden_options; hidden_options.add_options() @@ -106,12 +106,12 @@ namespace std::cout << m_options << "\n"; } - AesNI_Mode get_mode() const + aesni::Mode get_mode() const { return m_mode; } - AesNI_Algorithm get_algorithm() const + aesni::Algorithm get_algorithm() const { return m_algorithm; } @@ -125,8 +125,8 @@ namespace const std::string m_program_name; boost::program_options::options_description m_options; - AesNI_Mode m_mode; - AesNI_Algorithm m_algorithm; + aesni::Mode m_mode; + aesni::Algorithm m_algorithm; std::vector<std::string> m_args; }; } |