Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/aes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ export const gcmsiv: TRet<
// RFC 8452 §5: plaintext is unauthenticated here and MUST NOT be
// returned until the expected-tag check completes successfully.
if (!equalBytes(tag, expectedTag)) {
clean(...toClean);
clean(plaintext, ...toClean);
throw new Error('invalid polyval tag');
}
// Cleanup
Expand Down Expand Up @@ -1971,6 +1971,7 @@ export const aessiv: TRet<
if (equalBytes(t, v)) {
return p as TRet<Uint8Array>;
} else {
clean(p);
throw new Error('invalid siv tag');
}
},
Expand Down
Loading