GOST3410ValidationParameters.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 Gost3410ValidationParameters
  7. {
  8. private int x0;
  9. private int c;
  10. private long x0L;
  11. private long cL;
  12. public Gost3410ValidationParameters(
  13. int x0,
  14. int c)
  15. {
  16. this.x0 = x0;
  17. this.c = c;
  18. }
  19. public Gost3410ValidationParameters(
  20. long x0L,
  21. long cL)
  22. {
  23. this.x0L = x0L;
  24. this.cL = cL;
  25. }
  26. public int C { get { return c; } }
  27. public int X0 { get { return x0; } }
  28. public long CL { get { return cL; } }
  29. public long X0L { get { return x0L; } }
  30. public override bool Equals(
  31. object obj)
  32. {
  33. Gost3410ValidationParameters other = obj as Gost3410ValidationParameters;
  34. return other != null
  35. && other.c == this.c
  36. && other.x0 == this.x0
  37. && other.cL == this.cL
  38. && other.x0L == this.x0L;
  39. }
  40. public override int GetHashCode()
  41. {
  42. return c.GetHashCode() ^ x0.GetHashCode() ^ cL.GetHashCode() ^ x0L.GetHashCode();
  43. }
  44. }
  45. }
  46. #pragma warning restore
  47. #endif