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:
parent
192893ecf0
commit
3ee77f9e50
|
@ -139,7 +139,7 @@ SymEncryptedAEADProtected.prototype.crypt = async function (fn, key, data, strea
|
||||||
return stream.transformPair(data, async (readable, writable) => {
|
return stream.transformPair(data, async (readable, writable) => {
|
||||||
const reader = stream.getReader(readable);
|
const reader = stream.getReader(readable);
|
||||||
const buffer = new TransformStream({}, {
|
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
|
size: array => array.length
|
||||||
});
|
});
|
||||||
stream.pipe(buffer.readable, writable);
|
stream.pipe(buffer.readable, writable);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user