Compressed pubkey output is confirmed working, remove TODO, add comments.
This commit is contained in:
parent
d03e489913
commit
faa10f0f6a
1 changed files with 6 additions and 1 deletions
|
@ -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…
Reference in a new issue