Browse Source

Compressed pubkey output is confirmed working, remove TODO, add comments.

hk-custom-address
justmoon 13 years ago
parent
commit
faa10f0f6a
  1. 7
      src/ecdsa.js

7
src/ecdsa.js

@ -24,12 +24,17 @@ ECPointFp.prototype.getEncoded = function (compressed) {
if (compressed) {
if (y.isEven()) {
// Compressed even pubkey
// M = 02 || X
enc.unshift(0x02);
} else {
// Compressed uneven pubkey
// M = 03 || X
enc.unshift(0x03);
}
// TODO: Implement
} else {
// Uncompressed pubkey
// M = 04 || X || Y
enc.unshift(0x04);
enc = enc.concat(integerToBytes(y, 32));
}

Loading…
Cancel
Save