RTEMS-6
Annotated Report
libmd
Sun Feb 28 12:44:06 2021

40005850 <MD5Final>:                                                                      
  in[14] = mdContext->i[0];                                                               
40005850:   0005a783            lw  a5,0(a1)                                              
  in[15] = mdContext->i[1];                                                               
40005854:   0045a703            lw  a4,4(a1)                                              
{                                                                                         
40005858:   fa010113            addi    sp,sp,-96                                         
  mdi = (int)((mdContext->i[0] >> 3) & 0x3F);                                             
4000585c:   0037d613            srli    a2,a5,0x3                                         
{                                                                                         
40005860:   04812c23            sw  s0,88(sp)                                             
40005864:   05212823            sw  s2,80(sp)                                             
  in[14] = mdContext->i[0];                                                               
40005868:   02f12c23            sw  a5,56(sp)                                             
{                                                                                         
4000586c:   04112e23            sw  ra,92(sp)                                             
40005870:   04912a23            sw  s1,84(sp)                                             
40005874:   05312623            sw  s3,76(sp)                                             
  in[15] = mdContext->i[1];                                                               
40005878:   02e12e23            sw  a4,60(sp)                                             
  mdi = (int)((mdContext->i[0] >> 3) & 0x3F);                                             
4000587c:   03f67613            andi    a2,a2,63                                          
  padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);                                         
40005880:   03700793            li  a5,55                                                 
{                                                                                         
40005884:   00058913            mv  s2,a1                                                 
40005888:   00050413            mv  s0,a0                                                 
  padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);                                         
4000588c:   0cc7c463            blt a5,a2,40005954 <MD5Final+0x104>                       
40005890:   03800793            li  a5,56                                                 
40005894:   40c78633            sub a2,a5,a2                                              
  MD5Update (mdContext, PADDING, padLen);                                                 
40005898:   400245b7            lui a1,0x40024                                            
4000589c:   66c58593            addi    a1,a1,1644 # 4002466c <PADDING>                   
400058a0:   00090513            mv  a0,s2                                                 
400058a4:   ea9ff0ef            jal ra,4000574c <MD5Update>                               
  for (i = 0, ii = 0; i < 14; i++, ii += 4)                                               
400058a8:   01890993            addi    s3,s2,24                                          
400058ac:   00098713            mv  a4,s3                                                 
400058b0:   00010693            mv  a3,sp                                                 
400058b4:   03810313            addi    t1,sp,56                                          
    in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                        
400058b8:   00374783            lbu a5,3(a4)                                              
            (((UINT4)mdContext->in[ii+2]) << 16) |                                        
400058bc:   00274803            lbu a6,2(a4)                                              
            ((UINT4)mdContext->in[ii]);                                                   
400058c0:   00074883            lbu a7,0(a4)                                              
            (((UINT4)mdContext->in[ii+1]) << 8) |                                         
400058c4:   00174603            lbu a2,1(a4)                                              
    in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                        
400058c8:   01879793            slli    a5,a5,0x18                                        
            (((UINT4)mdContext->in[ii+2]) << 16) |                                        
400058cc:   01081813            slli    a6,a6,0x10                                        
    in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                        
400058d0:   0107e7b3            or  a5,a5,a6                                              
            (((UINT4)mdContext->in[ii+1]) << 8) |                                         
400058d4:   0117e7b3            or  a5,a5,a7                                              
400058d8:   00861613            slli    a2,a2,0x8                                         
400058dc:   00c7e7b3            or  a5,a5,a2                                              
    in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                        
400058e0:   00f6a023            sw  a5,0(a3)                                              
  for (i = 0, ii = 0; i < 14; i++, ii += 4)                                               
400058e4:   00468693            addi    a3,a3,4                                           
400058e8:   00470713            addi    a4,a4,4                                           
400058ec:   fcd316e3            bne t1,a3,400058b8 <MD5Final+0x68>                        
  Transform (mdContext->buf, in);                                                         
400058f0:   00890513            addi    a0,s2,8                                           
400058f4:   00010593            mv  a1,sp                                                 
400058f8:   00050493            mv  s1,a0                                                 
400058fc:   978ff0ef            jal ra,40004a74 <Transform>                               
  for (i = 0, ii = 0; i < 4; i++, ii += 4) {                                              
40005900:   00048513            mv  a0,s1                                                 
    mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF);                    
40005904:   00052783            lw  a5,0(a0)                                              
  for (i = 0, ii = 0; i < 4; i++, ii += 4) {                                              
40005908:   00450513            addi    a0,a0,4                                           
      (unsigned char)((mdContext->buf[i] >> 8) & 0xFF);                                   
4000590c:   0087d613            srli    a2,a5,0x8                                         
      (unsigned char)((mdContext->buf[i] >> 16) & 0xFF);                                  
40005910:   0107d693            srli    a3,a5,0x10                                        
      (unsigned char)((mdContext->buf[i] >> 24) & 0xFF);                                  
40005914:   0187d713            srli    a4,a5,0x18                                        
      (unsigned char)((mdContext->buf[i] >> 8) & 0xFF);                                   
40005918:   04c506a3            sb  a2,77(a0)                                             
      (unsigned char)((mdContext->buf[i] >> 16) & 0xFF);                                  
4000591c:   04d50723            sb  a3,78(a0)                                             
      (unsigned char)((mdContext->buf[i] >> 24) & 0xFF);                                  
40005920:   04e507a3            sb  a4,79(a0)                                             
    mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF);                    
40005924:   04f50623            sb  a5,76(a0)                                             
  for (i = 0, ii = 0; i < 4; i++, ii += 4) {                                              
40005928:   fca99ee3            bne s3,a0,40005904 <MD5Final+0xb4>                        
  memcpy(hash, mdContext->digest, 16);                                                    
4000592c:   00040513            mv  a0,s0                                                 
}                                                                                         
40005930:   05812403            lw  s0,88(sp)                                             
40005934:   05c12083            lw  ra,92(sp)                                             
40005938:   05412483            lw  s1,84(sp)                                             
4000593c:   04c12983            lw  s3,76(sp)                                             
  memcpy(hash, mdContext->digest, 16);                                                    
40005940:   05890593            addi    a1,s2,88                                          
}                                                                                         
40005944:   05012903            lw  s2,80(sp)                                             
  memcpy(hash, mdContext->digest, 16);                                                    
40005948:   01000613            li  a2,16                                                 
}                                                                                         
4000594c:   06010113            addi    sp,sp,96                                          
  memcpy(hash, mdContext->digest, 16);                                                    
