RC2Parameters.cs 788 B

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