Documentation ¶
Overview ¶
Package blake2s implements BLAKE2s cryptographic hash function.
Index ¶
Constants ¶
View Source
const ( BlockSize = 64 // block size of algorithm Size = 32 // maximum digest size SaltSize = 8 // maximum salt size PersonSize = 8 // maximum personalization string size KeySize = 32 // maximum size of key )
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a new hash.Hash configured with the given Config. Config can be nil, in which case the default one is used, calculating 32-byte digest. Returns non-nil error if Config contains invalid parameters.
Types ¶
type Config ¶
type Config struct { Size uint8 // digest size (if zero, default size of 32 bytes is used) Key []byte // key for prefix-MAC Salt []byte // salt (if < 8 bytes, padded with zeros) Person []byte // personalization (if < 8 bytes, padded with zeros) Tree *Tree // parameters for tree hashing }
Config is used to configure hash function parameters and keying. All parameters are optional.
type Tree ¶
type Tree struct { Fanout uint8 // fanout MaxDepth uint8 // maximal depth LeafSize uint32 // leaf maximal byte length (0 for unlimited) NodeOffset uint64 // node offset (0 for first, leftmost or leaf), max 2⁴⁸-1 NodeDepth uint8 // node depth (0 for leaves) InnerHashSize uint8 // inner hash byte length IsLastNode bool // indicates processing of the last node of layer }
Tree represents parameters for tree hashing.
Click to show internal directories.
Click to hide internal directories.