caculate mod_exp using BigDigits (http://www.di-mgt.com.au/bigdigits.html)