Use FortunaGenerator to implement PseudoRandom.

This commit is contained in:
akwizgran
2015-01-14 20:46:03 +00:00
parent 1c7432cac4
commit 7fbad8dc26
9 changed files with 63 additions and 92 deletions

View File

@@ -2,13 +2,14 @@ package org.briarproject;
import java.io.File;
import org.briarproject.api.crypto.SecretKey;
import org.briarproject.api.db.DatabaseConfig;
public class TestDatabaseConfig implements DatabaseConfig {
private final File dir;
private final long maxSize;
private volatile byte[] key = new byte[] { 'f', 'o', 'o' };
private volatile SecretKey key = new SecretKey(new byte[SecretKey.LENGTH]);
public TestDatabaseConfig(File dir, long maxSize) {
this.dir = dir;
@@ -23,11 +24,11 @@ public class TestDatabaseConfig implements DatabaseConfig {
return dir;
}
public void setEncryptionKey(byte[] key) {
public void setEncryptionKey(SecretKey key) {
this.key = key;
}
public byte[] getEncryptionKey() {
public SecretKey getEncryptionKey() {
return key;
}