PrimeField.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field
  5. {
  6. internal class PrimeField
  7. : IFiniteField
  8. {
  9. protected readonly BigInteger characteristic;
  10. internal PrimeField(BigInteger characteristic)
  11. {
  12. this.characteristic = characteristic;
  13. }
  14. public virtual BigInteger Characteristic
  15. {
  16. get { return characteristic; }
  17. }
  18. public virtual int Dimension
  19. {
  20. get { return 1; }
  21. }
  22. public override bool Equals(object obj)
  23. {
  24. if (this == obj)
  25. {
  26. return true;
  27. }
  28. PrimeField other = obj as PrimeField;
  29. if (null == other)
  30. {
  31. return false;
  32. }
  33. return characteristic.Equals(other.characteristic);
  34. }
  35. public override int GetHashCode()
  36. {
  37. return characteristic.GetHashCode();
  38. }
  39. }
  40. }
  41. #pragma warning restore
  42. #endif