; 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\bootloader\mico-fire_f429\obj_rvmdk\stm32f4xx_hash_md5.o --asm_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\stm32f4xx_hash_md5.d --cpu=Cortex-M4.fp --apcs=interwork --diag_suppress=9931,1,1293 -I..\..\..\..\Bootloader -I..\..\..\..\Board\fire_F429 -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 -IG:\GIT_OSC\F429_OV2640_MICO_SDRAM\Projects\STM32F429\bootloader\RVMDK\RTE -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -ID:\work\keil5\ARM\CMSIS\Include -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__MICROLIB -D__UVISION_VERSION=516 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DBOOTLOADER -DNO_MICO_RTOS -DHSE_VALUE=25000000 --omf_browse=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\stm32f4xx_hash_md5.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_md5.c]
                          THUMB

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

                  HASH_MD5 PROC
;;;92       */
;;;93     ErrorStatus HASH_MD5(uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
000000  e92d43f0          PUSH     {r4-r9,lr}
;;;94     {
000004  b08f              SUB      sp,sp,#0x3c
;;;95       HASH_InitTypeDef MD5_HASH_InitStructure;
;;;96       HASH_MsgDigest MD5_MessageDigest;
;;;97       __IO uint16_t nbvalidbitsdata = 0;
000006  f04f0800          MOV      r8,#0
00000a  4616              MOV      r6,r2                 ;94
00000c  460f              MOV      r7,r1                 ;94
00000e  4604              MOV      r4,r0                 ;94
000010  f8ad8034          STRH     r8,[sp,#0x34]
;;;98       uint32_t i = 0;
;;;99       __IO uint32_t counter = 0;
;;;100      uint32_t busystatus = 0;
;;;101      ErrorStatus status = SUCCESS;
;;;102      uint32_t inputaddr  = (uint32_t)Input;
;;;103      uint32_t outputaddr = (uint32_t)Output;
;;;104    
;;;105    
;;;106      /* Number of valid bits in last word of the Input data */
;;;107      nbvalidbitsdata = 8 * (Ilen % 4);
000014  0788              LSLS     r0,r1,#30
000016  0ec0              LSRS     r0,r0,#27
000018  4645              MOV      r5,r8                 ;98
00001a  f04f0901          MOV      r9,#1                 ;101
00001e  f8cd8030          STR      r8,[sp,#0x30]
000022  f8ad0034          STRH     r0,[sp,#0x34]
;;;108    
;;;109      /* HASH peripheral initialization */
;;;110      HASH_DeInit();
000026  f7fffffe          BL       HASH_DeInit
;;;111    
;;;112      /* HASH Configuration */
;;;113      MD5_HASH_InitStructure.HASH_AlgoSelection = HASH_AlgoSelection_MD5;
00002a  2080              MOVS     r0,#0x80
00002c  e9cd0808          STRD     r0,r8,[sp,#0x20]
;;;114      MD5_HASH_InitStructure.HASH_AlgoMode = HASH_AlgoMode_HASH;
;;;115      MD5_HASH_InitStructure.HASH_DataType = HASH_DataType_8b;
000030  2020              MOVS     r0,#0x20
;;;116      HASH_Init(&MD5_HASH_InitStructure);
000032  900a              STR      r0,[sp,#0x28]
000034  a808              ADD      r0,sp,#0x20
000036  f7fffffe          BL       HASH_Init
;;;117    
;;;118      /* Configure the number of valid bits in last word of the data */
;;;119      HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
00003a  f8bd0034          LDRH     r0,[sp,#0x34]
00003e  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;120    
;;;121      /* Write the Input block in the IN FIFO */
;;;122      for(i=0; i<Ilen; i+=4)
000042  e004              B        |L1.78|
                  |L1.68|
;;;123      {
;;;124        HASH_DataIn(*(uint32_t*)inputaddr);
000044  6820              LDR      r0,[r4,#0]
000046  f7fffffe          BL       HASH_DataIn
00004a  1d24              ADDS     r4,r4,#4
00004c  1d2d              ADDS     r5,r5,#4
                  |L1.78|
00004e  42bd              CMP      r5,r7                 ;122
000050  d3f8              BCC      |L1.68|
;;;125        inputaddr+=4;
;;;126      }
;;;127    
;;;128      /* Start the HASH processor */
;;;129      HASH_StartDigest();
000052  f7fffffe          BL       HASH_StartDigest
;;;130    
;;;131      /* wait until the Busy flag is RESET */
;;;132      do
;;;133      {
;;;134        busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
;;;135        counter++;
;;;136      }while ((counter != MD5BUSY_TIMEOUT) && (busystatus != RESET));
000056  f44f3480          MOV      r4,#0x10000
                  |L1.90|
00005a  2008              MOVS     r0,#8                 ;134
00005c  f7fffffe          BL       HASH_GetFlagStatus
000060  990c              LDR      r1,[sp,#0x30]         ;135
000062  1c49              ADDS     r1,r1,#1              ;135
000064  910c              STR      r1,[sp,#0x30]
000066  42a1              CMP      r1,r4
000068  d002              BEQ      |L1.112|
00006a  2800              CMP      r0,#0
00006c  d1f5              BNE      |L1.90|
00006e  e003              B        |L1.120|
                  |L1.112|
;;;137    
;;;138      if (busystatus != RESET)
000070  b110              CBZ      r0,|L1.120|
;;;139      {
;;;140         status = ERROR;
000072  f04f0900          MOV      r9,#0
000076  e00e              B        |L1.150|
                  |L1.120|
;;;141      }
;;;142      else
;;;143      {
;;;144        /* Read the message digest */
;;;145        HASH_GetDigest(&MD5_MessageDigest);
000078  4668              MOV      r0,sp
00007a  f7fffffe          BL       HASH_GetDigest
;;;146        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[0]);
00007e  9800              LDR      r0,[sp,#0]
000080  ba00              REV      r0,r0
;;;147        outputaddr+=4;
;;;148        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[1]);
000082  6030              STR      r0,[r6,#0]
000084  9801              LDR      r0,[sp,#4]
000086  ba00              REV      r0,r0
;;;149        outputaddr+=4;
;;;150        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[2]);
000088  6070              STR      r0,[r6,#4]
00008a  9802              LDR      r0,[sp,#8]
00008c  ba00              REV      r0,r0
;;;151        outputaddr+=4;
;;;152        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[3]);
00008e  60b0              STR      r0,[r6,#8]
000090  9803              LDR      r0,[sp,#0xc]
000092  ba00              REV      r0,r0
000094  60f0              STR      r0,[r6,#0xc]
                  |L1.150|
;;;153      }
;;;154      return status; 
;;;155    }
000096  b00f              ADD      sp,sp,#0x3c
000098  4648              MOV      r0,r9                 ;154
00009a  e8bd83f0          POP      {r4-r9,pc}
;;;156    
                          ENDP


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

                  HMAC_MD5 PROC
;;;167      */
;;;168    ErrorStatus HMAC_MD5(uint8_t *Key, uint32_t Keylen, uint8_t *Input, 
000000  e92d4fff          PUSH     {r0-r11,lr}
;;;169                         uint32_t Ilen, uint8_t Output[16])
;;;170    {
000004  b08f              SUB      sp,sp,#0x3c
;;;171      HASH_InitTypeDef MD5_HASH_InitStructure;
;;;172      HASH_MsgDigest MD5_MessageDigest;
;;;173      __IO uint16_t nbvalidbitsdata = 0;
000006  f04f0b00          MOV      r11,#0
00000a  f8dd9070          LDR      r9,[sp,#0x70]
00000e  469a              MOV      r10,r3                ;170
000010  4614              MOV      r4,r2                 ;170
000012  460e              MOV      r6,r1                 ;170
000014  f8adb038          STRH     r11,[sp,#0x38]
;;;174      __IO uint16_t nbvalidbitskey = 0;
000018  f8adb034          STRH     r11,[sp,#0x34]
;;;175      uint32_t i = 0;
;;;176      __IO uint32_t counter = 0;
;;;177      uint32_t busystatus = 0;
;;;178      ErrorStatus status = SUCCESS;
;;;179      uint32_t keyaddr    = (uint32_t)Key;
00001c  f8cdb000          STR      r11,[sp,#0]
;;;180      uint32_t inputaddr  = (uint32_t)Input;
;;;181      uint32_t outputaddr = (uint32_t)Output;
;;;182    
;;;183      /* Number of valid bits in last word of the Input data */
;;;184      nbvalidbitsdata = 8 * (Ilen % 4);
000020  0798              LSLS     r0,r3,#30
000022  0ec0              LSRS     r0,r0,#27
000024  9d0f              LDR      r5,[sp,#0x3c]
000026  465f              MOV      r7,r11                ;175
000028  f04f0801          MOV      r8,#1                 ;178
00002c  f8ad0038          STRH     r0,[sp,#0x38]
;;;185    
;;;186      /* Number of valid bits in last word of the Key */
;;;187      nbvalidbitskey = 8 * (Keylen % 4);
000030  0788              LSLS     r0,r1,#30
000032  0ec0              LSRS     r0,r0,#27
000034  f8ad0034          STRH     r0,[sp,#0x34]
;;;188       
;;;189      /* HASH peripheral initialization */
;;;190      HASH_DeInit();
000038  f7fffffe          BL       HASH_DeInit
;;;191    
;;;192      /* HASH Configuration */
;;;193      MD5_HASH_InitStructure.HASH_AlgoSelection = HASH_AlgoSelection_MD5;
00003c  2080              MOVS     r0,#0x80
;;;194      MD5_HASH_InitStructure.HASH_AlgoMode = HASH_AlgoMode_HMAC;
00003e  9009              STR      r0,[sp,#0x24]
000040  2040              MOVS     r0,#0x40
;;;195      MD5_HASH_InitStructure.HASH_DataType = HASH_DataType_8b;
000042  900a              STR      r0,[sp,#0x28]
000044  2020              MOVS     r0,#0x20
;;;196      if(Keylen > 64)
000046  900b              STR      r0,[sp,#0x2c]
000048  2e40              CMP      r6,#0x40
00004a  d902              BLS      |L2.82|
;;;197      {
;;;198        /* HMAC long Key */
;;;199        MD5_HASH_InitStructure.HASH_HMACKeyType = HASH_HMACKeyType_LongKey;
00004c  02c0              LSLS     r0,r0,#11
00004e  900c              STR      r0,[sp,#0x30]
000050  e001              B        |L2.86|
                  |L2.82|
;;;200      }
;;;201      else
;;;202      {
;;;203        /* HMAC short Key */
;;;204        MD5_HASH_InitStructure.HASH_HMACKeyType = HASH_HMACKeyType_ShortKey;
000052  f8cdb030          STR      r11,[sp,#0x30]
                  |L2.86|
;;;205      }
;;;206      HASH_Init(&MD5_HASH_InitStructure);
000056  a809              ADD      r0,sp,#0x24
000058  f7fffffe          BL       HASH_Init
;;;207    
;;;208      /* Configure the number of valid bits in last word of the Key */
;;;209      HASH_SetLastWordValidBitsNbr(nbvalidbitskey);
00005c  f8bd0034          LDRH     r0,[sp,#0x34]
000060  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;210    
;;;211      /* Write the Key */
;;;212      for(i=0; i<Keylen; i+=4)
000064  e004              B        |L2.112|
                  |L2.102|
;;;213      {
;;;214        HASH_DataIn(*(uint32_t*)keyaddr);
000066  6828              LDR      r0,[r5,#0]
000068  f7fffffe          BL       HASH_DataIn
00006c  1d2d              ADDS     r5,r5,#4
00006e  1d3f              ADDS     r7,r7,#4
                  |L2.112|
000070  42b7              CMP      r7,r6                 ;212
000072  d3f8              BCC      |L2.102|
;;;215        keyaddr+=4;
;;;216      }
;;;217      
;;;218      /* Start the HASH processor */
;;;219      HASH_StartDigest();
000074  f7fffffe          BL       HASH_StartDigest
000078  f44f3580          MOV      r5,#0x10000           ;199
                  |L2.124|
;;;220    
;;;221      /* wait until the Busy flag is RESET */
;;;222      do
;;;223      {
;;;224        busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
00007c  2008              MOVS     r0,#8
00007e  f7fffffe          BL       HASH_GetFlagStatus
;;;225        counter++;
000082  9900              LDR      r1,[sp,#0]
000084  1c49              ADDS     r1,r1,#1
;;;226      }while ((counter != MD5BUSY_TIMEOUT) && (busystatus != RESET));
000086  9100              STR      r1,[sp,#0]
000088  42a9              CMP      r1,r5
00008a  d002              BEQ      |L2.146|
00008c  2800              CMP      r0,#0
00008e  d1f5              BNE      |L2.124|
000090  e000              B        |L2.148|
                  |L2.146|
;;;227    
;;;228      if (busystatus != RESET)
000092  bbc8              CBNZ     r0,|L2.264|
                  |L2.148|
;;;229      {
;;;230         status = ERROR;
;;;231      }
;;;232      else
;;;233      {
;;;234        /* Configure the number of valid bits in last word of the Input data */
;;;235        HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
000094  f8bd0038          LDRH     r0,[sp,#0x38]
000098  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;236    
;;;237        /* Write the Input block in the IN FIFO */
;;;238        for(i=0; i<Ilen; i+=4)
00009c  2700              MOVS     r7,#0
00009e  e004              B        |L2.170|
                  |L2.160|
;;;239        {
;;;240          HASH_DataIn(*(uint32_t*)inputaddr);
0000a0  6820              LDR      r0,[r4,#0]
0000a2  f7fffffe          BL       HASH_DataIn
0000a6  1d24              ADDS     r4,r4,#4
0000a8  1d3f              ADDS     r7,r7,#4
                  |L2.170|
0000aa  4557              CMP      r7,r10                ;238
0000ac  d3f8              BCC      |L2.160|
;;;241          inputaddr+=4;
;;;242        }
;;;243    
;;;244        /* Start the HASH processor */
;;;245        HASH_StartDigest();
0000ae  f7fffffe          BL       HASH_StartDigest
;;;246    
;;;247        /* wait until the Busy flag is RESET */
;;;248        counter =0;
0000b2  f8cdb000          STR      r11,[sp,#0]
                  |L2.182|
;;;249        do
;;;250        {
;;;251           busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
0000b6  2008              MOVS     r0,#8
0000b8  f7fffffe          BL       HASH_GetFlagStatus
;;;252           counter++;
0000bc  9900              LDR      r1,[sp,#0]
0000be  1c49              ADDS     r1,r1,#1
;;;253        }while ((counter != MD5BUSY_TIMEOUT) && (busystatus != RESET));
0000c0  9100              STR      r1,[sp,#0]
0000c2  42a9              CMP      r1,r5
0000c4  d002              BEQ      |L2.204|
0000c6  2800              CMP      r0,#0
0000c8  d1f5              BNE      |L2.182|
0000ca  e000              B        |L2.206|
                  |L2.204|
;;;254    
;;;255        if (busystatus != RESET)
0000cc  b9e0              CBNZ     r0,|L2.264|
                  |L2.206|
;;;256        {
;;;257          status = ERROR;
;;;258        }
;;;259        else
;;;260        {  
;;;261          /* Configure the number of valid bits in last word of the Key */
;;;262          HASH_SetLastWordValidBitsNbr(nbvalidbitskey);
0000ce  f8bd0034          LDRH     r0,[sp,#0x34]
0000d2  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;263    
;;;264          /* Write the Key */
;;;265          keyaddr = (uint32_t)Key;
;;;266          for(i=0; i<Keylen; i+=4)
0000d6  2700              MOVS     r7,#0
0000d8  9c0f              LDR      r4,[sp,#0x3c]
0000da  e004              B        |L2.230|
                  |L2.220|
;;;267          {
;;;268            HASH_DataIn(*(uint32_t*)keyaddr);
0000dc  6820              LDR      r0,[r4,#0]
0000de  f7fffffe          BL       HASH_DataIn
0000e2  1d24              ADDS     r4,r4,#4
0000e4  1d3f              ADDS     r7,r7,#4
                  |L2.230|
0000e6  42b7              CMP      r7,r6                 ;266
0000e8  d3f8              BCC      |L2.220|
;;;269            keyaddr+=4;
;;;270          }
;;;271      
;;;272           /* Start the HASH processor */
;;;273           HASH_StartDigest();
0000ea  f7fffffe          BL       HASH_StartDigest
;;;274    
;;;275           /* wait until the Busy flag is RESET */
;;;276           counter =0;
0000ee  f8cdb000          STR      r11,[sp,#0]
                  |L2.242|
;;;277           do
;;;278           {
;;;279              busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
0000f2  2008              MOVS     r0,#8
0000f4  f7fffffe          BL       HASH_GetFlagStatus
;;;280              counter++;
0000f8  9900              LDR      r1,[sp,#0]
0000fa  1c49              ADDS     r1,r1,#1
;;;281          }while ((counter != MD5BUSY_TIMEOUT) && (busystatus != RESET));
0000fc  9100              STR      r1,[sp,#0]
0000fe  42a9              CMP      r1,r5
000100  d003              BEQ      |L2.266|
000102  2800              CMP      r0,#0
000104  d1f5              BNE      |L2.242|
000106  e004              B        |L2.274|
                  |L2.264|
000108  e000              B        |L2.268|
                  |L2.266|
;;;282    
;;;283          if (busystatus != RESET)
00010a  b110              CBZ      r0,|L2.274|
                  |L2.268|
;;;284          {
;;;285             status = ERROR;
00010c  f04f0800          MOV      r8,#0
000110  e012              B        |L2.312|
                  |L2.274|
;;;286          }
;;;287          else
;;;288          {
;;;289             /* Read the message digest */
;;;290             HASH_GetDigest(&MD5_MessageDigest);
000112  a801              ADD      r0,sp,#4
000114  f7fffffe          BL       HASH_GetDigest
;;;291             *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[0]);
000118  9801              LDR      r0,[sp,#4]
00011a  ba01              REV      r1,r0
;;;292             outputaddr+=4;
;;;293             *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[1]);
00011c  f8c91000          STR      r1,[r9,#0]
000120  9902              LDR      r1,[sp,#8]
000122  ba09              REV      r1,r1
;;;294             outputaddr+=4;
;;;295             *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[2]);
000124  f8c91004          STR      r1,[r9,#4]
000128  9903              LDR      r1,[sp,#0xc]
00012a  ba09              REV      r1,r1
;;;296             outputaddr+=4;
;;;297             *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[3]);
00012c  f8c91008          STR      r1,[r9,#8]
000130  9904              LDR      r1,[sp,#0x10]
000132  ba09              REV      r1,r1
000134  f8c9100c          STR      r1,[r9,#0xc]
                  |L2.312|
;;;298          }
;;;299        }
;;;300      }
;;;301      return status;  
;;;302    }
000138  b013              ADD      sp,sp,#0x4c
00013a  4640              MOV      r0,r8                 ;301
00013c  e8bd8ff0          POP      {r4-r11,pc}
;;;303    /**
                          ENDP


;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
