IDigest.cs 1.8 KB

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