Implement ec_double method.