1
0
xmss-KAT-generator/xmss_commons.c

27 Zeilen
454 B
C

/*
2016-09-22 15:31:41 +01:00
xmss_commons.c 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.
*/
2015-08-11 11:08:27 +01:00
#include "xmss_commons.h"
#include <stdlib.h>
#include <stdio.h>
2016-07-11 10:15:16 +01:00
#include <stdint.h>
2015-08-11 11:08:27 +01:00
2016-07-11 10:15:16 +01:00
void to_byte(unsigned char *out, unsigned long long in, uint32_t bytes)
2015-08-11 11:08:27 +01:00
{
2016-07-11 10:15:16 +01:00
int32_t i;
2016-02-16 18:24:12 +00:00
for (i = bytes-1; i >= 0; 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]);
}