Skip to content

Commit 2488158

Browse files
committed
Fix padding issue with exported private keys.
1 parent e90780d commit 2488158

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/eckey.js

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Bitcoin.ECKey = (function () {
7474

7575
ECKey.prototype.getExportedPrivateKey = function () {
7676
var hash = this.priv.toByteArrayUnsigned();
77+
while (hash.length < 32) hash.unshift(0);
7778
hash.unshift(0x80);
7879
var checksum = Crypto.SHA256(Crypto.SHA256(hash, {asBytes: true}), {asBytes: true});
7980
var bytes = hash.concat(checksum.slice(0,4));

0 commit comments

Comments
 (0)