You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, I need to use python3-ecdsa 0.18.0, but the tests/test_jacobi.py failed as below.
======================================================== FAILURES ========================================================
_______________________________________ TestJacobi.test_add_different_scale_points _______________________________________
self = <tests.test_jacobi.TestJacobi testMethod=test_add_different_scale_points>
@settings(max_examples=14)
> @given(
st.integers(
min_value=1, max_value=int(generator_brainpoolp160r1.order())
),
st.integers(
min_value=1, max_value=int(generator_brainpoolp160r1.order())
),
st.lists(
st.integers(
min_value=1, max_value=int(curve_brainpoolp160r1.p() - 1)
),
min_size=2,
max_size=2,
unique=True,
),
)
tests/test_jacobi.py:352:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_jacobi.py:375: in test_add_different_scale_points
b = PointJacobi.from_affine(j_g * b_mul)
tests/ellipticcurve.py:735: in from_affine
return PointJacobi(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.ellipticcurve.PointJacobi object at 0x7fcbf3fd9790>, curve = None, x = None, y = None, z = 1, order = None
generator = False
def __init__(self, curve, x, y, z, order=None, generator=False):
"""
Initialise a point that uses Jacobi representation internally.
:param CurveFp curve: curve on which the point resides
:param int x: the X parameter of Jacobi representation (equal to x when
converting from affine coordinates
:param int y: the Y parameter of Jacobi representation (equal to y when
converting from affine coordinates
:param int z: the Z parameter of Jacobi representation (equal to 1 when
converting from affine coordinates
:param int order: the point order, must be non zero when using
generator=True
:param bool generator: the point provided is a curve generator, as
such, it will be commonly used with scalar multiplication. This will
cause to precompute multiplication table generation for it
"""
super(PointJacobi, self).__init__()
self.__curve = curve
if GMPY: # pragma: no branch
> self.__coords = (mpz(x), mpz(y), mpz(z))
E TypeError: mpz() requires numeric or string argument
E Falsifying example: test_add_different_scale_points(
E a_mul=1,
E b_mul=1332297598440044874827085038830181364212942568457,
E new_z=[1, 2],
E self=<tests.test_jacobi.TestJacobi testMethod=test_add_different_scale_points>,
E )
tests/ellipticcurve.py:531: TypeError
___________________________________________ TestJacobi.test_add_scaled_points ____________________________________________
self = <tests.test_jacobi.TestJacobi testMethod=test_add_scaled_points>
@settings(max_examples=10)
> @given(
st.integers(
min_value=1, max_value=int(generator_brainpoolp160r1.order())
),
st.integers(
min_value=1, max_value=int(generator_brainpoolp160r1.order())
),
)
tests/test_jacobi.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_jacobi.py:247: in test_add_scaled_points
a = PointJacobi.from_affine(j_g * a_mul)
tests/ellipticcurve.py:735: in from_affine
return PointJacobi(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.ellipticcurve.PointJacobi object at 0x7fcbf3f7f2d0>, curve = None, x = None, y = None, z = 1, order = None
generator = False
def __init__(self, curve, x, y, z, order=None, generator=False):
"""
Initialise a point that uses Jacobi representation internally.
:param CurveFp curve: curve on which the point resides
:param int x: the X parameter of Jacobi representation (equal to x when
converting from affine coordinates
:param int y: the Y parameter of Jacobi representation (equal to y when
converting from affine coordinates
:param int z: the Z parameter of Jacobi representation (equal to 1 when
converting from affine coordinates
:param int order: the point order, must be non zero when using
generator=True
:param bool generator: the point provided is a curve generator, as
such, it will be commonly used with scalar multiplication. This will
cause to precompute multiplication table generation for it
"""
super(PointJacobi, self).__init__()
self.__curve = curve
if GMPY: # pragma: no branch
> self.__coords = (mpz(x), mpz(y), mpz(z))
E TypeError: mpz() requires numeric or string argument
E Falsifying example: test_add_scaled_points(
E a_mul=1332297598440044874827085038830181364212942568457,
E b_mul=1,
E self=<tests.test_jacobi.TestJacobi testMethod=test_add_scaled_points>,
E )
tests/ellipticcurve.py:531: TypeError
================================================ short test summary info =================================================
FAILED tests/test_jacobi.py::TestJacobi::test_add_different_scale_points - TypeError: mpz() requires numeric or string art
FAILED tests/test_jacobi.py::TestJacobi::test_add_scaled_points - TypeError: mpz() requires numeric or string argument
============================================= 2 failed, 49 passed in 38.90s ==============================================
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
For some reason, I need to use python3-ecdsa 0.18.0, but the tests/test_jacobi.py failed as below.
The text was updated successfully, but these errors were encountered: