src/sha_dev.js
function roundSHA1(block, H)
	{
		var W = [], a, b, c, d, e, T, ch = ch_32, parity = parity_32,
			maj = maj_32, rotl = rotl_32, safeAdd_2 = safeAdd_32_2, t,
			safeAdd_5 = safeAdd_32_5;

		a = H[0];
		b = H[1];
		c = H[2];
		d = H[3];
		e = H[4];

		for (t = 0; t < 80; t += 1)
		{
			if (t < 16)
			{
				W[t] = block[t];
			}
			else
			{
				W[t] = rotl(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
			}

			if (t < 20)
			{
				T = safeAdd_5(rotl(a, 5), ch(b, c, d), e, 0x5a827999, W[t]);
			}
			else if (t < 40)
			{
				T = safeAdd_5(rotl(a, 5), parity(b, c, d), e, 0x6ed9eba1, W[t]);
			}
			else if (t < 60)
			{
				T = safeAdd_5(rotl(a, 5), maj(b, c, d), e, 0x8f1bbcdc, W[t]);
			} else {
				T = safeAdd_5(rotl(a, 5), parity(b, c, d), e, 0xca62c1d6, W[t]);
			}

			e = d;
			d = c;
			c = rotl(b, 30);
			b = a;
			a = T;
		}

		H[0] = safeAdd_2(a, H[0]);
		H[1] = safeAdd_2(b, H[1]);
		H[2] = safeAdd_2(c, H[2]);
		H[3] = safeAdd_2(d, H[3]);
		H[4] = safeAdd_2(e, H[4]);

		return H;
	}
function roundSHA1(block, H)
	{
		var W = [], a, b, c, d, e, T, ch = ch_32, parity = parity_32,
			maj = maj_32, rotl = rotl_32, safeAdd_2 = safeAdd_32_2, t,
			safeAdd_5 = safeAdd_32_5;

		a = H[0];
		b = H[1];
		c = H[2];
		d = H[3];
		e = H[4];

		for (t = 0; t < 80; t += 1)
		{
			if (t < 16)
			{
				W[t] = block[t];
			}
			else
			{
				W[t] = rotl(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
			}

			if (t < 20)
			{
				T = safeAdd_5(rotl(a, 5), ch(b, c, d), e, 0x5a827999, W[t]);
			}
			else if (t < 40)
			{
				T = safeAdd_5(rotl(a, 5), parity(b, c, d), e, 0x6ed9eba1, W[t]);
			}
			else if (t < 60)
			{
				T = safeAdd_5(rotl(a, 5), maj(b, c, d), e, 0x8f1bbcdc, W[t]);
			} else {
				T = safeAdd_5(rotl(a, 5), parity(b, c, d), e, 0xca62c1d6, W[t]);
			}

			e = d;
			d = c;
			c = rotl(b, 30);
			b = a;
			a = T;
		}

		H[0] = safeAdd_2(a, H[0]);
		H[1] = safeAdd_2(b, H[1]);
		H[2] = safeAdd_2(c, H[2]);
		H[3] = safeAdd_2(d, H[3]);
		H[4] = safeAdd_2(e, H[4]);

		return H;
	}
function roundSHA1 ( block , H ) { var W = [ ] , a , b , c , d , e , T , ch = ch_32 , parity = parity_32 , maj = maj_32 , rotl = rotl_32 , safeAdd_2 = safeAdd_32_2 , t , safeAdd_5 = safeAdd_32_5 ; a = H [ 0 ] ; b = H [ 1 ] ; c = H [ 2 ] ; d = H [ 3 ] ; e = H [ 4 ] ; for ( t = 0 ; t < 80 ; t += 1 ) { if ( t < 16 ) { W [ t ] = block [ t ] ; } else { W [ t ] = rotl ( W [ t - 3 ] ^ W [ t - 8 ] ^ W [ t - 14 ] ^ W [ t - 16 ] , 1 ) ; } if ( t < 20 ) { T = safeAdd_5 ( rotl ( a , 5 ) , ch ( b , c , d ) , e , 0x5a827999 , W [ t ] ) ; } else if ( t < 40 ) { T = safeAdd_5 ( rotl ( a , 5 ) , parity ( b , c , d ) , e , 0x6ed9eba1 , W [ t ] ) ; } else if ( t < 60 ) { T = safeAdd_5 ( rotl ( a , 5 ) , maj ( b , c , d ) , e , 0x8f1bbcdc , W [ t ] ) ; } else { T = safeAdd_5 ( rotl ( a , 5 ) , parity ( b , c , d ) , e , 0xca62c1d6 , W [ t ] ) ; } e = d ; d = c ; c = rotl ( b , 30 ) ; b = a ; a = T ; } H [ 0 ] = safeAdd_2 ( a , H [ 0 ] ) ; H [ 1 ] = safeAdd_2 ( b , H [ 1 ] ) ; H [ 2 ] = safeAdd_2 ( c , H [ 2 ] ) ; H [ 3 ] = safeAdd_2 ( d , H [ 3 ] ) ; H [ 4 ] = safeAdd_2 ( e , H [ 4 ] ) ; return H ; }
Performs a round of SHA-1 hashing over a 512-byte block

@private
@param {Array<number>} block The binary array representation of the
block to hash
@param {Array<number>} H The intermediate H values from a previous
round
@return {Array<number>} The resulting H values
Performs a round of SHA - 1 hashing over a 512 - byte block