Merge pull request #487 from czurnieden/DoS_sqrt_mod Added checks for input in mp_sqrtmod_prime that caused infinite loops