From 6a56aea4227d3459d37c17ae67ad6eb686f391d1 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 3 Mar 2024 23:53:30 +0000 Subject: [PATCH] use Promise.all in genRSAAndEd25519KeyPair --- packages/backend/src/misc/gen-key-pair.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/src/misc/gen-key-pair.ts b/packages/backend/src/misc/gen-key-pair.ts index 58e3091369..0b033ec33e 100644 --- a/packages/backend/src/misc/gen-key-pair.ts +++ b/packages/backend/src/misc/gen-key-pair.ts @@ -6,8 +6,7 @@ import { genEd25519KeyPair, genRsaKeyPair } from '@misskey-dev/node-http-message-signatures'; export async function genRSAAndEd25519KeyPair(rsaModulusLength = 4096) { - const rsa = await genRsaKeyPair(rsaModulusLength); - const ed25519 = await genEd25519KeyPair(); + const [rsa, ed25519] = await Promise.all([genRsaKeyPair(rsaModulusLength), genEd25519KeyPair()]); return { publicKey: rsa.publicKey, privateKey: rsa.privateKey,