(master: Uint8Array, usage: string, path: string[])
| 64 | } |
| 65 | |
| 66 | export function deriveKey(master: Uint8Array, usage: string, path: string[]): Uint8Array { |
| 67 | let state = deriveSecretKeyTreeRoot(master, usage); |
| 68 | for (const index of path) { |
| 69 | state = deriveSecretKeyTreeChild(state.chainCode, index); |
| 70 | } |
| 71 | return state.key; |
| 72 | } |
| 73 | |
| 74 | export function deriveContentKeyPair(secret: Uint8Array): { publicKey: Uint8Array; secretKey: Uint8Array } { |
| 75 | const seed = deriveKey(secret, 'Happy EnCoder', ['content']); |
no test coverage detected