Use correct function to determine yP for pubkey compression. Fixes #6.

This commit is contained in:
justmoon 2012-04-07 01:58:42 +02:00
parent 795abdce1f
commit d03e489913

View file

@ -23,7 +23,7 @@ ECPointFp.prototype.getEncoded = function (compressed) {
var enc = integerToBytes(x, 32); var enc = integerToBytes(x, 32);
if (compressed) { if (compressed) {
if (y.testBit(0)) { if (y.isEven()) {
enc.unshift(0x02); enc.unshift(0x02);
} else { } else {
enc.unshift(0x03); enc.unshift(0x03);