Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

sublimator
Copy link
Contributor

Add Point#eq
Add Point#encode
Add Point#encodeCompressed
Add Curve#decodePoint
Add overrides for Montgomery curves/points

Squash of #48

bytes.length - 1 === len) {
return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
}
throw new Error('Unknown point format');
Copy link
Contributor Author

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 ?

Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I agree

@sublimator
Copy link
Contributor Author

Anything else you want changed here, or you want it squashed down?

@sublimator
Copy link
Contributor Author

@dcousens
The party over here now :)

[ 0x04 ].concat(x, intToBE(this.getY(), len)) ;
};

BasePoint.prototype.encode = function encode(compact, enc) {
Copy link
Contributor Author

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 ?

@sublimator
Copy link
Contributor Author

@indutny

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) ?

@indutny
Copy link
Owner

indutny commented Jul 20, 2015

@sublimator there is a mental cost for them (at least for me). Linting tests makes sense to me!

@indutny
Copy link
Owner

indutny commented Jul 20, 2015

LGTM, please squash ;)

@sublimator
Copy link
Contributor Author

squashed

@indutny
Copy link
Owner

indutny commented Jul 20, 2015

Landed and released, thank you!

@indutny indutny closed this Jul 20, 2015
@indutny indutny deleted the point-codec branch July 20, 2015 03:04
@sublimator
Copy link
Contributor Author

cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants