(chainCode: Uint8Array, index: string)
| 55 | } |
| 56 | |
| 57 | export function deriveSecretKeyTreeChild(chainCode: Uint8Array, index: string): KeyTreeState { |
| 58 | const data = new Uint8Array([0x00, ...new TextEncoder().encode(index)]); |
| 59 | const I = hmac_sha512(chainCode, data); |
| 60 | return { |
| 61 | key: I.slice(0, 32), |
| 62 | chainCode: I.slice(32), |
| 63 | }; |
| 64 | } |
| 65 | |
| 66 | export function deriveKey(master: Uint8Array, usage: string, path: string[]): Uint8Array { |
| 67 | let state = deriveSecretKeyTreeRoot(master, usage); |
no test coverage detected