Beispiel #1
0
 /// <summary>
 /// Alternate constructor with named parameters.
 /// </summary>
 public static CypherBasedPrngGenerator Create(byte[] key,
                                               ICryptoPrimitive cryptoPrimitive      = null,
                                               HashAlgorithm hashAlgorithm           = null,
                                               CypherCounter initialCounter          = null,
                                               int outputBufferSize                  = -1,
                                               Func <byte[]> additionalEntropyGetter = null)
 {
     return(new CypherBasedPrngGenerator(key,
                                         cryptoPrimitive ?? BlockCypherCryptoPrimitive.Aes256(),
                                         hashAlgorithm ?? SHA512.Create(),
                                         initialCounter ?? new CypherCounter(16),
                                         outputBufferSize < 0 ? 1024 : outputBufferSize,
                                         additionalEntropyGetter));
 }
Beispiel #2
0
 /// <summary>
 /// Initialise the CPRNG with the given key material, and default cypher (AES 256) and hash algorithm (SHA512), zero counter and supplied additional entropy source.
 /// </summary>
 public CypherBasedPrngGenerator(byte[] key, Func <byte[]> additionalEntropyGetter)
     : this(key, BlockCypherCryptoPrimitive.Aes256(), SHA512.Create(), new CypherCounter(16), 1024, additionalEntropyGetter)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Initialise the CPRNG with the given key material, and default cypher (AES 256) and hash algorithm (SHA512), and zero counter.
 /// </summary>
 public CypherBasedPrngGenerator(byte[] key)
     : this(key, BlockCypherCryptoPrimitive.Aes256(), SHA512.Create(), new CypherCounter(16), 1024, null)
 {
 }