pqc/crypto_sign/rainbowVc-classic/clean/rainbow_config.h
Matthias J. Kannwischer d1f2d16f46 remove ternary operator in rainbow to compute max
clang-tidy9.0.0 added a new check: bugprone-branch-clone
(https://releases.llvm.org/9.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html)
This doesn't like both branches of an if are the same.
This lead to a warning in rainbow, as where the maximum of two values (which
are always the same) is computed in a macro.
I don't always agree with this warning, but here I think it's worth to
remove the macro.
2021-03-24 21:02:44 +00:00

49 lines
984 B
C

#ifndef _H_RAINBOW_CONFIG_H_
#define _H_RAINBOW_CONFIG_H_
/// @file rainbow_config.h
/// @brief Defining the parameters of the Rainbow and the corresponding constants.
///
#define _GFSIZE 256
#define _V1 92
#define _O1 48
#define _O2 48
#define _MAX_O 48
#define _HASH_LEN 64
#define _V2 ((_V1) + (_O1))
/// size of N, in # of gf elements.
#define _PUB_N (_V1 + _O1 + _O2)
/// size of M, in # gf elements.
#define _PUB_M (_O1 + _O2)
/// size of variables, in # bytes.
// GF256
#define _V1_BYTE (_V1)
#define _V2_BYTE (_V2)
#define _O1_BYTE (_O1)
#define _O2_BYTE (_O2)
#define _MAX_O_BYTE (_MAX_O)
#define _PUB_N_BYTE (_PUB_N)
#define _PUB_M_BYTE (_PUB_M)
/// length of seed for public key, in # bytes
#define LEN_PKSEED 32
/// length of seed for secret key, in # bytes
#define LEN_SKSEED 32
/// length of salt for a signature, in # bytes
#define _SALT_BYTE 16
/// length of a signature
#define _SIGNATURE_BYTE (_PUB_N_BYTE + _SALT_BYTE)
#endif // _H_RAINBOW_CONFIG_H_