GTToolBox/GTEncryption/GTEncryptionMDFive.c
/*MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context.*/
MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context.
MD5 block update operation . Continues an MD5 message - digest operation processing another message block and updating the context .
static void ZX_MD5Update(MD5_CTX *context,unsigned char *input,unsigned int inputLen)
{
    unsigned int i, index, partLen;
    index = (unsigned int)((context->count[0] >> 3) & 0x3F);
    if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))
    {
        context->count[1]++;
    }
    context->count[1] += ((UINT4)inputLen >> 29);
    partLen = 64 - index;
    if(inputLen >= partLen)
    {
        ZX_MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen);
        ZX_MD5Transform (context->state, context->buffer);
        for (i = partLen; i + 63 < inputLen; i += 64)
        {
            ZX_MD5Transform (context->state, &input[i]);
        }
        index = 0;
    }
    else
        i = 0;
    ZX_MD5_memcpy((POINTER)&context->buffer[index], (POINTER)&input[i],inputLen-i);
}
static void ZX_MD5Update ( MD5_CTX * context , unsigned char * input , unsigned int inputLen ) { unsigned int i , index , partLen ; index = ( unsigned int ) ( ( context -> count [ 0 ] >> 3 ) & 0x3F ) ; if ( ( context -> count [ 0 ] += ( ( UINT4 ) inputLen << 3 ) ) < ( ( UINT4 ) inputLen << 3 ) ) { context -> count [ 1 ] ++ ; } context -> count [ 1 ] += ( ( UINT4 ) inputLen >> 29 ) ; partLen = 64 - index ; if ( inputLen >= partLen ) { ZX_MD5_memcpy ( ( POINTER ) & context -> buffer [ index ] , ( POINTER ) input , partLen ) ; ZX_MD5Transform ( context -> state , context -> buffer ) ; for ( i = partLen ; i + 63 < inputLen ; i += 64 ) { ZX_MD5Transform ( context -> state , & input [ i ] ) ; } index = 0 ; } else i = 0 ; ZX_MD5_memcpy ( ( POINTER ) & context -> buffer [ index ] , ( POINTER ) & input [ i ] , inputLen - i ) ; }
MD5 block update operation.
MD5 block update operation .
/* Compute number of bytes mod 64 */ /* Update number of bits */ /* Transform as many times as possible.
     */ /* Buffer remaining input */