Recovering secret using an invalid curve attack