Documentation ¶
Overview ¶
Package hash includes a general-purpose hashing algorithm, blake2b, that should be suitable for most of our needs. It also includes functions to calculate an HMAC.
Package hash includes a general-purpose hashing algorithm, blake2b, that should be suitable for most of our needs. It also includes functions to calculate an HMAC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CMixHash = crypto.BLAKE2b_256
CMixHash type is currently BLAKE2b_256
Functions ¶
func CreateHMAC ¶
NewHMAC creates a new Message Authentication Code from a message payload and a key. This function does not accept keys that are less than 256 bits (or 32 bytes) *Function was copied from (https://golang.org/pkg/crypto/hmac/), we need to analyze this again in the future *
func ExpandKey ¶
ExpandKey is a function that receives a key and expands such key to the size of the prime group
func NewCMixHash ¶
NewCMixHash returns the current cMix hash implementation which is currently the 256 bit version of blake2b
func VerifyHMAC ¶
CheckHMAC receives a MAC value along with the respective message and key associated with the Msg Authentication Code Returns true if calculated MAC matches the received one. False if not. *Function was copied from (https://golang.org/pkg/crypto/hmac/), we need to analyze this again in the future *