throw new Error('Invalid child key is greater than the order of the curve')
}
const pkParsed = parse256(pk)
- const childKey = (ILparsed + pkParsed) % Point.CURVE().n
- if (childKey === 0n) {
+ const ck = (ILparsed + pkParsed) % Point.CURVE().n
+ if (ck === 0n) {
throw new Error('Invalid child key is zero')
}
- return ({ privateKey: ser256(childKey).buffer, chainCode: IR })
+ return ({ privateKey: ser256(ck).buffer, chainCode: IR })
}
function ser32 (integer: number): Bytes {