mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
Fix: Resolve type incompatibility errors in sessionCrypto.ts
This commit is contained in:
@@ -88,7 +88,7 @@ export async function encryptJsonToBlob<T>(data: T): Promise<EncryptedBlob> {
|
||||
const ciphertext = await window.crypto.subtle.encrypt(
|
||||
{
|
||||
name: KEY_ALGORITHM,
|
||||
iv: iv as Uint8Array,
|
||||
iv: new Uint8Array(iv),
|
||||
},
|
||||
sessionKey,
|
||||
plaintext,
|
||||
@@ -121,10 +121,10 @@ export async function decryptBlobToJson<T>(blob: EncryptedBlob): Promise<T> {
|
||||
const decrypted = await window.crypto.subtle.decrypt(
|
||||
{
|
||||
name: KEY_ALGORITHM,
|
||||
iv: iv,
|
||||
iv: new Uint8Array(iv),
|
||||
},
|
||||
sessionKey,
|
||||
ciphertext,
|
||||
new Uint8Array(ciphertext),
|
||||
);
|
||||
|
||||
const jsonString = new TextDecoder().decode(decrypted);
|
||||
|
||||
Reference in New Issue
Block a user