Skip to content

Commit faa10f0

Browse files
committed
Compressed pubkey output is confirmed working, remove TODO, add comments.
1 parent d03e489 commit faa10f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ecdsa.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ ECPointFp.prototype.getEncoded = function (compressed) {
2424

2525
if (compressed) {
2626
if (y.isEven()) {
27+
// Compressed even pubkey
28+
// M = 02 || X
2729
enc.unshift(0x02);
2830
} else {
31+
// Compressed uneven pubkey
32+
// M = 03 || X
2933
enc.unshift(0x03);
3034
}
31-
// TODO: Implement
3235
} else {
36+
// Uncompressed pubkey
37+
// M = 04 || X || Y
3338
enc.unshift(0x04);
3439
enc = enc.concat(integerToBytes(y, 32));
3540
}

0 commit comments

Comments
 (0)