aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-05-24 17:47:15 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-05-24 17:47:15 +0300
commitbec414fe59dcc319183aab9ca9cbd70fbb4242df (patch)
tree89632780cc459350723b193aac2689b924878542 /src
parentadd higher-level encrypt/decrypt functions (diff)
downloadaes-tools-bec414fe59dcc319183aab9ca9cbd70fbb4242df.tar.gz
aes-tools-bec414fe59dcc319183aab9ca9cbd70fbb4242df.zip
add FIPS-style printing to AES-192/256 blocks
Diffstat (limited to '')
-rw-r--r--src/common.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 50d9886..9aed290 100644
--- a/src/common.c
+++ b/src/common.c
@@ -163,3 +163,35 @@ void print_aes_block128_fips_matrix_style(AesBlock128* block)
printf("%02x\n", bytes[3][i]);
}
}
+
+void print_aes_block192_fips_matrix_style(AesBlock192* block)
+{
+ int i, j;
+ __declspec(align(16)) unsigned char bytes[8][4];
+
+ _mm_store_si128((AesBlock128*) bytes, block->lo);
+ _mm_store_si128((AesBlock128*) bytes + 1, block->hi);
+
+ for (i = 0; i < 4; ++i)
+ {
+ for (j = 0; j < 5; ++j)
+ printf("%02x ", bytes[j][i]);
+ printf("%02x\n", bytes[5][i]);
+ }
+}
+
+void print_aes_block256_fips_matrix_style(AesBlock256* block)
+{
+ int i, j;
+ __declspec(align(16)) unsigned char bytes[8][4];
+
+ _mm_store_si128((AesBlock128*) bytes, block->lo);
+ _mm_store_si128((AesBlock128*) bytes + 1, block->hi);
+
+ for (i = 0; i < 4; ++i)
+ {
+ for (j = 0; j < 7; ++j)
+ printf("%02x ", bytes[j][i]);
+ printf("%02x\n", bytes[7][i]);
+ }
+}