Check.cs 730 B

1234567891011121314151617181920212223242526272829
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Crypto
  4. {
  5. internal class Check
  6. {
  7. internal static void DataLength(bool condition, string msg)
  8. {
  9. if (condition)
  10. throw new DataLengthException(msg);
  11. }
  12. internal static void DataLength(byte[] buf, int off, int len, string msg)
  13. {
  14. if (off + len > buf.Length)
  15. throw new DataLengthException(msg);
  16. }
  17. internal static void OutputLength(byte[] buf, int off, int len, string msg)
  18. {
  19. if (off + len > buf.Length)
  20. throw new OutputLengthException(msg);
  21. }
  22. }
  23. }
  24. #endif