summaryrefslogtreecommitdiff
path: root/xmss_commons.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmss_commons.c')
-rw-r--r--xmss_commons.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/xmss_commons.c b/xmss_commons.c
new file mode 100644
index 000000000..51171af91
--- /dev/null
+++ b/xmss_commons.c
@@ -0,0 +1,27 @@
1/*
2xmss_commons.c 20160722
3Andreas Hülsing
4Joost Rijneveld
5Public domain.
6*/
7
8#include "xmss_commons.h"
9#include <stdlib.h>
10#include <stdio.h>
11#include <stdint.h>
12
13void to_byte(unsigned char *out, unsigned long long in, uint32_t bytes)
14{
15 int32_t i;
16 for (i = bytes-1; i >= 0; i--) {
17 out[i] = in & 0xff;
18 in = in >> 8;
19 }
20}
21
22void hexdump(const unsigned char *a, size_t len)
23{
24 size_t i;
25 for (i = 0; i < len; i++)
26 printf("%02x", a[i]);
27} \ No newline at end of file