reduced visibility of some classes

This commit is contained in:
Sebastian Stenzel
2016-02-28 17:49:21 +01:00
parent be7e7e32b9
commit cbb669aa40
6 changed files with 26 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
package org.cryptomator.crypto.engine.impl;
public final class Constants {
private Constants() {
}
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;
}

View File

@@ -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;

View File

@@ -8,9 +8,9 @@
*******************************************************************************/
package org.cryptomator.crypto.engine.impl;
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.CHUNK_SIZE;
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.MAC_SIZE;
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.NONCE_SIZE;
import static org.cryptomator.crypto.engine.impl.Constants.CHUNK_SIZE;
import static org.cryptomator.crypto.engine.impl.Constants.MAC_SIZE;
import static org.cryptomator.crypto.engine.impl.Constants.NONCE_SIZE;
import java.io.IOException;
import java.io.UncheckedIOException;

View File

@@ -8,8 +8,8 @@
*******************************************************************************/
package org.cryptomator.crypto.engine.impl;
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.NONCE_SIZE;
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.PAYLOAD_SIZE;
import static org.cryptomator.crypto.engine.impl.Constants.NONCE_SIZE;
import static org.cryptomator.crypto.engine.impl.Constants.PAYLOAD_SIZE;
import java.io.IOException;
import java.io.UncheckedIOException;

View File

@@ -8,10 +8,11 @@
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
import static org.cryptomator.crypto.engine.impl.Constants.PAYLOAD_SIZE;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.cryptomator.crypto.engine.impl.FileContentCryptorImpl;
import org.cryptomator.filesystem.FileSystem;
import org.cryptomator.filesystem.Folder;
@@ -23,6 +24,6 @@ public class BlockAlignedFileSystemFactory {
}
public FileSystem get(Folder root) {
return new BlockAlignedFileSystem(root, FileContentCryptorImpl.PAYLOAD_SIZE);
return new BlockAlignedFileSystem(root, PAYLOAD_SIZE);
}
}

View File

@@ -19,7 +19,7 @@ import org.cryptomator.filesystem.File;
import org.cryptomator.filesystem.ReadableFile;
import org.cryptomator.filesystem.WritableFile;
public class CryptoFile extends CryptoNode implements File {
class CryptoFile extends CryptoNode implements File {
public CryptoFile(CryptoFolder parent, String name, Cryptor cryptor) {
super(parent, name, cryptor);