Documentation
¶
Overview ¶
Package sha256 implements SHA-256 (FIPS 180-4).
It exists for size, not for secrecy. Nothing here is a secret — the input is a version string and the output is a picture — but crypto/sha256 now arrives with the FIPS-140 module's self-tests, entropy sources and runtime checks behind it, which is about a sixth of a megabyte in a binary whose only job is to draw a mark. The algorithm itself is a fixed standard, so owning it costs nothing in drift: the digests are the same digests, and a test checks that against crypto/sha256 for every input the library uses.
Index ¶
Constants ¶
const BlockSize = 64
BlockSize is the algorithm's block size in bytes.
const Size = 32
Size is the length of a SHA-256 digest in bytes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
Digest is an in-progress SHA-256 computation. Its method set is the part of hash.Hash the library uses, so callers read the same as they did against crypto/sha256.