mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Use the Fortuna generator instead of the JVM's SecureRandom. Bug #4.
Note that this is only the generator part of Fortuna, not the accumulator. The generator requires a seed, which is provided by a platform-specific implementation of SeedProvider. On Linux the implementation reads the seed from /dev/urandom.
This commit is contained in:
16
briar-tests/src/org/briarproject/TestSeedProvider.java
Normal file
16
briar-tests/src/org/briarproject/TestSeedProvider.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package org.briarproject;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.briarproject.api.crypto.SeedProvider;
|
||||
|
||||
public class TestSeedProvider implements SeedProvider {
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
public byte[] getSeed() {
|
||||
byte[] seed = new byte[32];
|
||||
random.nextBytes(seed);
|
||||
return seed;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user