ICryptoTransform.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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;
  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 : IDisposable {
  17. bool CanReuseTransform {get;}
  18. /// <summary>
  19. /// Whether the function can transform multiple blocks at a time.
  20. /// </summary>
  21. bool CanTransformMultipleBlocks {get;}
  22. /// <summary>
  23. /// Size of input blocks for the function in bytes.
  24. /// </summary>
  25. int InputBlockSize {get;}
  26. /// <summary>
  27. /// Size of the output blocks of the function in bytes.
  28. /// </summary>
  29. int OutputBlockSize {get;}
  30. /// <summary>
  31. /// FIXME: Process some data. A block at a time? Less than a block at a time?
  32. /// </summary>
  33. int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
  34. /// <summary>
  35. /// Processes the final part of the data. Also finalizes the function if needed.
  36. /// </summary>
  37. byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount);
  38. }
  39. }