NaccacheSternKeyParameters.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  6. {
  7. /**
  8. * Public key parameters for NaccacheStern cipher. For details on this cipher,
  9. * please see
  10. *
  11. * http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf
  12. */
  13. public class NaccacheSternKeyParameters : AsymmetricKeyParameter
  14. {
  15. private readonly BigInteger g, n;
  16. private readonly int lowerSigmaBound;
  17. /**
  18. * @param privateKey
  19. */
  20. public NaccacheSternKeyParameters(bool privateKey, BigInteger g, BigInteger n, int lowerSigmaBound)
  21. : base(privateKey)
  22. {
  23. this.g = g;
  24. this.n = n;
  25. this.lowerSigmaBound = lowerSigmaBound;
  26. }
  27. /**
  28. * @return Returns the g.
  29. */
  30. public BigInteger G { get { return g; } }
  31. /**
  32. * @return Returns the lowerSigmaBound.
  33. */
  34. public int LowerSigmaBound { get { return lowerSigmaBound; } }
  35. /**
  36. * @return Returns the n.
  37. */
  38. public BigInteger Modulus { get { return n; } }
  39. }
  40. }
  41. #pragma warning restore
  42. #endif