Skip to content

Commit b8f2215

Browse files
committed
PK_MAX_RETRIES
1 parent 0c115a1 commit b8f2215

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/headers/tomcrypt_pk.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ enum {
1717
/* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */
1818
#define PK_STD 0x1000
1919

20+
/* iterations limit for retry-loops */
21+
#define PK_MAX_RETRIES 20
22+
2023
int rand_prime(void *N, long len, prng_state *prng, int wprng);
2124
int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng);
2225
int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng);

src/pk/ecc/ecc_sign_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen,
2222
{
2323
ecc_key pubkey;
2424
void *r, *s, *e, *p;
25-
int err, max_iterations = 20;
25+
int err, max_iterations = PK_MAX_RETRIES;
2626
unsigned long pbits, pbytes, i, shift_right;
2727
unsigned char ch, buf[MAXBLOCKSIZE];
2828

0 commit comments

Comments
 (0)