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
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
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);
});
});
});