-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More test coverage #126
More test coverage #126
Conversation
leftover after compressed points implementation
since MalformedPointError and UnexpectedDER are user-visible (thrown by methods that users are expected to use), export them in the root of the module hierarchy
as assert will be optimised out if the module is compiled with optimisations on, we can't use them for checking user-provided data use an exception that inherits from it, so that existing code will behave as expected
There are few pure-maths methods that are unused by the library code, mark them deprecated so that we can remove them in the future
1d26d1e
to
83dab29
Compare
@ueno: please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
assert len(xs) == curve.baselen, (len(xs), curve.baselen) | ||
assert len(ys) == curve.baselen, (len(ys), curve.baselen) | ||
if len(xs) != curve.baselen: | ||
raise MalformedPointError("Unexpected length of encoded x") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be a bit friendly that the actual length is embedded in the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is that we support 3 different lengths: for raw encoding, uncompressed X9.62 and compressed X9.62 so the message would be very confusing if we provided so much data.
And those two checks will get triggered only when the Curve we use is misconstructed, so they are more asserts than real checks
Uplift the test coverage from #124 to master
deprecate some unused methods
clean-up raised exceptions