Browse Source

Fix padding issue with exported private keys.

hk-custom-address
Stefan Thomas 13 years ago
parent
commit
24881584c7
  1. 1
      src/eckey.js

1
src/eckey.js

@ -74,6 +74,7 @@ Bitcoin.ECKey = (function () {
ECKey.prototype.getExportedPrivateKey = function () {
var hash = this.priv.toByteArrayUnsigned();
while (hash.length < 32) hash.unshift(0);
hash.unshift(0x80);
var checksum = Crypto.SHA256(Crypto.SHA256(hash, {asBytes: true}), {asBytes: true});
var bytes = hash.concat(checksum.slice(0,4));

Loading…
Cancel
Save