Merged
Conversation
8 tasks
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
Member
Author
|
@ueno: please review |
ueno
approved these changes
Oct 10, 2019
| 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.
wouldn't it be a bit friendly that the actual length is embedded in the message?
Member
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uplift the test coverage from #124 to master
deprecate some unused methods
clean-up raised exceptions