Browse Source

Add accidentally omitted params.h

Previously this was generated and thus gitignored
master
Joost Rijneveld 7 years ago
parent
commit
1a7df37f59
No known key found for this signature in database GPG Key ID: A4FE39CF49CBC553
3 changed files with 36 additions and 11 deletions
  1. +0
    -3
      .gitignore
  2. +0
    -8
      Makefile
  3. +36
    -0
      params.h

+ 0
- 3
.gitignore View File

@@ -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

+ 0
- 8
Makefile View File

@@ -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

+ 36
- 0
params.h View File

@@ -0,0 +1,36 @@
#ifndef PARAMS_H
#define PARAMS_H

#include <stdint.h>

// 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

Loading…
Cancel
Save