private static DigestRandomGenerator CreatePrng(string digestName, bool autoSeed) { IDigest digest = DigestUtilities.GetDigest(digestName); if (digest == null) { return(null); } DigestRandomGenerator digestRandomGenerator = new DigestRandomGenerator(digest); if (autoSeed) { digestRandomGenerator.AddSeedMaterial(SecureRandom.NextCounterValue()); digestRandomGenerator.AddSeedMaterial(SecureRandom.GetSeed(digest.GetDigestSize())); } return(digestRandomGenerator); }