Fix function to calculate encrypted ECE ciphertext length (#1153)

This commit is contained in:
Tim Visée 2019-02-18 20:19:15 +01:00 committed by Danny Coates
parent 06c9b126a3
commit b76150d4d9
1 changed files with 2 additions and 1 deletions

View File

@ -282,7 +282,8 @@ class StreamSlicer {
}
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));
}
/*