Social Graph: read-only state sync with primary device
This commit is contained in:
parent
12745a2c79
commit
8502d23576
19 changed files with 1035 additions and 57 deletions
14
ts/Crypto.ts
14
ts/Crypto.ts
|
@ -184,6 +184,20 @@ export async function decryptFile(
|
|||
return decryptSymmetric(key, ciphertext);
|
||||
}
|
||||
|
||||
export async function deriveStorageManifestKey(
|
||||
storageServiceKey: ArrayBuffer,
|
||||
version: number
|
||||
) {
|
||||
return hmacSha256(storageServiceKey, bytesFromString(`Manifest_${version}`));
|
||||
}
|
||||
|
||||
export async function deriveStorageItemKey(
|
||||
storageServiceKey: ArrayBuffer,
|
||||
itemID: string
|
||||
) {
|
||||
return hmacSha256(storageServiceKey, bytesFromString(`Item_${itemID}`));
|
||||
}
|
||||
|
||||
export async function deriveAccessKey(profileKey: ArrayBuffer) {
|
||||
const iv = getZeroes(12);
|
||||
const plaintext = getZeroes(16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue