IBufferedCipher.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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>Block cipher engines are expected to conform to this interface.</remarks>
  7. public interface IBufferedCipher
  8. {
  9. /// <summary>The name of the algorithm this cipher implements.</summary>
  10. string AlgorithmName { get; }
  11. /// <summary>Initialise the cipher.</summary>
  12. /// <param name="forEncryption">If true the cipher is initialised for encryption,
  13. /// if false for decryption.</param>
  14. /// <param name="parameters">The key and other data required by the cipher.</param>
  15. void Init(bool forEncryption, ICipherParameters parameters);
  16. int GetBlockSize();
  17. int GetOutputSize(int inputLen);
  18. int GetUpdateOutputSize(int inputLen);
  19. byte[] ProcessByte(byte input);
  20. int ProcessByte(byte input, byte[] output, int outOff);
  21. byte[] ProcessBytes(byte[] input);
  22. byte[] ProcessBytes(byte[] input, int inOff, int length);
  23. int ProcessBytes(byte[] input, byte[] output, int outOff);
  24. int ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff);
  25. byte[] DoFinal();
  26. byte[] DoFinal(byte[] input);
  27. byte[] DoFinal(byte[] input, int inOff, int length);
  28. int DoFinal(byte[] output, int outOff);
  29. int DoFinal(byte[] input, byte[] output, int outOff);
  30. int DoFinal(byte[] input, int inOff, int length, byte[] output, int outOff);
  31. /// <summary>
  32. /// Reset the cipher. After resetting the cipher is in the same state
  33. /// as it was after the last init (if there was one).
  34. /// </summary>
  35. void Reset();
  36. }
  37. }
  38. #pragma warning restore
  39. #endif