Skip to content

Commit

Permalink
fix: y-fire secretbuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
royce-mathew committed Jan 7, 2025
1 parent 5ff8d88 commit a412199
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/y-fire/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ export const base64ToUint8Array = async (base64: string) => {

export const generateKey = async (sender: string, receiver: string) => {
const secretBuffer = string.encodeUtf8(sender).buffer
const salt = string.encodeUtf8(receiver).buffer
const salt = new Uint8Array(string.encodeUtf8(receiver).buffer)
const key = await crypto.subtle
.importKey("raw", secretBuffer, "PBKDF2", false, ["deriveKey"])
.importKey("raw", new Uint8Array(secretBuffer), "PBKDF2", false, [
"deriveKey",
])
.then((keyMaterial) =>
crypto.subtle.deriveKey(
{
Expand Down

0 comments on commit a412199

Please sign in to comment.