async function y(t){if(t.byteLength!==32)throw new Error(`Encryption key must be exactly 32 bytes, got ${t.byteLength}`);return globalThis.crypto.subtle.importKey("raw",t,"AES-GCM",!1,["encrypt","decrypt"])}async function E(t,e){if(e.byteLength<28)throw new Error(`Encrypted data too short: expected at least 28 bytes, got ${e.byteLength}`);const n=e.subarray(0,12),r=e.subarray(12),o=await globalThis.crypto.subtle.decrypt({name:"AES-GCM",iv:n,tagLength:128},t,r);return new Uint8Array(o)}export{E as decrypt,y as importKey};
