#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) #pragma warning disable using System; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto { /// The interface stream ciphers conform to. public interface IStreamCipher { /// The name of the algorithm this cipher implements. string AlgorithmName { get; } /// Initialise the cipher. /// If true the cipher is initialised for encryption, /// if false for decryption. /// The key and other data required by the cipher. /// /// If the parameters argument is inappropriate. /// void Init(bool forEncryption, ICipherParameters parameters); /// encrypt/decrypt a single byte returning the result. /// the byte to be processed. /// the result of processing the input byte. byte ReturnByte(byte input); /// /// Process a block of bytes from , putting the result into . /// /// The input byte array. /// /// The offset into input where the data to be processed starts. /// /// The number of bytes to be processed. /// The output buffer the processed bytes go into. /// /// The offset into output the processed data starts at. /// /// If the input buffer is too small. /// If the output buffer is too small. void ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff); #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER || _UNITY_2021_2_OR_NEWER_ /// /// Process a block of bytes from , putting the result into . /// /// The input span. /// The output span. /// If the output span is too small. void ProcessBytes(ReadOnlySpan input, Span output); #endif /// /// Reset the cipher to the same state as it was after the last init (if there was one). /// void Reset(); } } #pragma warning restore #endif