diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index da3296e..aa00be1 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -17,6 +17,9 @@ enum { /* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */ #define PK_STD 0x1000 +/* iterations limit for retry-loops */ +#define PK_MAX_RETRIES 20 + int rand_prime(void *N, long len, prng_state *prng, int wprng); int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index 18e3875..e97dcf4 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -22,7 +22,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, { ecc_key pubkey; void *r, *s, *e, *p; - int err, max_iterations = 20; + int err, max_iterations = PK_MAX_RETRIES; unsigned long pbits, pbytes, i, shift_right; unsigned char ch, buf[MAXBLOCKSIZE];