comparing two public key im trying to find which one big or small
is there any alternative way to do this ,already pm you my code
please help!
Well you should split up this operation
R = P <= Q
You should make it:
eq = P.x == Q.x
lt = P.x < Q.x
R = eq or lt
You cannot directly compare two Point classes. Read this page to understand why:
https://crypto.stackexchange.com/questions/98189/how-to-prove-that-an-elliptic-curve-point-is-smaller-or-greater-than-half-of-theIf there were a polynomial time solution[1] then this would provide a polynomial time solution to the elliptic curve discrete logarithm problem. We strongly believe this not to be the case.
...
[1] They are talking about a similar problem, where you find if the point is on the smaller half or bigger half of the private key range. But this discussion is why you cannot check two Point classes for
Less Than - because their private keys are unknown.
To work around this, you should compare the X coordinates directly.This will tell you if the X points are smaller or bigger, and allows you to order the public keys by characteristic P (instead of by private key order N).
P.S. I would appreciate it if you post the questions about the code inside this thread only, posting the same thing in the thread *and* in my PM mailbox is a bit annoying because I am already watching this thread.
pk1 = '02C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5'#private key=2
pk2 = '022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4'#private key=5