fixed size limit on server to include crypto overhead

This commit is contained in:
Danny Coates
2019-03-06 10:31:50 -08:00
parent dce8b6e525
commit 7f9674f494
7 changed files with 24 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ import Archive from '../../../app/archive';
import { b64ToArray } from '../../../app/utils';
import { blobStream, concatStream } from '../../../app/streams';
import { decryptStream, encryptStream } from '../../../app/ece.js';
import { encryptedSize } from '../../../app/utils';
const rs = 36;
@@ -101,4 +102,10 @@ describe('Streaming', function() {
assert.deepEqual(result, decrypted);
});
});
describe('encryptedSize', function() {
it('matches the size of an encrypted buffer', function() {
assert.equal(encryptedSize(buffer.length, rs), encrypted.length);
});
});
});