Skip to content
Browse files

Fix padding issue with exported private keys.

  • Loading branch information...
1 parent e90780d commit 24881584c721adc268fbd8c58f57e04fb82c5a08 @justmoon justmoon committed Aug 26, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/eckey.js
View
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));

0 comments on commit 2488158

Please sign in to comment.
Something went wrong with that request. Please try again.