Skip to content

Conversation

@psechenov
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Nov 15, 2019

Coverage Status

Coverage increased (+0.2%) to 95.435% when pulling b8d4122 on psechenov:objects_comparison_improvement into c3136e4 on warner:master.

Copy link
Member

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test coverage missing

@tomato42 tomato42 added the feature functionality to be implemented label Nov 15, 2019
@psechenov psechenov requested a review from tomato42 November 17, 2019 20:12
Copy link
Member

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for insisting on 100% line coverage, but typos in python code won't be caught until the line is actually executed and the dereference fails


def __eq__(self, other):
if isinstance(other, CurveFp):
"""Return True if the points are identical, False otherwise."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

points, not curves?


assert not pubkey.verifies(msg - 1, signature)


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: whitespace at the end of file


@classmethod
def setUpClass(cls):
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why define it if it's unused?

c = CurveFp(100, -3, 100)
p = Point(c, 100, 100, 100)
self.assertNotEqual(self.g_23, p)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: whitespace at end of file

self.assertEqual(self.c_23, CurveFp(23, 1, 1))

def test_inequality_curves(self):
c192 = CurveFp(p, -3, b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other test cases use global variables because they use the functional style and the pytest framework, this one uses the object-based approach from unittest, so I'd say that the use of global variables is less clean here...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to classes. Not sure if it is possible to convert test_p192_mult_tests preserving functionality.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I'm fine with either approach, what I'm not a fan of is mixing them

@tomato42
Copy link
Member

side note: it looks like you have not associated the email you used in commits with your github account, you may want to add it Settings→Emails

@psechenov psechenov requested a review from tomato42 November 19, 2019 10:32
# From X9.62 I.1 (p. 96):
def test_add_and_mult_equivalence(self):
for n, exp in enumerate(self._add_n_times(self.g_23, 8)):
self.assertEqual(self.g_23 * n, exp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests were using pytest decorators because then every test case is considered a separate instance, so a failure in one won't stop the others from executing

in new unittest it's the "subtest" mechanism, but I don't know if it was backported to earlier pythons...

I think it's easier to leave them as pytest tests


data = [(3, 10, 9, 7, 17, 20), # real add
(3, 10, 3, 10, 7, 12)] # double
for (x1, y1, x2, y2, x3, y3) in data:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, failure in "real add" will cause the "double" case to be skipped

self.assertEqual(self.c_23, CurveFp(23, 1, 1))

def test_inequality_curves(self):
c192 = CurveFp(p, -3, b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I'm fine with either approach, what I'm not a fan of is mixing them

Copy link
Member

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test coverage for SigningKey and VerifyingKey missing for case with object of different type

@psechenov psechenov requested a review from tomato42 November 19, 2019 16:05
Copy link
Member

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

@tomato42 tomato42 added this to the v0.15 milestone Nov 19, 2019
@tomato42 tomato42 merged commit 79d7d90 into tlsfuzzer:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature functionality to be implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants