Internal version of BN_mod_inverse allowing checking of no-inverse without