version: 1.10

package sha512

import "crypto/sha512"

Overview

Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 hash algorithms as defined in FIPS 180-4.

All the hash.Hash implementations returned by this package also implement encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal and unmarshal the internal state of the hash.

Index

Package files

sha512.go sha512block.go sha512block_amd64.go

Constants

  1. const (
  2. // Size is the size, in bytes, of a SHA-512 checksum.
  3. Size = 64
  4.  
  5. // Size224 is the size, in bytes, of a SHA-512/224 checksum.
  6. Size224 = 28
  7.  
  8. // Size256 is the size, in bytes, of a SHA-512/256 checksum.
  9. Size256 = 32
  10.  
  11. // Size384 is the size, in bytes, of a SHA-384 checksum.
  12. Size384 = 48
  13.  
  14. // BlockSize is the block size, in bytes, of the SHA-512/224,
  15. // SHA-512/256, SHA-384 and SHA-512 hash functions.
  16. BlockSize = 128
  17. )

func New

  1. func New() hash.Hash

New returns a new hash.Hash computing the SHA-512 checksum.

func New384

  1. func New384() hash.Hash

New384 returns a new hash.Hash computing the SHA-384 checksum.

func New512_224

  1. func New512_224() hash.Hash

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

func New512_256

  1. func New512_256() hash.Hash

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

func Sum384

  1. func Sum384(data []byte) (sum384 [Size384]byte)

Sum384 returns the SHA384 checksum of the data.

func Sum512

  1. func Sum512(data []byte) [Size]byte

Sum512 returns the SHA512 checksum of the data.

func Sum512_224

  1. func Sum512_224(data []byte) (sum224 [Size224]byte)

Sum512_224 returns the Sum512/224 checksum of the data.

func Sum512_256

  1. func Sum512_256(data []byte) (sum256 [Size256]byte)

Sum512_256 returns the Sum512/256 checksum of the data.