ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 09 Feb 2024 20:06:17 +0100Can't verify that a polynomial is correcthttps://ask.sagemath.org/question/75853/cant-verify-that-a-polynomial-is-correct/ You are working on a problem that involves tampering with the domain parameters of an ECDSA. I'm trying to find a value for u that satisfies the following expression, but when I use sagemath to find the value and then do the inverse, the value doesn't fit. what could be the problem?![image description](http://)
F = GF(p)
R = PolynomialRing(F, "u")
u = R.gen()
equation = (3 * xG ^ 2 + a * u ^ 4) ^ 2 - (4 * xQ) * (
xG ^ 3 + a * u ^ 4 * xG + b * u ^ 6
) - (8 * xG) * (xG ^ 3 + a * u ^ 4 * xG + b * u ^ 6)
roots = equation.roots(multiplicities=False)
for root in roots:
print(hex(root))Wed, 07 Feb 2024 01:23:03 +0100https://ask.sagemath.org/question/75853/cant-verify-that-a-polynomial-is-correct/Comment by Emmanuel Charpentier for <p>You are working on a problem that involves tampering with the domain parameters of an ECDSA. I'm trying to find a value for u that satisfies the following expression, but when I use sagemath to find the value and then do the inverse, the value doesn't fit. what could be the problem?http:// (image description)</p>
<pre><code>F = GF(p)
R = PolynomialRing(F, "u")
u = R.gen()
equation = (3 * xG ^ 2 + a * u ^ 4) ^ 2 - (4 * xQ) * (
xG ^ 3 + a * u ^ 4 * xG + b * u ^ 6
) - (8 * xG) * (xG ^ 3 + a * u ^ 4 * xG + b * u ^ 6)
roots = equation.roots(multiplicities=False)
for root in roots:
print(hex(root))
</code></pre>
https://ask.sagemath.org/question/75853/cant-verify-that-a-polynomial-is-correct/?comment=75896#post-id-75896Also, what is `p` ?Fri, 09 Feb 2024 20:06:17 +0100https://ask.sagemath.org/question/75853/cant-verify-that-a-polynomial-is-correct/?comment=75896#post-id-75896Comment by Max Alekseyev for <p>You are working on a problem that involves tampering with the domain parameters of an ECDSA. I'm trying to find a value for u that satisfies the following expression, but when I use sagemath to find the value and then do the inverse, the value doesn't fit. what could be the problem?http:// (image description)</p>
<pre><code>F = GF(p)
R = PolynomialRing(F, "u")
u = R.gen()
equation = (3 * xG ^ 2 + a * u ^ 4) ^ 2 - (4 * xQ) * (
xG ^ 3 + a * u ^ 4 * xG + b * u ^ 6
) - (8 * xG) * (xG ^ 3 + a * u ^ 4 * xG + b * u ^ 6)
roots = equation.roots(multiplicities=False)
for root in roots:
print(hex(root))
</code></pre>
https://ask.sagemath.org/question/75853/cant-verify-that-a-polynomial-is-correct/?comment=75860#post-id-75860`xG` and many other variables are not defined in your code. Please provide a complete code. Also, what "doesn't fit" means?Thu, 08 Feb 2024 20:12:31 +0100https://ask.sagemath.org/question/75853/cant-verify-that-a-polynomial-is-correct/?comment=75860#post-id-75860