2018-02-26 04:56:44 +01:00
|
|
|
/* $OpenBSD: xmss_commons.c,v 1.2 2018/02/26 03:56:44 dtucker Exp $ */
|
2018-02-23 16:58:37 +01:00
|
|
|
/*
|
|
|
|
xmss_commons.c 20160722
|
|
|
|
Andreas Hülsing
|
|
|
|
Joost Rijneveld
|
|
|
|
Public domain.
|
|
|
|
*/
|
|
|
|
|
2018-02-26 02:18:14 +01:00
|
|
|
#include "includes.h"
|
2018-02-28 09:59:35 +01:00
|
|
|
#ifdef WITH_XMSS
|
2018-02-26 02:18:14 +01:00
|
|
|
|
2018-02-23 16:58:37 +01:00
|
|
|
#include "xmss_commons.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2018-02-26 07:42:56 +01:00
|
|
|
#ifdef HAVE_STDINT_H
|
2018-02-23 16:58:37 +01:00
|
|
|
#include <stdint.h>
|
2018-02-26 07:42:56 +01:00
|
|
|
#endif
|
2018-02-23 16:58:37 +01: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 04:51:59 +01:00
|
|
|
#if 0
|
2018-02-23 16:58:37 +01: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 02:18:14 +01:00
|
|
|
}
|
2018-02-26 04:51:59 +01:00
|
|
|
#endif
|
2018-02-27 04:45:17 +01:00
|
|
|
#endif /* WITH_XMSS */
|