Hello I have found a weird behaviour of the sha256 Reset() method with the hmac. So I have the following question.
Why does this example produce panics ?
sha256Hash := sha256.New()
salt := []byte{1, 2, 3}
hmac.New(func() hash.Hash {
sha256Hash.Reset()
return sha256Hash
}, salt)
panic: crypto/hmac: hash generation function does not produce unique values
But this example does not produce panics
salt := []byte{1, 2, 3}
hmac.New(func() hash.Hash {
return sha256.New()
}, salt)
What is the difference between these examples.
Hello I have found a weird behaviour of the sha256 Reset() method with the hmac. So I have the following question.
Why does this example produce panics ?
But this example does not produce panics
What is the difference between these examples.