As crypto/hmac.Equal is relying on crypto/subtle.ConstantTimeCompare, which already checks the length of the two byte slices, we do not need such a length check in crypto/hmac.Equal.
crypto/subtle.ConstantTimeCompare: https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go#L12
crypto/hmac.Equal: https://github.com/golang/go/blob/master/src/crypto/hmac/hmac.go#L97
I think the length check was used in crypto/hmac.Equal as it was previously not included in crypto/subtle.ConstantTimeCompare.
As
crypto/hmac.Equalis relying oncrypto/subtle.ConstantTimeCompare, which already checks the length of the two byte slices, we do not need such a length check incrypto/hmac.Equal.crypto/subtle.ConstantTimeCompare: https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go#L12crypto/hmac.Equal: https://github.com/golang/go/blob/master/src/crypto/hmac/hmac.go#L97I think the length check was used in
crypto/hmac.Equalas it was previously not included incrypto/subtle.ConstantTimeCompare.