mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-08 15:10:54 +03:00
Fix function to calculate encrypted ECE ciphertext length (#1153)
This commit is contained in:
@@ -282,7 +282,8 @@ class StreamSlicer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function encryptedSize(size, rs = ECE_RECORD_SIZE) {
|
export function encryptedSize(size, rs = ECE_RECORD_SIZE) {
|
||||||
return 21 + size + 16 * Math.floor(size / (rs - 17));
|
const chunk_meta = TAG_LENGTH + 1; // Chunk metadata, tag and delimiter
|
||||||
|
return 21 + size + chunk_meta * Math.ceil(size / (rs - chunk_meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user