Add key generation

This commit is contained in:
Tilen Komel committed 2024-08-29 23:19:12 +02:00
1 parent 8c4c8a760e
commit 22cd5aa88d
2 files changed
+32 -22

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import { x25519 } from "@noble/curves/ed25519";
export function getX25519PrivateKey(): Uint8Array {
return x25519.utils.randomPrivateKey();
}
export function getX25519PublicKey(privateKey: Uint8Array): Uint8Array {
return x25519.getPublicKey(privateKey);
}