mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-10 18:54:44 +00:00
AEAD: Fix high water mark calculation based on chunk size
Use current packet's chunk size instead of default chunk size.
This commit is contained in:
@@ -139,7 +139,7 @@ SymEncryptedAEADProtected.prototype.crypt = async function (fn, key, data, strea
|
||||
return stream.transformPair(data, async (readable, writable) => {
|
||||
const reader = stream.getReader(readable);
|
||||
const buffer = new TransformStream({}, {
|
||||
highWaterMark: streaming ? util.getHardwareConcurrency() * 2 ** (config.aead_chunk_size_byte + 6) : Infinity,
|
||||
highWaterMark: streaming ? util.getHardwareConcurrency() * 2 ** (this.chunkSizeByte + 6) : Infinity,
|
||||
size: array => array.length
|
||||
});
|
||||
stream.pipe(buffer.readable, writable);
|
||||
|
||||
Reference in New Issue
Block a user