c49affb655fc

fix: vault_id uses full 32-byte BLAKE3 digest (64 hex chars), up from truncated 8-byte/16-char (v3.6.99)

time
2026-05-22 18:32 UTC · 5 months ago
machine
koh2
parent
c9a5d79ae31e
2 files src/background/chirp-sync-vault-adapter.test.ts+2 −2src/shared/sync-identity.ts+2 −2
src/background/chirp-sync-vault-adapter.test.ts+2 −2
@@ -53,12 +53,12 @@5353     return pubkeyToHex(kp.publicKeyRaw);5454   }5555 56-  it("computeVaultId returns a stable 16-char hex string for the same masterKey", async () => {56+  it("computeVaultId returns a stable 64-char hex string for the same masterKey", async () => {5757     const { adapter } = await setupVault();5858     const id1 = await adapter.computeVaultId();5959     const id2 = await adapter.computeVaultId();6060     expect(id1).toBe(id2);61-    expect(id1).toMatch(/^[0-9a-f]{16}$/);61+    expect(id1).toMatch(/^[0-9a-f]{64}$/);6262   });6363 6464   it("getOurDeviceId is stable across calls and a fresh UUID v4 on first call", async () => {

view file

src/shared/sync-identity.ts+2 −2
@@ -5,7 +5,7 @@55 //                              salt="peach-sync-identity-v1",66 //                              info=device_id))77 //8-//   vault_id = first 8 bytes of BLAKE3(master_key || "peach-vault-id"), hex8+//   vault_id = BLAKE3(master_key || "peach-vault-id"), hex (64 chars / 32 bytes)99 //1010 // Determinism is the point: losing and reinstalling Peach against the same1111 // vault recovers the same sync identity, so paired peers do not need to@@ -25,7 +25,7 @@2525 const SYNC_IDENTITY_SALT = new TextEncoder().encode("peach-sync-identity-v1");2626 const SYNC_SIGNING_SALT = new TextEncoder().encode("peach-sync-signing-v1");2727 const VAULT_ID_INFO = new TextEncoder().encode("peach-vault-id");28-const VAULT_ID_HEX_LENGTH = 16; // 8 bytes → 16 hex chars28+const VAULT_ID_HEX_LENGTH = 64; // full 32-byte BLAKE3 digest → 64 hex chars2929 3030 // PKCS#8 prefix for a raw 32-byte Ed25519 seed (RFC 8410 §7).3131 //   SEQUENCE(46) { INTEGER 0, AlgorithmIdentifier(id-Ed25519),

view file