fixing proper use of exp in generateKeyPair(b, exp) and tests