@Test public void testSeedsAreDistinct() { if (!(OsUtils.isLinux())) { System.err.println("WARNING: Skipping test, can't run on this OS"); return; } Set<Bytes> seeds = new HashSet<>(); LinuxSecureRandomSpi engine = new LinuxSecureRandomSpi(); for (int i = 0; i < 1000; i++) { byte[] seed = engine.engineGenerateSeed(SEED_BYTES); assertEquals(SEED_BYTES, seed.length); assertTrue(seeds.add(new Bytes(seed))); } }
@Override protected byte[] engineGenerateSeed(int len) { byte[] seed = new byte[len]; engineNextBytes(seed); return seed; }
LinuxSecureRandomSpi extends SecureRandomSpi { @Override protected byte[] engineGenerateSeed(int len) { byte[] seed = new byte[len]; engineNextBytes(seed); return seed; } }
LinuxSecureRandomSpi extends SecureRandomSpi { @Override protected byte[] engineGenerateSeed(int len) { byte[] seed = new byte[len]; engineNextBytes(seed); return seed; } LinuxSecureRandomSpi();   LinuxSecureRandomSpi(File inputDevice, File outputDevice); }
LinuxSecureRandomSpi extends SecureRandomSpi { @Override protected byte[] engineGenerateSeed(int len) { byte[] seed = new byte[len]; engineNextBytes(seed); return seed; } LinuxSecureRandomSpi();   LinuxSecureRandomSpi(File inputDevice, File outputDevice);  }
LinuxSecureRandomSpi extends SecureRandomSpi { @Override protected byte[] engineGenerateSeed(int len) { byte[] seed = new byte[len]; engineNextBytes(seed); return seed; } LinuxSecureRandomSpi();   LinuxSecureRandomSpi(File inputDevice, File outputDevice);   }