- reduced size of chunks, a MAC is calculated for (not final yet)

- faster range requests due to reduced chunk size, thus faster video playback start
- fixed range requests
- making file locks optional (if not supported by file system)
This commit is contained in:
Sebastian Stenzel
2015-07-03 19:30:49 +02:00
parent bc76ab285d
commit d76154c8d1
10 changed files with 233 additions and 25 deletions
@@ -84,7 +84,7 @@ interface AesCryptographicConfiguration {
/**
* Number of bytes, a content block over which a MAC is calculated consists of.
*/
int CONTENT_MAC_BLOCK = 5 * 1024 * 1024;
int CONTENT_MAC_BLOCK = 128 * 1024;
/**
* How to encode the encrypted file names safely. Base32 uses only alphanumeric characters and is case-insensitive.
@@ -139,10 +139,10 @@ public class Aes256CryptorTest {
@Test
public void testPartialDecryption() throws IOException, DecryptFailedException, WrongPasswordException, UnsupportedKeyLengthException, EncryptFailedException {
// our test plaintext data:
final byte[] plaintextData = new byte[524288 * Integer.BYTES];
// 8MiB test plaintext data:
final byte[] plaintextData = new byte[2097152 * Integer.BYTES];
final ByteBuffer bbIn = ByteBuffer.wrap(plaintextData);
for (int i = 0; i < 524288; i++) {
for (int i = 0; i < 2097152; i++) {
bbIn.putInt(i);
}
final InputStream plaintextIn = new ByteArrayInputStream(plaintextData);