IEntropySource.cs 933 B

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
  5. {
  6. /// <summary>
  7. /// Base interface describing an entropy source for a DRBG.
  8. /// </summary>
  9. public interface IEntropySource
  10. {
  11. /// <summary>
  12. /// Return whether or not this entropy source is regarded as prediction resistant.
  13. /// </summary>
  14. /// <value><c>true</c> if this instance is prediction resistant; otherwise, <c>false</c>.</value>
  15. bool IsPredictionResistant { get; }
  16. /// <summary>
  17. /// Return a byte array of entropy.
  18. /// </summary>
  19. /// <returns>The entropy bytes.</returns>
  20. byte[] GetEntropy();
  21. /// <summary>
  22. /// Return the number of bits of entropy this source can produce.
  23. /// </summary>
  24. /// <value>The size, in bits, of the return value of getEntropy.</value>
  25. int EntropySize { get; }
  26. }
  27. }
  28. #pragma warning restore
  29. #endif