abort nicely when A == 0 (mod N)
avoid buffer underflow when A is longer than N
abort nicely when H_nn_* fails