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
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.
License: CC-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.
Cite this
iinventedlight. 2026. "Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256." iinventedlight Library, iil:note:cv4khmew, version of 2026-11-27. https://iinventedlight.com/library/notes/go-crypto-sha512/. License: CC-BY-4.0.
@misc{iil_note_cv4khmew,
author = {{iinventedlight}},
title = {{Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-27},
url = {https://iinventedlight.com/library/notes/go-crypto-sha512/},
note = {Permanent ID iil:note:cv4khmew. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-crypto-sha512.schema.json (schema; CC-BY-4.0)
- go-crypto-sha512.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-crypto-sha512.md.