From 0b6b94e6b6152f15cf4c2247c5974f539aae28cd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 21:49:46 +0200 Subject: Adding upstream version 1:9.6p1. Signed-off-by: Daniel Baumann --- xmss_commons.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 xmss_commons.c (limited to 'xmss_commons.c') diff --git a/xmss_commons.c b/xmss_commons.c new file mode 100644 index 0000000..8d6b80b --- /dev/null +++ b/xmss_commons.c @@ -0,0 +1,36 @@ +/* $OpenBSD: xmss_commons.c,v 1.2 2018/02/26 03:56:44 dtucker Exp $ */ +/* +xmss_commons.c 20160722 +Andreas Hülsing +Joost Rijneveld +Public domain. +*/ + +#include "includes.h" +#ifdef WITH_XMSS + +#include "xmss_commons.h" +#include +#include +#ifdef HAVE_STDINT_H +# include +#endif + +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; + } +} + +#if 0 +void hexdump(const unsigned char *a, size_t len) +{ + size_t i; + for (i = 0; i < len; i++) + printf("%02x", a[i]); +} +#endif +#endif /* WITH_XMSS */ -- cgit v1.2.3