mp_2expt
if ((res = mp_2expt(a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) {
if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) {
if ((res = mp_2expt(&tmp, p)) != MP_OKAY) {
if ((res = mp_2expt(a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {