#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) #pragma warning disable using System; using System.IO; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto.Impl { /// Base interface for services supporting AEAD encryption/decryption. public interface TlsAeadCipherImpl { /// Set the key to be used by the AEAD cipher implementation supporting this service. /// array holding the AEAD cipher key. /// offset into the array the key starts at. /// length of the key in the array. /// void SetKey(byte[] key, int keyOff, int keyLen); /// Initialise the parameters for the AEAD operator. /// the nonce. /// MAC size in bytes. /// any additional data to be included in the MAC calculation. /// if the parameters are inappropriate. void Init(byte[] nonce, int macSize, byte[] additionalData); /// Return the maximum size of the output for input of inputLength bytes. /// the length (in bytes) of the proposed input. /// the maximum size of the output. int GetOutputSize(int inputLength); /// Perform the cipher encryption/decryption returning the output in output. /// /// Note: we have to use DoFinal() here as it is the only way to guarantee output from the underlying cipher. /// /// array holding input data to the cipher. /// offset into input array data starts at. /// length of the input data in the array. /// array to hold the cipher output. /// offset into output array to start saving output. /// the amount of data written to output. /// in case of failure. int DoFinal(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset); } } #pragma warning restore #endif