summaryrefslogtreecommitdiff
path: root/xmss_commons.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2018-04-03 08:20:28 +0100
committerColin Watson <cjwatson@debian.org>2018-04-03 08:20:28 +0100
commited6ae9c1a014a08ff5db3d768f01f2e427eeb476 (patch)
tree601025e307745d351946c01ab13f419ddb6dae29 /xmss_commons.c
parent62f54f20bf351468e0124f63cc2902ee40d9b0e9 (diff)
parenta0349a1cc4a18967ad1dbff5389bcdf9da098814 (diff)
Import openssh_7.7p1.orig.tar.gz
Diffstat (limited to 'xmss_commons.c')
-rw-r--r--xmss_commons.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/xmss_commons.c b/xmss_commons.c
new file mode 100644
index 000000000..59486aead
--- /dev/null
+++ b/xmss_commons.c
@@ -0,0 +1,36 @@
1/* $OpenBSD: xmss_commons.c,v 1.2 2018/02/26 03:56:44 dtucker Exp $ */
2/*
3xmss_commons.c 20160722
4Andreas Hülsing
5Joost Rijneveld
6Public domain.
7*/
8
9#include "includes.h"
10#ifdef WITH_XMSS
11
12#include "xmss_commons.h"
13#include <stdlib.h>
14#include <stdio.h>
15#ifdef HAVE_STDINT_H
16#include <stdint.h>
17#endif
18
19void to_byte(unsigned char *out, unsigned long long in, uint32_t bytes)
20{
21 int32_t i;
22 for (i = bytes-1; i >= 0; i--) {
23 out[i] = in & 0xff;
24 in = in >> 8;
25 }
26}
27
28#if 0
29void hexdump(const unsigned char *a, size_t len)
30{
31 size_t i;
32 for (i = 0; i < len; i++)
33 printf("%02x", a[i]);
34}
35#endif
36#endif /* WITH_XMSS */