---
source: https://iinventedlight.com/library/notes/go-crypto-sha512.md
title: "Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Go Authors, sha512 package - crypto/sha512; The Go Authors, sha512.go (source). BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-27
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-27
as_of: 2026-11-27
confidence: medium
untested: "Not reproduced (2026-11-27). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-crypto-sha512"
tags: [go, sha512, sha384, fips-180-4, hash]
client: Librarian
sources:
  - id: S1
    title: "sha512 package - crypto/sha512"
    publisher: The Go Authors
    url: https://pkg.go.dev/crypto/sha512
    accessed: 2026-11-27
    license: "BSD-3-Clause"
  - id: S2
    title: "sha512.go (source)"
    publisher: The Go Authors
    url: https://go.dev/src/crypto/sha512/sha512.go
    accessed: 2026-11-27
    license: "BSD-3-Clause"
---
# Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256
**Answer:** Package sha512 implements the SHA384, SHA512, SHA512/224, and SHA512/256 hash algorithms as defined in FIPS 180-4.

## Algorithms and sizes

The package implements the SHA384, SHA512, SHA512/224, and SHA512/256 hash algorithms as defined in FIPS 180-4.

Size is 64 bytes for a SHA512 checksum. Size224 is 28 bytes, Size256 is 32 bytes, and Size384 is 48 bytes. BlockSize is 128 bytes.

## Constructors and checksum helpers

New, New384, New512_224, and New512_256 each return a hash.Hash for the matching algorithm.

The hash.Hash implementations also implement BinaryMarshaler and BinaryUnmarshaler to marshal and unmarshal the internal state of the hash. New also implements BinaryAppender.

Sum512, Sum384, Sum512_224, and Sum512_256 return the checksum of the data.

RegisterHash is used with New, New384, New512_224, and New512_256. If Enabled is set, New can return NewSHA512.

## See also

- [go-crypto-sha256](https://iinventedlight.com/library/notes/go-crypto-sha256/)
- [go-crypto-hmac](https://iinventedlight.com/library/notes/go-crypto-hmac/)
- [go-hash-fnv](https://iinventedlight.com/library/notes/go-hash-fnv/)

## Claims

- id: C1
  claim: The package implements SHA-384, SHA-512, SHA-512/224, and SHA-512/256 from FIPS 180-4.
  source: S1
  evidence: "Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256"

- id: C2
  claim: Size is 64 bytes for a SHA-512 checksum.
  source: S2
  evidence: "Size is the size, in bytes, of a SHA-512 checksum."

- id: C3
  claim: New returns a hash.Hash that computes the SHA-512 checksum.
  source: S1
  evidence: "New returns a new hash.Hash computing the SHA-512 checksum."

## Sources

- [S1] sha512 package - crypto/sha512. The Go Authors. https://pkg.go.dev/crypto/sha512 . License: BSD-3-Clause. Accessed 2026-11-27.

- [S2] sha512.go (source). The Go Authors. https://go.dev/src/crypto/sha512/sha512.go . License: BSD-3-Clause. Accessed 2026-11-27.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, sha512 package - crypto/sha512; The Go Authors, sha512.go (source). BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
