Allocating memory for modulus and exponent