RC2Parameters.cs 858 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  5. {
  6. public class RC2Parameters
  7. : KeyParameter
  8. {
  9. private readonly int bits;
  10. public RC2Parameters(
  11. byte[] key)
  12. : this(key, (key.Length > 128) ? 1024 : (key.Length * 8))
  13. {
  14. }
  15. public RC2Parameters(
  16. byte[] key,
  17. int keyOff,
  18. int keyLen)
  19. : this(key, keyOff, keyLen, (keyLen > 128) ? 1024 : (keyLen * 8))
  20. {
  21. }
  22. public RC2Parameters(
  23. byte[] key,
  24. int bits)
  25. : base(key)
  26. {
  27. this.bits = bits;
  28. }
  29. public RC2Parameters(
  30. byte[] key,
  31. int keyOff,
  32. int keyLen,
  33. int bits)
  34. : base(key, keyOff, keyLen)
  35. {
  36. this.bits = bits;
  37. }
  38. public int EffectiveKeyBits
  39. {
  40. get { return bits; }
  41. }
  42. }
  43. }
  44. #pragma warning restore
  45. #endif