; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\stm32f4xx_cryp_des.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\stm32f4xx_cryp_des.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\stm32f4xx_cryp_des.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.c]
                          THUMB

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

                  CRYP_DES_CBC PROC
;;;199      */
;;;200    ErrorStatus CRYP_DES_CBC(uint8_t Mode, uint8_t Key[8], uint8_t InitVectors[8],
000000  e92d4ff0          PUSH     {r4-r11,lr}
;;;201                             uint8_t *Input, uint32_t Ilength, uint8_t *Output)
;;;202    {
000004  b095              SUB      sp,sp,#0x54
000006  4680              MOV      r8,r0
000008  4689              MOV      r9,r1
00000a  4692              MOV      r10,r2
00000c  469b              MOV      r11,r3
;;;203      CRYP_InitTypeDef DES_CRYP_InitStructure;
;;;204      CRYP_KeyInitTypeDef DES_CRYP_KeyInitStructure;
;;;205      CRYP_IVInitTypeDef DES_CRYP_IVInitStructure;
;;;206      __IO uint32_t counter = 0;
00000e  2000              MOVS     r0,#0
000010  9004              STR      r0,[sp,#0x10]
;;;207      uint32_t busystatus = 0;
000012  9003              STR      r0,[sp,#0xc]
;;;208      ErrorStatus status = SUCCESS;
000014  2001              MOVS     r0,#1
000016  9002              STR      r0,[sp,#8]
;;;209      uint32_t keyaddr    = (uint32_t)Key;
000018  464e              MOV      r6,r9
;;;210      uint32_t inputaddr  = (uint32_t)Input;
00001a  465c              MOV      r4,r11
;;;211      uint32_t outputaddr = (uint32_t)Output;
00001c  9d1f              LDR      r5,[sp,#0x7c]
;;;212      uint32_t ivaddr     = (uint32_t)InitVectors;
00001e  4657              MOV      r7,r10
;;;213      uint32_t i = 0;
000020  2000              MOVS     r0,#0
000022  9001              STR      r0,[sp,#4]
;;;214    
;;;215      /* Crypto structures initialisation*/
;;;216      CRYP_KeyStructInit(&DES_CRYP_KeyInitStructure);
000024  a809              ADD      r0,sp,#0x24
000026  f7fffffe          BL       CRYP_KeyStructInit
;;;217    
;;;218      /* Crypto Init for Encryption process */
;;;219      if(Mode == MODE_ENCRYPT) /* DES encryption */
00002a  f1b80f01          CMP      r8,#1
00002e  d102              BNE      |L1.54|
;;;220      {
;;;221         DES_CRYP_InitStructure.CRYP_AlgoDir  = CRYP_AlgoDir_Encrypt;
000030  2000              MOVS     r0,#0
000032  9011              STR      r0,[sp,#0x44]
000034  e001              B        |L1.58|
                  |L1.54|
;;;222      }
;;;223      else /*if(Mode == MODE_DECRYPT)*/ /* DES decryption */
;;;224      {
;;;225         DES_CRYP_InitStructure.CRYP_AlgoDir  = CRYP_AlgoDir_Decrypt;
000036  2004              MOVS     r0,#4
000038  9011              STR      r0,[sp,#0x44]
                  |L1.58|
;;;226      }
;;;227    
;;;228      DES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_DES_CBC;
00003a  2018              MOVS     r0,#0x18
00003c  9012              STR      r0,[sp,#0x48]
;;;229      DES_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b;
00003e  2080              MOVS     r0,#0x80
000040  9013              STR      r0,[sp,#0x4c]
;;;230      CRYP_Init(&DES_CRYP_InitStructure);
000042  a811              ADD      r0,sp,#0x44
000044  f7fffffe          BL       CRYP_Init
;;;231    
;;;232      /* Key Initialisation */
;;;233      DES_CRYP_KeyInitStructure.CRYP_Key1Left = __REV(*(uint32_t*)(keyaddr));
000048  6830              LDR      r0,[r6,#0]
00004a  ba00              REV      r0,r0
00004c  900b              STR      r0,[sp,#0x2c]
;;;234      keyaddr+=4;
00004e  1d36              ADDS     r6,r6,#4
;;;235      DES_CRYP_KeyInitStructure.CRYP_Key1Right= __REV(*(uint32_t*)(keyaddr));
000050  6830              LDR      r0,[r6,#0]
000052  ba00              REV      r0,r0
000054  900c              STR      r0,[sp,#0x30]
;;;236      CRYP_KeyInit(& DES_CRYP_KeyInitStructure);
000056  a809              ADD      r0,sp,#0x24
000058  f7fffffe          BL       CRYP_KeyInit
;;;237    
;;;238      /* Initialization Vectors */
;;;239      DES_CRYP_IVInitStructure.CRYP_IV0Left = __REV(*(uint32_t*)(ivaddr));
00005c  6838              LDR      r0,[r7,#0]
00005e  ba00              REV      r0,r0
000060  9005              STR      r0,[sp,#0x14]
;;;240      ivaddr+=4;
000062  1d3f              ADDS     r7,r7,#4
;;;241      DES_CRYP_IVInitStructure.CRYP_IV0Right= __REV(*(uint32_t*)(ivaddr));
000064  6838              LDR      r0,[r7,#0]
000066  ba00              REV      r0,r0
000068  9006              STR      r0,[sp,#0x18]
;;;242      CRYP_IVInit(&DES_CRYP_IVInitStructure);
00006a  a805              ADD      r0,sp,#0x14
00006c  f7fffffe          BL       CRYP_IVInit
;;;243    
;;;244      /* Flush IN/OUT FIFO */
;;;245      CRYP_FIFOFlush();
000070  f7fffffe          BL       CRYP_FIFOFlush
;;;246      
;;;247      /* Enable Crypto processor */
;;;248      CRYP_Cmd(ENABLE);
000074  2001              MOVS     r0,#1
000076  f7fffffe          BL       CRYP_Cmd
;;;249    
;;;250      if(CRYP_GetCmdStatus() == DISABLE)
00007a  f7fffffe          BL       CRYP_GetCmdStatus
00007e  b918              CBNZ     r0,|L1.136|
;;;251      {
;;;252        /* The CRYP peripheral clock is not enabled or the device doesn't embedd 
;;;253           the CRYP peripheral (please check the device sales type. */
;;;254        return(ERROR);
000080  2000              MOVS     r0,#0
                  |L1.130|
;;;255      }
;;;256      for(i=0; ((i<Ilength) && (status != ERROR)); i+=8)
;;;257      {
;;;258        /* Write the Input block in the Input FIFO */
;;;259        CRYP_DataIn(*(uint32_t*)(inputaddr));
;;;260        inputaddr+=4;
;;;261        CRYP_DataIn(*(uint32_t*)(inputaddr));
;;;262        inputaddr+=4;
;;;263    
;;;264        /* Wait until the complete message has been processed */
;;;265        counter = 0;
;;;266        do
;;;267        {
;;;268          busystatus = CRYP_GetFlagStatus(CRYP_FLAG_BUSY);
;;;269          counter++;
;;;270        }while ((counter != DESBUSY_TIMEOUT) && (busystatus != RESET));
;;;271    
;;;272        if (busystatus != RESET)
;;;273       {
;;;274           status = ERROR;
;;;275        }
;;;276        else
;;;277        {
;;;278          /* Read the Output block from the Output FIFO */
;;;279          *(uint32_t*)(outputaddr) = CRYP_DataOut();
;;;280          outputaddr+=4;
;;;281          *(uint32_t*)(outputaddr) = CRYP_DataOut();
;;;282          outputaddr+=4;
;;;283        }
;;;284      }
;;;285    
;;;286      /* Disable Crypto */
;;;287      CRYP_Cmd(DISABLE);
;;;288    
;;;289      return status; 
;;;290    }
000082  b015              ADD      sp,sp,#0x54
000084  e8bd8ff0          POP      {r4-r11,pc}
                  |L1.136|
000088  2000              MOVS     r0,#0                 ;256
00008a  9001              STR      r0,[sp,#4]            ;256
00008c  e028              B        |L1.224|
                  |L1.142|
00008e  6820              LDR      r0,[r4,#0]            ;259
000090  f7fffffe          BL       CRYP_DataIn
000094  1d24              ADDS     r4,r4,#4              ;260
000096  6820              LDR      r0,[r4,#0]            ;261
000098  f7fffffe          BL       CRYP_DataIn
00009c  1d24              ADDS     r4,r4,#4              ;262
00009e  2000              MOVS     r0,#0                 ;265
0000a0  9004              STR      r0,[sp,#0x10]         ;265
0000a2  bf00              NOP                            ;266
                  |L1.164|
0000a4  2010              MOVS     r0,#0x10              ;268
0000a6  f7fffffe          BL       CRYP_GetFlagStatus
0000aa  9003              STR      r0,[sp,#0xc]          ;268
0000ac  9804              LDR      r0,[sp,#0x10]         ;269
0000ae  1c40              ADDS     r0,r0,#1              ;269
0000b0  9004              STR      r0,[sp,#0x10]         ;269
0000b2  9804              LDR      r0,[sp,#0x10]         ;270
0000b4  f5b03f80          CMP      r0,#0x10000           ;270
0000b8  d002              BEQ      |L1.192|
0000ba  9803              LDR      r0,[sp,#0xc]          ;270
0000bc  2800              CMP      r0,#0                 ;270
0000be  d1f1              BNE      |L1.164|
                  |L1.192|
0000c0  9803              LDR      r0,[sp,#0xc]          ;272
0000c2  b110              CBZ      r0,|L1.202|
0000c4  2000              MOVS     r0,#0                 ;274
0000c6  9002              STR      r0,[sp,#8]            ;274
0000c8  e007              B        |L1.218|
                  |L1.202|
0000ca  f7fffffe          BL       CRYP_DataOut
0000ce  6028              STR      r0,[r5,#0]            ;279
0000d0  1d2d              ADDS     r5,r5,#4              ;280
0000d2  f7fffffe          BL       CRYP_DataOut
0000d6  6028              STR      r0,[r5,#0]            ;281
0000d8  1d2d              ADDS     r5,r5,#4              ;282
                  |L1.218|
0000da  9801              LDR      r0,[sp,#4]            ;256
0000dc  3008              ADDS     r0,r0,#8              ;256
0000de  9001              STR      r0,[sp,#4]            ;256
                  |L1.224|
0000e0  991e              LDR      r1,[sp,#0x78]         ;256
0000e2  9801              LDR      r0,[sp,#4]            ;256
0000e4  4288              CMP      r0,r1                 ;256
0000e6  d202              BCS      |L1.238|
0000e8  9802              LDR      r0,[sp,#8]            ;256
0000ea  2800              CMP      r0,#0                 ;256
0000ec  d1cf              BNE      |L1.142|
                  |L1.238|
0000ee  2000              MOVS     r0,#0                 ;287
0000f0  f7fffffe          BL       CRYP_Cmd
0000f4  9802              LDR      r0,[sp,#8]            ;289
0000f6  e7c4              B        |L1.130|
;;;291    
                          ENDP


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

                  CRYP_DES_ECB PROC
;;;98       */
;;;99     ErrorStatus CRYP_DES_ECB(uint8_t Mode, uint8_t Key[8], uint8_t *Input, 
000000  e92d4ff0          PUSH     {r4-r11,lr}
;;;100                             uint32_t Ilength, uint8_t *Output)
;;;101    {
000004  b08f              SUB      sp,sp,#0x3c
000006  4607              MOV      r7,r0
000008  4688              MOV      r8,r1
00000a  4691              MOV      r9,r2
00000c  469a              MOV      r10,r3
;;;102      CRYP_InitTypeDef DES_CRYP_InitStructure;
;;;103      CRYP_KeyInitTypeDef DES_CRYP_KeyInitStructure;
;;;104      __IO uint32_t counter = 0;
00000e  2000              MOVS     r0,#0
000010  9002              STR      r0,[sp,#8]
;;;105      uint32_t busystatus = 0;
000012  4683              MOV      r11,r0
;;;106      ErrorStatus status = SUCCESS;
000014  2001              MOVS     r0,#1
000016  9001              STR      r0,[sp,#4]
;;;107      uint32_t keyaddr    = (uint32_t)Key;
000018  4646              MOV      r6,r8
;;;108      uint32_t inputaddr  = (uint32_t)Input;
00001a  464c              MOV      r4,r9
;;;109      uint32_t outputaddr = (uint32_t)Output;
00001c  9d18              LDR      r5,[sp,#0x60]
;;;110      uint32_t i = 0;
00001e  2000              MOVS     r0,#0
000020  9000              STR      r0,[sp,#0]
;;;111    
;;;112      /* Crypto structures initialisation*/
;;;113      CRYP_KeyStructInit(&DES_CRYP_KeyInitStructure);
000022  a803              ADD      r0,sp,#0xc
000024  f7fffffe          BL       CRYP_KeyStructInit
;;;114    
;;;115      /* Crypto Init for Encryption process */
;;;116      if( Mode == MODE_ENCRYPT ) /* DES encryption */
000028  2f01              CMP      r7,#1
00002a  d102              BNE      |L2.50|
;;;117      {
;;;118         DES_CRYP_InitStructure.CRYP_AlgoDir  = CRYP_AlgoDir_Encrypt;
00002c  2000              MOVS     r0,#0
00002e  900b              STR      r0,[sp,#0x2c]
000030  e001              B        |L2.54|
                  |L2.50|
;;;119      }
;;;120      else/* if( Mode == MODE_DECRYPT )*/ /* DES decryption */
;;;121      {      
;;;122         DES_CRYP_InitStructure.CRYP_AlgoDir  = CRYP_AlgoDir_Decrypt;
000032  2004              MOVS     r0,#4
000034  900b              STR      r0,[sp,#0x2c]
                  |L2.54|
;;;123      }
;;;124    
;;;125      DES_CRYP_InitStructure.CRYP_AlgoMode = CRYP_AlgoMode_DES_ECB;
000036  2010              MOVS     r0,#0x10
000038  900c              STR      r0,[sp,#0x30]
;;;126      DES_CRYP_InitStructure.CRYP_DataType = CRYP_DataType_8b;
00003a  2080              MOVS     r0,#0x80
00003c  900d              STR      r0,[sp,#0x34]
;;;127      CRYP_Init(&DES_CRYP_InitStructure);
00003e  a80b              ADD      r0,sp,#0x2c
000040  f7fffffe          BL       CRYP_Init
;;;128    
;;;129      /* Key Initialisation */
;;;130      DES_CRYP_KeyInitStructure.CRYP_Key1Left = __REV(*(uint32_t*)(keyaddr));
000044  6830              LDR      r0,[r6,#0]
000046  ba00              REV      r0,r0
000048  9005              STR      r0,[sp,#0x14]
;;;131      keyaddr+=4;
00004a  1d36              ADDS     r6,r6,#4
;;;132      DES_CRYP_KeyInitStructure.CRYP_Key1Right= __REV(*(uint32_t*)(keyaddr));
00004c  6830              LDR      r0,[r6,#0]
00004e  ba00              REV      r0,r0
000050  9006              STR      r0,[sp,#0x18]
;;;133      CRYP_KeyInit(& DES_CRYP_KeyInitStructure);
000052  a803              ADD      r0,sp,#0xc
000054  f7fffffe          BL       CRYP_KeyInit
;;;134    
;;;135      /* Flush IN/OUT FIFO */
;;;136      CRYP_FIFOFlush();
000058  f7fffffe          BL       CRYP_FIFOFlush
;;;137    
;;;138      /* Enable Crypto processor */
;;;139      CRYP_Cmd(ENABLE);
00005c  2001              MOVS     r0,#1
00005e  f7fffffe          BL       CRYP_Cmd
;;;140    
;;;141      if(CRYP_GetCmdStatus() == DISABLE)
000062  f7fffffe          BL       CRYP_GetCmdStatus
000066  b918              CBNZ     r0,|L2.112|
;;;142      {
;;;143        /* The CRYP peripheral clock is not enabled or the device doesn't embedd 
;;;144           the CRYP peripheral (please check the device sales type. */
;;;145        return(ERROR);
000068  2000              MOVS     r0,#0
                  |L2.106|
;;;146      }
;;;147      for(i=0; ((i<Ilength) && (status != ERROR)); i+=8)
;;;148      {
;;;149    
;;;150        /* Write the Input block in the Input FIFO */
;;;151        CRYP_DataIn(*(uint32_t*)(inputaddr));
;;;152        inputaddr+=4;
;;;153        CRYP_DataIn(*(uint32_t*)(inputaddr));
;;;154        inputaddr+=4;
;;;155    
;;;156    /* Wait until the complete message has been processed */
;;;157        counter = 0;
;;;158        do
;;;159        {
;;;160          busystatus = CRYP_GetFlagStatus(CRYP_FLAG_BUSY);
;;;161          counter++;
;;;162        }while ((counter != DESBUSY_TIMEOUT) && (busystatus != RESET));
;;;163    
;;;164        if (busystatus != RESET)
;;;165       {
;;;166           status = ERROR;
;;;167        }
;;;168        else
;;;169        {
;;;170    
;;;171          /* Read the Output block from the Output FIFO */
;;;172          *(uint32_t*)(outputaddr) = CRYP_DataOut();
;;;173          outputaddr+=4;
;;;174          *(uint32_t*)(outputaddr) = CRYP_DataOut();
;;;175          outputaddr+=4;
;;;176        }
;;;177      }
;;;178    
;;;179      /* Disable Crypto */
;;;180      CRYP_Cmd(DISABLE);
;;;181    
;;;182      return status; 
;;;183    }
00006a  b00f              ADD      sp,sp,#0x3c
00006c  e8bd8ff0          POP      {r4-r11,pc}
                  |L2.112|
000070  2000              MOVS     r0,#0                 ;147
000072  9000              STR      r0,[sp,#0]            ;147
000074  e029              B        |L2.202|
                  |L2.118|
000076  6820              LDR      r0,[r4,#0]            ;151
000078  f7fffffe          BL       CRYP_DataIn
00007c  1d24              ADDS     r4,r4,#4              ;152
00007e  6820              LDR      r0,[r4,#0]            ;153
000080  f7fffffe          BL       CRYP_DataIn
000084  1d24              ADDS     r4,r4,#4              ;154
000086  2000              MOVS     r0,#0                 ;157
000088  9002              STR      r0,[sp,#8]            ;157
00008a  bf00              NOP                            ;158
                  |L2.140|
00008c  2010              MOVS     r0,#0x10              ;160
00008e  f7fffffe          BL       CRYP_GetFlagStatus
000092  4683              MOV      r11,r0                ;160
000094  9802              LDR      r0,[sp,#8]            ;161
000096  1c40              ADDS     r0,r0,#1              ;161
000098  9002              STR      r0,[sp,#8]            ;161
00009a  9802              LDR      r0,[sp,#8]            ;162
00009c  f5b03f80          CMP      r0,#0x10000           ;162
0000a0  d002              BEQ      |L2.168|
0000a2  f1bb0f00          CMP      r11,#0                ;162
0000a6  d1f1              BNE      |L2.140|
                  |L2.168|
0000a8  f1bb0f00          CMP      r11,#0                ;164
0000ac  d002              BEQ      |L2.180|
0000ae  2000              MOVS     r0,#0                 ;166
0000b0  9001              STR      r0,[sp,#4]            ;166
0000b2  e007              B        |L2.196|
                  |L2.180|
0000b4  f7fffffe          BL       CRYP_DataOut
0000b8  6028              STR      r0,[r5,#0]            ;172
0000ba  1d2d              ADDS     r5,r5,#4              ;173
0000bc  f7fffffe          BL       CRYP_DataOut
0000c0  6028              STR      r0,[r5,#0]            ;174
0000c2  1d2d              ADDS     r5,r5,#4              ;175
                  |L2.196|
0000c4  9800              LDR      r0,[sp,#0]            ;147
0000c6  3008              ADDS     r0,r0,#8              ;147
0000c8  9000              STR      r0,[sp,#0]            ;147
                  |L2.202|
0000ca  9800              LDR      r0,[sp,#0]            ;147
0000cc  4550              CMP      r0,r10                ;147
0000ce  d202              BCS      |L2.214|
0000d0  9801              LDR      r0,[sp,#4]            ;147
0000d2  2800              CMP      r0,#0                 ;147
0000d4  d1cf              BNE      |L2.118|
                  |L2.214|
0000d6  2000              MOVS     r0,#0                 ;180
0000d8  f7fffffe          BL       CRYP_Cmd
0000dc  9801              LDR      r0,[sp,#4]            ;182
0000de  e7c4              B        |L2.106|
;;;184    
                          ENDP


;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\Platform\\MCU\\STM32F4xx\\peripherals\\Libraries\\STM32F4xx_StdPeriph_Driver\\src\\stm32f4xx_cryp_des.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___20_stm32f4xx_cryp_des_c_9174d91f____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___20_stm32f4xx_cryp_des_c_9174d91f____REV16| PROC
#line 115

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
