🐛 fix: Fixing issues with generating standard and quantum-resistant encryption keys
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import * as x25519 from '@noble/ed25519';
|
||||
import { x25519 } from '@noble/curves/ed25519.js';
|
||||
import { toB64Url } from './util';
|
||||
|
||||
/**
|
||||
* Generate a Reality key pair
|
||||
* @returns An object containing the private and public keys in base64url format
|
||||
*/
|
||||
export async function generateRealityKeyPair() {
|
||||
const { secretKey, publicKey } = await x25519.keygenAsync();
|
||||
export function generateRealityKeyPair() {
|
||||
const { secretKey, publicKey } = x25519.keygen();
|
||||
return { privateKey: toB64Url(secretKey), publicKey: toB64Url(publicKey) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user