; 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_sha1.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_sha1.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_sha1.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_sha1.c]
                          THUMB

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

                  HASH_SHA1 PROC
;;;92       */
;;;93     ErrorStatus HASH_SHA1(uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
000000  e92d43f0          PUSH     {r4-r9,lr}
;;;94     {
000004  b08f              SUB      sp,sp,#0x3c
;;;95       HASH_InitTypeDef SHA1_HASH_InitStructure;
;;;96       HASH_MsgDigest SHA1_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      /* Number of valid bits in last word of the Input data */
;;;106      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]
;;;107    
;;;108      /* HASH peripheral initialization */
;;;109      HASH_DeInit();
000026  f7fffffe          BL       HASH_DeInit
;;;110    
;;;111      /* HASH Configuration */
;;;112      SHA1_HASH_InitStructure.HASH_AlgoSelection = HASH_AlgoSelection_SHA1;
;;;113      SHA1_HASH_InitStructure.HASH_AlgoMode = HASH_AlgoMode_HASH;
00002a  f8cd8020          STR      r8,[sp,#0x20]
;;;114      SHA1_HASH_InitStructure.HASH_DataType = HASH_DataType_8b;
00002e  2020              MOVS     r0,#0x20
;;;115      HASH_Init(&SHA1_HASH_InitStructure);
000030  e9cd8009          STRD     r8,r0,[sp,#0x24]
000034  a808              ADD      r0,sp,#0x20
000036  f7fffffe          BL       HASH_Init
;;;116    
;;;117      /* Configure the number of valid bits in last word of the data */
;;;118      HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
00003a  f8bd0034          LDRH     r0,[sp,#0x34]
00003e  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;119    
;;;120      /* Write the Input block in the IN FIFO */
;;;121      for(i=0; i<Ilen; i+=4)
000042  e004              B        |L1.78|
                  |L1.68|
;;;122      {
;;;123        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                 ;121
000050  d3f8              BCC      |L1.68|
;;;124        inputaddr+=4;
;;;125      }
;;;126    
;;;127      /* Start the HASH processor */
;;;128      HASH_StartDigest();
000052  f7fffffe          BL       HASH_StartDigest
;;;129    
;;;130      /* wait until the Busy flag is RESET */
;;;131      do
;;;132      {
;;;133        busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
;;;134        counter++;
;;;135      }while ((counter != SHA1BUSY_TIMEOUT) && (busystatus != RESET));
000056  f44f3480          MOV      r4,#0x10000
                  |L1.90|
00005a  2008              MOVS     r0,#8                 ;133
00005c  f7fffffe          BL       HASH_GetFlagStatus
000060  990c              LDR      r1,[sp,#0x30]         ;134
000062  1c49              ADDS     r1,r1,#1              ;134
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|
;;;136    
;;;137      if (busystatus != RESET)
000070  b110              CBZ      r0,|L1.120|
;;;138      {
;;;139         status = ERROR;
000072  f04f0900          MOV      r9,#0
000076  e011              B        |L1.156|
                  |L1.120|
;;;140      }
;;;141      else
;;;142      {
;;;143        /* Read the message digest */
;;;144        HASH_GetDigest(&SHA1_MessageDigest);
000078  4668              MOV      r0,sp
00007a  f7fffffe          BL       HASH_GetDigest
;;;145        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[0]);
00007e  9800              LDR      r0,[sp,#0]
000080  ba00              REV      r0,r0
;;;146        outputaddr+=4;
;;;147        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[1]);
000082  6030              STR      r0,[r6,#0]
000084  9801              LDR      r0,[sp,#4]
000086  ba00              REV      r0,r0
;;;148        outputaddr+=4;
;;;149        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[2]);
000088  6070              STR      r0,[r6,#4]
00008a  9802              LDR      r0,[sp,#8]
00008c  ba00              REV      r0,r0
;;;150        outputaddr+=4;
;;;151        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[3]);
00008e  60b0              STR      r0,[r6,#8]
000090  9803              LDR      r0,[sp,#0xc]
000092  ba00              REV      r0,r0
;;;152        outputaddr+=4;
;;;153        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[4]);
000094  60f0              STR      r0,[r6,#0xc]
000096  9804              LDR      r0,[sp,#0x10]
000098  ba00              REV      r0,r0
00009a  6130              STR      r0,[r6,#0x10]
                  |L1.156|
;;;154      }
;;;155      return status;
;;;156    }
00009c  b00f              ADD      sp,sp,#0x3c
00009e  4648              MOV      r0,r9                 ;155
0000a0  e8bd83f0          POP      {r4-r9,pc}
;;;157    
                          ENDP


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

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


;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
