You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Check.cs 575 B

4 years ago
1234567891011121314151617181920212223
  1. using Org.BouncyCastle.Crypto;
  2. namespace Shadowsocks.Net.Crypto.Extensions
  3. {
  4. internal static class Check
  5. {
  6. internal static void DataLength(byte[] buf, int off, int len, string msg)
  7. {
  8. if (off > buf.Length - len)
  9. {
  10. throw new DataLengthException(msg);
  11. }
  12. }
  13. internal static void OutputLength(byte[] buf, int off, int len, string msg)
  14. {
  15. if (off > buf.Length - len)
  16. {
  17. throw new OutputLengthException(msg);
  18. }
  19. }
  20. }
  21. }