constants: zero key.

This commit is contained in:
Christopher Jeffrey 2016-07-21 08:10:44 -07:00
parent bb0149e603
commit 8bcfeca44e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 14 additions and 7 deletions

View File

@ -94,11 +94,7 @@ var unorm;
* Constants
*/
var PUBLIC_KEY = new Buffer(33);
PUBLIC_KEY.fill(0);
var FINGER_PRINT = new Buffer(4);
FINGER_PRINT.fill(0);
var FINGER_PRINT = new Buffer('00000000', 'hex');
/**
* HD Mnemonic
@ -845,7 +841,7 @@ function HDPrivateKey(options) {
this.chainCode = constants.ZERO_HASH;
this.privateKey = constants.ZERO_HASH;
this.publicKey = PUBLIC_KEY;
this.publicKey = constants.ZERO_KEY;
this.fingerPrint = null;
this.mnemonic = null;
@ -1521,7 +1517,7 @@ function HDPublicKey(options) {
this.parentFingerPrint = FINGER_PRINT;
this.childIndex = 0;
this.chainCode = constants.ZERO_HASH;
this.publicKey = PUBLIC_KEY;
this.publicKey = constants.ZERO_KEY;
this.fingerPrint = null;

View File

@ -630,6 +630,17 @@ exports.ZERO_HASH160 = new Buffer(
exports.NULL_HASH160 = '0000000000000000000000000000000000000000';
/**
* A compressed pubkey of all zeroes.
* @const {Buffer}
* @default
*/
exports.ZERO_KEY = new Buffer(
'000000000000000000000000000000000000000000000000000000000000000000',
'hex'
);
/**
* BCoin version.
* @const {String}