IXof.cs 1.6 KB

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