summaryrefslogtreecommitdiff
path: root/sshkey-xmss.h
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2018-02-23 15:58:37 +0000
committerDamien Miller <djm@mindrot.org>2018-02-26 11:40:41 +1100
commit1b11ea7c58cd5c59838b5fa574cd456d6047b2d4 (patch)
tree7e96cb41b5234b9d327f7c8f41392f09aed0994e /sshkey-xmss.h
parent7d330a1ac02076de98cfc8fda05353d57b603755 (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 'sshkey-xmss.h')
-rw-r--r--sshkey-xmss.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/sshkey-xmss.h b/sshkey-xmss.h
new file mode 100644
index 000000000..b9f8ead10
--- /dev/null
+++ b/sshkey-xmss.h
@@ -0,0 +1,56 @@
1/* $OpenBSD: sshkey-xmss.h,v 1.1 2018/02/23 15:58:38 markus Exp $ */
2/*
3 * Copyright (c) 2017 Markus Friedl. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#ifndef SSHKEY_XMSS_H
26#define SSHKEY_XMSS_H
27
28#define XMSS_SHA2_256_W16_H10_NAME "XMSS_SHA2-256_W16_H10"
29#define XMSS_SHA2_256_W16_H16_NAME "XMSS_SHA2-256_W16_H16"
30#define XMSS_SHA2_256_W16_H20_NAME "XMSS_SHA2-256_W16_H20"
31#define XMSS_DEFAULT_NAME XMSS_SHA2_256_W16_H10_NAME
32
33size_t sshkey_xmss_pklen(const struct sshkey *);
34size_t sshkey_xmss_sklen(const struct sshkey *);
35int sshkey_xmss_init(struct sshkey *, const char *);
36void sshkey_xmss_free_state(struct sshkey *);
37int sshkey_xmss_generate_private_key(struct sshkey *, u_int);
38int sshkey_xmss_serialize_state(const struct sshkey *, struct sshbuf *);
39int sshkey_xmss_serialize_state_opt(const struct sshkey *, struct sshbuf *,
40 enum sshkey_serialize_rep);
41int sshkey_xmss_serialize_pk_info(const struct sshkey *, struct sshbuf *,
42 enum sshkey_serialize_rep);
43int sshkey_xmss_deserialize_state(struct sshkey *, struct sshbuf *);
44int sshkey_xmss_deserialize_state_opt(struct sshkey *, struct sshbuf *);
45int sshkey_xmss_deserialize_pk_info(struct sshkey *, struct sshbuf *);
46
47int sshkey_xmss_siglen(const struct sshkey *, size_t *);
48void *sshkey_xmss_params(const struct sshkey *);
49void *sshkey_xmss_bds_state(const struct sshkey *);
50int sshkey_xmss_get_state(const struct sshkey *, sshkey_printfn *);
51int sshkey_xmss_enable_maxsign(struct sshkey *, u_int32_t);
52int sshkey_xmss_forward_state(const struct sshkey *, u_int32_t);
53int sshkey_xmss_update_state(const struct sshkey *, sshkey_printfn *);
54u_int32_t sshkey_xmss_signatures_left(const struct sshkey *);
55
56#endif /* SSHKEY_XMSS_H */