@volr/sdk-core 0.1.90 → 0.1.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ import { createPasskeyProvider } from '@volr/sdk-core';
30
30
 
31
31
  // Create a passkey-based provider
32
32
  const provider = createPasskeyProvider(adapter, {
33
- prfInput: { origin, projectId, credentialId },
33
+ prfInput: { projectId, credentialId },
34
34
  encryptedBlob: { cipher, nonce },
35
35
  aad: new TextEncoder().encode('volr/master-seed/v1|userId|passkey|v1'),
36
36
  });
package/dist/index.cjs CHANGED
@@ -229,14 +229,13 @@ function createMasterKeyProvider() {
229
229
  };
230
230
  }
231
231
  function deriveWrapKey(input) {
232
- const { origin, projectId, salt } = input;
233
- const rpId = typeof window !== "undefined" && origin ? new URL(origin).hostname : origin;
234
- const prfInput = new TextEncoder().encode(`${rpId}|${projectId}`);
235
- const prfOutput = sha256.sha256(prfInput);
232
+ const { projectId, salt } = input;
233
+ const prfInputBytes = new TextEncoder().encode(`volr|${projectId}`);
234
+ const prfOutput = sha256.sha256(prfInputBytes);
236
235
  const defaultSalt = salt || sha256.sha256(
237
- new TextEncoder().encode(`volr/salt|${rpId}|${projectId}`)
236
+ new TextEncoder().encode(`volr/salt|${projectId}`)
238
237
  );
239
- const info = `volr/wrap-key/v1|${rpId}|${projectId}`;
238
+ const info = `volr/wrap-key/v1|${projectId}`;
240
239
  const wrapKey = hkdfSha256(prfOutput, defaultSalt, info, 32);
241
240
  return wrapKey;
242
241
  }