-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.