Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-26 Thread Thulasi Goriparthi
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. You can retrieve the x and y co-ordinates using EC_POINT_get_affine_coordinates as below, where x-cordinate matches w

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-26 Thread Luca Di Mauro
I checked the 'test' folder but I didn't found any tests that help me in this case. However the only doubt is how I can use the API offered by openssl library. I understand how retreive a point (and consequently to assign it to a public key) starting from a compressed-y representation (which

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Billy Brumley
> If I have an x-point which follows this representation > https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html (so it is > composed by 33 byte and first byte is '0x02') and I use > 'EC_POINT_set_compressed_coordinates_GFp' function, it will be > considered as compressed-y-0 or compressed-y-1

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Luca Di Mauro
But the y bit is indicated by the foutth parameter of 'EC_POINT_set_compressed_coordinates_GFp' function. Isn't the representation you linked different by that that I linked previously? Luca Thulasi Goriparthi ha scritto: 02 indicates y bit is 0 03 indicates y bit is 1 http://citeseerx.i

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Thulasi Goriparthi
02 indicates y bit is 0 03 indicates y bit is 1 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.202.2977&rep=rep1&type=pdf Thanks, Thulasi. On Fri, 25 Oct 2019 at 16:50, Luca Di Mauro wrote: > > Mh, maybe I didn't understand. > > If I have an x-point which follows this representation

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Luca Di Mauro
Mh, maybe I didn't understand. If I have an x-point which follows this representation https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html (so it is composed by 33 byte and first byte is '0x02') and I use 'EC_POINT_set_compressed_coordinates_GFp' function, it will be considered as

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Billy Brumley
> Thank you! I thought they were the same. > > And given an x-only coordinate, how can I find the y coordinate? I > don't find the relative functions on the documentation. Well it depends on what you mean. Internally, EC_POINT_set_compressed_coordinates_GFp will internally automatically compute th

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Luca Di Mauro
Thank you! I thought they were the same. And given an x-only coordinate, how can I find the y coordinate? I don't find the relative functions on the documentation. Luca Billy Brumley ha scritto: Don't do that. As I said, the library is trying to tell you that's not a point on the secp256k

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-25 Thread Billy Brumley
Don't do that. As I said, the library is trying to tell you that's not a point on the secp256k1 curve. Quickly browsing the standard, you are likely looking for the prime256v1 curve. BBB On Fri, 25 Oct 2019, 9.28 Luca Di Mauro, wrote: > I think it is correct because I extracted the hexadecimal

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-24 Thread Luca Di Mauro
I think it is correct because I extracted the hexadecimal string from a packet contained in a pcap. This compressed point is created following the ETSI TS 103 097 v1.3.1 standard for secured communications in the vehicular communication context (https://www.etsi.org/deliver/etsi_ts/103000

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-24 Thread Billy Brumley
> EC_GROUP* group = EC_GROUP_new_by_curve_name (NID_secp256k1); > "c16b4ce0532f5dc9d09114fe121d3956ae84f9eb677a0d4bdac1d3af7a91950c"; I don't believe there's a point on secp256k1 with that x-coordinate. If you check the failure reason for EC_POINT_set_compressed_coordinates_GFp in

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-24 Thread Luca Di Mauro
Hi, the link you posted below are very useful! However, after many trials and errors, I created a little program to derive a public key from an x-only coordinate but, in the last step, it fails, namely in the function 'EC_POINT_set_compressed_coordinates_GFp' called in the function 'loadK

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-18 Thread Luca Di Mauro
Thank you very much for the reply! Yes, I have also the additional information about on which of two solutions I should take. I'll check the guides you linked below. Luca Di Mauro Nicola Tuveri ha scritto: Hi, with traditional EC from the x coordinate alone you can't really do that, beca

Re: Compute EC_KEY starting from X or Y coordinate only

2019-10-18 Thread Nicola Tuveri
Hi, with traditional EC from the x coordinate alone you can't really do that, because there are always 2 possible solutions for y (in R the curve is symmetrical on the x axis). The standards define a "compressed point" format in which you can send the coordinate x and an additional bit to select