ICryptoTransform.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // System.Security.Cryptography ICryptoTransform interface
  3. //
  4. // Authors:
  5. // Matthew S. Ford ([email protected])
  6. //
  7. // Copyright 2001 by Matthew S. Ford.
  8. //
  9. using System.Security.Cryptography;
  10. namespace System.Security.Cryptography {
  11. /// <summary>
  12. /// Crytographic functions that can process a stream of bytes implement this interface.
  13. /// This works by stringing together one or more ICryptoTransform classes with a stream.
  14. /// Data is passed from one to the next without the need of outside buffering/intervention.
  15. /// </summary>
  16. public interface ICryptoTransform {
  17. /// <summary>
  18. /// Whether the function can transform multiple blocks at a time.
  19. /// </summary>
  20. bool CanTransformMultipleBlocks {get;}
  21. /// <summary>
  22. /// Size of input blocks for the function.
  23. /// </summary>
  24. int InputBlockSize {get;}
  25. /// <summary>
  26. /// Size of the output blocks of the function.
  27. /// </summary>
  28. int OutputBlockSize {get;}
  29. /// <summary>
  30. /// FIXME: Process some data. A block at a time? Less than a block at a time?
  31. /// </summary>
  32. int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
  33. /// <summary>
  34. /// Processes the final part of the data. Also finalizes the function if needed.
  35. /// </summary>
  36. byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount);
  37. }
  38. }