From 3304264990b96c09b174716ecb8da63d24457ae8 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 21 Dec 2019 14:50:03 +0300 Subject: utils/ -> aesxx/utils/ --- utils/data_parsers.hpp | 59 -------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 utils/data_parsers.hpp (limited to 'utils/data_parsers.hpp') diff --git a/utils/data_parsers.hpp b/utils/data_parsers.hpp deleted file mode 100644 index 1207c7c..0000000 --- a/utils/data_parsers.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2015 Egor Tensin -// This file is part of the "AES tools" project. -// For details, see https://github.com/egor-tensin/aes-tools. -// Distributed under the MIT License. - -#pragma once - -#include - -#include -#include - -#include -#include -#include - -inline std::istream& operator>>(std::istream& is, aes::Mode& dest) -{ - std::string src; - is >> src; - - static const std::unordered_map lookup_table = - { - {"ecb", AES_ECB}, - {"cbc", AES_CBC}, - {"cfb", AES_CFB}, - {"ofb", AES_OFB}, - {"ctr", AES_CTR}, - }; - - const auto it = lookup_table.find(boost::algorithm::to_lower_copy(src)); - - if (it == lookup_table.cend()) - throw boost::program_options::invalid_option_value(src); - - dest = it->second; - return is; -} - -inline std::istream& operator>>(std::istream& is, aes::Algorithm& dest) -{ - std::string src; - is >> src; - - static const std::unordered_map lookup_table = - { - {"aes128", AES_AES128}, - {"aes192", AES_AES192}, - {"aes256", AES_AES256}, - }; - - const auto it = lookup_table.find(boost::algorithm::to_lower_copy(src)); - - if (it == lookup_table.cend()) - throw boost::program_options::invalid_option_value(src); - - dest = it->second; - return is; -} -- cgit v1.2.3