From b623ec5d8e187c530dc58df604245c349fd7416a Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 14 Feb 2024 16:05:31 -0600 Subject: [PATCH] fix: use Uint8Array instead of ArrayBuffer --- src/crypto/encryption.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/encryption.ts b/src/crypto/encryption.ts index 0e9460acb..8398cd8f2 100644 --- a/src/crypto/encryption.ts +++ b/src/crypto/encryption.ts @@ -2,7 +2,7 @@ import { ciphertext } from '@xmtp/proto' import Ciphertext, { AESGCMNonceSize, KDFSaltSize } from './Ciphertext' import crypto from './crypto' -const hkdfNoInfo = new ArrayBuffer(0) +const hkdfNoInfo = new Uint8Array().buffer // This is a variation of https://github.com/paulmillr/noble-secp256k1/blob/main/index.ts#L1378-L1388 // that uses `digest('SHA-256', bytes)` instead of `digest('SHA-256', bytes.buffer)`