aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/bitsliced-aes/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/monniaux/bitsliced-aes/utils.c')
-rw-r--r--test/monniaux/bitsliced-aes/utils.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/monniaux/bitsliced-aes/utils.c b/test/monniaux/bitsliced-aes/utils.c
new file mode 100644
index 00000000..3b375bb1
--- /dev/null
+++ b/test/monniaux/bitsliced-aes/utils.c
@@ -0,0 +1,30 @@
+
+#ifndef TEST_FOOTPRINT
+#include <stdio.h>
+#include "utils.h"
+
+
+void dump_hex(uint8_t * h, int len)
+{
+ while(len--)
+ printf("%02hhx",*h++);
+ printf("\n");
+}
+
+void dump_word(word_t * h, int len)
+{
+ while(len--)
+ if ((len+1) % 8) printf("%" WPAD WFMT "\n",*h++);
+ else printf("%d:\n%" WPAD WFMT "\n",128-len-1,*h++);
+
+ printf("\n");
+}
+
+void dump_block(word_t * h, int len)
+{
+ while(len-=2 >= 0)
+ printf("%" WPAD WFMT"%" WPAD WFMT "\n",*h++,*h++);
+ printf("\n");
+}
+
+#endif