When the API wc_ecc_verify_hash_ex calls "wc_ecc_mulmod" it returns an error because the heap is set to NULL.
/* compute u1*mG + u2*mQ = mG */
if (err == MP_OKAY)
err = wc_ecc_mulmod_ex(&u1, mG, mG, curve->Af, curve->prime, 0, key->heap);
if (err == MP_OKAY)
err = wc_ecc_mulmod_ex(&u2, mQ, mQ, curve->Af, curve->prime, 0, key->heap);
/* find the montgomery mp */
if (err == MP_OKAY)
err = mp_montgomery_setup(curve->prime, &mp);
/* add them */
if (err == MP_OKAY)
err = ecc_projective_add_point(mQ, mG, mG, curve->Af,
curve->prime, mp);
/* reduce */
if (err == MP_OKAY)
err = ecc_map(mG, curve->prime, mp);
}
Thanks.
When the API wc_ecc_verify_hash_ex calls "wc_ecc_mulmod" it returns an error because the heap is set to NULL.
I managed to fix the issue by calling "wc_ecc_mulmod_ex" instead of "wc_ecc_mulmod" and passed key->heap parameter.
below is the fixed code (ecc.c file lines 3788 and 3790) :
#ifndef ECC_SHAMIR
{
mp_digit mp;
#else
Thanks.