How are P and ((z1*s2 - z2*s1)/(r*(s1-s2))) calculated?

0

Given:

p  = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
r  = 0xd47ce4c025c35ec440bc81d99834a624875161a26bf56ef7fdc0f5d52f843ad1
s1 = 0x44e1ff2dfd8102cf7a47c21d5c9fd5701610d04953c6836596b4fe9dd2f53e3e
s2 = 0x9a5f1c75e461d7ceb1cf3cab9013eb2dc85b6d0da8c3c6e27e3a5a5b3faa5bab
z1 = 0xc0e2d0a89a348de88fda08211c70d1d7e52ccef2eb9459911bf977d587784c6e
z2 = 0x17b0f41c8c337ac1e18c98759e83a8cccbc368dd9d89e5f03cb633c265fd0ddc

How is "P" calculated? Which calculator/script is used to calculate z1*s2, in here ((z1*s2 - z2*s1)/(r*(s1-s2))) and so on????

Thanks so much, I will appreciate your clarification.

Bill

Posted 2018-05-12T23:47:58.173

Reputation: 1

I've edited your question to remove the all-caps text. Could you please provide more context?Murch 2018-05-12T23:56:10.657

This is the algorithm to determine the the secret key from two signatures with the same nonce.Pieter Wuille 2018-05-13T00:03:22.343

I tired to run the python script from bitcoin.stackexchange.com/questions/35848/… on https://ideone.com/ but I keep getting a syntax error, please where did I go wrong. The example there is not actually working....

Bill 2018-05-14T06:58:30.657

the example is working fine if you select Python instead of Python 3Mike D 2018-05-14T09:02:45.290

Answers

1

How is "P" calculated?

P is one of the parameters for the secp256k1 curve as defined in http://www.secg.org/sec2-v2.pdf.

Which calculator/script is used to calculate z1*s2, in here ((z1*s2 - z2*s1)/(r*(s1-s2))) and so on????

Any calculator you want. They are just integers (albeit large integers) so you can use anything that can do large integer computations.

Andrew Chow

Posted 2018-05-12T23:47:58.173

Reputation: 40 910

Nope, these are integers modulo the group size. The division requires computing a modular inverse.Pieter Wuille 2018-05-13T00:11:54.480

Please explain how you did it and how you got 'P' above. Thanks....Bill 2018-05-14T06:55:49.160

As I said in my answer, P is defined by the secp256k1 curve which is defined in the pdf I linked.Andrew Chow 2018-05-14T15:24:04.513