|
@@ -8,6 +8,9 @@
|
|
|
*******************************************************************************/
|
|
|
package org.cryptomator.crypto.engine.impl;
|
|
|
|
|
|
+import static org.cryptomator.crypto.engine.impl.Constants.CHUNK_SIZE;
|
|
|
+import static org.cryptomator.crypto.engine.impl.Constants.PAYLOAD_SIZE;
|
|
|
+
|
|
|
import java.nio.ByteBuffer;
|
|
|
import java.security.SecureRandom;
|
|
|
import java.util.Optional;
|
|
@@ -19,12 +22,7 @@ import org.cryptomator.crypto.engine.FileContentCryptor;
|
|
|
import org.cryptomator.crypto.engine.FileContentDecryptor;
|
|
|
import org.cryptomator.crypto.engine.FileContentEncryptor;
|
|
|
|
|
|
-public class FileContentCryptorImpl implements FileContentCryptor {
|
|
|
-
|
|
|
- public static final int PAYLOAD_SIZE = 32 * 1024;
|
|
|
- public static final int NONCE_SIZE = 16;
|
|
|
- public static final int MAC_SIZE = 32;
|
|
|
- public static final int CHUNK_SIZE = NONCE_SIZE + PAYLOAD_SIZE + MAC_SIZE;
|
|
|
+class FileContentCryptorImpl implements FileContentCryptor {
|
|
|
|
|
|
private final SecretKey encryptionKey;
|
|
|
private final SecretKey macKey;
|