2018-02-27 03:45:17 +00:00
|
|
|
#ifdef WITH_XMSS
|
2018-02-23 15:58:37 +00:00
|
|
|
/*
|
|
|
|
xmss_commons.c 20160722
|
|
|
|
Andreas Hülsing
|
|
|
|
Joost Rijneveld
|
|
|
|
Public domain.
|
|
|
|
*/
|
|
|
|
|
2018-02-26 01:18:14 +00:00
|
|
|
#include "includes.h"
|
|
|
|
|
2018-02-23 15:58:37 +00:00
|
|
|
#include "xmss_commons.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2018-02-26 06:42:56 +00:00
|
|
|
#ifdef HAVE_STDINT_H
|
2018-02-23 15:58:37 +00:00
|
|
|
#include <stdint.h>
|
2018-02-26 06:42:56 +00:00
|
|
|
#endif
|
2018-02-23 15:58:37 +00:00
|
|
|
|
|
|
|
void to_byte(unsigned char *out, unsigned long long in, uint32_t bytes)
|
|
|
|
{
|
|
|
|
int32_t i;
|
|
|
|
for (i = bytes-1; i >= 0; i--) {
|
|
|
|
out[i] = in & 0xff;
|
|
|
|
in = in >> 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-26 03:51:59 +00:00
|
|
|
#if 0
|
2018-02-23 15:58:37 +00:00
|
|
|
void hexdump(const unsigned char *a, size_t len)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
printf("%02x", a[i]);
|
2018-02-26 01:18:14 +00:00
|
|
|
}
|
2018-02-26 03:51:59 +00:00
|
|
|
#endif
|
2018-02-27 03:45:17 +00:00
|
|
|
#endif /* WITH_XMSS */
|