From 0520b60faf82f38189b56b7f83107369e7a815db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 30 Jan 2014 19:43:46 +0100 Subject: [PATCH] Make options configurable for HMAC_DRBG --- include/polarssl/config.h | 7 +++++++ include/polarssl/hmac_drbg.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/include/polarssl/config.h b/include/polarssl/config.h index 7b08bbcc6..ced277e08 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -1916,6 +1916,13 @@ #define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ #define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ +// HMAC_DRBG options +// +#define POLARSSL_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ +#define POLARSSL_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ +#define POLARSSL_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ +#define POLARSSL_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ + // ECP options // #define POLARSSL_ECP_MAX_BITS 521 /**< Maximum bit size of groups */ diff --git a/include/polarssl/hmac_drbg.h b/include/polarssl/hmac_drbg.h index 36d120049..79be0a6a9 100644 --- a/include/polarssl/hmac_drbg.h +++ b/include/polarssl/hmac_drbg.h @@ -37,10 +37,12 @@ #define POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG -0x0038 /**< Input too large (Entropy + additional). */ #define POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR -0x003A /**< Read/write error in file. */ +#if !defined(POLARSSL_CONFIG_OPTIONS) #define POLARSSL_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ #define POLARSSL_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ #define POLARSSL_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ #define POLARSSL_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ +#endif /* !POLARSSL_CONFIG_OPTIONS */ #define POLARSSL_HMAC_DRBG_PR_OFF 0 /**< No prediction resistance */ #define POLARSSL_HMAC_DRBG_PR_ON 1 /**< Prediction resistance enabled */