pqc/crypto_sign/sphincs-sha256-128s-robust/clean/params.h

54 lines
3.1 KiB
C
Raw Normal View History

#ifndef PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_PARAMS_H
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_PARAMS_H
2019-04-16 14:15:03 +01:00
/* Hash output length in bytes. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N 16
2019-04-16 14:15:03 +01:00
/* Height of the hypertree. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FULL_HEIGHT 64
2019-04-16 14:15:03 +01:00
/* Number of subtree layer. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_D 8
2019-04-16 14:15:03 +01:00
/* FORS tree dimensions. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_HEIGHT 15
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_TREES 10
2019-04-16 14:15:03 +01:00
/* Winternitz parameter, */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_W 16
2019-04-16 14:15:03 +01:00
/* The hash function is defined by linking a different hash.c file, as opposed
to setting a #define constant. */
/* For clarity */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_ADDR_BYTES 32
2019-04-16 14:15:03 +01:00
/* WOTS parameters. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LOGW 4
2019-04-16 14:15:03 +01:00
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN1 (8 * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N / PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LOGW)
2019-04-16 14:15:03 +01:00
/* PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN2 is floor(log(len_1 * (w - 1)) / log(w)) + 1; we precompute */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN2 3
2019-04-16 14:15:03 +01:00
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN (PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN1 + PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN2)
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_BYTES (PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_LEN * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N)
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_PK_BYTES PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_BYTES
2019-04-16 14:15:03 +01:00
/* Subtree size. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_TREE_HEIGHT (PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FULL_HEIGHT / PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_D)
2019-04-16 14:15:03 +01:00
/* FORS parameters. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_MSG_BYTES ((PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_HEIGHT * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_TREES + 7) / 8)
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_BYTES ((PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_HEIGHT + 1) * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_TREES * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N)
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_PK_BYTES PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N
2019-04-16 14:15:03 +01:00
/* Resulting SPX sizes. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_BYTES (PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N + PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FORS_BYTES + PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_D * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_WOTS_BYTES +\
PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_FULL_HEIGHT * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N)
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_PK_BYTES (2 * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N)
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_SK_BYTES (2 * PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_N + PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_PK_BYTES)
2019-04-16 14:15:03 +01:00
/* Optionally, signing can be made non-deterministic using optrand.
This can help counter side-channel attacks that would benefit from
getting a large number of traces when the signer uses the same nodes. */
#define PQCLEAN_SPHINCSSHA256128SROBUST_CLEAN_OPTRAND_BYTES 32
2019-04-16 14:15:03 +01:00
#endif