(privateKey: string | Uint8Array)
| 9 | const ed25519 = getEd25519(); |
| 10 | |
| 11 | export function getED25519Key(privateKey: string | Uint8Array): { |
| 12 | sk: Uint8Array; |
| 13 | pk: Uint8Array; |
| 14 | } { |
| 15 | const privKey = typeof privateKey === "string" ? hexToBytes(privateKey) : privateKey; |
| 16 | const pk = ed25519.getPublicKey(privKey); |
| 17 | const sk = new Uint8Array(64); |
| 18 | sk.set(privKey, 0); |
| 19 | sk.set(pk, 32); |
| 20 | return { sk, pk }; |
| 21 | } |
no test coverage detected