try {
if (typeof input === 'string' && /^[A-F0-9]{64}$/i.test(input)) {
const prv = hex.toBytes(input)
- const pub = nano25519_derive(prv)
- const signature = nano25519_sign(hex.toBytes(this.hash), new Uint8Array([...prv, ...pub]))
- this.signature = bytes.toHex(signature)
+ try {
+ const pub = nano25519_derive(prv)
+ const signature = nano25519_sign(hex.toBytes(this.hash), new Uint8Array([...prv, ...pub]))
+ this.signature = bytes.toHex(signature)
+ } finally {
+ prv.fill(0)
+ }
} else if (input instanceof Wallet && typeof index === 'number'
&& (frontier === undefined || frontier instanceof (this.constructor as typeof Block))
) {