(
- ({ className, variant, prefix, suffix, action, ...props }, ref) => {
+ ({ className, value, variant, prefix, suffix, action, ...props }, ref) => {
return (
{prefix && (
@@ -45,6 +45,7 @@ const Input = React.forwardRef(
className,
inputVariants({ variant }),
)}
+ value={value}
ref={ref}
{...props}
/>
diff --git a/src/core/utils/x25519.ts b/src/core/utils/x25519.ts
new file mode 100644
index 00000000..2729d80a
--- /dev/null
+++ b/src/core/utils/x25519.ts
@@ -0,0 +1,15 @@
+import { x25519 } from "@noble/curves/ed25519";
+
+export function getX25519PrivateKey(): Uint8Array {
+ const key = x25519.utils.randomPrivateKey();
+
+ key[0] &= 248;
+ key[31] &= 127;
+ key[31] |= 64;
+
+ return key;
+}
+
+export function getX25519PublicKey(privateKey: Uint8Array): Uint8Array {
+ return x25519.getPublicKey(privateKey);
+}