libraries/WM_Libraries/Platform/Common/crypto/wm_crypto_hard.c
void tls_crypto_md5_update(psDigestContext_t *md, const unsigned char *buf, u32 len)
{
	u32 n;

	while (len > 0) {
		n = min(len, (64 - md->md5.curlen));
		memcpy(md->md5.buf + md->md5.curlen, buf, (size_t)n);
		md->md5.curlen	+= n;
		buf				+= n;
		len				-= n;

/*
		is 64 bytes full?
 */
		if (md->md5.curlen == 64) {
			hd_md5_compress(md);
#ifdef HAVE_NATIVE_INT64
			md->md5.length += 512;
#else
			n = (md->md5.lengthLo + 512) & 0xFFFFFFFFL;
			if (n < md->md5.lengthLo) {
				md->md5.lengthHi++;
			}
			md->md5.lengthLo = n;
#endif /* HAVE_NATIVE_INT64 */
			md->md5.curlen = 0;
		}
	}
}
/**
 * @brief			Process a message block using MD5 algorithm.
 *				This function performs a MD5 block update operation. It continues an MD5 message-digest operation,
 *				by processing InputLen-byte length message block pointed to by buf, and by updating the MD5 context pointed to by md. 
 *				This function may be called as many times as necessary, so the message may be processed in blocks.
 *
 * @param[in]		md		MD5 Digest Context. 
 * @param[in]  	buf 		InputLen-byte length message block
 * @param[in]  	len 		The buf 's length 
 *
 * @return		None
 *
 * @note			None
 */
@brief                       Process a message block using MD5 algorithm.
This function performs a MD5 block update operation. It continues an MD5 message-digest operation,
by processing InputLen-byte length message block pointed to by buf, and by updating the MD5 context pointed to by md.
This function may be called as many times as necessary, so the message may be processed in blocks.

@param[in]           md              MD5 Digest Context.
@param[in]   buf             InputLen-byte length message block
@param[in]   len             The buf 's length

@return              None

@note                        None
@brief Process a message block using MD5 algorithm . This function performs a MD5 block update operation . It continues an MD5 message - digest operation by processing InputLen - byte length message block pointed to by buf and by updating the MD5 context pointed to by md . This function may be called as many times as necessary so the message may be processed in blocks . @param [ in ] md MD5 Digest Context . @param [ in ] buf InputLen - byte length message block @param [ in ] len The buf ' s length @return None @note None
void tls_crypto_md5_update(psDigestContext_t *md, const unsigned char *buf, u32 len)
{
	u32 n;
	while (len > 0) {
		n = min(len, (64 - md->md5.curlen));
		memcpy(md->md5.buf + md->md5.curlen, buf, (size_t)n);
		md->md5.curlen	+= n;
		buf				+= n;
		len				-= n;
		if (md->md5.curlen == 64) {
			hd_md5_compress(md);
#ifdef HAVE_NATIVE_INT64
			md->md5.length += 512;
#else
			n = (md->md5.lengthLo + 512) & 0xFFFFFFFFL;
			if (n < md->md5.lengthLo) {
				md->md5.lengthHi++;
			}
			md->md5.lengthLo = n;
#endif 
			md->md5.curlen = 0;
		}
	}
}
void tls_crypto_md5_update ( psDigestContext_t * md , const unsigned char * buf , u32 len ) { u32 n ; while ( len > 0 ) { n = min ( len , ( 64 - md -> md5 . curlen ) ) ; memcpy ( md -> md5 . buf + md -> md5 . curlen , buf , ( size_t ) n ) ; md -> md5 . curlen += n ; buf += n ; len -= n ; if ( md -> md5 . curlen == 64 ) { hd_md5_compress ( md ) ; #ifdef HAVE_NATIVE_INT64 md -> md5 . length += 512 ; #else n = ( md -> md5 . lengthLo + 512 ) & 0xFFFFFFFFL ; if ( n < md -> md5 . lengthLo ) { md -> md5 . lengthHi ++ ; } md -> md5 . lengthLo = n ; #endif md -> md5 . curlen = 0 ; } } }
@brief                       Process a message block using MD5 algorithm.
@brief Process a message block using MD5 algorithm .
/*
		is 64 bytes full?
 */ /* HAVE_NATIVE_INT64 */