hd: use buffer pool for key derivation.

This commit is contained in:
Christopher Jeffrey 2017-09-03 11:29:59 -07:00
parent 45e41b1bb4
commit d00e924965
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 2 additions and 2 deletions

View File

@ -199,7 +199,7 @@ HDPrivateKey.prototype.derive = function derive(index, hardened) {
if (cache)
return cache;
const bw = new StaticWriter(37);
const bw = StaticWriter.pool(37);
if (index & common.HARDENED) {
bw.writeU8(0);

View File

@ -165,7 +165,7 @@ HDPublicKey.prototype.derive = function derive(index, hardened) {
if (cache)
return cache;
const bw = new StaticWriter(37);
const bw = StaticWriter.pool(37);
bw.writeBytes(this.publicKey);
bw.writeU32BE(index);