#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) #pragma warning disable using System; using Best.HTTP.SecureProtocol.Org.BouncyCastle.Security; namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings { /// Block cipher padders are expected to conform to this interface. public interface IBlockCipherPadding { /// Initialise the padder. /// A source of randomness, if any required. void Init(SecureRandom random); /// The name of the algorithm this padder implements. string PaddingName { get; } /// Add padding to the passed in block. /// the block to add padding to. /// the offset into the block the padding is to start at. /// the number of bytes of padding added. int AddPadding(byte[] input, int inOff); #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER || UNITY_2021_2_OR_NEWER /// Add padding to the passed in block. /// the block to add padding to. /// the offset into the block the padding is to start at. /// the number of bytes of padding added. int AddPadding(Span block, int position); #endif /// Determine the length of padding present in the passed in block. /// the block to check padding for. /// the number of bytes of padding present. int PadCount(byte[] input); #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER || UNITY_2021_2_OR_NEWER /// Determine the length of padding present in the passed in block. /// the block to check padding for. /// the number of bytes of padding present. int PadCount(ReadOnlySpan block); #endif } } #pragma warning restore #endif