I have an elliptic curve EC and I need to find such an point G of EC which coordinate is the smallest non-negative integer of all points on the curve. I need it for an implementation of ECOH hashing algorithm. I was trying to use openssl to achieve this goal but so far I haven't figure out how to find such a point. I was trying to do this:
EC_POINT *G = EC_POINT_new(ec);
for(int i = 1; i < 1024; i++)
{
itoa(i, str, 10);
BN_dec2bn(&x, str);
EC_POINT_set_affine_coordinates_GFp(ec, G, x, y, ctx);
if(EC_POINT_is_on_curve(ec, G, ctx))
printf("%s\n", str);
}
But it only checks whether the point with the coordinates of (x, y) is on the curve or not. How can I find it?