Documentation
¶
Overview ¶
Package blake2b implements BLAKE2b cryptographic hash function.
Index ¶
Constants ¶
View Source
const ( BlockSize = 128 // block size of algorithm Size = 64 // maximum digest size SaltSize = 16 // maximum salt size PersonSize = 16 // maximum personalization string size KeySize = 64 // 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 64-byte digest. Returns non-nil error if Config contains invalid parameters.
func NewMAC ¶
NewMAC returns a new hash.Hash computing BLAKE2b prefix- Message Authentication Code of the given size in bytes (up to 64) with the given key (up to 64 bytes in length).
Types ¶
type Config ¶
type Config struct {
Size uint8 // digest size (if zero, default size of 64 bytes is used)
Key []byte // key for prefix-MAC
Salt []byte // salt (if < 16 bytes, padded with zeros)
Person []byte // personalization (if < 16 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)
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.