From 1a7df37f596b3f7b8f3257d0a8049e0249ea00ba Mon Sep 17 00:00:00 2001 From: Joost Rijneveld Date: Mon, 16 Oct 2017 15:15:56 +0200 Subject: [PATCH] Add accidentally omitted params.h Previously this was generated and thus gitignored --- .gitignore | 3 --- Makefile | 8 -------- params.h | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 params.h diff --git a/.gitignore b/.gitignore index 198b902..c6432ad 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,3 @@ test/test_xmssmt_core_XMSSMT* test/test_xmssmt_core_fast_XMSSMT* test/speed test/gen_testvectors -params_XMSS_*.h -params_XMSSMT_*.h -params.h diff --git a/Makefile b/Makefile index 38b886b..b0e9571 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,6 @@ test/test_xmssmt_core \ test/test_xmssmt .PHONY: clean -.PRECIOUS: params_%.h - -params_%.h: params.h.py - python3 params.h.py $(patsubst params_%.h,%,$@) > $@ test/test_wots: params.c hash.c fips202.c hash_address.c randombytes.c wots.c xmss_commons.c test/test_wots.c params.h hash.h fips202.h hash_address.h randombytes.h wots.h xmss_commons.h $(CC) $(CFLAGS) params.c hash.c fips202.c hash_address.c randombytes.c wots.c xmss_commons.c test/test_wots.c -o $@ -lcrypto -lm @@ -44,7 +40,3 @@ clean: -rm test/test_xmssmt_core -rm test/test_xmssmt_core_fast -rm test/test_xmssmt - -distclean: clean - -rm params.h - -rm params_XMSS*.h \ No newline at end of file diff --git a/params.h b/params.h new file mode 100644 index 0000000..7b6f82c --- /dev/null +++ b/params.h @@ -0,0 +1,36 @@ +#ifndef PARAMS_H +#define PARAMS_H + +#include + +// These are merely internal identifiers for the supported hash functions +#define XMSS_SHA2 0 +#define XMSS_SHAKE 1 + +// This is a consequence of the OID definitions in the draft, used for parsing +#define XMSS_OID_LEN 4 + +// This structure will be populated when calling xmss[mt]_parse_oid +typedef struct { + unsigned int func; + unsigned int n; + unsigned int wots_w; + unsigned int wots_log_w; + unsigned int wots_len1; + unsigned int wots_len2; + unsigned int wots_len; + unsigned int wots_keysize; + unsigned int full_height; + unsigned int tree_height; + unsigned int d; + unsigned int index_len; + unsigned int bytes; + unsigned int publickey_bytes; + unsigned int privatekey_bytes; + unsigned int bds_k; +} xmss_params; + +int xmss_parse_oid(xmss_params *params, const uint32_t oid); +int xmssmt_parse_oid(xmss_params *params, const uint32_t oid); + +#endif