Improving performance of bn_mp_expt_d The loop was always iterating DIGIT_BIT times, instead of halting when possible. This changes makes sure it executes less operations. This change has also been incorporated into Rubinius / https://github.com/evanphx/rubinius which uses libtommath