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 = 64
The size of a SHA-1 checksum in bytes.
const Size = 20
const _K0 = 0x5A827999
const _K1 = 0x6ED9EBA1
const _K2 = 0x8F1BBCDC
const _K3 = 0xCA62C1D6
const chunk = 64
const init0 = 0x67452301
const init1 = 0xEFCDAB89
const init2 = 0x98BADCFE
const init3 = 0x10325476
const init4 = 0xC3D2E1F0
var k = []uint32{...}
const magic = "sha\x01"
const marshaledSize = *ast.BinaryExpr
var useAVX2 = *ast.BinaryExpr
var useAsm = cpu.S390X.HasSHA1
digest 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() int
ConstantTimeSum computes the same result of [Sum] but in constant time
func (d *digest) ConstantTimeSum(in []byte) []byte
func (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.Hash
func (d *digest) Reset()
func (d *digest) Size() int
func (d *digest) Sum(in []byte) []byte
Sum returns the SHA-1 checksum of the data.
func Sum(data []byte) [Size]byte
func (d *digest) UnmarshalBinary(b []byte) error
func (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]byte
func (d *digest) constSum() [Size]byte
func 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