libraries/WM_Libraries/Platform/Common/crypto/wm_crypto_hard.c
void tls_crypto_sha1_update(psDigestContext_t * md, const unsigned char *buf, u32 len)
{
	u32 n;
	while (len > 0) {
		n = min(len, (64 - md->sha1.curlen));
		memcpy(md->sha1.buf + md->sha1.curlen, buf, (size_t)n);
		md->sha1.curlen		+= n;
		buf					+= n;
		len					-= n;

		/* is 64 bytes full? */
		if (md->sha1.curlen == 64) {
			hd_sha1_compress(md);
#ifdef HAVE_NATIVE_INT64
			md->sha1.length += 512;
#else
			n = (md->sha1.lengthLo + 512) & 0xFFFFFFFFL;
			if (n < md->sha1.lengthLo) {
				md->sha1.lengthHi++;
			}
			md->sha1.lengthLo = n;
#endif /* HAVE_NATIVE_INT64 */
			md->sha1.curlen = 0;
		}
	}
}
/**
 * @brief			Process a message block using SHA1 algorithm.
 *				This function performs a SHA1 block update operation. It continues an SHA1 message-digest operation, 
 *				by processing InputLen-byte length message block pointed to by buf, and by updating the SHA1 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		Pointer to the SHA1 Digest Context. 
 * @param[in]  	buf 		InputLen-byte length message block
 * @param[in]  	len 		The buf 's length 
 *
 * @returnl		None	
 *
 * @note			None
 */
@brief                       Process a message block using SHA1 algorithm.
This function performs a SHA1 block update operation. It continues an SHA1 message-digest operation,
by processing InputLen-byte length message block pointed to by buf, and by updating the SHA1 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              Pointer to the SHA1 Digest Context.
@param[in]   buf             InputLen-byte length message block
@param[in]   len             The buf 's length

@returnl             None

@note                        None
@brief Process a message block using SHA1 algorithm . This function performs a SHA1 block update operation . It continues an SHA1 message - digest operation by processing InputLen - byte length message block pointed to by buf and by updating the SHA1 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 Pointer to the SHA1 Digest Context . @param [ in ] buf InputLen - byte length message block @param [ in ] len The buf ' s length @returnl None @note None
void tls_crypto_sha1_update(psDigestContext_t * md, const unsigned char *buf, u32 len)
{
	u32 n;
	while (len > 0) {
		n = min(len, (64 - md->sha1.curlen));
		memcpy(md->sha1.buf + md->sha1.curlen, buf, (size_t)n);
		md->sha1.curlen		+= n;
		buf					+= n;
		len					-= n;
		if (md->sha1.curlen == 64) {
			hd_sha1_compress(md);
#ifdef HAVE_NATIVE_INT64
			md->sha1.length += 512;
#else
			n = (md->sha1.lengthLo + 512) & 0xFFFFFFFFL;
			if (n < md->sha1.lengthLo) {
				md->sha1.lengthHi++;
			}
			md->sha1.lengthLo = n;
#endif 
			md->sha1.curlen = 0;
		}
	}
}
void tls_crypto_sha1_update ( psDigestContext_t * md , const unsigned char * buf , u32 len ) { u32 n ; while ( len > 0 ) { n = min ( len , ( 64 - md -> sha1 . curlen ) ) ; memcpy ( md -> sha1 . buf + md -> sha1 . curlen , buf , ( size_t ) n ) ; md -> sha1 . curlen += n ; buf += n ; len -= n ; if ( md -> sha1 . curlen == 64 ) { hd_sha1_compress ( md ) ; #ifdef HAVE_NATIVE_INT64 md -> sha1 . length += 512 ; #else n = ( md -> sha1 . lengthLo + 512 ) & 0xFFFFFFFFL ; if ( n < md -> sha1 . lengthLo ) { md -> sha1 . lengthHi ++ ; } md -> sha1 . lengthLo = n ; #endif md -> sha1 . curlen = 0 ; } } }
@brief                       Process a message block using SHA1 algorithm.
@brief Process a message block using SHA1 algorithm .
/* is 64 bytes full? */ /* HAVE_NATIVE_INT64 */