AaltoTLS.RecordLayer.RecordHandler.CreateAEADEncryptor C# (CSharp) Method

CreateAEADEncryptor() private static method

private static CreateAEADEncryptor ( CipherSuite cipherSuite, Record record, byte key, byte fixedIV, byte recordIV, System.UInt64 seqNum, byte &nonceExplicit ) : ICryptoTransform
cipherSuite AaltoTLS.PluginInterface.CipherSuite
record Record
key byte
fixedIV byte
recordIV byte
seqNum System.UInt64
nonceExplicit byte
return ICryptoTransform
        private static ICryptoTransform CreateAEADEncryptor(CipherSuite cipherSuite, Record record,
		                                                    byte[] key, byte[] fixedIV, byte[] recordIV,
		                                                    UInt64 seqNum, out byte[] nonceExplicit)
        {
            // Construct the nonce for AEAD cipher
            nonceExplicit = GenerateAEADNonceExplicit(recordIV, seqNum);
            byte[] nonce = GenerateAEADNonce(fixedIV, nonceExplicit);

            // Construct the additional bytes for AEAD cipher
            byte[] additional = GetAdditionalBytes(seqNum, record.Type, record.Version, record.Fragment.Length);

            return cipherSuite.BulkCipherAlgorithm.CreateEncryptor(key, nonce, additional);
        }