mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-20 15:04:23 +00:00
reduced visibility of some classes
This commit is contained in:
+13
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
+4
-6
@@ -8,6 +8,9 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.cryptomator.crypto.engine.impl;
|
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.nio.ByteBuffer;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.Optional;
|
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.FileContentDecryptor;
|
||||||
import org.cryptomator.crypto.engine.FileContentEncryptor;
|
import org.cryptomator.crypto.engine.FileContentEncryptor;
|
||||||
|
|
||||||
public class FileContentCryptorImpl implements FileContentCryptor {
|
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;
|
|
||||||
|
|
||||||
private final SecretKey encryptionKey;
|
private final SecretKey encryptionKey;
|
||||||
private final SecretKey macKey;
|
private final SecretKey macKey;
|
||||||
|
|||||||
+3
-3
@@ -8,9 +8,9 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.cryptomator.crypto.engine.impl;
|
package org.cryptomator.crypto.engine.impl;
|
||||||
|
|
||||||
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.CHUNK_SIZE;
|
import static org.cryptomator.crypto.engine.impl.Constants.CHUNK_SIZE;
|
||||||
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.MAC_SIZE;
|
import static org.cryptomator.crypto.engine.impl.Constants.MAC_SIZE;
|
||||||
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.NONCE_SIZE;
|
import static org.cryptomator.crypto.engine.impl.Constants.NONCE_SIZE;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UncheckedIOException;
|
import java.io.UncheckedIOException;
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.cryptomator.crypto.engine.impl;
|
package org.cryptomator.crypto.engine.impl;
|
||||||
|
|
||||||
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.NONCE_SIZE;
|
import static org.cryptomator.crypto.engine.impl.Constants.NONCE_SIZE;
|
||||||
import static org.cryptomator.crypto.engine.impl.FileContentCryptorImpl.PAYLOAD_SIZE;
|
import static org.cryptomator.crypto.engine.impl.Constants.PAYLOAD_SIZE;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UncheckedIOException;
|
import java.io.UncheckedIOException;
|
||||||
|
|||||||
+3
-2
@@ -8,10 +8,11 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.cryptomator.filesystem.blockaligned;
|
package org.cryptomator.filesystem.blockaligned;
|
||||||
|
|
||||||
|
import static org.cryptomator.crypto.engine.impl.Constants.PAYLOAD_SIZE;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import org.cryptomator.crypto.engine.impl.FileContentCryptorImpl;
|
|
||||||
import org.cryptomator.filesystem.FileSystem;
|
import org.cryptomator.filesystem.FileSystem;
|
||||||
import org.cryptomator.filesystem.Folder;
|
import org.cryptomator.filesystem.Folder;
|
||||||
|
|
||||||
@@ -23,6 +24,6 @@ public class BlockAlignedFileSystemFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FileSystem get(Folder root) {
|
public FileSystem get(Folder root) {
|
||||||
return new BlockAlignedFileSystem(root, FileContentCryptorImpl.PAYLOAD_SIZE);
|
return new BlockAlignedFileSystem(root, PAYLOAD_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ import org.cryptomator.filesystem.File;
|
|||||||
import org.cryptomator.filesystem.ReadableFile;
|
import org.cryptomator.filesystem.ReadableFile;
|
||||||
import org.cryptomator.filesystem.WritableFile;
|
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) {
|
public CryptoFile(CryptoFolder parent, String name, Cryptor cryptor) {
|
||||||
super(parent, name, cryptor);
|
super(parent, name, cryptor);
|
||||||
|
|||||||
Reference in New Issue
Block a user