IXof.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Crypto
  4. {
  5. /// <remarks>
  6. /// With FIPS PUB 202 a new kind of message digest was announced which supported extendable output, or variable digest sizes.
  7. /// This interface provides the extra method required to support variable output on a digest implementation.
  8. /// </remarks>
  9. public interface IXof
  10. : IDigest
  11. {
  12. /// <summary>
  13. /// Output the results of the final calculation for this digest to outLen number of bytes.
  14. /// </summary>
  15. /// <param name="output">output array to write the output bytes to.</param>
  16. /// <param name="outOff">offset to start writing the bytes at.</param>
  17. /// <param name="outLen">the number of output bytes requested.</param>
  18. /// <returns>the number of bytes written</returns>
  19. int DoFinal(byte[] output, int outOff, int outLen);
  20. /// <summary>
  21. /// Start outputting the results of the final calculation for this digest. Unlike DoFinal, this method
  22. /// will continue producing output until the Xof is explicitly reset, or signals otherwise.
  23. /// </summary>
  24. /// <param name="output">output array to write the output bytes to.</param>
  25. /// <param name="outOff">offset to start writing the bytes at.</param>
  26. /// <param name="outLen">the number of output bytes requested.</param>
  27. /// <returns>the number of bytes written</returns>
  28. int DoOutput(byte[] output, int outOff, int outLen);
  29. }
  30. }
  31. #endif