ecdsa-polynomial-nonce-recurrence-attack
ecdsa-polynomial-nonce-recurrence-attack copied to clipboard
Conversion from SageMath to SymPy
I am running some tests on your project with the original attacks. The SageMath environment works perfectly on my Linux desktop, but I am attempting to convert the code from SageMath libraries to SymPy so that I can continue to test on my phone's PyDroid 3 app. The two lines of code that I am having an issue with converting are:
> (dd,) = R._first_ngens(1)
I have converted the original functions preceding the above to:
> dd = symbols('dd')
> Z = GF(usedcurve.order)
> R = PolynomialRing(Z, symbols = ('dd',))
I am trying to build the functions for the PolynomialRing so that calculation of the roots produces accurate results. This brings me to the second line of code that is causing me an issue:
> d_guesses = poly_target.roots()
I have converted this (thus far) using the multivariate roots functions of SymPy without success on evaluating the roots properly. At present this is the converted code snippet:
> d_guesses1 = real_roots(poly_target)
> d_guesses2 = [[int(root.evalf()) % usedcurve.order] for root in d_guesses1]
This is simply resulting in [0][1]. With other functions I am receiving an output of irrational numbers, or the entire roots factorial equation displayed.
Any assitance you are able to provide would be very welcome to assist with testing the original attacks on our mobile devices without using the SageMath environment. Thank you.