the nonce k = (s2 - h2 + s1h1)(s1 - r1)-1 mod n
= (s2-h2+s1h1)s1-1 - (s2-h2+s1h1)r1-1
Which is just s2h1-h2s1 - s2r1-1 +h2r1-1+s1h1r1-1.
Would some kind soul please show me how k = (s2 - h2 + s1h1)(s1 - r1)
-1 mod n would be coded in Python? All my attempts come out with a k value much more than 256 bits.
Thank you