download
raw
650 Bytes
import encrypt from '../runtime/encrypt.js';
import decrypt from '../runtime/decrypt.js';
import { encode as base64url } from '../runtime/base64url.js';
export async function wrap(alg, key, cek, iv) {
const jweAlgorithm = alg.slice(0, 7);
const wrapped = await encrypt(jweAlgorithm, cek, key, iv, new Uint8Array(0));
return {
encryptedKey: wrapped.ciphertext,
iv: base64url(wrapped.iv),
tag: base64url(wrapped.tag),
};
}
export async function unwrap(alg, key, encryptedKey, iv, tag) {
const jweAlgorithm = alg.slice(0, 7);
return decrypt(jweAlgorithm, key, encryptedKey, iv, tag, new Uint8Array(0));
}

Xet Storage Details

Size:
650 Bytes
·
Xet hash:
7984a9774b30b0c9ccf4dd195602a43f3406fb5c3f7237d0a6f8abce8c6ffbe2

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.