Replace buffer.slice() with buffer.subarray()

This commit is contained in:
Fedor Indutny
2025-06-09 14:37:30 -07:00
committed by GitHub
parent 4a6e2d297b
commit b0634f9a9d
19 changed files with 54 additions and 45 deletions

View File

@@ -95,8 +95,8 @@ export class Crypto {
throw new Error('Invalid GCM ciphertext');
}
const tag = input.slice(input.length - AUTH_TAG_SIZE);
input = input.slice(0, input.length - AUTH_TAG_SIZE);
const tag = input.subarray(input.length - AUTH_TAG_SIZE);
input = input.subarray(0, input.length - AUTH_TAG_SIZE);
gcm.setAuthTag(tag);