.then(I => childKey(curve, pk, I))
}
-function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): ExtendedKey {
+function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): Promise<ExtendedKey> {
const IL = I.slice(0, I.byteLength / 2)
const IR = I.slice(I.byteLength / 2)
if (curve === 'ed25519 seed') {
- return ({ privateKey: IL, chainCode: IR })
+ return Promise.resolve({ privateKey: IL, chainCode: IR })
}
const ILparsed = parse256(new Uint8Array(IL))
if (ILparsed >= Point.CURVE().n) {
if (ck === 0n) {
throw new Error('Invalid child key is zero')
}
- return ({ privateKey: ser256(ck).buffer, chainCode: IR })
+ return Promise.resolve({ privateKey: ser256(ck).buffer, chainCode: IR })
}
function ser32 (integer: number): Bytes {