/* Accepts an array of octets as the next portion of the message.  */
EXP_FUNC void STDCALL ICACHE_FLASH_ATTR MD5_Update(MD5_CTX *ctx, const uint8_t *msg, int len)
/* Accepts an array of octets as the next portion of the message.  */
EXP_FUNC void STDCALL ICACHE_FLASH_ATTR MD5_Update(MD5_CTX *ctx, const uint8_t *msg, int len)
{
    uint32_t x;
    int i, partLen;
    x = (uint32_t)((ctx->count[0] >> 3) & 0x3F);
    if ((ctx->count[0] += ((uint32_t)len << 3)) < ((uint32_t)len << 3))
        ctx->count[1]++;
    ctx->count[1] += ((uint32_t)len >> 29);
    partLen = 64 - x;
    if (len >= partLen) 
    {
        memcpy(&ctx->buffer[x], msg, partLen);
        MD5Transform(ctx->state, ctx->buffer);
        for (i = partLen; i + 63 < len; i += 64)
            MD5Transform(ctx->state, &msg[i]);
        x = 0;
    }
    else
        i = 0;
    memcpy(&ctx->buffer[x], &msg[i], len-i);
}