aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/aesni/data.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-05-22 01:03:07 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-05-22 01:03:07 +0300
commit1463fd0559e0a664cd6a1bf6462a68dd79e58814 (patch)
treecd9ba513f473186a0780baf3f212c57d4521d91f /include/aesni/data.h
downloadaes-tools-1463fd0559e0a664cd6a1bf6462a68dd79e58814.tar.gz
aes-tools-1463fd0559e0a664cd6a1bf6462a68dd79e58814.zip
initial commit
Diffstat (limited to 'include/aesni/data.h')
-rw-r--r--include/aesni/data.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/aesni/data.h b/include/aesni/data.h
new file mode 100644
index 0000000..029d8c8
--- /dev/null
+++ b/include/aesni/data.h
@@ -0,0 +1,41 @@
+/**
+ * \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 <emmintrin.h>
+
+typedef __m128i AesBlock;
+
+AesBlock make_aes_block(int highest, int high, int low, int lowest);
+
+typedef AesBlock Aes128Key;
+
+typedef struct
+{
+ AesBlock hi;
+ AesBlock lo;
+}
+Aes192Key;
+
+typedef struct
+{
+ AesBlock hi;
+ AesBlock lo;
+}
+Aes256Key;
+
+typedef struct
+{
+ unsigned char bytes[4][4];
+}
+AesState;
+
+AesState aes_block_to_state(AesBlock);
+
+void print_aes_block(AesBlock);