From a8bcabb090ce57f2b4c535e7a1283ffa06496ad1 Mon Sep 17 00:00:00 2001 From: Gancho Radkov Date: Fri, 1 Sep 2023 11:33:26 +0100 Subject: [PATCH] fix: sets `rejectZero` flag to true to avoid all zero key derivation --- packages/utils/src/crypto.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/utils/src/crypto.ts b/packages/utils/src/crypto.ts index 2f0c91618..d8ea8999e 100644 --- a/packages/utils/src/crypto.ts +++ b/packages/utils/src/crypto.ts @@ -36,6 +36,7 @@ export function deriveSymKey(privateKeyA: string, publicKeyB: string): string { const sharedKey = x25519.sharedKey( fromString(privateKeyA, BASE16), fromString(publicKeyB, BASE16), + true, ); const hkdf = new HKDF(SHA256, sharedKey); const symKey = hkdf.expand(KEY_LENGTH);