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

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

                  HASH_MD5 PROC
;;;86       */
;;;87     ErrorStatus HASH_MD5(uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
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 MD5_HASH_InitStructure;
;;;90       HASH_MsgDigest MD5_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     
;;;100      /* Number of valid bits in last word of the Input data */
;;;101      nbvalidbitsdata = 8 * (Ilen % 4);
00001e  07a8              LSLS     r0,r5,#30
000020  0ec0              LSRS     r0,r0,#27
000022  9001              STR      r0,[sp,#4]
;;;102    
;;;103      /* HASH peripheral initialization */
;;;104      HASH_DeInit();
000024  f7fffffe          BL       HASH_DeInit
;;;105    
;;;106      /* HASH Configuration */
;;;107      MD5_HASH_InitStructure.HASH_AlgoSelection = HASH_AlgoSelection_MD5;
000028  2080              MOVS     r0,#0x80
00002a  9007              STR      r0,[sp,#0x1c]
;;;108      MD5_HASH_InitStructure.HASH_AlgoMode = HASH_AlgoMode_HASH;
00002c  2000              MOVS     r0,#0
00002e  9008              STR      r0,[sp,#0x20]
;;;109      MD5_HASH_InitStructure.HASH_DataType = HASH_DataType_8b;
000030  2020              MOVS     r0,#0x20
000032  9009              STR      r0,[sp,#0x24]
;;;110      HASH_Init(&MD5_HASH_InitStructure);
000034  a807              ADD      r0,sp,#0x1c
000036  f7fffffe          BL       HASH_Init
;;;111    
;;;112      /* Configure the number of valid bits in last word of the data */
;;;113      HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
00003a  9801              LDR      r0,[sp,#4]
00003c  f7fffffe          BL       HASH_SetLastWordValidBitsNbr
;;;114    
;;;115      /* Write the Input block in the IN FIFO */
;;;116      for(i=0; i<Ilen; i+=4)
000040  bf00              NOP      
000042  e007              B        |L1.84|
                  |L1.68|
;;;117      {
;;;118        HASH_DataIn(*(uint32_t*)inputaddr);
000044  f8db0000          LDR      r0,[r11,#0]
000048  f7fffffe          BL       HASH_DataIn
;;;119        inputaddr+=4;
00004c  f10b0b04          ADD      r11,r11,#4
000050  f10a0a04          ADD      r10,r10,#4            ;116
                  |L1.84|
000054  45aa              CMP      r10,r5                ;116
000056  d3f5              BCC      |L1.68|
;;;120      }
;;;121    
;;;122      /* Start the HASH processor */
;;;123      HASH_StartDigest();
000058  f7fffffe          BL       HASH_StartDigest
;;;124    
;;;125      /* wait until the Busy flag is RESET */
;;;126      do
00005c  bf00              NOP      
                  |L1.94|
;;;127      {
;;;128        busystatus = HASH_GetFlagStatus(HASH_FLAG_BUSY);
00005e  2008              MOVS     r0,#8
000060  f7fffffe          BL       HASH_GetFlagStatus
000064  4681              MOV      r9,r0
;;;129        counter++;
000066  f1080801          ADD      r8,r8,#1
;;;130      }while ((counter != MD5BUSY_TIMEOUT) && (busystatus != RESET));
00006a  f5b83f80          CMP      r8,#0x10000
00006e  d002              BEQ      |L1.118|
000070  f1b90f00          CMP      r9,#0
000074  d1f3              BNE      |L1.94|
                  |L1.118|
;;;131    
;;;132      if (busystatus != RESET)
000076  f1b90f00          CMP      r9,#0
00007a  d002              BEQ      |L1.130|
;;;133      {
;;;134         status = ERROR;
00007c  2000              MOVS     r0,#0
00007e  9000              STR      r0,[sp,#0]
000080  e011              B        |L1.166|
                  |L1.130|
;;;135      }
;;;136      else
;;;137      {
;;;138        /* Read the message digest */
;;;139        HASH_GetDigest(&MD5_MessageDigest);
000082  a802              ADD      r0,sp,#8
000084  f7fffffe          BL       HASH_GetDigest
;;;140        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[0]);
000088  9802              LDR      r0,[sp,#8]
00008a  ba00              REV      r0,r0
00008c  6020              STR      r0,[r4,#0]
;;;141        outputaddr+=4;
00008e  1d24              ADDS     r4,r4,#4
;;;142        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[1]);
000090  9803              LDR      r0,[sp,#0xc]
000092  ba00              REV      r0,r0
000094  6020              STR      r0,[r4,#0]
;;;143        outputaddr+=4;
000096  1d24              ADDS     r4,r4,#4
;;;144        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[2]);
000098  9804              LDR      r0,[sp,#0x10]
00009a  ba00              REV      r0,r0
00009c  6020              STR      r0,[r4,#0]
;;;145        outputaddr+=4;
00009e  1d24              ADDS     r4,r4,#4
;;;146        *(uint32_t*)(outputaddr)  = __REV(MD5_MessageDigest.Data[3]);
0000a0  9805              LDR      r0,[sp,#0x14]
0000a2  ba00              REV      r0,r0
0000a4  6020              STR      r0,[r4,#0]
                  |L1.166|
;;;147      }
;;;148      return status; 
0000a6  9800              LDR      r0,[sp,#0]
;;;149    }
0000a8  b00b              ADD      sp,sp,#0x2c
0000aa  e8bd8ff0          POP      {r4-r11,pc}
;;;150    
                          ENDP


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

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


;*** Start embedded assembler ***

#line 1 "..\\..\\..\\Libraries\\STM32F4xx_StdPeriph_Driver\\src\\stm32f4xx_hash_md5.c"
	AREA ||.rev16_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___20_stm32f4xx_hash_md5_c_HASH_MD5____REV16|
#line 114 "C:\\Keil\\ARM\\CMSIS\\Include\\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, READONLY
	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 ***
