Add key generation

This commit is contained in:
Tilen Komel
2024-08-29 23:19:12 +02:00
parent 8c4c8a760e
commit 22cd5aa88d
2 changed files with 32 additions and 22 deletions
+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);
}