Check.cs 804 B

1234567891011121314151617181920212223242526272829
  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. internal class Check
  7. {
  8. internal static void DataLength(bool condition, string msg)
  9. {
  10. if (condition)
  11. throw new DataLengthException(msg);
  12. }
  13. internal static void DataLength(byte[] buf, int off, int len, string msg)
  14. {
  15. if (off > (buf.Length - len))
  16. throw new DataLengthException(msg);
  17. }
  18. internal static void OutputLength(byte[] buf, int off, int len, string msg)
  19. {
  20. if (off > (buf.Length - len))
  21. throw new OutputLengthException(msg);
  22. }
  23. }
  24. }
  25. #pragma warning restore
  26. #endif