ISP80090Drbg.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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.Drbg
  5. {
  6. /**
  7. * Interface to SP800-90A deterministic random bit generators.
  8. */
  9. public interface ISP80090Drbg
  10. {
  11. /**
  12. * Return the block size of the DRBG.
  13. *
  14. * @return the block size (in bits) produced by each round of the DRBG.
  15. */
  16. int BlockSize { get; }
  17. /**
  18. * Populate a passed in array with random data.
  19. *
  20. * @param output output array for generated bits.
  21. * @param additionalInput additional input to be added to the DRBG in this step.
  22. * @param predictionResistant true if a reseed should be forced, false otherwise.
  23. *
  24. * @return number of bits generated, -1 if a reseed required.
  25. */
  26. int Generate(byte[] output, byte[] additionalInput, bool predictionResistant);
  27. /**
  28. * Reseed the DRBG.
  29. *
  30. * @param additionalInput additional input to be added to the DRBG in this step.
  31. */
  32. void Reseed(byte[] additionalInput);
  33. }
  34. }
  35. #pragma warning restore
  36. #endif