package blake2b
Import Path
golang.org/x/crypto/blake2b (on go.dev)
Dependency Relation
imports 7 packages, and imported by one package
Involved Source Files
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693
and the extendable output function (XOF) BLAKE2Xb.
BLAKE2b is optimized for 64-bit platforms—including NEON-enabled ARMs—and
produces digests of any size between 1 and 64 bytes.
For a detailed specification of BLAKE2b see https://blake2.net/blake2.pdf
and for BLAKE2Xb see https://blake2.net/blake2x.pdf
If you aren't sure which function you need, use BLAKE2b (Sum512 or New512).
If you need a secret-key MAC (message authentication code), use the New512
function with a non-nil key.
BLAKE2X is a construction to compute hash values larger than 64 bytes. It
can produce hash values between 0 and 4 GiB.
blake2bAVX2_amd64.go
blake2b_generic.go
blake2x.go
register.go
blake2bAVX2_amd64.s
blake2b_amd64.s
Package-Level Type Names (total 3, in which 1 are exported)
XOF defines the interface to hash functions that
support arbitrary-length output.
Clone returns a copy of the XOF in its current state.
( XOF) Read(p []byte) (n int, err error)
Reset resets the XOF to its initial state.
( XOF) Write(p []byte) (n int, err error)
*xof
XOF : io.Reader
XOF : io.ReadWriter
XOF : io.Writer
func NewXOF(size uint32, key []byte) (XOF, error)
func XOF.Clone() XOF
Package-Level Functions (total 21, in which 8 are exported)
New returns a new hash.Hash computing the BLAKE2b checksum with a custom length.
A non-nil key turns the hash into a MAC. The key must be between zero and 64 bytes long.
The hash size can be a value between 1 and 64 but it is highly recommended to use
values equal or greater than:
- 32 if BLAKE2b is used as a hash function (The key is zero bytes long).
- 16 if BLAKE2b is used as a MAC function (The key is at least 16 bytes long).
When the key is nil, the returned hash.Hash implements BinaryMarshaler
and BinaryUnmarshaler for state (de)serialization as documented by hash.Hash.
New256 returns a new hash.Hash computing the BLAKE2b-256 checksum. A non-nil
key turns the hash into a MAC. The key must be between zero and 64 bytes long.
New384 returns a new hash.Hash computing the BLAKE2b-384 checksum. A non-nil
key turns the hash into a MAC. The key must be between zero and 64 bytes long.
New512 returns a new hash.Hash computing the BLAKE2b-512 checksum. A non-nil
key turns the hash into a MAC. The key must be between zero and 64 bytes long.
NewXOF creates a new variable-output-length hash. The hash either produce a
known number of bytes (1 <= size < 2**32-1), or an unknown number of bytes
(size == OutputLengthUnknown). In the latter case, an absolute limit of
256GiB applies.
A non-nil key turns the hash into a MAC. The key must between
zero and 32 bytes long.
Sum256 returns the BLAKE2b-256 checksum of the data.
Sum384 returns the BLAKE2b-384 checksum of the data.
Sum512 returns the BLAKE2b-512 checksum of the data.
Package-Level Variables (total 7, none are exported)
Package-Level Constants (total 9, in which 5 are exported)
The blocksize of BLAKE2b in bytes.
OutputLengthUnknown can be used as the size argument to NewXOF to indicate
the length of the output is not known in advance.
The hash size of BLAKE2b-512 in bytes.
The hash size of BLAKE2b-256 in bytes.
The hash size of BLAKE2b-384 in bytes.
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)