BlockCipherPadding.cs 1.2 KB

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