BlockCipherPadding.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
  6. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings
  7. {
  8. /**
  9. * Block cipher padders are expected to conform to this interface
  10. */
  11. public interface IBlockCipherPadding
  12. {
  13. /**
  14. * Initialise the padder.
  15. *
  16. * @param param parameters, if any required.
  17. */
  18. void Init(SecureRandom random);
  19. //throws ArgumentException;
  20. /**
  21. * Return the name of the algorithm the cipher implements.
  22. *
  23. * @return the name of the algorithm the cipher implements.
  24. */
  25. string PaddingName { get; }
  26. /**
  27. * add the pad bytes to the passed in block, returning the
  28. * number of bytes added.
  29. */
  30. int AddPadding(byte[] input, int inOff);
  31. /**
  32. * return the number of pad bytes present in the block.
  33. * @exception InvalidCipherTextException if the padding is badly formed
  34. * or invalid.
  35. */
  36. int PadCount(byte[] input);
  37. //throws InvalidCipherTextException;
  38. }
  39. }
  40. #pragma warning restore
  41. #endif