IDigest.cs 1.7 KB

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