Hi David,
Thank you for your help with the static memory allocation. I seem to have resolved my issues in regards to that, but now I am facing another issue.
Within the function wc_RsaFuncitonSync called from within wc_RsaFunction I am seeing the following errors and I am not sure how to resolve these issues:
/* tmpa = tmp^dP mod p */
r = mp_exptmod(&tmp, &key->dP, &key->p, &tmpa);
ret = RET_ERR(ret, r, MP_EXPTMOD_E);
R = -1
Ret = -112 (MP_EXPTMOD_E)
/* tmpb = tmp^dQ mod q */
r = mp_exptmod(&tmp, &key->dQ, &key->q, &tmpb);
ret = RET_ERR(ret, r, MP_EXPTMOD_E);
R = -1
Ret = -112
r = mp_mulmod(&tmp, &key->u, &key->p, &tmp);
ret = RET_ERR(ret, r, MP_MULMOD_E);
R = -1
Upon digging a bit further it seems that when mp_exptmod() ends up eventually calling making the call
x = fp_count_bits (X);
from within
static int _fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
I see it enter the conditional statement
if (a->used == 0) {
return 0;
}
which eventually causes the error that I see at the higher level.
In regards to the error with mp_mulmod() I see that when the call
err = fp_mod(&t, c, d);
is made from within
int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
I see that the conditional statement
if ((err = fp_div(a, b, NULL, &t)) != FP_OKAY) {
return err;
}
is the root of the error that I see at the higher level.
Do you have any clue as to why these errors would be occuring?
Thank you,
Thomas Hickey