40005950:   7d41506f            j   4001b124 <memcpy>                                     
  padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);                                         
40005954:   07800793            li  a5,120                                                <== NOT EXECUTED
40005958:   40c78633            sub a2,a5,a2                                              <== NOT EXECUTED
4000595c:   f3dff06f            j   40005898 <MD5Final+0x48>                              <== NOT EXECUTED
                                                                                          

4000574c <MD5Update>: mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
4000574c:   00052783            lw  a5,0(a0)                                              
{                                                                                         
40005750:   fa010113            addi    sp,sp,-96                                         
40005754:   05212823            sw  s2,80(sp)                                             
  if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0])                          
40005758:   00361713            slli    a4,a2,0x3                                         
{                                                                                         
4000575c:   00050913            mv  s2,a0                                                 
    mdContext->i[1]++;                                                                    
40005760:   00452503            lw  a0,4(a0)                                              
  if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0])                          
40005764:   00f70733            add a4,a4,a5                                              
    mdContext->i[1]++;                                                                    
40005768:   00f736b3            sltu    a3,a4,a5                                          
4000576c:   00d50533            add a0,a0,a3                                              
  mdContext->i[1] += ((UINT4)inLen >> 29);                                                
40005770:   01d65693            srli    a3,a2,0x1d                                        
{                                                                                         
40005774:   05312623            sw  s3,76(sp)                                             
40005778:   04112e23            sw  ra,92(sp)                                             
4000577c:   04812c23            sw  s0,88(sp)                                             
40005780:   04912a23            sw  s1,84(sp)                                             
40005784:   05412423            sw  s4,72(sp)                                             
40005788:   05512223            sw  s5,68(sp)                                             
  mdContext->i[1] += ((UINT4)inLen >> 29);                                                
4000578c:   00a686b3            add a3,a3,a0                                              
  mdContext->i[0] += ((UINT4)inLen << 3);                                                 
40005790:   00e92023            sw  a4,0(s2)                                              
  mdContext->i[1] += ((UINT4)inLen >> 29);                                                
40005794:   00d92223            sw  a3,4(s2)                                              
  while (inLen--) {                                                                       
40005798:   00c589b3            add s3,a1,a2                                              
4000579c:   02060c63            beqz    a2,400057d4 <MD5Update+0x88>                      <== NEVER TAKEN
400057a0:   0037d793            srli    a5,a5,0x3                                         
400057a4:   00058413            mv  s0,a1                                                 
400057a8:   03f7f793            andi    a5,a5,63                                          
    if (mdi == 0x40) {                                                                    
400057ac:   04000a13            li  s4,64                                                 
400057b0:   04010493            addi    s1,sp,64                                          
      Transform (mdContext->buf, in);                                                     
400057b4:   00890a93            addi    s5,s2,8                                           
    mdContext->in[mdi++] = *inBuf++;                                                      
400057b8:   00044683            lbu a3,0(s0)                                              
400057bc:   00f90733            add a4,s2,a5                                              
400057c0:   00178793            addi    a5,a5,1                                           
400057c4:   00d70c23            sb  a3,24(a4)                                             
400057c8:   00140413            addi    s0,s0,1                                           
    if (mdi == 0x40) {                                                                    
400057cc:   03478663            beq a5,s4,400057f8 <MD5Update+0xac>                       
  while (inLen--) {                                                                       
400057d0:   ff3414e3            bne s0,s3,400057b8 <MD5Update+0x6c>                       
}                                                                                         
400057d4:   05c12083            lw  ra,92(sp)                                             
400057d8:   05812403            lw  s0,88(sp)                                             
400057dc:   05412483            lw  s1,84(sp)                                             
400057e0:   05012903            lw  s2,80(sp)                                             
400057e4:   04c12983            lw  s3,76(sp)                                             
400057e8:   04812a03            lw  s4,72(sp)                                             
400057ec:   04412a83            lw  s5,68(sp)                                             
400057f0:   06010113            addi    sp,sp,96                                          
400057f4:   00008067            ret                                                       
400057f8:   01890713            addi    a4,s2,24                                          
400057fc:   00010693            mv  a3,sp                                                 
        in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                    
40005800:   00374783            lbu a5,3(a4)                                              
                (((UINT4)mdContext->in[ii+2]) << 16) |                                    
40005804:   00274803            lbu a6,2(a4)                                              
                ((UINT4)mdContext->in[ii]);                                               
40005808:   00074883            lbu a7,0(a4)                                              
                (((UINT4)mdContext->in[ii+1]) << 8) |                                     
4000580c:   00174603            lbu a2,1(a4)                                              
        in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                    
40005810:   01879793            slli    a5,a5,0x18                                        
                (((UINT4)mdContext->in[ii+2]) << 16) |                                    
40005814:   01081813            slli    a6,a6,0x10                                        
        in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                    
40005818:   0107e7b3            or  a5,a5,a6                                              
                (((UINT4)mdContext->in[ii+1]) << 8) |                                     
4000581c:   0117e7b3            or  a5,a5,a7                                              
40005820:   00861613            slli    a2,a2,0x8                                         
40005824:   00c7e7b3            or  a5,a5,a2                                              
        in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |                                    
40005828:   00f6a023            sw  a5,0(a3)                                              
      for (i = 0, ii = 0; i < 16; i++, ii += 4)                                           
4000582c:   00468693            addi    a3,a3,4                                           
40005830:   00470713            addi    a4,a4,4                                           
40005834:   fcd496e3            bne s1,a3,40005800 <MD5Update+0xb4>                       
      Transform (mdContext->buf, in);                                                     
40005838:   00010593            mv  a1,sp                                                 
4000583c:   000a8513            mv  a0,s5                                                 
40005840:   a34ff0ef            jal ra,40004a74 <Transform>                               
      mdi = 0;                                                                            
40005844:   00000793            li  a5,0                                                  
  while (inLen--) {                                                                       
40005848:   f73418e3            bne s0,s3,400057b8 <MD5Update+0x6c>                       
4000584c:   f89ff06f            j   400057d4 <MD5Update+0x88>                             
                                                                                          

400112c8 <SHA512_Update>: uint64_t bitlen[2]; uint64_t r; const unsigned char *src = in; /* Number of bytes left in the buffer from previous updates */ r = (ctx->count[1] >> 3) & 0x7f;
400112c8:   04852783            lw  a5,72(a0)                                             
400112cc:   04c52683            lw  a3,76(a0)                                             
{                                                                                         
400112d0:   fe010113            addi    sp,sp,-32                                         
                                                                                          
    /* Convert the length into a number of bits */                                        
    bitlen[1] = ((uint64_t)len) << 3;                                                     
400112d4:   00361813            slli    a6,a2,0x3                                         
{                                                                                         
400112d8:   00912a23            sw  s1,20(sp)                                             
400112dc:   01312623            sw  s3,12(sp)                                             
400112e0:   00050493            mv  s1,a0                                                 
400112e4:   00060993            mv  s3,a2                                                 
    bitlen[0] = ((uint64_t)len) >> 61;                                                    
                                                                                          
    /* Update number of bits */                                                           
    if ((ctx->count[1] += bitlen[1]) < bitlen[1])                                         
400112e8:   01078533            add a0,a5,a6                                              
    bitlen[1] = ((uint64_t)len) << 3;                                                     
400112ec:   01d65613            srli    a2,a2,0x1d                                        
    if ((ctx->count[1] += bitlen[1]) < bitlen[1])                                         
400112f0:   00f53733            sltu    a4,a0,a5                                          
400112f4:   00c686b3            add a3,a3,a2                                              
{                                                                                         
400112f8:   00812c23            sw  s0,24(sp)                                             
400112fc:   01212823            sw  s2,16(sp)                                             
40011300:   00112e23            sw  ra,28(sp)                                             
40011304:   01412423            sw  s4,8(sp)                                              
40011308:   01512223            sw  s5,4(sp)                                              
    if ((ctx->count[1] += bitlen[1]) < bitlen[1])                                         
4001130c:   00d70733            add a4,a4,a3                                              
    r = (ctx->count[1] >> 3) & 0x7f;                                                      
40011310:   0037d913            srli    s2,a5,0x3                                         
    if ((ctx->count[1] += bitlen[1]) < bitlen[1])                                         
40011314:   04a4a423            sw  a0,72(s1)                                             
40011318:   04e4a623            sw  a4,76(s1)                                             
{                                                                                         
4001131c:   00058413            mv  s0,a1                                                 
    r = (ctx->count[1] >> 3) & 0x7f;                                                      
40011320:   07f97913            andi    s2,s2,127                                         
    if ((ctx->count[1] += bitlen[1]) < bitlen[1])                                         
40011324:   0ac76663            bltu    a4,a2,400113d0 <SHA512_Update+0x108>              
40011328:   0ae60263            beq a2,a4,400113cc <SHA512_Update+0x104>                  
        ctx->count[0]++;                                                                  
    ctx->count[0] += bitlen[0];                                                           
                                                                                          
    /* Handle the case where we don't need to perform any transforms */                   
    if (len < 128 - r) {                                                                  
4001132c:   08000793            li  a5,128                                                
        memcpy(&ctx->buf[r], src, len);                                                   
40011330:   05090513            addi    a0,s2,80                                          
    if (len < 128 - r) {                                                                  
40011334:   41278ab3            sub s5,a5,s2                                              
        memcpy(&ctx->buf[r], src, len);                                                   
40011338:   00a48533            add a0,s1,a0                                              
    if (len < 128 - r) {                                                                  
4001133c:   0d57e263            bltu    a5,s5,40011400 <SHA512_Update+0x138>              
40011340:   0d59e063            bltu    s3,s5,40011400 <SHA512_Update+0x138>              
        return;                                                                           
    }                                                                                     
                                                                                          
    /* Finish the current block */                                                        
    memcpy(&ctx->buf[r], src, 128 - r);                                                   
40011344:   00040593            mv  a1,s0                                                 
40011348:   000a8613            mv  a2,s5                                                 
4001134c:   5d9090ef            jal ra,4001b124 <memcpy>                                  
    SHA512_Transform(ctx->state, ctx->buf);                                               
40011350:   05048a13            addi    s4,s1,80                                          
40011354:   000a0593            mv  a1,s4                                                 
40011358:   00048513            mv  a0,s1                                                 
4001135c:   938f70ef            jal ra,40008494 <SHA512_Transform>                        
    src += 128 - r;                                                                       
40011360:   f8098993            addi    s3,s3,-128                                        
    len -= 128 - r;                                                                       
40011364:   01390933            add s2,s2,s3                                              
                                                                                          
    /* Perform complete blocks */                                                         
    while (len >= 128) {                                                                  
40011368:   07f00793            li  a5,127                                                
    src += 128 - r;                                                                       
4001136c:   01540433            add s0,s0,s5                                              
    while (len >= 128) {                                                                  
40011370:   0927fe63            bgeu    a5,s2,4001140c <SHA512_Update+0x144>              
40011374:   f8090993            addi    s3,s2,-128                                        <== NOT EXECUTED
40011378:   f809f993            andi    s3,s3,-128                                        <== NOT EXECUTED
4001137c:   08098993            addi    s3,s3,128                                         <== NOT EXECUTED
40011380:   013409b3            add s3,s0,s3                                              <== NOT EXECUTED
        SHA512_Transform(ctx->state, src);                                                
40011384:   00040593            mv  a1,s0                                                 <== NOT EXECUTED
40011388:   00048513            mv  a0,s1                                                 <== NOT EXECUTED
        src += 128;                                                                       
4001138c:   08040413            addi    s0,s0,128                                         <== NOT EXECUTED
        SHA512_Transform(ctx->state, src);                                                
40011390:   904f70ef            jal ra,40008494 <SHA512_Transform>                        <== NOT EXECUTED
    while (len >= 128) {                                                                  
40011394:   ff3418e3            bne s0,s3,40011384 <SHA512_Update+0xbc>                   <== NOT EXECUTED
        len -= 128;                                                                       
40011398:   07f97913            andi    s2,s2,127                                         <== NOT EXECUTED
    }                                                                                     
                                                                                          
    /* Copy left over data into buffer */                                                 
    memcpy(ctx->buf, src, len);                                                           
4001139c:   00090613            mv  a2,s2                                                 
400113a0:   00098593            mv  a1,s3                                                 
400113a4:   000a0513            mv  a0,s4                                                 
}                                                                                         
400113a8:   01812403            lw  s0,24(sp)                                             
400113ac:   01c12083            lw  ra,28(sp)                                             
400113b0:   01412483            lw  s1,20(sp)                                             
400113b4:   01012903            lw  s2,16(sp)                                             
400113b8:   00c12983            lw  s3,12(sp)                                             
400113bc:   00812a03            lw  s4,8(sp)                                              
400113c0:   00412a83            lw  s5,4(sp)                                              
400113c4:   02010113            addi    sp,sp,32                                          
    memcpy(ctx->buf, src, len);                                                           
400113c8:   55d0906f            j   4001b124 <memcpy>                                     
    if ((ctx->count[1] += bitlen[1]) < bitlen[1])                                         
400113cc:   f70570e3            bgeu    a0,a6,4001132c <SHA512_Update+0x64>               
        ctx->count[0]++;                                                                  
400113d0:   0404a783            lw  a5,64(s1)                                             <== NOT EXECUTED
400113d4:   0444a683            lw  a3,68(s1)                                             <== NOT EXECUTED
        memcpy(&ctx->buf[r], src, len);                                                   
400113d8:   05090513            addi    a0,s2,80                                          <== NOT EXECUTED
        ctx->count[0]++;                                                                  
400113dc:   00178713            addi    a4,a5,1                                           <== NOT EXECUTED
400113e0:   00f737b3            sltu    a5,a4,a5                                          <== NOT EXECUTED
400113e4:   00d787b3            add a5,a5,a3                                              <== NOT EXECUTED
400113e8:   04f4a223            sw  a5,68(s1)                                             <== NOT EXECUTED
    if (len < 128 - r) {                                                                  
400113ec:   08000793            li  a5,128                                                <== NOT EXECUTED
        ctx->count[0]++;                                                                  
400113f0:   04e4a023            sw  a4,64(s1)                                             <== NOT EXECUTED
    if (len < 128 - r) {                                                                  
400113f4:   41278ab3            sub s5,a5,s2                                              <== NOT EXECUTED
        memcpy(&ctx->buf[r], src, len);                                                   
400113f8:   00a48533            add a0,s1,a0                                              <== NOT EXECUTED
    if (len < 128 - r) {                                                                  
400113fc:   f557f2e3            bgeu    a5,s5,40011340 <SHA512_Update+0x78>               <== NOT EXECUTED
        memcpy(&ctx->buf[r], src, len);                                                   
40011400:   00098613            mv  a2,s3                                                 
40011404:   00040593            mv  a1,s0                                                 
40011408:   fa1ff06f            j   400113a8 <SHA512_Update+0xe0>                         
    src += 128 - r;                                                                       
4001140c:   00040993            mv  s3,s0                                                 
40011410:   f8dff06f            j   4001139c <SHA512_Update+0xd4>