(seed: Uint8Array, usage: string)
| 47 | }; |
| 48 | |
| 49 | export function deriveSecretKeyTreeRoot(seed: Uint8Array, usage: string): KeyTreeState { |
| 50 | const I = hmac_sha512(new TextEncoder().encode(usage + ' Master Seed'), seed); |
| 51 | return { |
| 52 | key: I.slice(0, 32), |
| 53 | chainCode: I.slice(32), |
| 54 | }; |
| 55 | } |
| 56 | |
| 57 | export function deriveSecretKeyTreeChild(chainCode: Uint8Array, index: string): KeyTreeState { |
| 58 | const data = new Uint8Array([0x00, ...new TextEncoder().encode(index)]); |
no test coverage detected