public BouncyCastleRandom() { logger.info("Generating random seed from SecureRandom."); long t = System.currentTimeMillis(); byte[] seed = new SecureRandom().generateSeed(8); logger.debug("Creating random seed took {} ms", System.currentTimeMillis() - t); random.addSeedMaterial(seed); }
/** * Add more seed material to the generator. * * @param seed a long value to be mixed into the generator's state. */ public void addSeedMaterial( long seed) { synchronized (this) { windowCount = 0; generator.addSeedMaterial(seed); } }
/** * Add more seed material to the generator. * * @param seed a long value to be mixed into the generator's state. */ public void addSeedMaterial( long seed) { synchronized (this) { windowCount = 0; generator.addSeedMaterial(seed); } }
/** * Add more seed material to the generator. * * @param seed a byte array to be mixed into the generator's state. */ public void addSeedMaterial( byte[] seed) { synchronized (this) { windowCount = 0; generator.addSeedMaterial(seed); } }
/** * Add more seed material to the generator. * * @param seed a byte array to be mixed into the generator's state. */ public void addSeedMaterial( byte[] seed) { synchronized (this) { windowCount = 0; generator.addSeedMaterial(seed); } }
public BouncyCastleRandom() { logger.info("Generating random seed from SecureRandom."); long t = System.currentTimeMillis(); byte[] seed = new SecureRandom().generateSeed(8); logger.debug("Creating random seed took {} ms", System.currentTimeMillis() - t); random.addSeedMaterial(seed); }
public BouncyCastleRandom() { byte[] seed = new SecureRandom().generateSeed(8); random.addSeedMaterial(seed); }
AbstractTlsContext(SecureRandom secureRandom, SecurityParameters securityParameters) { Digest d = TlsUtils.createHash(HashAlgorithm.sha256); byte[] seed = new byte[d.getDigestSize()]; secureRandom.nextBytes(seed); this.nonceRandom = new DigestRandomGenerator(d); nonceRandom.addSeedMaterial(nextCounterValue()); nonceRandom.addSeedMaterial(Times.nanoTime()); nonceRandom.addSeedMaterial(seed); this.secureRandom = secureRandom; this.securityParameters = securityParameters; }
AbstractTlsContext(SecureRandom secureRandom, SecurityParameters securityParameters) { Digest d = TlsUtils.createHash(HashAlgorithm.sha256); byte[] seed = new byte[d.getDigestSize()]; secureRandom.nextBytes(seed); this.nonceRandom = new DigestRandomGenerator(d); nonceRandom.addSeedMaterial(nextCounterValue()); nonceRandom.addSeedMaterial(Times.nanoTime()); nonceRandom.addSeedMaterial(seed); this.secureRandom = secureRandom; this.securityParameters = securityParameters; }
public BouncyCastleRandom() { ValidateUtils.checkTrue(SecurityUtils.isBouncyCastleRegistered(), "BouncyCastle not registered"); this.random = new VMPCRandomGenerator(); byte[] seed = new SecureRandom().generateSeed(8); this.random.addSeedMaterial(seed); }
public BouncyCastleRandom() { ValidateUtils.checkTrue(SecurityUtils.isBouncyCastleRegistered(), "BouncyCastle not registered"); this.random = new VMPCRandomGenerator(); byte[] seed = new SecureRandom().generateSeed(8); this.random.addSeedMaterial(seed); }
public BouncyCastleRandom() { ValidateUtils.checkTrue(SecurityUtils.isBouncyCastleRegistered(), "BouncyCastle not registered"); this.random = new VMPCRandomGenerator(); byte[] seed = new SecureRandom().generateSeed(8); this.random.addSeedMaterial(seed); }