NewCurveKeypair(): return error instead of panic on failure