; generated by ARM C/C++ Compiler, 4.1 [Build 894]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o.\STM324xG_EVAL\stm32f4xx_cryp.o --asm_dir=.\STM324xG_EVAL\ --list_dir=.\STM324xG_EVAL\ --depend=.\STM324xG_EVAL\stm32f4xx_cryp.d --cpu=Cortex-M4.fp --apcs=interwork -O0 -Otime -I..\ -I..\..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\Utilities\STM32_EVAL\Common -I..\..\..\Utilities\STM32_EVAL\STM3240_41_G_EVAL -IC:\Keil\ARM\RV31\Inc -IC:\Keil\ARM\CMSIS\Include -IC:\Keil\ARM\Inc\ST\STM32F4xx -D__MICROLIB -DUSE_STM324xG_EVAL -DSTM32F4XX -DUSE_STDPERIPH_DRIVER --omf_browse=.\STM324xG_EVAL\stm32f4xx_cryp.crf ..\..\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp.c]
                          THUMB

                          AREA ||i.CRYP_Cmd||, CODE, READONLY, ALIGN=2

                  CRYP_Cmd PROC
;;;369      */
;;;370    void CRYP_Cmd(FunctionalState NewState)
000000  b130              CBZ      r0,|L1.16|
;;;371    {
;;;372      /* Check the parameters */
;;;373      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;374    
;;;375      if (NewState != DISABLE)
;;;376      {
;;;377        /* Enable the Cryptographic processor */
;;;378        CRYP->CR |= CRYP_CR_CRYPEN;
000002  4907              LDR      r1,|L1.32|
000004  6809              LDR      r1,[r1,#0]
000006  f4414100          ORR      r1,r1,#0x8000
00000a  4a05              LDR      r2,|L1.32|
00000c  6011              STR      r1,[r2,#0]
00000e  e005              B        |L1.28|
                  |L1.16|
;;;379      }
;;;380      else
;;;381      {
;;;382        /* Disable the Cryptographic processor */
;;;383        CRYP->CR &= ~CRYP_CR_CRYPEN;
000010  4903              LDR      r1,|L1.32|
000012  6809              LDR      r1,[r1,#0]
000014  f4214100          BIC      r1,r1,#0x8000
000018  4a01              LDR      r2,|L1.32|
00001a  6011              STR      r1,[r2,#0]
                  |L1.28|
;;;384      }
;;;385    }
00001c  4770              BX       lr
;;;386    /**
                          ENDP

00001e  0000              DCW      0x0000
                  |L1.32|
                          DCD      0x50060000

                          AREA ||i.CRYP_DMACmd||, CODE, READONLY, ALIGN=2

                  CRYP_DMACmd PROC
;;;611      */
;;;612    void CRYP_DMACmd(uint8_t CRYP_DMAReq, FunctionalState NewState)
000000  b129              CBZ      r1,|L2.14|
;;;613    {
;;;614      /* Check the parameters */
;;;615      assert_param(IS_CRYP_DMAREQ(CRYP_DMAReq));
;;;616      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;617    
;;;618      if (NewState != DISABLE)
;;;619      {
;;;620        /* Enable the selected CRYP DMA request */
;;;621        CRYP->DMACR |= CRYP_DMAReq;
000002  4a07              LDR      r2,|L2.32|
000004  6912              LDR      r2,[r2,#0x10]
000006  4302              ORRS     r2,r2,r0
000008  4b05              LDR      r3,|L2.32|
00000a  611a              STR      r2,[r3,#0x10]
00000c  e006              B        |L2.28|
                  |L2.14|
;;;622      }
;;;623      else
;;;624      {
;;;625        /* Disable the selected CRYP DMA request */
;;;626        CRYP->DMACR &= (uint8_t)~CRYP_DMAReq;
00000e  4a04              LDR      r2,|L2.32|
000010  6912              LDR      r2,[r2,#0x10]
000012  43c3              MVNS     r3,r0
000014  b2db              UXTB     r3,r3
000016  401a              ANDS     r2,r2,r3
000018  4b01              LDR      r3,|L2.32|
00001a  611a              STR      r2,[r3,#0x10]
                  |L2.28|
;;;627      }
;;;628    }
00001c  4770              BX       lr
;;;629    /**
                          ENDP

00001e  0000              DCW      0x0000
                  |L2.32|
                          DCD      0x50060000

                          AREA ||i.CRYP_DataIn||, CODE, READONLY, ALIGN=2

                  CRYP_DataIn PROC
;;;412      */
;;;413    void CRYP_DataIn(uint32_t Data)
000000  4901              LDR      r1,|L3.8|
;;;414    {
;;;415      CRYP->DR = Data;
000002  6088              STR      r0,[r1,#8]
;;;416    }
000004  4770              BX       lr
;;;417    
                          ENDP

000006  0000              DCW      0x0000
                  |L3.8|
                          DCD      0x50060000

                          AREA ||i.CRYP_DataOut||, CODE, READONLY, ALIGN=2

                  CRYP_DataOut PROC
;;;422      */
;;;423    uint32_t CRYP_DataOut(void)
000000  4801              LDR      r0,|L4.8|
;;;424    {
;;;425      return CRYP->DOUT;
000002  68c0              LDR      r0,[r0,#0xc]
;;;426    }
000004  4770              BX       lr
;;;427    /**
                          ENDP

000006  0000              DCW      0x0000
                  |L4.8|
                          DCD      0x50060000

                          AREA ||i.CRYP_DeInit||, CODE, READONLY, ALIGN=1

                  CRYP_DeInit PROC
;;;214      */
;;;215    void CRYP_DeInit(void)
000000  b510              PUSH     {r4,lr}
;;;216    {
;;;217      /* Enable CRYP reset state */
;;;218      RCC_AHB2PeriphResetCmd(RCC_AHB2Periph_CRYP, ENABLE);
000002  2101              MOVS     r1,#1
000004  2010              MOVS     r0,#0x10
000006  f7fffffe          BL       RCC_AHB2PeriphResetCmd
;;;219    
;;;220      /* Release CRYP from reset state */
;;;221      RCC_AHB2PeriphResetCmd(RCC_AHB2Periph_CRYP, DISABLE);
00000a  2100              MOVS     r1,#0
00000c  2010              MOVS     r0,#0x10
00000e  f7fffffe          BL       RCC_AHB2PeriphResetCmd
;;;222    }
000012  bd10              POP      {r4,pc}
;;;223    
                          ENDP


                          AREA ||i.CRYP_FIFOFlush||, CODE, READONLY, ALIGN=2

                  CRYP_FIFOFlush PROC
;;;357      */
;;;358    void CRYP_FIFOFlush(void)
000000  4803              LDR      r0,|L6.16|
;;;359    {
;;;360      /* Reset the read and write pointers of the FIFOs */
;;;361      CRYP->CR |= CRYP_CR_FFLUSH;
000002  6800              LDR      r0,[r0,#0]
000004  f4404080          ORR      r0,r0,#0x4000
000008  4901              LDR      r1,|L6.16|
00000a  6008              STR      r0,[r1,#0]
;;;362    }
00000c  4770              BX       lr
;;;363    
                          ENDP

00000e  0000              DCW      0x0000
                  |L6.16|
                          DCD      0x50060000

                          AREA ||i.CRYP_GetFlagStatus||, CODE, READONLY, ALIGN=2

                  CRYP_GetFlagStatus PROC
;;;798      */
;;;799    FlagStatus CRYP_GetFlagStatus(uint8_t CRYP_FLAG)
000000  4601              MOV      r1,r0
;;;800    {
;;;801      FlagStatus bitstatus = RESET;
000002  2000              MOVS     r0,#0
;;;802      uint32_t tempreg = 0;
000004  2200              MOVS     r2,#0
;;;803    
;;;804      /* Check the parameters */
;;;805      assert_param(IS_CRYP_GET_FLAG(CRYP_FLAG));
;;;806    
;;;807      /* check if the FLAG is in RISR register */
;;;808      if ((CRYP_FLAG & FLAG_MASK) != 0x00) 
000006  f0110f20          TST      r1,#0x20
00000a  d002              BEQ      |L7.18|
;;;809      {
;;;810        tempreg = CRYP->RISR;
00000c  4b05              LDR      r3,|L7.36|
00000e  699a              LDR      r2,[r3,#0x18]
000010  e001              B        |L7.22|
                  |L7.18|
;;;811      }
;;;812      else  /* The FLAG is in SR register */
;;;813      {
;;;814        tempreg = CRYP->SR;
000012  4b04              LDR      r3,|L7.36|
000014  685a              LDR      r2,[r3,#4]
                  |L7.22|
;;;815      }
;;;816    
;;;817    
;;;818      /* Check the status of the specified CRYP flag */
;;;819      if ((tempreg & CRYP_FLAG ) != (uint8_t)RESET)
000016  420a              TST      r2,r1
000018  d001              BEQ      |L7.30|
;;;820      {
;;;821        /* CRYP_FLAG is set */
;;;822        bitstatus = SET;
00001a  2001              MOVS     r0,#1
00001c  e000              B        |L7.32|
                  |L7.30|
;;;823      }
;;;824      else
;;;825      {
;;;826        /* CRYP_FLAG is reset */
;;;827        bitstatus = RESET;
00001e  2000              MOVS     r0,#0
                  |L7.32|
;;;828      }
;;;829    
;;;830      /* Return the CRYP_FLAG status */
;;;831      return  bitstatus;
;;;832    }
000020  4770              BX       lr
;;;833    
                          ENDP

000022  0000              DCW      0x0000
                  |L7.36|
                          DCD      0x50060000

                          AREA ||i.CRYP_GetITStatus||, CODE, READONLY, ALIGN=2

                  CRYP_GetITStatus PROC
;;;764      */
;;;765    ITStatus CRYP_GetITStatus(uint8_t CRYP_IT)
000000  4601              MOV      r1,r0
;;;766    {
;;;767      ITStatus bitstatus = RESET;
000002  2000              MOVS     r0,#0
;;;768      /* Check the parameters */
;;;769      assert_param(IS_CRYP_GET_IT(CRYP_IT));
;;;770    
;;;771      /* Check the status of the specified CRYP interrupt */
;;;772      if ((CRYP->MISR &  CRYP_IT) != (uint8_t)RESET)
000004  4a03              LDR      r2,|L8.20|
000006  69d2              LDR      r2,[r2,#0x1c]
000008  420a              TST      r2,r1
00000a  d001              BEQ      |L8.16|
;;;773      {
;;;774        /* CRYP_IT is set */
;;;775        bitstatus = SET;
00000c  2001              MOVS     r0,#1
00000e  e000              B        |L8.18|
                  |L8.16|
;;;776      }
;;;777      else
;;;778      {
;;;779        /* CRYP_IT is reset */
;;;780        bitstatus = RESET;
000010  2000              MOVS     r0,#0
                  |L8.18|
;;;781      }
;;;782      /* Return the CRYP_IT status */
;;;783      return bitstatus;
;;;784    }
000012  4770              BX       lr
;;;785    
                          ENDP

                  |L8.20|
                          DCD      0x50060000

                          AREA ||i.CRYP_ITConfig||, CODE, READONLY, ALIGN=2

                  CRYP_ITConfig PROC
;;;736      */
;;;737    void CRYP_ITConfig(uint8_t CRYP_IT, FunctionalState NewState)
000000  b129              CBZ      r1,|L9.14|
;;;738    {
;;;739      /* Check the parameters */
;;;740      assert_param(IS_CRYP_CONFIG_IT(CRYP_IT));
;;;741      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;742    
;;;743      if (NewState != DISABLE)
;;;744      {
;;;745        /* Enable the selected CRYP interrupt */
;;;746        CRYP->IMSCR |= CRYP_IT;
000002  4a07              LDR      r2,|L9.32|
000004  6952              LDR      r2,[r2,#0x14]
000006  4302              ORRS     r2,r2,r0
000008  4b05              LDR      r3,|L9.32|
00000a  615a              STR      r2,[r3,#0x14]
00000c  e006              B        |L9.28|
                  |L9.14|
;;;747      }
;;;748      else
;;;749      {
;;;750        /* Disable the selected CRYP interrupt */
;;;751        CRYP->IMSCR &= (uint8_t)~CRYP_IT;
00000e  4a04              LDR      r2,|L9.32|
000010  6952              LDR      r2,[r2,#0x14]
000012  43c3              MVNS     r3,r0
000014  b2db              UXTB     r3,r3
000016  401a              ANDS     r2,r2,r3
000018  4b01              LDR      r3,|L9.32|
00001a  615a              STR      r2,[r3,#0x14]
                  |L9.28|
;;;752      }
;;;753    }
00001c  4770              BX       lr
;;;754    
                          ENDP

00001e  0000              DCW      0x0000
                  |L9.32|
                          DCD      0x50060000

                          AREA ||i.CRYP_IVInit||, CODE, READONLY, ALIGN=2

                  CRYP_IVInit PROC
;;;328      */
;;;329    void CRYP_IVInit(CRYP_IVInitTypeDef* CRYP_IVInitStruct)
000000  4a04              LDR      r2,|L10.20|
;;;330    {
;;;331      CRYP->IV0LR = CRYP_IVInitStruct->CRYP_IV0Left;
000002  6801              LDR      r1,[r0,#0]
000004  6411              STR      r1,[r2,#0x40]
;;;332      CRYP->IV0RR = CRYP_IVInitStruct->CRYP_IV0Right;
000006  6841              LDR      r1,[r0,#4]
000008  6451              STR      r1,[r2,#0x44]
;;;333      CRYP->IV1LR = CRYP_IVInitStruct->CRYP_IV1Left;
00000a  6881              LDR      r1,[r0,#8]
00000c  6491              STR      r1,[r2,#0x48]
;;;334      CRYP->IV1RR = CRYP_IVInitStruct->CRYP_IV1Right;
00000e  68c1              LDR      r1,[r0,#0xc]
000010  64d1              STR      r1,[r2,#0x4c]
;;;335    }
000012  4770              BX       lr
;;;336    
                          ENDP

                  |L10.20|
                          DCD      0x50060000

                          AREA ||i.CRYP_IVStructInit||, CODE, READONLY, ALIGN=1

                  CRYP_IVStructInit PROC
;;;342      */
;;;343    void CRYP_IVStructInit(CRYP_IVInitTypeDef* CRYP_IVInitStruct)
000000  2100              MOVS     r1,#0
;;;344    {
;;;345      CRYP_IVInitStruct->CRYP_IV0Left  = 0;
000002  6001              STR      r1,[r0,#0]
;;;346      CRYP_IVInitStruct->CRYP_IV0Right = 0;
000004  6041              STR      r1,[r0,#4]
;;;347      CRYP_IVInitStruct->CRYP_IV1Left  = 0;
000006  6081              STR      r1,[r0,#8]
;;;348      CRYP_IVInitStruct->CRYP_IV1Right = 0;
000008  60c1              STR      r1,[r0,#0xc]
;;;349    }
00000a  4770              BX       lr
;;;350    
                          ENDP


                          AREA ||i.CRYP_Init||, CODE, READONLY, ALIGN=2

                  CRYP_Init PROC
;;;230      */
;;;231    void CRYP_Init(CRYP_InitTypeDef* CRYP_InitStruct)
000000  491d              LDR      r1,|L12.120|
;;;232    {
;;;233      /* Check the parameters */
;;;234      assert_param(IS_CRYP_ALGOMODE(CRYP_InitStruct->CRYP_AlgoMode));
;;;235      assert_param(IS_CRYP_DATATYPE(CRYP_InitStruct->CRYP_DataType));
;;;236      assert_param(IS_CRYP_ALGODIR(CRYP_InitStruct->CRYP_AlgoDir));
;;;237    
;;;238      /* Select Algorithm mode*/  
;;;239      CRYP->CR &= ~CRYP_CR_ALGOMODE;
000002  6809              LDR      r1,[r1,#0]
000004  f0210138          BIC      r1,r1,#0x38
000008  4a1b              LDR      r2,|L12.120|
00000a  6011              STR      r1,[r2,#0]
;;;240      CRYP->CR |= CRYP_InitStruct->CRYP_AlgoMode;
00000c  4611              MOV      r1,r2
00000e  6809              LDR      r1,[r1,#0]
000010  8842              LDRH     r2,[r0,#2]
000012  4311              ORRS     r1,r1,r2
000014  4a18              LDR      r2,|L12.120|
000016  6011              STR      r1,[r2,#0]
;;;241    
;;;242      /* Select dataType */ 
;;;243      CRYP->CR &= ~CRYP_CR_DATATYPE;
000018  4611              MOV      r1,r2
00001a  6809              LDR      r1,[r1,#0]
00001c  f02101c0          BIC      r1,r1,#0xc0
000020  6011              STR      r1,[r2,#0]
;;;244      CRYP->CR |= CRYP_InitStruct->CRYP_DataType;
000022  4611              MOV      r1,r2
000024  6809              LDR      r1,[r1,#0]
000026  8882              LDRH     r2,[r0,#4]
000028  4311              ORRS     r1,r1,r2
00002a  4a13              LDR      r2,|L12.120|
00002c  6011              STR      r1,[r2,#0]
;;;245    
;;;246      /* select Key size (used only with AES algorithm) */
;;;247      if ((CRYP_InitStruct->CRYP_AlgoMode == CRYP_AlgoMode_AES_ECB) ||
00002e  8841              LDRH     r1,[r0,#2]
000030  2920              CMP      r1,#0x20
000032  d008              BEQ      |L12.70|
;;;248          (CRYP_InitStruct->CRYP_AlgoMode == CRYP_AlgoMode_AES_CBC) ||
000034  8841              LDRH     r1,[r0,#2]
000036  2928              CMP      r1,#0x28
000038  d005              BEQ      |L12.70|
;;;249          (CRYP_InitStruct->CRYP_AlgoMode == CRYP_AlgoMode_AES_CTR) ||
00003a  8841              LDRH     r1,[r0,#2]
00003c  2930              CMP      r1,#0x30
00003e  d002              BEQ      |L12.70|
;;;250          (CRYP_InitStruct->CRYP_AlgoMode == CRYP_AlgoMode_AES_Key))
000040  8841              LDRH     r1,[r0,#2]
000042  2938              CMP      r1,#0x38
000044  d10b              BNE      |L12.94|
                  |L12.70|
;;;251      {
;;;252        assert_param(IS_CRYP_KEYSIZE(CRYP_InitStruct->CRYP_KeySize));
;;;253        CRYP->CR &= ~CRYP_CR_KEYSIZE;
000046  490c              LDR      r1,|L12.120|
000048  6809              LDR      r1,[r1,#0]
00004a  f4217140          BIC      r1,r1,#0x300
00004e  4a0a              LDR      r2,|L12.120|
000050  6011              STR      r1,[r2,#0]
;;;254        CRYP->CR |= CRYP_InitStruct->CRYP_KeySize; /* Key size and value must be 
000052  4611              MOV      r1,r2
000054  6809              LDR      r1,[r1,#0]
000056  88c2              LDRH     r2,[r0,#6]
000058  4311              ORRS     r1,r1,r2
00005a  4a07              LDR      r2,|L12.120|
00005c  6011              STR      r1,[r2,#0]
                  |L12.94|
;;;255                                                      configured once the key has 
;;;256                                                      been prepared */
;;;257      }
;;;258    
;;;259      /* Select data Direction */ 
;;;260      CRYP->CR &= ~CRYP_CR_ALGODIR;
00005e  4906              LDR      r1,|L12.120|
000060  6809              LDR      r1,[r1,#0]
000062  f0210104          BIC      r1,r1,#4
000066  4a04              LDR      r2,|L12.120|
000068  6011              STR      r1,[r2,#0]
;;;261      CRYP->CR |= CRYP_InitStruct->CRYP_AlgoDir;
00006a  4611              MOV      r1,r2
00006c  6809              LDR      r1,[r1,#0]
00006e  8802              LDRH     r2,[r0,#0]
000070  4311              ORRS     r1,r1,r2
000072  4a01              LDR      r2,|L12.120|
000074  6011              STR      r1,[r2,#0]
;;;262    }
000076  4770              BX       lr
;;;263    
                          ENDP

                  |L12.120|
                          DCD      0x50060000

                          AREA ||i.CRYP_KeyInit||, CODE, READONLY, ALIGN=2

                  CRYP_KeyInit PROC
;;;291      */
;;;292    void CRYP_KeyInit(CRYP_KeyInitTypeDef* CRYP_KeyInitStruct)
000000  4a08              LDR      r2,|L13.36|
;;;293    {
;;;294      /* Key Initialisation */
;;;295      CRYP->K0LR = CRYP_KeyInitStruct->CRYP_Key0Left;
000002  6801              LDR      r1,[r0,#0]
000004  6211              STR      r1,[r2,#0x20]
;;;296      CRYP->K0RR = CRYP_KeyInitStruct->CRYP_Key0Right;
000006  6841              LDR      r1,[r0,#4]
000008  6251              STR      r1,[r2,#0x24]
;;;297      CRYP->K1LR = CRYP_KeyInitStruct->CRYP_Key1Left;
00000a  6881              LDR      r1,[r0,#8]
00000c  6291              STR      r1,[r2,#0x28]
;;;298      CRYP->K1RR = CRYP_KeyInitStruct->CRYP_Key1Right;
00000e  68c1              LDR      r1,[r0,#0xc]
000010  62d1              STR      r1,[r2,#0x2c]
;;;299      CRYP->K2LR = CRYP_KeyInitStruct->CRYP_Key2Left;
000012  6901              LDR      r1,[r0,#0x10]
000014  6311              STR      r1,[r2,#0x30]
;;;300      CRYP->K2RR = CRYP_KeyInitStruct->CRYP_Key2Right;
000016  6941              LDR      r1,[r0,#0x14]
000018  6351              STR      r1,[r2,#0x34]
;;;301      CRYP->K3LR = CRYP_KeyInitStruct->CRYP_Key3Left;
00001a  6981              LDR      r1,[r0,#0x18]
00001c  6391              STR      r1,[r2,#0x38]
;;;302      CRYP->K3RR = CRYP_KeyInitStruct->CRYP_Key3Right;
00001e  69c1              LDR      r1,[r0,#0x1c]
000020  63d1              STR      r1,[r2,#0x3c]
;;;303    }
000022  4770              BX       lr
;;;304    
                          ENDP

                  |L13.36|
                          DCD      0x50060000

                          AREA ||i.CRYP_KeyStructInit||, CODE, READONLY, ALIGN=1

                  CRYP_KeyStructInit PROC
;;;310      */
;;;311    void CRYP_KeyStructInit(CRYP_KeyInitTypeDef* CRYP_KeyInitStruct)
000000  2100              MOVS     r1,#0
;;;312    {
;;;313      CRYP_KeyInitStruct->CRYP_Key0Left  = 0;
000002  6001              STR      r1,[r0,#0]
;;;314      CRYP_KeyInitStruct->CRYP_Key0Right = 0;
000004  6041              STR      r1,[r0,#4]
;;;315      CRYP_KeyInitStruct->CRYP_Key1Left  = 0;
000006  6081              STR      r1,[r0,#8]
;;;316      CRYP_KeyInitStruct->CRYP_Key1Right = 0;
000008  60c1              STR      r1,[r0,#0xc]
;;;317      CRYP_KeyInitStruct->CRYP_Key2Left  = 0;
00000a  6101              STR      r1,[r0,#0x10]
;;;318      CRYP_KeyInitStruct->CRYP_Key2Right = 0;
00000c  6141              STR      r1,[r0,#0x14]
;;;319      CRYP_KeyInitStruct->CRYP_Key3Left  = 0;
00000e  6181              STR      r1,[r0,#0x18]
;;;320      CRYP_KeyInitStruct->CRYP_Key3Right = 0;
000010  61c1              STR      r1,[r0,#0x1c]
;;;321    }
000012  4770              BX       lr
;;;322    /**
                          ENDP


                          AREA ||i.CRYP_RestoreContext||, CODE, READONLY, ALIGN=2

                  CRYP_RestoreContext PROC
;;;550      */
;;;551    void CRYP_RestoreContext(CRYP_Context* CRYP_ContextRestore)  
000000  4a10              LDR      r2,|L15.68|
;;;552    {
;;;553    
;;;554      /* Configure the processor with the saved configuration */
;;;555      CRYP->CR = CRYP_ContextRestore->CR_bits9to2;
000002  6801              LDR      r1,[r0,#0]
000004  6011              STR      r1,[r2,#0]
;;;556    
;;;557      /* restore The key value */
;;;558      CRYP->K0LR = CRYP_ContextRestore->CRYP_K0LR; 
000006  6941              LDR      r1,[r0,#0x14]
000008  6211              STR      r1,[r2,#0x20]
;;;559      CRYP->K0RR = CRYP_ContextRestore->CRYP_K0RR;
00000a  6981              LDR      r1,[r0,#0x18]
00000c  6251              STR      r1,[r2,#0x24]
;;;560      CRYP->K1LR = CRYP_ContextRestore->CRYP_K1LR;
00000e  69c1              LDR      r1,[r0,#0x1c]
000010  6291              STR      r1,[r2,#0x28]
;;;561      CRYP->K1RR = CRYP_ContextRestore->CRYP_K1RR;
000012  6a01              LDR      r1,[r0,#0x20]
000014  62d1              STR      r1,[r2,#0x2c]
;;;562      CRYP->K2LR = CRYP_ContextRestore->CRYP_K2LR;
000016  6a41              LDR      r1,[r0,#0x24]
000018  6311              STR      r1,[r2,#0x30]
;;;563      CRYP->K2RR = CRYP_ContextRestore->CRYP_K2RR;
00001a  6a81              LDR      r1,[r0,#0x28]
00001c  6351              STR      r1,[r2,#0x34]
;;;564      CRYP->K3LR = CRYP_ContextRestore->CRYP_K3LR;
00001e  6ac1              LDR      r1,[r0,#0x2c]
000020  6391              STR      r1,[r2,#0x38]
;;;565      CRYP->K3RR = CRYP_ContextRestore->CRYP_K3RR;
000022  6b01              LDR      r1,[r0,#0x30]
000024  63d1              STR      r1,[r2,#0x3c]
;;;566    
;;;567      /* and the initialization vectors. */
;;;568      CRYP->IV0LR = CRYP_ContextRestore->CRYP_IV0LR;
000026  6841              LDR      r1,[r0,#4]
000028  6411              STR      r1,[r2,#0x40]
;;;569      CRYP->IV0RR = CRYP_ContextRestore->CRYP_IV0RR;
00002a  6881              LDR      r1,[r0,#8]
00002c  6451              STR      r1,[r2,#0x44]
;;;570      CRYP->IV1LR = CRYP_ContextRestore->CRYP_IV1LR;
00002e  68c1              LDR      r1,[r0,#0xc]
000030  6491              STR      r1,[r2,#0x48]
;;;571      CRYP->IV1RR = CRYP_ContextRestore->CRYP_IV1RR;
000032  6901              LDR      r1,[r0,#0x10]
000034  64d1              STR      r1,[r2,#0x4c]
;;;572    
;;;573      /* Enable the cryptographic processor */
;;;574      CRYP->CR |= CRYP_CR_CRYPEN;
000036  4611              MOV      r1,r2
000038  6809              LDR      r1,[r1,#0]
00003a  f4414100          ORR      r1,r1,#0x8000
00003e  6011              STR      r1,[r2,#0]
;;;575    }
000040  4770              BX       lr
;;;576    /**
                          ENDP

000042  0000              DCW      0x0000
                  |L15.68|
                          DCD      0x50060000

                          AREA ||i.CRYP_SaveContext||, CODE, READONLY, ALIGN=2

                  CRYP_SaveContext PROC
;;;465      */
;;;466    ErrorStatus CRYP_SaveContext(CRYP_Context* CRYP_ContextSave,
000000  b5f0              PUSH     {r4-r7,lr}
;;;467                                 CRYP_KeyInitTypeDef* CRYP_KeyInitStruct)
;;;468    {
000002  4602              MOV      r2,r0
;;;469      __IO uint32_t timeout = 0;
000004  2300              MOVS     r3,#0
;;;470      uint32_t ckeckmask = 0, bitstatus;    
000006  2400              MOVS     r4,#0
;;;471      ErrorStatus status = ERROR;
000008  2000              MOVS     r0,#0
;;;472    
;;;473      /* Stop DMA transfers on the IN FIFO by clearing the DIEN bit in the CRYP_DMACR */
;;;474      CRYP->DMACR &= ~(uint32_t)CRYP_DMACR_DIEN;
00000a  4e27              LDR      r6,|L16.168|
00000c  6936              LDR      r6,[r6,#0x10]
00000e  f0260601          BIC      r6,r6,#1
000012  4f25              LDR      r7,|L16.168|
000014  613e              STR      r6,[r7,#0x10]
;;;475        
;;;476      /* Wait until both the IN and OUT FIFOs are empty  
;;;477        (IFEM=1 and OFNE=0 in the CRYP_SR register) and the 
;;;478         BUSY bit is cleared. */
;;;479    
;;;480      if ((CRYP->CR & (uint32_t)(CRYP_CR_ALGOMODE_TDES_ECB | CRYP_CR_ALGOMODE_TDES_CBC)) != (uint32_t)0 )/* TDES */
000016  463e              MOV      r6,r7
000018  6836              LDR      r6,[r6,#0]
00001a  f0160f08          TST      r6,#8
00001e  d001              BEQ      |L16.36|
;;;481      { 
;;;482        ckeckmask =  CRYP_SR_IFEM | CRYP_SR_BUSY ;
000020  2411              MOVS     r4,#0x11
000022  e000              B        |L16.38|
                  |L16.36|
;;;483      }
;;;484      else /* AES or DES */
;;;485      {
;;;486        ckeckmask =  CRYP_SR_IFEM | CRYP_SR_BUSY | CRYP_SR_OFNE;
000024  2415              MOVS     r4,#0x15
                  |L16.38|
;;;487      }           
;;;488       
;;;489      do 
000026  bf00              NOP      
                  |L16.40|
;;;490      {
;;;491        bitstatus = CRYP->SR & ckeckmask;
000028  4e1f              LDR      r6,|L16.168|
00002a  6876              LDR      r6,[r6,#4]
00002c  ea060504          AND      r5,r6,r4
;;;492        timeout++;
000030  1c5b              ADDS     r3,r3,#1
;;;493      }
;;;494      while ((timeout != MAX_TIMEOUT) && (bitstatus != CRYP_SR_IFEM));
000032  f5a3467f          SUB      r6,r3,#0xff00
000036  3eff              SUBS     r6,r6,#0xff
000038  d001              BEQ      |L16.62|
00003a  2d01              CMP      r5,#1
00003c  d1f4              BNE      |L16.40|
                  |L16.62|
;;;495         
;;;496      if ((CRYP->SR & ckeckmask) != CRYP_SR_IFEM)
00003e  4e1a              LDR      r6,|L16.168|
000040  6876              LDR      r6,[r6,#4]
000042  4026              ANDS     r6,r6,r4
000044  2e01              CMP      r6,#1
000046  d001              BEQ      |L16.76|
;;;497      {
;;;498        status = ERROR;
000048  2000              MOVS     r0,#0
00004a  e02c              B        |L16.166|
                  |L16.76|
;;;499      }
;;;500      else
;;;501      {      
;;;502        /* Stop DMA transfers on the OUT FIFO by 
;;;503           - writing the DOEN bit to 0 in the CRYP_DMACR register 
;;;504           - and clear the CRYPEN bit. */
;;;505    
;;;506        CRYP->DMACR &= ~(uint32_t)CRYP_DMACR_DOEN;
00004c  4e16              LDR      r6,|L16.168|
00004e  6936              LDR      r6,[r6,#0x10]
000050  f0260602          BIC      r6,r6,#2
000054  4f14              LDR      r7,|L16.168|
000056  613e              STR      r6,[r7,#0x10]
;;;507        CRYP->CR &= ~(uint32_t)CRYP_CR_CRYPEN;
000058  463e              MOV      r6,r7
00005a  6836              LDR      r6,[r6,#0]
00005c  f4264600          BIC      r6,r6,#0x8000
000060  603e              STR      r6,[r7,#0]
;;;508    
;;;509        /* Save the current configuration (bits [9:2] in the CRYP_CR register) */
;;;510        CRYP_ContextSave->CR_bits9to2  = CRYP->CR & (CRYP_CR_KEYSIZE  | 
000062  463e              MOV      r6,r7
000064  6836              LDR      r6,[r6,#0]
000066  f406767f          AND      r6,r6,#0x3fc
00006a  6016              STR      r6,[r2,#0]
;;;511                                                     CRYP_CR_DATATYPE | 
;;;512                                                     CRYP_CR_ALGOMODE |
;;;513                                                     CRYP_CR_ALGODIR); 
;;;514    
;;;515        /* and, if not in ECB mode, the initialization vectors. */
;;;516        CRYP_ContextSave->CRYP_IV0LR = CRYP->IV0LR;
00006c  463e              MOV      r6,r7
00006e  6c36              LDR      r6,[r6,#0x40]
000070  6056              STR      r6,[r2,#4]
;;;517        CRYP_ContextSave->CRYP_IV0RR = CRYP->IV0RR;
000072  463e              MOV      r6,r7
000074  6c76              LDR      r6,[r6,#0x44]
000076  6096              STR      r6,[r2,#8]
;;;518        CRYP_ContextSave->CRYP_IV1LR = CRYP->IV1LR;
000078  463e              MOV      r6,r7
00007a  6cb6              LDR      r6,[r6,#0x48]
00007c  60d6              STR      r6,[r2,#0xc]
;;;519        CRYP_ContextSave->CRYP_IV1RR = CRYP->IV1RR;
00007e  463e              MOV      r6,r7
000080  6cf6              LDR      r6,[r6,#0x4c]
000082  6116              STR      r6,[r2,#0x10]
;;;520    
;;;521        /* save The key value */
;;;522        CRYP_ContextSave->CRYP_K0LR = CRYP_KeyInitStruct->CRYP_Key0Left; 
000084  680e              LDR      r6,[r1,#0]
000086  6156              STR      r6,[r2,#0x14]
;;;523        CRYP_ContextSave->CRYP_K0RR = CRYP_KeyInitStruct->CRYP_Key0Right; 
000088  684e              LDR      r6,[r1,#4]
00008a  6196              STR      r6,[r2,#0x18]
;;;524        CRYP_ContextSave->CRYP_K1LR = CRYP_KeyInitStruct->CRYP_Key1Left; 
00008c  688e              LDR      r6,[r1,#8]
00008e  61d6              STR      r6,[r2,#0x1c]
;;;525        CRYP_ContextSave->CRYP_K1RR = CRYP_KeyInitStruct->CRYP_Key1Right; 
000090  68ce              LDR      r6,[r1,#0xc]
000092  6216              STR      r6,[r2,#0x20]
;;;526        CRYP_ContextSave->CRYP_K2LR = CRYP_KeyInitStruct->CRYP_Key2Left; 
000094  690e              LDR      r6,[r1,#0x10]
000096  6256              STR      r6,[r2,#0x24]
;;;527        CRYP_ContextSave->CRYP_K2RR = CRYP_KeyInitStruct->CRYP_Key2Right; 
000098  694e              LDR      r6,[r1,#0x14]
00009a  6296              STR      r6,[r2,#0x28]
;;;528        CRYP_ContextSave->CRYP_K3LR = CRYP_KeyInitStruct->CRYP_Key3Left; 
00009c  698e              LDR      r6,[r1,#0x18]
00009e  62d6              STR      r6,[r2,#0x2c]
;;;529        CRYP_ContextSave->CRYP_K3RR = CRYP_KeyInitStruct->CRYP_Key3Right; 
0000a0  69ce              LDR      r6,[r1,#0x1c]
0000a2  6316              STR      r6,[r2,#0x30]
;;;530    
;;;531       /* When needed, save the DMA status (pointers for IN and OUT messages, 
;;;532          number of remaining bytes, etc.) */
;;;533         
;;;534        status = SUCCESS;
0000a4  2001              MOVS     r0,#1
                  |L16.166|
;;;535      }
;;;536    
;;;537       return status;
;;;538    }
0000a6  bdf0              POP      {r4-r7,pc}
;;;539    
                          ENDP

                  |L16.168|
                          DCD      0x50060000

                          AREA ||i.CRYP_StructInit||, CODE, READONLY, ALIGN=1

                  CRYP_StructInit PROC
;;;269      */
;;;270    void CRYP_StructInit(CRYP_InitTypeDef* CRYP_InitStruct)
000000  2100              MOVS     r1,#0
;;;271    {
;;;272      /* Initialize the CRYP_AlgoDir member */
;;;273      CRYP_InitStruct->CRYP_AlgoDir = CRYP_AlgoDir_Encrypt;
000002  8001              STRH     r1,[r0,#0]
;;;274    
;;;275      /* initialize the CRYP_AlgoMode member */
;;;276      CRYP_InitStruct->CRYP_AlgoMode = CRYP_AlgoMode_TDES_ECB;
000004  8041              STRH     r1,[r0,#2]
;;;277    
;;;278      /* initialize the CRYP_DataType member */
;;;279      CRYP_InitStruct->CRYP_DataType = CRYP_DataType_32b;
000006  8081              STRH     r1,[r0,#4]
;;;280      
;;;281      /* Initialize the CRYP_KeySize member */
;;;282      CRYP_InitStruct->CRYP_KeySize = CRYP_KeySize_128b;
000008  80c1              STRH     r1,[r0,#6]
;;;283    }
00000a  4770              BX       lr
;;;284    
                          ENDP


;*** Start embedded assembler ***

#line 1 "..\\..\\..\\Libraries\\STM32F4xx_StdPeriph_Driver\\src\\stm32f4xx_cryp.c"
	AREA ||.rev16_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___16_stm32f4xx_cryp_c_459f21d3____REV16|
#line 114 "C:\\Keil\\ARM\\CMSIS\\Include\\core_cmInstr.h"
|__asm___16_stm32f4xx_cryp_c_459f21d3____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___16_stm32f4xx_cryp_c_459f21d3____REVSH|
#line 128
|__asm___16_stm32f4xx_cryp_c_459f21d3____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
