aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/bitsliced-aes/utils.c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-30 11:08:09 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-30 11:08:09 +0100
commit3e6decf91e07646e137cff11cb31c87ced574467 (patch)
treee4e50a8f0f3c378658d5fb204dd41322b73a2953 /test/monniaux/bitsliced-aes/utils.c
parent07f94da073dede202ff88f3893f15828243b44a3 (diff)
downloadcompcert-kvx-3e6decf91e07646e137cff11cb31c87ced574467.tar.gz
compcert-kvx-3e6decf91e07646e137cff11cb31c87ced574467.zip
https://github.com/conorpp/bitsliced-aes
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