<div dir="ltr"><div>Call to EC_POINT_set_compressed_coodinates() with with x-coordinate and y-bit will resolve the curve equation for y and chooses y out of two possible y values based on y-bit input.</div><div><br></div><div>You can retrieve the x and y co-ordinates using EC_POINT_get_affine_coordinates as below, where x-cordinate matches with your input x.</div><div><br></div><div>EC_POINT_get_affine_coordinates(group, ec_pub_key, bn_x, bn_y, NULL);</div><div><br></div><div>Thanks,</div><div>Thulasi.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 26 Oct 2019 at 13:21, Luca Di Mauro <<a href="mailto:luca.dimauro@cnit.it">luca.dimauro@cnit.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I checked the 'test' folder but I didn't found any tests that help me  <br>
in this case.<br>
<br>
However the only doubt is how I can use the API offered by openssl library.<br>
I understand how retreive a point (and consequently to assign it to a  <br>
public key) starting from a compressed-y representation (which belongs  <br>
to this standard  <br>
<a href="https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html" rel="noreferrer" target="_blank">https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html</a>).<br>
<br>
My doubt now is how to obtain a point (x,y) given the coordinate,  <br>
which means resolve the equation y^2= x^3 + ax + b.<br>
Can you give me some tips to found a solution?<br>
<br>
Luca<br>
<br>
Billy Brumley <<a href="mailto:bbrumley@gmail.com" target="_blank">bbrumley@gmail.com</a>> ha scritto:<br>
<br>
>> If I have an x-point which follows this representation<br>
>> <a href="https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html" rel="noreferrer" target="_blank">https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html</a> (so it is<br>
>> composed by 33 byte and first byte is '0x02') and I use<br>
>> 'EC_POINT_set_compressed_coordinates_GFp' function, it will be<br>
>> considered as compressed-y-0 or compressed-y-1? Or it is correctly<br>
>> considered as the x coordinate?<br>
><br>
> What you are saying and what you are doing are two different things.<br>
><br>
> Your code is at a very low level.<br>
><br>
> Above this there is some encoding of points, depending on any number<br>
> of standards. OpenSSL implements some of them, but at a higher level.<br>
><br>
> The low level API you're talking about provides maximum flexibility to<br>
> map that high level encoding in to the API's "x-coord + y-bit"<br>
> concept. It's up to you to figure out the details. (Including<br>
> determining if the encoding in OpenSSL matches what's expected in your<br>
> spec.)<br>
><br>
> You need to play around a bit with the lib -- you can't expect this<br>
> list to interpret the standard for you. Check the "test" folder for<br>
> sample code.<br>
><br>
> BBB<br>
<br>
<br>
<br>
</blockquote></div>