예제 #1
0
        // Token: 0x06000088 RID: 136 RVA: 0x00006FE0 File Offset: 0x000051E0
        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.GetNextBytes(SecureRandom.Master, digest.GetDigestSize()));
            }
            return(digestRandomGenerator);
        }
예제 #2
0
 private static byte[] CreateIV(SecureRandom random, int ivLength)
 {
     return(SecureRandom.GetNextBytes(random, ivLength));
 }