IDsaKCalculator.cs 1.3 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. using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
  6. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
  7. {
  8. /**
  9. * Interface define calculators of K values for DSA/ECDSA.
  10. */
  11. public interface IDsaKCalculator
  12. {
  13. /**
  14. * Return true if this calculator is deterministic, false otherwise.
  15. *
  16. * @return true if deterministic, otherwise false.
  17. */
  18. bool IsDeterministic { get; }
  19. /**
  20. * Non-deterministic initialiser.
  21. *
  22. * @param n the order of the DSA group.
  23. * @param random a source of randomness.
  24. */
  25. void Init(BigInteger n, SecureRandom random);
  26. /**
  27. * Deterministic initialiser.
  28. *
  29. * @param n the order of the DSA group.
  30. * @param d the DSA private value.
  31. * @param message the message being signed.
  32. */
  33. void Init(BigInteger n, BigInteger d, byte[] message);
  34. /**
  35. * Return the next valid value of K.
  36. *
  37. * @return a K value.
  38. */
  39. BigInteger NextK();
  40. }
  41. }
  42. #pragma warning restore
  43. #endif