/**
 * \file parameters.h
 * \brief Parameters of the piglet1 scheme
 */

#ifndef PIGLET1_PARAMETER_H
#define PIGLET1_PARAMETER_H
#define PARAM_SECURITY 128 /**< Expected security level */

#define FIELD_Q 2
#define FIELD_M 163

#define PARAM_L 3
#define PARAM_K 2
#define PARAM_R 53
#define PARAM_Q FIELD_Q /**< Parameter q of the scheme (finite field GF(q^m)) */
#define PARAM_M FIELD_M /**< Parameter m of the scheme (finite field GF(q^m)) */
#define PARAM_W 5 /**< Parameter omega of the scheme (weight of vectors) */
#define PARAM_WE 5 /**< Parameter omega_e of the scheme (weight of vectors) */

#define FIELD_ELT_BYTES ((PARAM_M+7)>>3) //Field element bytes used

#define SHA512_BYTES 64 /**< Size of SHA512 output */

#define VEC_K_BYTES (PARAM_K * FIELD_ELT_BYTES) /**< Number of bytes required to store a vector of size k */
#define VEC_R_BYTES (PARAM_R * FIELD_ELT_BYTES) /**< Number of bytes required to store a vector of size r */
#define VEC_L_BYTES (PARAM_L * FIELD_ELT_BYTES) /**< Number of bytes required to store a vector of size r */

#define GD_SEED_LEN 32 /**< Seed size of generator vector*/

#define PK_SEED_LEN 40 /**< Seed size of the public key*/
#define SK_SEED_LEN 40 /**< Seed size of the NIST seed expander */
#define SEEDEXPANDER_MAX_LENGTH 4294967295 /**< Max length of the NIST seed expander */

#define PUBLIC_KEY_BYTES (PARAM_R * PARAM_K * FIELD_ELT_BYTES + PK_SEED_LEN + GD_SEED_LEN)
#define SECRET_KEY_BYTES (PUBLIC_KEY_BYTES+SK_SEED_LEN+GD_SEED_LEN) /**< Secret key size */
#define SHARED_SECRET_BYTES 64 /**< Shared secret size */

#define CIPHERTEXT_BYTES (PARAM_R * (PARAM_K+1) * FIELD_ELT_BYTES + SHA512_BYTES)

#endif
