hd: use buffer pool for key derivation.
This commit is contained in:
parent
45e41b1bb4
commit
d00e924965
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user