<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<IP xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
    ns0:schemaLocation="http://mcd.rou.st.com/modules.php?name=mcu ../../../../../../../doc/V4/Development/Specifications/db/IP_Modes.xsd"
    xmlns="http://mcd.rou.st.com/modules.php?name=mcu"
    DBVersion="V4.0"
    IPType="service"
    IpGroup="Security"
    Name="AES"
    Version="aes3_v1_0_Cube">

    <About>AES: Advanced Encryption Standard</About>

    <RefParameter Name="Algorithm" Comment="Data encryption type" DefaultValue="AESECB" Type="list" Group="Algorithm">
        <Description>AES Data encryption types list</Description>
        <PossibleValue Value="AESECB" Comment="AES ECB" Semaphore="Semaphore_CRYP_Coding_AESECB$IpInstance"/>
        <PossibleValue Value="AESCBC" Comment="AES CBC" Semaphore="Semaphore_CRYP_Coding_AESCBC$IpInstance"/>
        <PossibleValue Value="AESCTR" Comment="AES CTR" Semaphore="Semaphore_CRYP_Coding_AESCTR$IpInstance"/>
        <PossibleValue Value="AESGCMGMAC" Comment="AES GCM GMAC" Semaphore="Semaphore_CRYP_Coding_AESGCM_GMAC$IpInstance"/>
        <PossibleValue Value="AESCCM" Comment="AES CCM" Semaphore="Semaphore_CRYP_Coding_AES_CCM$IpInstance"/>
    </RefParameter>

    <RefParameter Comment="Data type" DefaultValue="CRYP_DATATYPE_32B" Name="DataType" Type="list" Group="Parameters">
        <Description>AES Data Type selection: 32-bit data, 16-bit data, 8-bit data or 1-bit string.&lt;br&gt;This parameter can be a value of @ref CRYP_Data_Type.&lt;br&gt;Possible values are:&lt;br&gt; CRYP_DATATYPE_32B&lt;br&gt; CRYP_DATATYPE_16B&lt;br&gt; CRYP_DATATYPE_8B&lt;br&gt; CRYP_DATATYPE_1B</Description>
        <PossibleValue Comment="32b" Value="CRYP_DATATYPE_32B"/>
        <PossibleValue Comment="16b" Value="CRYP_DATATYPE_16B"/>
        <PossibleValue Comment="8b" Value="CRYP_DATATYPE_8B"/>
        <PossibleValue Comment="1b" Value="CRYP_DATATYPE_1B"/>
    </RefParameter>

    <RefParameter Comment="KeySize" DefaultValue="CRYP_KEYSIZE_128B" Name="KeySize" Type="list" Group="Parameters">
        <Description>Key size selection: 128 or 256 bit key length.&lt;br&gt;This parameter can be a value of @ref CRYP_Key_Size.&lt;br&gt;Possible values are:&lt;br&gt; CRYP_KEYSIZE_128B&lt;br&gt; CRYP_KEYSIZE_256B</Description>
        <PossibleValue Comment="128b" Value="CRYP_KEYSIZE_128B" Semaphore="Semaphore_CRYP_KEYSIZE_128B$IpInstance"/>
        <PossibleValue Comment="256b" Value="CRYP_KEYSIZE_256B" Semaphore="Semaphore_CRYP_KEYSIZE_256B$IpInstance"/>
    </RefParameter>

    <RefParameter Comment="Operating Mode" DefaultValue="CRYP_ALGOMODE_ENCRYPT" Name="OperatingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="((Semaphore_CRYP_Coding_AESECB$IpInstance)|(Semaphore_CRYP_Coding_AESCBC$IpInstance))"/>
        <Description>AES ECB/CBC operating mode.&lt;br&gt;This parameter can be a value of @ref CRYP_AES_OperatingMode.&lt;br&gt;Possible values are:&lt;br&gt; CRYP_ALGOMODE_ENCRYPT&lt;br&gt; CRYP_ALGOMODE_KEYDERIVATION&lt;br&gt; CRYP_ALGOMODE_DECRYPT&lt;br&gt; CRYP_ALGOMODE_KEYDERIVATION_DECRYPT</Description>
        <PossibleValue Comment="Encryption mode" Value="CRYP_ALGOMODE_ENCRYPT"/>
        <PossibleValue Comment="Key derivation mode" Value="CRYP_ALGOMODE_KEYDERIVATION"/>
        <PossibleValue Comment="Decryption" Value="CRYP_ALGOMODE_DECRYPT"/>
        <PossibleValue Comment="Key derivation and decryption" Value="CRYP_ALGOMODE_KEYDERIVATION_DECRYPT"/>
    </RefParameter>
    <RefParameter Comment="Operating Mode" DefaultValue="CRYP_ALGOMODE_ENCRYPT" Name="OperatingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESCTR$IpInstance)"/>
        <Description>AESCTR operating mode.&lt;br&gt;This parameter can be a value of @ref CRYP_AES_OperatingMode.&lt;br&gt;Possible values are:&lt;br&gt; CRYP_ALGOMODE_ENCRYPT&lt;br&gt; CRYP_ALGOMODE_KEYDERIVATION&lt;br&gt; CRYP_ALGOMODE_DECRYPT</Description>
        <PossibleValue Comment="Encryption mode" Value="CRYP_ALGOMODE_ENCRYPT"/>
        <PossibleValue Comment="Key derivation mode" Value="CRYP_ALGOMODE_KEYDERIVATION"/>
        <PossibleValue Comment="Decryption" Value="CRYP_ALGOMODE_DECRYPT"/>
    </RefParameter>
    <RefParameter Comment="Operating Mode" DefaultValue="CRYP_ALGOMODE_ENCRYPT" Name="OperatingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AES_CCM$IpInstance)"/>
        <Description>AESGCM_GMAC operating mode.&lt;br&gt;This parameter can be a value of @ref CRYP_AES_OperatingMode.&lt;br&gt;Possible values are:&lt;br&gt; CRYP_ALGOMODE_ENCRYPT&lt;br&gt; CRYP_ALGOMODE_KEYDERIVATION&lt;br&gt; CRYP_ALGOMODE_DECRYPT&lt;br&gt; CRYP_ALGOMODE_KEYDERIVATION_DECRYPT&lt;br&gt; CRYP_ALGOMODE_TAG_GENERATION</Description>
        <PossibleValue Comment="Encryption mode" Value="CRYP_ALGOMODE_ENCRYPT"/>
        <PossibleValue Comment="Key derivation mode" Value="CRYP_ALGOMODE_KEYDERIVATION"/>
        <PossibleValue Comment="Decryption" Value="CRYP_ALGOMODE_DECRYPT"/>
        <PossibleValue Comment="Key derivation and decryption" Value="CRYP_ALGOMODE_KEYDERIVATION_DECRYPT"/>
        <PossibleValue Comment="GMAC authentication tag generation" Value="CRYP_ALGOMODE_TAG_GENERATION"/>
    </RefParameter>
    <RefParameter Comment="Operating Mode" DefaultValue="CRYP_ALGOMODE_ENCRYPT" Name="OperatingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESGCM_GMAC$IpInstance)|(Semaphore_CRYP_Coding_AES_CCM$IpInstance)"/>
        <Description>AESGCM_GMAC operating mode.&lt;br&gt;This parameter can be a value of @ref CRYP_AES_OperatingMode.&lt;br&gt;Possible values are:&lt;br&gt; CRYP_ALGOMODE_ENCRYPT&lt;br&gt; CRYP_ALGOMODE_KEYDERIVATION&lt;br&gt; CRYP_ALGOMODE_DECRYPT&lt;br&gt; CRYP_ALGOMODE_TAG_GENERATION</Description>
        <PossibleValue Comment="Encryption mode" Value="CRYP_ALGOMODE_ENCRYPT"/>
        <PossibleValue Comment="Key derivation mode" Value="CRYP_ALGOMODE_KEYDERIVATION"/>
        <PossibleValue Comment="Decryption" Value="CRYP_ALGOMODE_DECRYPT"/>
        <PossibleValue Comment="GMAC authentication tag generation" Value="CRYP_ALGOMODE_TAG_GENERATION"/>
    </RefParameter>

    <RefParameter Comment="Chaining Mode" DefaultValue="CRYP_CHAINMODE_AES_ECB" Name="ChainingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESECB$IpInstance)"/>
        <Description>AESECB Chaining Mode.&lt;br&gt; This parameter can be a value of @ref CRYP_AES_ChainingMode&lt;br&gt;Possible values are:&lt;br&gt; CRYP_CHAINMODE_AES_ECB</Description>
        <PossibleValue Comment="Electronic codebook chaining algorithm(CRYP_CHAINMODE_AES_ECB)" Value="CRYP_CHAINMODE_AES_ECB"/>
    </RefParameter>
    <RefParameter Comment="Chaining Mode" DefaultValue="CRYP_CHAINMODE_AES_CBC" Name="ChainingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESCBC$IpInstance)"/>
        <Description>AESCBC Chaining Mode.&lt;br&gt; This parameter can be a value of @ref CRYP_AES_ChainingMode&lt;br&gt;Possible values are:&lt;br&gt; CRYP_CHAINMODE_AES_CBC</Description>
        <PossibleValue Comment="Cipher block chaining algorithm (CRYP_CHAINMODE_AES_CBC)" Value="CRYP_CHAINMODE_AES_CBC"/>
    </RefParameter>
    <RefParameter Comment="Chaining Mode" DefaultValue="CRYP_CHAINMODE_AES_CTR" Name="ChainingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESCTR$IpInstance)"/>
        <Description>AESCTR Chaining Mode.&lt;br&gt; This parameter can be a value of @ref CRYP_AES_ChainingMode&lt;br&gt;Possible values are:&lt;br&gt; CRYP_CHAINMODE_AES_CTR</Description>
        <PossibleValue Comment="Counter mode chaining algorithm (CRYP_CHAINMODE_AES_CTR)" Value="CRYP_CHAINMODE_AES_CTR"/>
    </RefParameter>
    <RefParameter Comment="Chaining Mode" DefaultValue="CRYP_CHAINMODE_AES_GCM_GMAC" Name="ChainingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESGCM_GMAC$IpInstance)"/>
        <Description>AESGCM_GMAC Chaining Mode.&lt;br&gt; This parameter can be a value of @ref CRYP_AES_ChainingMode&lt;br&gt;Possible values are:&lt;br&gt; CRYP_CHAINMODE_AES_GCM</Description>
        <PossibleValue Comment="Galois counter mode - Galois message authentication code (CRYP_CHAINMODE_AES_GCM_GMAC)" Value="CRYP_CHAINMODE_AES_GCM_GMAC" Semaphore="Semaphore_CRYP_CHAINMODE_AES_GCM_GMAC$IpInstance"/>
    </RefParameter>
    <RefParameter Comment="Chaining Mode" DefaultValue="CRYP_CHAINMODE_AES_CCM" Name="ChainingMode" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AES_CCM$IpInstance)"/>
        <Description>AES_CCM Chaining Mode.&lt;br&gt; This parameter can be a value of @ref CRYP_AES_ChainingMode&lt;br&gt;Possible values are:&lt;br&gt; CRYP_CHAINMODE_AES_CCM</Description>
        <PossibleValue Comment="Cipher message authentication code (CRYP_CHAINMODE_AES_CCM)" Value="CRYP_CHAINMODE_AES_CCM" Semaphore="Semaphore_CRYP_CHAINMODE_AES_CCM$IpInstance"/>
    </RefParameter>

    <RefParameter Comment="Key Write Flag" DefaultValue="CRYP_KEY_WRITE_ENABLE" Name="KeyWriteFlag" Type="list" Group="Parameters">
        <Description>Key Write Flag.&lt;br&gt; This parameter allows to bypass or not key write-up before decryption. It can be a value of @ref CRYP_Key_Write&lt;br&gt;Possible values are:&lt;br&gt; CRYP_KEY_WRITE_ENABLE&lt;br&gt; CRYP_KEY_WRITE_DISABLE</Description>
        <PossibleValue Comment="Enable decryption key writing" Value="CRYP_KEY_WRITE_ENABLE"/>
        <PossibleValue Comment="Disable decryption key writing" Value="CRYP_KEY_WRITE_DISABLE"/>
    </RefParameter>

    <RefParameter Comment="GCM Phase (Processing phase of the Galois Counter Mode)" DefaultValue="null" Name="GCMCMACPhase" Type="list" Group="Parameters" Visible="false">
        <Condition Diagnostic="" Expression="((Semaphore_CRYP_Coding_AESECB$IpInstance)|(Semaphore_CRYP_Coding_AESCBC$IpInstance)|(Semaphore_CRYP_Coding_AESCTR$IpInstance))"/>
        <Description>Indicates the processing phase of the Galois Counter Mode (GCM), Galois Message Authentication Code (GMAC), Cipher Message Authentication Code (CMAC) (when applicable) or Counter with Cipher Mode (CCM) (when applicable).This parameter can be a value of @ref CRYP_GCM_CMAC_Phase</Description>
    </RefParameter>
    <RefParameter Comment="GCM Phase (Processing phase of the Galois Counter Mode)" DefaultValue="CRYP_GCM_INIT_PHASE" Name="GCMCMACPhase" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="Semaphore_CRYP_Coding_AESGCM_GMAC$IpInstance"/>
        <Description>GCMCMACPhase.&lt;br&gt; Indicates the processing phase of the Galois Counter Mode (GCM).&lt;br&gt; This parameter can be a value of @ref CRYP_GCM_CMAC_Phase.&lt;br&gt; Possible values are:&lt;br&gt; CRYP_GCM_INIT_PHASE&lt;br&gt; CRYP_GCMCMAC_HEADER_PHASE&lt;br&gt; CRYP_GCM_PAYLOAD_PHASE&lt;br&gt; CRYP_GCMCMAC_FINAL_PHASE</Description>
        <PossibleValue Comment="GCM GMAC init phase" Value="CRYP_GCM_INIT_PHASE"/>
        <PossibleValue Comment="GCM GMAC header phase" Value="CRYP_GCMCMAC_HEADER_PHASE"/>
        <PossibleValue Comment="GCM payload phase" Value="CRYP_GCM_PAYLOAD_PHASE"/>
        <PossibleValue Comment="GCM GMAC final phase" Value="CRYP_GCMCMAC_FINAL_PHASE"/>
    </RefParameter>
    <RefParameter Comment="GCM Phase (Processing phase of the Galois Counter Mode)" DefaultValue="CRYP_GCMCMAC_HEADER_PHASE" Name="GCMCMACPhase" Type="list" Group="Parameters">
        <Condition Diagnostic="" Expression="Semaphore_CRYP_Coding_AES_CCM$IpInstance"/>
        <Description>GCMCMACPhase.&lt;br&gt; Indicates the processing phase of the Galois Counter Mode (GCM).&lt;br&gt; This parameter can be a value of @ref CRYP_GCM_CMAC_Phase.&lt;br&gt; Possible values are:&lt;br&gt; CRYP_GCM_INIT_PHASE&lt;br&gt; CRYP_GCMCMAC_HEADER_PHASE&lt;br&gt; CRYP_GCM_PAYLOAD_PHASE&lt;br&gt; CRYP_GCMCMAC_FINAL_PHASE</Description>
        <PossibleValue Comment="GCM CMAC init phase" Value="CRYP_GCM_INIT_PHASE"/>
        <PossibleValue Comment="GCM CMAC header phase" Value="CRYP_GCMCMAC_HEADER_PHASE"/>
        <PossibleValue Comment="GCM payload phase" Value="CRYP_GCM_PAYLOAD_PHASE"/>
        <PossibleValue Comment="GCM CMAC final phase" Value="CRYP_GCMCMAC_FINAL_PHASE"/>
    </RefParameter>

    <RefParameter Comment="Encryption/Decryption key" ArraySize="16" ArrayTypeElement="uint8_t;16" Name="pKey" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_KEYSIZE_128B$IpInstance)"/>
        <Description>Encryption/Decryption key</Description>
    </RefParameter>
    <RefParameter Comment="Encryption/Decryption key" ArraySize="32" ArrayTypeElement="uint8_t;16" Name="pKey" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_KEYSIZE_256B$IpInstance)"/>
        <Description>Encryption/Decryption key</Description>
    </RefParameter>

    <RefParameter Comment="Initialization vector" ArraySize="16" ArrayTypeElement="uint8_t;16" Name="pInitVect" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Condition Diagnostic="" Expression="((Semaphore_CRYP_Coding_AESCBC$IpInstance)|(Semaphore_CRYP_Coding_AESCTR$IpInstance)|(Semaphore_CRYP_Coding_AESGCM_GMAC$IpInstance))"/>
        <Description>Initialization Vector used for CTR, CBC,GCM GMAC, CMAC (and CCM when applicable) modes</Description>
    </RefParameter>
    <RefParameter Comment="Initialization vector" Name="pInitVect" Type="list" Group="Parameters" DefaultValue="null" Visible="false">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESECB$IpInstance)|(Semaphore_CRYP_Coding_AES_CCM$IpInstance)"/>
        <Description>Initialization Vector used for CTR, CBC,GCM GMAC, CMAC (and CCM when applicable) modes</Description>
    </RefParameter>

    <RefParameter Comment="Header" ArraySize="64" ArrayTypeElement="uint8_t;16" Name="Header" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Condition Diagnostic="" Expression="HeaderSize=64"/>
        <Description>Header used in GCM GMAC, CMAC</Description>
    </RefParameter>
    <RefParameter Comment="Header" ArraySize="48" ArrayTypeElement="uint8_t;16" Name="Header" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Condition Diagnostic="" Expression="HeaderSize=48"/>
        <Description>Header used in GCM GMAC, CMAC</Description>
    </RefParameter>
    <RefParameter Comment="Header" ArraySize="32" ArrayTypeElement="uint8_t;16" Name="Header" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Description>Header used in GCM GMAC, CMAC</Description>
        <Condition Diagnostic="" Expression="HeaderSize=32"/>
        <Description>Header used in GCM GMAC, CMAC</Description>
    </RefParameter>
    <RefParameter Comment="Header" ArraySize="16" ArrayTypeElement="uint8_t;16" Name="Header" Type="Array" Separator=" " Group="Parameters" DefaultValue="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00">
        <Condition Diagnostic="" Expression="HeaderSize=16"/>
        <Description>Header used in GCM GMAC, CMAC</Description>
    </RefParameter>
    <RefParameter Comment="Header" Name="Header" Type="list" Group="Parameters" DefaultValue="null" Visible="false">
        <Description>Header used in GCM GMAC, CMAC</Description>
    </RefParameter>

    <RefParameter Comment="Header size" DefaultValue="null" Name="HeaderSize" Type="integer" Group="Parameters" Visible="false">
        <Condition Diagnostic="" Expression="((Semaphore_CRYP_Coding_AESECB$IpInstance)|(Semaphore_CRYP_Coding_AESCBC$IpInstance)|(Semaphore_CRYP_Coding_AESCTR$IpInstance))"/>
        <Description>Header size in bytes</Description>
    </RefParameter>
    <RefParameter Comment="Header size" DefaultValue="64B(HeaderSize)" Name="HeaderSize" Type="List" Group="Parameters">
        <Condition Diagnostic="" Expression="(Semaphore_CRYP_Coding_AESGCM_GMAC$IpInstance)|(Semaphore_CRYP_Coding_AES_CCM$IpInstance)"/>
        <Description>Header size in bytes</Description>
        <PossibleValue Comment="64B" Value="64"/>
        <PossibleValue Comment="48B" Value="48"/>
        <PossibleValue Comment="32B" Value="32"/>
        <PossibleValue Comment="16B" Value="16"/>
    </RefParameter>

    <RefMode Name="AES_Activate" HalMode ="AES">
        <ConfigForMode>AES_Init</ConfigForMode>
        <Parameter Name="Algorithm"/>
        <Parameter Name="DataType"/>
        <Parameter Name="KeySize"/>
        <Parameter Name="pKey"/>
        <Parameter Name="OperatingMode"/>
        <Parameter Name="ChainingMode"/>
        <Parameter Name="KeyWriteFlag"/>
        <Parameter Name="GCMCMACPhase"/>
        <Parameter Name="HeaderSize"/>
        <Parameter Name="Header"/>
        <Parameter Name="pInitVect"/>
    </RefMode>
    
    <ModeLogicOperator Name="OR">
		<Mode Name="AES_State" UserName="Activated">
			<ModeLogicOperator Name="XOR">
				<Mode Name="AES_Activate" UserName="Activated">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_AES" />
					</SignalLogicalOp>
				<Semaphore>S_AES</Semaphore>
				</Mode>
			</ModeLogicOperator>
		</Mode>
	</ModeLogicOperator>
    
    <!-- RefSignal for AES -->
    <RefSignal Name="VS_AES" Virtual="true"/>
        
</IP>
