IDigest.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
  5. {
  6. /**
  7. * interface that a message digest conforms to.
  8. */
  9. public interface IDigest
  10. {
  11. /**
  12. * return the algorithm name
  13. *
  14. * @return the algorithm name
  15. */
  16. string AlgorithmName { get; }
  17. /**
  18. * return the size, in bytes, of the digest produced by this message digest.
  19. *
  20. * @return the size, in bytes, of the digest produced by this message digest.
  21. */
  22. int GetDigestSize();
  23. /**
  24. * return the size, in bytes, of the internal buffer used by this digest.
  25. *
  26. * @return the size, in bytes, of the internal buffer used by this digest.
  27. */
  28. int GetByteLength();
  29. /**
  30. * update the message digest with a single byte.
  31. *
  32. * @param inByte the input byte to be entered.
  33. */
  34. void Update(byte input);
  35. /**
  36. * update the message digest with a block of bytes.
  37. *
  38. * @param input the byte array containing the data.
  39. * @param inOff the offset into the byte array where the data starts.
  40. * @param len the length of the data.
  41. */
  42. void BlockUpdate(byte[] input, int inOff, int length);
  43. /**
  44. * Close the digest, producing the final digest value. The doFinal
  45. * call leaves the digest reset.
  46. *
  47. * @param output the array the digest is to be copied into.
  48. * @param outOff the offset into the out array the digest is to start at.
  49. */
  50. int DoFinal(byte[] output, int outOff);
  51. /**
  52. * reset the digest back to it's initial state.
  53. */
  54. void Reset();
  55. }
  56. }
  57. #pragma warning restore
  58. #endif