IDsaKCalculator.cs 1.2 KB

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