2015-08-11 11:23:30 +01:00
|
|
|
/*
|
2016-02-16 15:31:18 +00:00
|
|
|
xmss_commons.c 20160210
|
2015-08-11 11:23:30 +01:00
|
|
|
Andreas Hülsing
|
2016-02-16 15:31:18 +00:00
|
|
|
Joost Rijneveld
|
2015-08-11 11:23:30 +01:00
|
|
|
Public domain.
|
|
|
|
*/
|
|
|
|
|
2015-08-11 11:08:27 +01:00
|
|
|
#include "xmss_commons.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2015-08-12 14:30:01 +01:00
|
|
|
void to_byte(unsigned char *out, unsigned int in, int bytes)
|
2015-08-11 11:08:27 +01:00
|
|
|
{
|
|
|
|
int i;
|
2016-02-02 13:06:43 +00:00
|
|
|
for (i = 0; i < bytes; i++) {
|
2015-08-11 11:08:27 +01:00
|
|
|
out[i] = in & 0xff;
|
|
|
|
in = in >> 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void hexdump(const unsigned char *a, size_t len)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
printf("%02x", a[i]);
|
|
|
|
}
|