// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package sha1

import (
	
)

const (
	_K0 = 0x5A827999
	_K1 = 0x6ED9EBA1
	_K2 = 0x8F1BBCDC
	_K3 = 0xCA62C1D6
)

// blockGeneric is a portable, pure Go version of the SHA-1 block step.
// It's used by sha1block_generic.go and tests.
func ( *digest,  []byte) {
	var  [16]uint32

	, , , ,  := .h[0], .h[1], .h[2], .h[3], .h[4]
	for len() >= chunk {
		// Can interlace the computation of w with the
		// rounds below if needed for speed.
		for  := 0;  < 16; ++ {
			 :=  * 4
			[] = uint32([])<<24 | uint32([+1])<<16 | uint32([+2])<<8 | uint32([+3])
		}

		, , , ,  := , , , , 

		// Each of the four 20-iteration rounds
		// differs only in the computation of f and
		// the choice of K (_K0, _K1, etc).
		 := 0
		for ;  < 16; ++ {
			 := & | (^)&
			 := bits.RotateLeft32(, 5) +  +  + [&0xf] + _K0
			, , , ,  = , , bits.RotateLeft32(, 30), , 
		}
		for ;  < 20; ++ {
			 := [(-3)&0xf] ^ [(-8)&0xf] ^ [(-14)&0xf] ^ [()&0xf]
			[&0xf] = bits.RotateLeft32(, 1)

			 := & | (^)&
			 := bits.RotateLeft32(, 5) +  +  + [&0xf] + _K0
			, , , ,  = , , bits.RotateLeft32(, 30), , 
		}
		for ;  < 40; ++ {
			 := [(-3)&0xf] ^ [(-8)&0xf] ^ [(-14)&0xf] ^ [()&0xf]
			[&0xf] = bits.RotateLeft32(, 1)
			 :=  ^  ^ 
			 := bits.RotateLeft32(, 5) +  +  + [&0xf] + _K1
			, , , ,  = , , bits.RotateLeft32(, 30), , 
		}
		for ;  < 60; ++ {
			 := [(-3)&0xf] ^ [(-8)&0xf] ^ [(-14)&0xf] ^ [()&0xf]
			[&0xf] = bits.RotateLeft32(, 1)
			 := (( | ) & ) | ( & )
			 := bits.RotateLeft32(, 5) +  +  + [&0xf] + _K2
			, , , ,  = , , bits.RotateLeft32(, 30), , 
		}
		for ;  < 80; ++ {
			 := [(-3)&0xf] ^ [(-8)&0xf] ^ [(-14)&0xf] ^ [()&0xf]
			[&0xf] = bits.RotateLeft32(, 1)
			 :=  ^  ^ 
			 := bits.RotateLeft32(, 5) +  +  + [&0xf] + _K3
			, , , ,  = , , bits.RotateLeft32(, 30), , 
		}

		 += 
		 += 
		 += 
		 += 
		 += 

		 = [chunk:]
	}

	.h[0], .h[1], .h[2], .h[3], .h[4] = , , , , 
}