Diffie-Hellman example and more efficient modPow implementation