aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 05:29:39 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-17 05:29:39 +0300
commit5eccc857d96d6cf1e0e77cf8685b9b414137c1d9 (patch)
tree80fbf5c5cc77e74febcbe37464d95fc9f9d5fdcd
parentexamples: C++/libaesnixx instead of C/libaes (diff)
downloadaes-tools-5eccc857d96d6cf1e0e77cf8685b9b414137c1d9.tar.gz
aes-tools-5eccc857d96d6cf1e0e77cf8685b9b414137c1d9.zip
cxx: add block parsing
Diffstat (limited to '')
-rw-r--r--cxx/include/aesnixx/data.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/cxx/include/aesnixx/data.hpp b/cxx/include/aesnixx/data.hpp
index 9eec56c..7a67b27 100644
--- a/cxx/include/aesnixx/data.hpp
+++ b/cxx/include/aesnixx/data.hpp
@@ -69,6 +69,36 @@ namespace aesni
return std::string(str.str);
}
+ void from_string(Block128& dest, const char* src)
+ {
+ aesni_parse_block128(&dest, src, ErrorDetailsThrowsInDestructor());
+ }
+
+ void from_string(Block192& dest, const char* src)
+ {
+ aesni_parse_block192(&dest, src, ErrorDetailsThrowsInDestructor());
+ }
+
+ void from_string(Block256& dest, const char* src)
+ {
+ aesni_parse_block256(&dest, src, ErrorDetailsThrowsInDestructor());
+ }
+
+ void from_string(Block128& dest, const std::string& src)
+ {
+ return from_string(dest, src.c_str());
+ }
+
+ void from_string(Block192& dest, const std::string& src)
+ {
+ return from_string(dest, src.c_str());
+ }
+
+ void from_string(Block256& dest, const std::string& src)
+ {
+ return from_string(dest, src.c_str());
+ }
+
std::string to_matrix_string(const Block128& block)
{
AesNI_BlockMatrixString128 str;