MCPcopy Create free account
hub / github.com/Web3Auth/Auth / getED25519Key

Function getED25519Key

src/ed25519/utils.ts:11–21  ·  view source on GitHub ↗
(privateKey: string | Uint8Array)

Source from the content-addressed store, hash-verified

9const ed25519 = getEd25519();
10
11export 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}

Callers 2

ed25519.test.tsFile · 0.90
getEd25519KeyFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected