sha512

Imports

Imports #

"bytes"
"crypto/internal/fips140"
"errors"
"crypto/internal/fips140"
"crypto/internal/fips140deps/byteorder"
"errors"
"math/bits"
"crypto/internal/fips140deps/cpu"
"crypto/internal/impl"
"crypto/internal/fips140deps/cpu"
"crypto/internal/impl"
"crypto/internal/fips140deps/cpu"
"crypto/internal/impl"
"crypto/internal/fips140deps/godebug"
"crypto/internal/impl"

Constants & Variables

_K var #

var _K = [...]uint64{...}

blockSize const #

blockSize is the block size, in bytes, of the SHA-512/224, SHA-512/256, SHA-384 and SHA-512 hash functions.

const blockSize = 128

chunk const #

const chunk = 128

init0 const #

const init0 = 0x6a09e667f3bcc908

init0_224 const #

const init0_224 = 0x8c3d37c819544da2

init0_256 const #

const init0_256 = 0x22312194fc2bf72c

init0_384 const #

const init0_384 = 0xcbbb9d5dc1059ed8

init1 const #

const init1 = 0xbb67ae8584caa73b

init1_224 const #

const init1_224 = 0x73e1996689dcd4d6

init1_256 const #

const init1_256 = 0x9f555fa3c84c64c2

init1_384 const #

const init1_384 = 0x629a292a367cd507

init2 const #

const init2 = 0x3c6ef372fe94f82b

init2_224 const #

const init2_224 = 0x1dfab7ae32ff9c82

init2_256 const #

const init2_256 = 0x2393b86b6f53b151

init2_384 const #

const init2_384 = 0x9159015a3070dd17

init3 const #

const init3 = 0xa54ff53a5f1d36f1

init3_224 const #

const init3_224 = 0x679dd514582f9fcf

init3_256 const #

const init3_256 = 0x963877195940eabd

init3_384 const #

const init3_384 = 0x152fecd8f70e5939

init4 const #

const init4 = 0x510e527fade682d1

init4_224 const #

const init4_224 = 0x0f6d2b697bd44da8

init4_256 const #

const init4_256 = 0x96283ee2a88effe3

init4_384 const #

const init4_384 = 0x67332667ffc00b31

init5 const #

const init5 = 0x9b05688c2b3e6c1f

init5_224 const #

const init5_224 = 0x77e36f7304c48942

init5_256 const #

const init5_256 = 0xbe5e1e2553863992

init5_384 const #

const init5_384 = 0x8eb44a8768581511

init6 const #

const init6 = 0x1f83d9abfb41bd6b

init6_224 const #

const init6_224 = 0x3f9d85a86a1d36c8

init6_256 const #

const init6_256 = 0x2b0199fc2c85b8aa

init6_384 const #

const init6_384 = 0xdb0c2e0d64f98fa7

init7 const #

const init7 = 0x5be0cd19137e2179

init7_224 const #

const init7_224 = 0x1112e6ad91d692a1

init7_256 const #

const init7_256 = 0x0eb72ddc81c52ca2

init7_384 const #

const init7_384 = 0x47b5481dbefa4fa4

magic384 const #

const magic384 = "sha\x04"

magic512 const #

const magic512 = "sha\x07"

magic512_224 const #

const magic512_224 = "sha\x05"

magic512_256 const #

const magic512_256 = "sha\x06"

marshaledSize const #

const marshaledSize = *ast.BinaryExpr

ppc64sha512 var #

The POWER architecture doesn't have a way to turn off SHA-512 support at runtime with GODEBUG=cpu.something=off, so introduce a new GODEBUG knob for that. It's intentionally only checked at init() time, to avoid the performance overhead of checking it on every block.

var ppc64sha512 = *ast.BinaryExpr

size224 const #

size224 is the size, in bytes, of a SHA-512/224 checksum.

const size224 = 28

size256 const #

size256 is the size, in bytes, of a SHA-512/256 checksum.

const size256 = 32

size384 const #

size384 is the size, in bytes, of a SHA-384 checksum.

const size384 = 48

size512 const #

size512 is the size, in bytes, of a SHA-512 checksum.

const size512 = 64

useAVX2 var #

var useAVX2 = *ast.BinaryExpr

useSHA512 var #

var useSHA512 = cpu.S390XHasSHA512

useSHA512 var #

var useSHA512 = cpu.ARM64HasSHA512

Structs

Digest struct #

Digest is a SHA-384, SHA-512, SHA-512/224, or SHA-512/256 [hash.Hash] implementation.

type Digest struct {
h [8]uint64
x [chunk]byte
nx int
len uint64
size int
}

Functions

AppendBinary method #

func (d *Digest) AppendBinary(b []byte) ([]byte, error)

BlockSize method #

func (d *Digest) BlockSize() int

MarshalBinary method #

func (d *Digest) MarshalBinary() ([]byte, error)

New function #

New returns a new Digest computing the SHA-512 hash.

func New() *Digest

New384 function #

New384 returns a new Digest computing the SHA-384 hash.

func New384() *Digest

New512_224 function #

New512_224 returns a new Digest computing the SHA-512/224 hash.

func New512_224() *Digest

New512_256 function #

New512_256 returns a new Digest computing the SHA-512/256 hash.

func New512_256() *Digest

Reset method #

func (d *Digest) Reset()

Size method #

func (d *Digest) Size() int

Sum method #

func (d *Digest) Sum(in []byte) []byte

UnmarshalBinary method #

func (d *Digest) UnmarshalBinary(b []byte) error

Write method #

func (d *Digest) Write(p []byte) (nn int, err error)

block function #

func block(dig *Digest, p []byte)

block function #

func block(dig *Digest, p []byte)

block function #

go:noescape

func block(dig *Digest, p []byte)

block function #

func block(dig *Digest, p []byte)

block function #

func block(dig *Digest, p []byte)

block function #

func block(dig *Digest, p []byte)

blockAMD64 function #

go:noescape

func blockAMD64(dig *Digest, p []byte)

blockAVX2 function #

go:noescape

func blockAVX2(dig *Digest, p []byte)

blockGeneric function #

func blockGeneric(dig *Digest, p []byte)

blockPOWER function #

go:noescape

func blockPOWER(dig *Digest, p []byte)

blockS390X function #

go:noescape

func blockS390X(dig *Digest, p []byte)

blockSHA512 function #

go:noescape

func blockSHA512(dig *Digest, p []byte)

checkSum method #

func (d *Digest) checkSum() [size512]byte

consumeUint64 function #

func consumeUint64(b []byte) ([]byte, uint64)

init function #

func init()

init function #

func init()

init function #

func init()

init function #

func init()

init function #

func init()

Generated with Arrow