Standard Library

GoCryptoHMAC

crypto/hmac package. New() creates HMAC with a key. Equal() provides constant-time comparison. Using == instead of Equal() for MAC verification is a timing attack.

1 sanitizer

Sanitizers

.Equal()Sanitizer
#
Signature
Equal(mac1, mac2 []byte) bool

Constant-time comparison. Use this instead of bytes.Equal for MAC verification.

Other Methods

.New()Neutral
#
Signature
New(h func() hash.Hash, key []byte) hash.Hash

Creates new HMAC. Safe when using strong hash (sha256, sha512).

Fully-Qualified Names

FQNField
crypto/hmacfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

go.mod
// standard library — no go.mod entry required
rule.py
from codepathfinder.go_rule import GoCryptoHMAC