IRandomGenerator.cs 1.1 KB

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