GOST3410ValidationParameters.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Crypto.Parameters
  4. {
  5. public class Gost3410ValidationParameters
  6. {
  7. private int x0;
  8. private int c;
  9. private long x0L;
  10. private long cL;
  11. public Gost3410ValidationParameters(
  12. int x0,
  13. int c)
  14. {
  15. this.x0 = x0;
  16. this.c = c;
  17. }
  18. public Gost3410ValidationParameters(
  19. long x0L,
  20. long cL)
  21. {
  22. this.x0L = x0L;
  23. this.cL = cL;
  24. }
  25. public int C { get { return c; } }
  26. public int X0 { get { return x0; } }
  27. public long CL { get { return cL; } }
  28. public long X0L { get { return x0L; } }
  29. public override bool Equals(
  30. object obj)
  31. {
  32. Gost3410ValidationParameters other = obj as Gost3410ValidationParameters;
  33. return other != null
  34. && other.c == this.c
  35. && other.x0 == this.x0
  36. && other.cL == this.cL
  37. && other.x0L == this.x0L;
  38. }
  39. public override int GetHashCode()
  40. {
  41. return c.GetHashCode() ^ x0.GetHashCode() ^ cL.GetHashCode() ^ x0L.GetHashCode();
  42. }
  43. }
  44. }
  45. #endif