diff --git a/src/ecdsa/test_jacobi.py b/src/ecdsa/test_jacobi.py index 50650280..f811b922 100644 --- a/src/ecdsa/test_jacobi.py +++ b/src/ecdsa/test_jacobi.py @@ -666,15 +666,9 @@ def test_mul_add_with_doubled_negation_of_itself(self): self.assertEqual(j_g.mul_add(4, dbl_neg, 2), INFINITY) @given( - st.integers( - min_value=0, max_value=int(generator_112r2.order() - 1) - ), - st.integers( - min_value=0, max_value=int(generator_112r2.order() - 1) - ), - st.integers( - min_value=0, max_value=int(generator_112r2.order() - 1) - ) + st.integers(min_value=0, max_value=int(generator_112r2.order() - 1)), + st.integers(min_value=0, max_value=int(generator_112r2.order() - 1)), + st.integers(min_value=0, max_value=int(generator_112r2.order() - 1)), ) @example(693, 2, 3293) # values that will hit all the conditions for NAF def test_mul_add_random(self, mul1, mul2, mul3): @@ -893,6 +887,7 @@ def interrupter(barrier_start, barrier_end, lock_exit): class TestZeroCurve(unittest.TestCase): """Tests with curve that has (0, 0) on the curve.""" + def setUp(self): self.curve = CurveFp(23, 1, 0) diff --git a/src/ecdsa/test_pyecdsa.py b/src/ecdsa/test_pyecdsa.py index 6c0266e8..41878959 100644 --- a/src/ecdsa/test_pyecdsa.py +++ b/src/ecdsa/test_pyecdsa.py @@ -856,18 +856,18 @@ def test_hybrid_decoding_with_blocked_format(self): self.assertIn("Invalid X9.62 encoding", str(exp.exception)) - def test_hybrid_decoding_with_inconsistent_encoding_and_no_validation(self): + def test_hybrid_decoding_with_inconsistent_encoding_and_no_validation( + self, + ): sk = SigningKey.from_secret_exponent(123456789) vk = sk.verifying_key enc = vk.to_string("hybrid") - self.assertEqual(enc[:1], b'\x06') - enc = b'\x07' + enc[1:] + self.assertEqual(enc[:1], b"\x06") + enc = b"\x07" + enc[1:] b = VerifyingKey.from_string( - enc, - valid_encodings=("hybrid",), - validate_point=False + enc, valid_encodings=("hybrid",), validate_point=False ) self.assertEqual(vk, b) @@ -919,8 +919,8 @@ def test_decoding_with_inconsistent_hybrid_odd_point(self): vk = sk.verifying_key enc = vk.to_string("hybrid") - self.assertEqual(enc[:1], b'\x07') - enc = b'\x06' + enc[1:] + self.assertEqual(enc[:1], b"\x07") + enc = b"\x06" + enc[1:] with self.assertRaises(MalformedPointError): b = VerifyingKey.from_string(enc, valid_encodings=("hybrid",))