Hi
This is my version if you have private key or may need to bf.
def Get_Nonce_K_With_Private_Key(r,s,z,x):
if (x == 0 ):
return 0;
sinv = pow(s,N-2,N)
t1 = (x*r) % N
t2 = (z+t1) % N
myK = (sinv*t2) % N
if (myK == 0 ):
return 0;
if ((myK*G).x.num == r):
return myK
return 0
But you can always do R == K * G to find out if you really found valid K or not.
Regards,