diff options
author | markus@openbsd.org <markus@openbsd.org> | 2018-02-23 15:58:37 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-02-26 11:40:41 +1100 |
commit | 1b11ea7c58cd5c59838b5fa574cd456d6047b2d4 (patch) | |
tree | 7e96cb41b5234b9d327f7c8f41392f09aed0994e /xmss_commons.c | |
parent | 7d330a1ac02076de98cfc8fda05353d57b603755 (diff) |
upstream: Add experimental support for PQC XMSS keys (Extended
Hash-Based Signatures) The code is not compiled in by default (see WITH_XMSS
in Makefile.inc) Joint work with stefan-lukas_gazdag at genua.eu See
https://tools.ietf.org/html/draft-irtf-cfrg-xmss-hash-based-signatures-12 ok
djm@
OpenBSD-Commit-ID: ef3eccb96762a5d6f135d7daeef608df7776a7ac
Diffstat (limited to 'xmss_commons.c')
-rw-r--r-- | xmss_commons.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xmss_commons.c b/xmss_commons.c new file mode 100644 index 000000000..51171af91 --- /dev/null +++ b/xmss_commons.c | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | xmss_commons.c 20160722 | ||
3 | Andreas Hülsing | ||
4 | Joost Rijneveld | ||
5 | Public domain. | ||
6 | */ | ||
7 | |||
8 | #include "xmss_commons.h" | ||
9 | #include <stdlib.h> | ||
10 | #include <stdio.h> | ||
11 | #include <stdint.h> | ||
12 | |||
13 | void to_byte(unsigned char *out, unsigned long long in, uint32_t bytes) | ||
14 | { | ||
15 | int32_t i; | ||
16 | for (i = bytes-1; i >= 0; i--) { | ||
17 | out[i] = in & 0xff; | ||
18 | in = in >> 8; | ||
19 | } | ||
20 | } | ||
21 | |||
22 | void hexdump(const unsigned char *a, size_t len) | ||
23 | { | ||
24 | size_t i; | ||
25 | for (i = 0; i < len; i++) | ||
26 | printf("%02x", a[i]); | ||
27 | } \ No newline at end of file | ||