; generated by ARM C/C++ Compiler, 4.1 [Build 894]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o.\STM324xG_EVAL\stm32f4xx_hash_sha1.o --asm_dir=.\STM324xG_EVAL\ --list_dir=.\STM324xG_EVAL\ --depend=.\STM324xG_EVAL\stm32f4xx_hash_sha1.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_hash_sha1.crf ..\..\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_sha1.c]
                          THUMB

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

                  HASH_SHA1 PROC
;;;86       */
;;;87     ErrorStatus HASH_SHA1(uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
000000  e92d4ff0          PUSH     {r4-r11,lr}
;;;88     {
000004  b08b              SUB      sp,sp,#0x2c
000006  4606              MOV      r6,r0
000008  460d              MOV      r5,r1
00000a  4617              MOV      r7,r2
;;;89       HASH_InitTypeDef SHA1_HASH_InitStructure;
;;;90       HASH_MsgDigest SHA1_MessageDigest;
;;;91       __IO uint16_t nbvalidbitsdata = 0;
00000c  2000              MOVS     r0,#0
00000e  9001              STR      r0,[sp,#4]
;;;92       uint32_t i = 0;
000010  4682              MOV      r10,r0
;;;93       __IO uint32_t counter = 0;
000012  4680              MOV      r8,r0
;;;94       uint32_t busystatus = 0;
000014  4681              MOV      r9,r0
;;;95       ErrorStatus status = SUCCESS;
000016  2001              MOVS     r0,#1
000018  9000              STR      r0,[sp,#0]
;;;96       uint32_t inputaddr  = (uint32_t)Input;
00001a  46b3              MOV      r11,r6
;;;97       uint32_t outputaddr = (uint32_t)Output;
00001c  463c              MOV      r4,r7
;;;98     
;;;99       /* Number of valid bits in last word of the Input data */
;;;100      nbvalidbitsdata = 8 * (Ilen % 4);
00001e  07a8              LSLS     r0,r5,#30
000020  0ec0              LSRS     r0,r0,#27
000022  9001              STR      r0,[sp,#4]
;;;101    
;;;102      /* HASH peripheral initialization */
;;;103      HASH_DeInit();
000024  f7fffffe          BL       HASH_DeInit
;;;104    
;;;105      /* HASH Configuration */
;;;106      SHA1_HASH_InitStructure.HASH_AlgoSelection = HASH_AlgoSelection_SHA1;
000028  2000              MOVS     r0,#0
00002a  9007              STR      r0,[sp,#0x1c]
;;;107      SHA1_HASH_InitStructure.HASH_AlgoMode = HASH_AlgoMode_HASH;
00002c  9008              STR      r0,[sp,#0x20]
;;;108      SHA1_HASH_InitStructure.HASH_DataType = HASH_DataType_8b;
00002e  2020              MOVS     r0,#0x20
000030  9009              STR      r0,[sp,#0x24]
;;;109      HASH_Init(&SHA1_HASH_InitStructure);
000032  a807              ADD      r0,sp,#0x1c
000034  f7fffffe          BL       HASH_Init
;;;110    
;;;111      /* Configure the number of valid bits in last word of the data */
;;;112      HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
000038  9801              LDR      r0,[sp,#4]
00003a  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;113    
;;;114      /* Write the Input block in the IN FIFO */
;;;115      for(i=0; i<Ilen; i+=4)
00003e  bf00              NOP      
000040  e007              B        |L1.82|
                  |L1.66|
;;;116      {
;;;117        HASH_DataIn(*(uint32_t*)inputaddr);
000042  f8db0000          LDR      r0,[r11,#0]
000046  f7fffffe          BL       HASH_DataIn
;;;118        inputaddr+=4;
00004a  f10b0b04          ADD      r11,r11,#4
00004e  f10a0a04          ADD      r10,r10,#4            ;115
                  |L1.82|
000052  45aa              CMP      r10,r5                ;115
000054  d3f5              BCC      |L1.66|
;;;119      }
;;;120    
;;;121      /* Start the HASH processor */
;;;122      HASH_StartDigest();
000056  f7fffffe          BL       HASH_StartDigest
;;;123    
;;;124      /* wait until the Busy flag is RESET */
;;;125      do
00005a  bf00              NOP      
                  |L1.92|
;;;126      {
;;;127        busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
00005c  2008              MOVS     r0,#8
00005e  f7fffffe          BL       HASH_GetFlagStatus
000062  4681              MOV      r9,r0
;;;128        counter++;
000064  f1080801          ADD      r8,r8,#1
;;;129      }while ((counter != SHA1BUSY_TIMEOUT) && (busystatus != RESET));
000068  f5b83f80          CMP      r8,#0x10000
00006c  d002              BEQ      |L1.116|
00006e  f1b90f00          CMP      r9,#0
000072  d1f3              BNE      |L1.92|
                  |L1.116|
;;;130    
;;;131      if (busystatus != RESET)
000074  f1b90f00          CMP      r9,#0
000078  d002              BEQ      |L1.128|
;;;132      {
;;;133         status = ERROR;
00007a  2000              MOVS     r0,#0
00007c  9000              STR      r0,[sp,#0]
00007e  e015              B        |L1.172|
                  |L1.128|
;;;134      }
;;;135      else
;;;136      {
;;;137        /* Read the message digest */
;;;138        HASH_GetDigest(&SHA1_MessageDigest);
000080  a802              ADD      r0,sp,#8
000082  f7fffffe          BL       HASH_GetDigest
;;;139        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[0]);
000086  9802              LDR      r0,[sp,#8]
000088  ba00              REV      r0,r0
00008a  6020              STR      r0,[r4,#0]
;;;140        outputaddr+=4;
00008c  1d24              ADDS     r4,r4,#4
;;;141        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[1]);
00008e  9803              LDR      r0,[sp,#0xc]
000090  ba00              REV      r0,r0
000092  6020              STR      r0,[r4,#0]
;;;142        outputaddr+=4;
000094  1d24              ADDS     r4,r4,#4
;;;143        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[2]);
000096  9804              LDR      r0,[sp,#0x10]
000098  ba00              REV      r0,r0
00009a  6020              STR      r0,[r4,#0]
;;;144        outputaddr+=4;
00009c  1d24              ADDS     r4,r4,#4
;;;145        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[3]);
00009e  9805              LDR      r0,[sp,#0x14]
0000a0  ba00              REV      r0,r0
0000a2  6020              STR      r0,[r4,#0]
;;;146        outputaddr+=4;
0000a4  1d24              ADDS     r4,r4,#4
;;;147        *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[4]);
0000a6  9806              LDR      r0,[sp,#0x18]
0000a8  ba00              REV      r0,r0
0000aa  6020              STR      r0,[r4,#0]
                  |L1.172|
;;;148      }
;;;149      return status;
0000ac  9800              LDR      r0,[sp,#0]
;;;150    }
0000ae  b00b              ADD      sp,sp,#0x2c
0000b0  e8bd8ff0          POP      {r4-r11,pc}
;;;151    
                          ENDP


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

                  HMAC_SHA1 PROC
;;;162      */
;;;163    ErrorStatus HMAC_SHA1(uint8_t *Key, uint32_t Keylen, uint8_t *Input,
000000  e92d4fff          PUSH     {r0-r11,lr}
;;;164                          uint32_t Ilen, uint8_t Output[20])
;;;165    {
000004  ed2d8b02          VPUSH    {d8}
000008  b08d              SUB      sp,sp,#0x34
00000a  4682              MOV      r10,r0
00000c  4688              MOV      r8,r1
00000e  469b              MOV      r11,r3
000010  ed9d8a1c          VLDR     s16,[sp,#0x70]
;;;166      HASH_InitTypeDef SHA1_HASH_InitStructure;
;;;167      HASH_MsgDigest SHA1_MessageDigest;
;;;168      __IO uint16_t nbvalidbitsdata = 0;
000014  2000              MOVS     r0,#0
000016  9003              STR      r0,[sp,#0xc]
;;;169      __IO uint16_t nbvalidbitskey = 0;
000018  9002              STR      r0,[sp,#8]
;;;170      uint32_t i = 0;
00001a  2500              MOVS     r5,#0
;;;171      __IO uint32_t counter = 0;
00001c  2600              MOVS     r6,#0
;;;172      uint32_t busystatus = 0;
00001e  2700              MOVS     r7,#0
;;;173      ErrorStatus status = SUCCESS;
000020  2001              MOVS     r0,#1
000022  9001              STR      r0,[sp,#4]
;;;174      uint32_t keyaddr    = (uint32_t)Key;
000024  46d1              MOV      r9,r10
;;;175      uint32_t inputaddr  = (uint32_t)Input;
000026  ed9d0a11          VLDR     s0,[sp,#0x44]
00002a  ed8d0a00          VSTR     s0,[sp,#0]
;;;176      uint32_t outputaddr = (uint32_t)Output;
00002e  ee184a10          VMOV     r4,s16
;;;177    
;;;178      /* Number of valid bits in last word of the Input data */
;;;179      nbvalidbitsdata = 8 * (Ilen % 4);
000032  ea4f708b          LSL      r0,r11,#30
000036  0ec0              LSRS     r0,r0,#27
000038  9003              STR      r0,[sp,#0xc]
;;;180    
;;;181      /* Number of valid bits in last word of the Key */
;;;182      nbvalidbitskey = 8 * (Keylen % 4);
00003a  ea4f7088          LSL      r0,r8,#30
00003e  0ec0              LSRS     r0,r0,#27
000040  9002              STR      r0,[sp,#8]
;;;183    
;;;184      /* HASH peripheral initialization */
;;;185      HASH_DeInit();
000042  f7fffffe          BL       HASH_DeInit
;;;186    
;;;187      /* HASH Configuration */
;;;188      SHA1_HASH_InitStructure.HASH_AlgoSelection = HASH_AlgoSelection_SHA1;
000046  2000              MOVS     r0,#0
000048  9009              STR      r0,[sp,#0x24]
;;;189      SHA1_HASH_InitStructure.HASH_AlgoMode = HASH_AlgoMode_HMAC;
00004a  2040              MOVS     r0,#0x40
00004c  900a              STR      r0,[sp,#0x28]
;;;190      SHA1_HASH_InitStructure.HASH_DataType = HASH_DataType_8b;
00004e  2020              MOVS     r0,#0x20
000050  900b              STR      r0,[sp,#0x2c]
;;;191      if(Keylen > 64)
000052  f1b80f40          CMP      r8,#0x40
000056  d902              BLS      |L2.94|
;;;192      {
;;;193        /* HMAC long Key */
;;;194        SHA1_HASH_InitStructure.HASH_HMACKeyType = HASH_HMACKeyType_LongKey;
000058  02c0              LSLS     r0,r0,#11
00005a  900c              STR      r0,[sp,#0x30]
00005c  e001              B        |L2.98|
                  |L2.94|
;;;195      }
;;;196      else
;;;197      {
;;;198        /* HMAC short Key */
;;;199        SHA1_HASH_InitStructure.HASH_HMACKeyType = HASH_HMACKeyType_ShortKey;
00005e  2000              MOVS     r0,#0
000060  900c              STR      r0,[sp,#0x30]
                  |L2.98|
;;;200      }
;;;201      HASH_Init(&SHA1_HASH_InitStructure);
000062  a809              ADD      r0,sp,#0x24
000064  f7fffffe          BL       HASH_Init
;;;202    
;;;203      /* Configure the number of valid bits in last word of the Key */
;;;204      HASH_SetLastWordValidBitsNbr(nbvalidbitskey);
000068  9802              LDR      r0,[sp,#8]
00006a  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;205    
;;;206      /* Write the Key */
;;;207      for(i=0; i<Keylen; i+=4)
00006e  2500              MOVS     r5,#0
000070  e006              B        |L2.128|
                  |L2.114|
;;;208      {
;;;209        HASH_DataIn(*(uint32_t*)keyaddr);
000072  f8d90000          LDR      r0,[r9,#0]
000076  f7fffffe          BL       HASH_DataIn
;;;210        keyaddr+=4;
00007a  f1090904          ADD      r9,r9,#4
00007e  1d2d              ADDS     r5,r5,#4              ;207
                  |L2.128|
000080  4545              CMP      r5,r8                 ;207
000082  d3f6              BCC      |L2.114|
;;;211      }
;;;212    
;;;213      /* Start the HASH processor */
;;;214      HASH_StartDigest();
000084  f7fffffe          BL       HASH_StartDigest
;;;215    
;;;216      /* wait until the Busy flag is RESET */
;;;217      do
000088  bf00              NOP      
                  |L2.138|
;;;218      {
;;;219        busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
00008a  2008              MOVS     r0,#8
00008c  f7fffffe          BL       HASH_GetFlagStatus
000090  4607              MOV      r7,r0
;;;220        counter++;
000092  1c76              ADDS     r6,r6,#1
;;;221      }while ((counter != SHA1BUSY_TIMEOUT) && (busystatus != RESET));
000094  f5b63f80          CMP      r6,#0x10000
000098  d001              BEQ      |L2.158|
00009a  2f00              CMP      r7,#0
00009c  d1f5              BNE      |L2.138|
                  |L2.158|
;;;222    
;;;223      if (busystatus != RESET)
00009e  b117              CBZ      r7,|L2.166|
;;;224      {
;;;225         status = ERROR;
0000a0  2000              MOVS     r0,#0
0000a2  9001              STR      r0,[sp,#4]
0000a4  e057              B        |L2.342|
                  |L2.166|
;;;226      }
;;;227      else
;;;228      {
;;;229        /* Configure the number of valid bits in last word of the Input data */
;;;230        HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
0000a6  9803              LDR      r0,[sp,#0xc]
0000a8  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;231    
;;;232        /* Write the Input block in the IN FIFO */
;;;233        for(i=0; i<Ilen; i+=4)
0000ac  2500              MOVS     r5,#0
0000ae  e007              B        |L2.192|
                  |L2.176|
;;;234        {
;;;235          HASH_DataIn(*(uint32_t*)inputaddr);
0000b0  9900              LDR      r1,[sp,#0]
0000b2  6808              LDR      r0,[r1,#0]
0000b4  f7fffffe          BL       HASH_DataIn
;;;236          inputaddr+=4;
0000b8  9800              LDR      r0,[sp,#0]
0000ba  1d00              ADDS     r0,r0,#4
0000bc  9000              STR      r0,[sp,#0]
0000be  1d2d              ADDS     r5,r5,#4              ;233
                  |L2.192|
0000c0  455d              CMP      r5,r11                ;233
0000c2  d3f5              BCC      |L2.176|
;;;237        }
;;;238    
;;;239        /* Start the HASH processor */
;;;240        HASH_StartDigest();
0000c4  f7fffffe          BL       HASH_StartDigest
;;;241    
;;;242    
;;;243        /* wait until the Busy flag is RESET */
;;;244        counter =0;
0000c8  2600              MOVS     r6,#0
;;;245        do
0000ca  bf00              NOP      
                  |L2.204|
;;;246        {
;;;247          busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
0000cc  2008              MOVS     r0,#8
0000ce  f7fffffe          BL       HASH_GetFlagStatus
0000d2  4607              MOV      r7,r0
;;;248          counter++;
0000d4  1c76              ADDS     r6,r6,#1
;;;249        }while ((counter != SHA1BUSY_TIMEOUT) && (busystatus != RESET));
0000d6  f5b63f80          CMP      r6,#0x10000
0000da  d001              BEQ      |L2.224|
0000dc  2f00              CMP      r7,#0
0000de  d1f5              BNE      |L2.204|
                  |L2.224|
;;;250    
;;;251        if (busystatus != RESET)
0000e0  b117              CBZ      r7,|L2.232|
;;;252        {
;;;253          status = ERROR;
0000e2  2000              MOVS     r0,#0
0000e4  9001              STR      r0,[sp,#4]
0000e6  e036              B        |L2.342|
                  |L2.232|
;;;254        }
;;;255        else
;;;256        {  
;;;257          /* Configure the number of valid bits in last word of the Key */
;;;258          HASH_SetLastWordValidBitsNbr(nbvalidbitskey);
0000e8  9802              LDR      r0,[sp,#8]
0000ea  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;259    
;;;260          /* Write the Key */
;;;261          keyaddr = (uint32_t)Key;
0000ee  46d1              MOV      r9,r10
;;;262          for(i=0; i<Keylen; i+=4)
0000f0  2500              MOVS     r5,#0
0000f2  e006              B        |L2.258|
                  |L2.244|
;;;263          {
;;;264            HASH_DataIn(*(uint32_t*)keyaddr);
0000f4  f8d90000          LDR      r0,[r9,#0]
0000f8  f7fffffe          BL       HASH_DataIn
;;;265            keyaddr+=4;
0000fc  f1090904          ADD      r9,r9,#4
000100  1d2d              ADDS     r5,r5,#4              ;262
                  |L2.258|
000102  4545              CMP      r5,r8                 ;262
000104  d3f6              BCC      |L2.244|
;;;266          }
;;;267    
;;;268          /* Start the HASH processor */
;;;269          HASH_StartDigest();
000106  f7fffffe          BL       HASH_StartDigest
;;;270    
;;;271          /* wait until the Busy flag is RESET */
;;;272          counter =0;
00010a  2600              MOVS     r6,#0
;;;273          do
00010c  bf00              NOP      
                  |L2.270|
;;;274          {
;;;275            busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
00010e  2008              MOVS     r0,#8
000110  f7fffffe          BL       HASH_GetFlagStatus
000114  4607              MOV      r7,r0
;;;276            counter++;
000116  1c76              ADDS     r6,r6,#1
;;;277          }while ((counter != SHA1BUSY_TIMEOUT) && (busystatus != RESET));
000118  f5b63f80          CMP      r6,#0x10000
00011c  d001              BEQ      |L2.290|
00011e  2f00              CMP      r7,#0
000120  d1f5              BNE      |L2.270|
                  |L2.290|
;;;278    
;;;279          if (busystatus != RESET)
000122  b117              CBZ      r7,|L2.298|
;;;280          {
;;;281            status = ERROR;
000124  2000              MOVS     r0,#0
000126  9001              STR      r0,[sp,#4]
000128  e015              B        |L2.342|
                  |L2.298|
;;;282          }
;;;283          else
;;;284          {
;;;285            /* Read the message digest */
;;;286            HASH_GetDigest(&SHA1_MessageDigest);
00012a  a804              ADD      r0,sp,#0x10
00012c  f7fffffe          BL       HASH_GetDigest
;;;287            *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[0]);
000130  9804              LDR      r0,[sp,#0x10]
000132  ba00              REV      r0,r0
000134  6020              STR      r0,[r4,#0]
;;;288            outputaddr+=4;
000136  1d24              ADDS     r4,r4,#4
;;;289            *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[1]);
000138  9805              LDR      r0,[sp,#0x14]
00013a  ba00              REV      r0,r0
00013c  6020              STR      r0,[r4,#0]
;;;290            outputaddr+=4;
00013e  1d24              ADDS     r4,r4,#4
;;;291            *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[2]);
000140  9806              LDR      r0,[sp,#0x18]
000142  ba00              REV      r0,r0
000144  6020              STR      r0,[r4,#0]
;;;292            outputaddr+=4;
000146  1d24              ADDS     r4,r4,#4
;;;293            *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[3]);
000148  9807              LDR      r0,[sp,#0x1c]
00014a  ba00              REV      r0,r0
00014c  6020              STR      r0,[r4,#0]
;;;294            outputaddr+=4;
00014e  1d24              ADDS     r4,r4,#4
;;;295            *(uint32_t*)(outputaddr)  = __REV(SHA1_MessageDigest.Data[4]);
000150  9808              LDR      r0,[sp,#0x20]
000152  ba00              REV      r0,r0
000154  6020              STR      r0,[r4,#0]
                  |L2.342|
;;;296          }
;;;297        }  
;;;298      }
;;;299      return status;  
000156  9801              LDR      r0,[sp,#4]
;;;300    }
000158  b00d              ADD      sp,sp,#0x34
00015a  ecbd8b02          VPOP     {d8}
00015e  b004              ADD      sp,sp,#0x10
000160  e8bd8ff0          POP      {r4-r11,pc}
;;;301    /**
                          ENDP


;*** Start embedded assembler ***

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

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE, READONLY
	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 ***
