@Override public void useSerialStores(int instances, int largestBlock, byte[] passphrase) { SecureRandom sr = new SecureRandom(passphrase); NoiseProducer noiseProducer = new NoiseProducer(sr); serialStoreReleaseAck = new Pipe[instances]; serialStoreReplay = new Pipe[instances]; serialStoreWriteAck = new Pipe[instances]; serialStoreRequestReplay = new Pipe[instances]; serialStoreWrite = new Pipe[instances]; for(int j=0; j<instances; j++) { buildSerialStore(j, noiseProducer, largestBlock, SequentialReplayerImpl.File); } }
@Override public void useSerialStores(int instances, int largestBlock, String passphrase) { CharSequenceToUTF8 charSequenceToUTF8 = CharSequenceToUTF8Local.get(); SecureRandom sr = new SecureRandom(charSequenceToUTF8.convert(passphrase).asBytes()); charSequenceToUTF8.clear(); NoiseProducer noiseProducer = new NoiseProducer(sr); serialStoreReleaseAck = new Pipe[instances]; serialStoreReplay = new Pipe[instances]; serialStoreWriteAck = new Pipe[instances]; serialStoreRequestReplay = new Pipe[instances]; serialStoreWrite = new Pipe[instances]; int j = instances; while (--j>=0) { buildSerialStore(j, noiseProducer, largestBlock, SequentialReplayerImpl.File); } }
np = new NoiseProducer(new SecureRandom("seed".getBytes()));
SecureRandom sr = new SecureRandom(charSequenceToUTF8.convert(username).append(":").append(password).asBytes()); charSequenceToUTF8.clear(); noiseProducer = new NoiseProducer(sr);