account for 8k keys with MySQL compatibility

This commit is contained in:
Jacob Barthelmeh
2017-09-12 14:57:44 -06:00
parent afcef7d394
commit 1b3a8f40b8
2 changed files with 9 additions and 1 deletions

View File

@ -1043,7 +1043,7 @@ top:
/* if not zero goto step 4 */
if (mp_iszero (&u) == MP_NO) {
if (++loop_check > 4096) {
if (++loop_check > MAX_INVMOD_SZ) {
res = MP_VAL;
goto LBL_ERR;
}

View File

@ -230,6 +230,14 @@ typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
#define PRIME_SIZE 256
#endif
#ifndef MAX_INVMOD_SZ
#if defined(WOLFSSL_MYSQL_COMPATIBLE)
#define MAX_INVMOD_SZ 8192
#else
#define MAX_INVMOD_SZ 4096
#endif
#endif
#define mp_prime_random(a, t, size, bbs, cb, dat) \
mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?LTM_PRIME_BBS:0, cb, dat)