Imports #
"internal/cpu"
"crypto"
"crypto/internal/boring"
"crypto/internal/fips140only"
"errors"
"hash"
"internal/byteorder"
"math/bits"
"internal/cpu"
"internal/cpu"
"internal/cpu"
"crypto"
"crypto/internal/boring"
"crypto/internal/fips140only"
"errors"
"hash"
"internal/byteorder"
"math/bits"
"internal/cpu"
"internal/cpu"
The blocksize of SHA-1 in bytes.
const BlockSize = 64The size of a SHA-1 checksum in bytes.
const Size = 20const _K0 = 0x5A827999const _K1 = 0x6ED9EBA1const _K2 = 0x8F1BBCDCconst _K3 = 0xCA62C1D6const chunk = 64const init0 = 0x67452301const init1 = 0xEFCDAB89const init2 = 0x98BADCFEconst init3 = 0x10325476const init4 = 0xC3D2E1F0var k = []uint32{...}const magic = "sha\x01"const marshaledSize = *ast.BinaryExprvar useAVX2 = *ast.BinaryExprvar useAsm = cpu.S390X.HasSHA1digest represents the partial evaluation of a checksum.
type digest struct {
h [5]uint32
x [chunk]byte
nx int
len uint64
}func (d *digest) AppendBinary(b []byte) ([]byte, error)func (d *digest) BlockSize() intConstantTimeSum computes the same result of [Sum] but in constant time
func (d *digest) ConstantTimeSum(in []byte) []bytefunc (d *digest) MarshalBinary() ([]byte, error)New returns a new [hash.Hash] computing the SHA1 checksum. The Hash also implements [encoding.BinaryMarshaler], [encoding.BinaryAppender] and [encoding.BinaryUnmarshaler] to marshal and unmarshal the internal state of the hash.
func New() hash.Hashfunc (d *digest) Reset()func (d *digest) Size() intfunc (d *digest) Sum(in []byte) []byteSum returns the SHA-1 checksum of the data.
func Sum(data []byte) [Size]bytefunc (d *digest) UnmarshalBinary(b []byte) errorfunc (d *digest) Write(p []byte) (nn int, err error)func block(dig *digest, p []byte)func block(dig *digest, p []byte)go:noescape
func block(dig *digest, p []byte)func block(dig *digest, p []byte)go:noescape
func blockAMD64(dig *digest, p []byte)go:noescape
func blockAVX2(dig *digest, p []byte)blockGeneric is a portable, pure Go version of the SHA-1 block step. It's used by sha1block_generic.go and tests.
func blockGeneric(dig *digest, p []byte)func (d *digest) checkSum() [Size]bytefunc (d *digest) constSum() [Size]bytefunc consumeUint32(b []byte) ([]byte, uint32)func consumeUint64(b []byte) ([]byte, uint64)func init()go:noescape
func sha1block(h []uint32, p []byte, k []uint32)Generated with Arrow