IRandomGenerator.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Crypto.Prng
  4. {
  5. /// <remarks>Generic interface for objects generating random bytes.</remarks>
  6. public interface IRandomGenerator
  7. {
  8. /// <summary>Add more seed material to the generator.</summary>
  9. /// <param name="seed">A byte array to be mixed into the generator's state.</param>
  10. void AddSeedMaterial(byte[] seed);
  11. /// <summary>Add more seed material to the generator.</summary>
  12. /// <param name="seed">A long value to be mixed into the generator's state.</param>
  13. void AddSeedMaterial(long seed);
  14. /// <summary>Fill byte array with random values.</summary>
  15. /// <param name="bytes">Array to be filled.</param>
  16. void NextBytes(byte[] bytes);
  17. /// <summary>Fill byte array with random values.</summary>
  18. /// <param name="bytes">Array to receive bytes.</param>
  19. /// <param name="start">Index to start filling at.</param>
  20. /// <param name="len">Length of segment to fill.</param>
  21. void NextBytes(byte[] bytes, int start, int len);
  22. }
  23. }
  24. #endif