user51673: There function in libsecp256k1 that allows you to directly set the field element to 32 bytes of your choice. Does secp256k1 always return a valid group element for any 32 byte value?

secp256k1_fe_set_b32(&xpoint, bytes)
secp256k1_ge_set_xo_var(ge, &xpoint, 0)


user208: The size of secp256k1's coordinate field is 2256 - 232 - 977.
That means there are only 232 + 977 (about 4 billion) possible 32-byte combinations that are not a valid coordinate.
Only slightly less than half (around 2255 - 1.17 * 2127) of those are the X coordinate of a point on the curve (in fact, for every valid X coordinate, there are either exactly 0 or exactly 2 points on the curve).

51673: <p>There function in libsecp256k1 that allows you to directly set the field element to 32 bytes of your choice. Does secp256k1 <em>always</em> return a valid group element for any 32 byte value?</p>
<blockquote>
<p>secp256k1_fe_set_b32(&amp;xpoint, bytes)</p>
<p>secp256k1_ge_set_xo_var(ge, &amp;xpoint, 0)</p>
</blockquote>
 208: <p>The size of secp256k1's coordinate field is 2<sup>256</sup> - 2<sup>32</sup> - 977.</p>

<p>That means there are only 2<sup>32</sup> + 977 (about 4 billion) possible 32-byte combinations that are not a valid coordinate.</p>

<p>Only slightly less than half (around 2<sup>255</sup> - 1.17 * 2<sup>127</sup>) of those are the X coordinate of a point on the curve (in fact, for every valid X coordinate, there are either exactly 0 or exactly 2 points on the curve).</p>
