-
Notifications
You must be signed in to change notification settings - Fork 457
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
[WIP] Add Point codec methods: #49
Conversation
bytes.length - 1 === len) { | ||
return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); | ||
} | ||
throw new Error('Unknown point format'); |
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.
Should this method try and check for validity of the point ?
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.
I wouldn't do it.
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.
I think I agree
Anything else you want changed here, or you want it squashed down? |
@dcousens |
[ 0x04 ].concat(x, intToBE(this.getY(), len)) ; | ||
}; | ||
|
||
BasePoint.prototype.encode = function encode(compact, enc) { |
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.
How do we feel about switching the order of the compact and enc args around ? In context of encodeCompressed
?
I inlined those methods, and fixed the quoting issues, along with some other lint issues. It might pay to enable linting etc for the tests eh ( when moving to semi-standard probably a good time) ? |
@sublimator there is a mental cost for them (at least for me). Linting tests makes sense to me! |
LGTM, please squash ;) |
squashed |
Landed and released, thank you! |
cheers :) |
Add Point#eq
Add Point#encode
Add Point#encodeCompressed
Add Curve#decodePoint
Add overrides for Montgomery curves/points
Squash of #48